`http://cadaver.homeftp.net/games/mwsrc.zip/scroll.s
`
`1
`;
`ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕ(cid:31)
`2
`;∫Scroll- and background graphics routines ∫
`3
`;
`ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕ(cid:31)
`4
`
`5
`;⁄ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒĿ
`6
`;≥INITMAP ≥
`7
`;≥ ≥
`8
`;≥Calculates start addresses for each row of the blockmap. ≥
`9
`;≥ ≥
`10 ;≥Parameters: - ≥
`11 ;≥Returns: - ≥
`12 ;≥Modifies: A,X ≥
`13 ;¿ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒŸ
`14
`15 initmap: lda #<MAP
`16 sta scrolltemp1
`17 lda #>MAP
`18 sta scrolltemp2
`19 ldx #$00
`20 im_loop: lda scrolltemp1
`21 sta maptbllo,x
`22 lda scrolltemp2
`23 sta maptblhi,x
`24 lda scrolltemp1
`25 clc
`26 adc mapsx
`27 sta scrolltemp1
`28 bcc im_notover
`29 inc scrolltemp2
`30 im_notover: inx
`31 cpx #$80
`32 bne im_loop
`33 rts
`34
`35 ;⁄ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒĿ
`36 ;≥INITBLOCKS ≥
`37 ;≥ ≥
`38 ;≥Calculates address for each background graphics block. ≥
`39 ;≥ ≥
`40 ;≥Parameters: - ≥
`41 ;≥Returns: - ≥
`Ex. 1032
`
`Kendyl Román
`
`1 of 28
`IBG 1032
`CBM of U.S. Pat. No. 7,685,055
`
`
`
`Ex. 1032
`http://cadaver.homeftp.net/games/mwsrc.zip/scroll.s
`
`42 ;≥Modifies: A,X ≥
`43 ;¿ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒŸ
`44
`45 initblocks: lda #<BLOCKS
`46 sta scrolltemp1
`47 lda #>BLOCKS
`48 sta scrolltemp2
`49 ldx #$00
`50 ib_loop: lda scrolltemp1
`51 sta blktbllo,x
`52 lda scrolltemp2
`53 sta blktblhi,x
`54 lda scrolltemp1
`55 clc
`56 adc #$10
`57 sta scrolltemp1
`58 bcc ib_notover
`59 inc scrolltemp2
`60 ib_notover: inx
`61 cpx #$80
`62 bne ib_loop
`63 rts
`64
`65 ;⁄ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒĿ
`66 ;≥INITSCROLL ≥
`67 ;≥ ≥
`68 ;≥Resets scrolling zeropage variables and sets finescroll so that whole chars ≥
`69 ;≥are visible. (when screen is actually being scrolled, finescroll is centered ≥
`70 ;≥whenever scrolling has been stopped) ≥
`71 ;≥ ≥
`72 ;≥Parameters: - ≥
`73 ;≥Returns: - ≥
`74 ;≥Modifies: A ≥
`75 ;¿ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒŸ
`76
`77 initscroll: jsr is_clear
`78 sta screen
`79 lda #$07
`80 is_setscrollpos:sta scrollx
`81 sta scrolly
`82 ora #$10
`83 sta r2_setx+1
`84 sta r2_sety+1
`Kendyl Román
`
`Ex. 1032
`
`2 of 28
`
`
`
`Ex. 1032
`http://cadaver.homeftp.net/games/mwsrc.zip/scroll.s
`
`85 rts
`86 is_clear: lda #$00
`87 sta scrollsx
`88 sta scrollsy
`89 sta scrollcsx
`90 sta scrollcsy
`91 sta scrcounter
`92 sta scradd
`93 rts
`94
`95 ;⁄ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒĿ
`96 ;≥SETMAPPOS ≥
`97 ;≥ ≥
`98 ;≥Sets map position, and centers the finescroll registers. ≥
`99 ;≥ ≥
`100 ;≥Parameters: X,Y - X and Y position in blocks ≥
`101 ;≥Returns: - ≥
`102 ;≥Modifies: A ≥
`103 ;¿ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒŸ
`104
`105 setmappos: stx mapx
`106 sty mapy
`107 lda #$02
`108 sta blockx
`109 lda #$01
`110 sta blocky
`111 lda #$04
`112 jsr is_setscrollpos
`113 jmp ds_setsprpos
`114
`115 ;⁄ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒĿ
`116 ;≥DOSCROLL ≥
`117 ;≥ ≥
`118 ;≥Performs scrolling logic. ≥
`119 ;≥ ≥
`120 ;≥Parameters: - ≥
`121 ;≥Returns: - ≥
`122 ;≥Modifies: A,X,Y ≥
`123 ;¿ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒŸ
`124
`125 doscroll: lda scradd ;If speed 0, wait for new
`126 beq ds_getnewspeed ;(nonzero) speed request
`127 lda scrollx ;Update finescrolling
`Ex. 1032
`Kendyl Román
`
`3 of 28
`
`
`
`Ex. 1032
`http://cadaver.homeftp.net/games/mwsrc.zip/scroll.s
`
`128 sec
`129 sbc scrollcsx ;(don't care of overflow yet)
`130 and #$07
`131 sta scrollx
`132 lda scrolly
`133 sec
`134 sbc scrollcsy
`135 and #$07
`136 sta scrolly
`137 lda scrcounter ;Then increase scrollcounter
`138 clc ;(amount of scrolled pixels)
`139 adc scradd
`140 sta scrcounter
`Ex. 1032
`141 cmp #$08 ;If it's >7, the scrolling has
`142 bcs ds_getnewspeed ;completed
`http://cadaver.homeftp.net/games/mwsrc.zip/scro11.s
`143 cmp #$04 ;If 4, prepare to swap screens
`sec
`144 beq ds_prepare ;and update graphics in the
`128
`145 jmp ds_setsprpos ;border,
`sbc
`scro"csx
`129
`;(don't care of overflow yet)
`146 ds_prepare: lda scrollcsx ;as well as change the block-
`and
`L30
`#$07
`sta
`147 beq ds_pxdone ;and mapposition variables
`scro"x
`131
`148 bmi ds_goleft
`lda
`132
`scro"y
`sec
`149 ds_goright: inc blockx
`133
`150 lda blockx
`sbc
`134
`scro"csy
`151 cmp #4
`and
`135
`#$07
`sta
`152 bcc ds_pxdone
`136
`scro"y
`scrcounter
`153 lda #0
`lda
`137
`154 sta blockx
`clc
`L38
`155 inc mapx
`adc
`scradd
`L39
`sta
`scrcounter
`156 jmp ds_pxdone
`L40
`L41
`157 ds_goleft: dec blockx
`cmp
`#$08
`158 bpl ds_pxdone
`142
`bcs
`ds_getnewspeed
`159 lda #3
`143
`cmp
`#$04
`144
`160 sta blockx
`ds_prepare
`161 dec mapx
`145
`ds_setsprpos
`jmp
`162 ds_pxdone: lda scrollcsy
`scrollcsx
`146
`ds_prepare:
`L47
`163 beq ds_pydone
`ds_pxdone
`164 bmi ds_goup
`148
`ds_go;eft
`165 ds_godown: inc blocky
`blockx
`149
`ds_goright:
`166 lda blocky
`b'ockx
`L50
`167 cmp #4
`151
`#4
`168 bcc ds_pydone
`152
`ds_pxdone
`169 lda #0
`153
`#0
`170 sta blocky
`154
`blockx
`155
`mapx
`Kendyl Román
`156
`ds_pxdone
`157
`blockx
`L58
`159
`
`;If it's >7,
`;completed
`;If 4, prepare to swap screens
`;and update graphics in the
`;border,
`;as well as change the block-
`;and mapposition variables
`
`;Then increase scrollcounter
`;(amount of scrolled pixels)
`
`the scrolling has
`
`ds_goleft:
`
`ds_pxdone
`#3
`
`Ex. 1032
`
`4 of 28
`
`
`
`Ex. 1032
`http://cadaver.homeftp.net/games/mwsrc.zip/scroll.s
`
`171 inc mapy
`172 jmp ds_pydone
`173 ds_goup: dec blocky
`174 bpl ds_pydone
`175 lda #3
`176 sta blocky
`177 dec mapy
`178 ds_pydone: jmp ds_setsprpos
`179
`180 ds_getnewspeed: lda #$00
`181 sta scrcounter
`182 sta scradd ;Assume zero speed
`183 lda scrollsy
`184 sta scrollcsy
`185 lda scrollsx ;Copy speed request into the
`186 sta scrollcsx ;actual scrolling speed
`187 bpl ds_xnotneg ;Take absolute value of X-speed
`188 eor #$ff
`189 clc
`190 adc #$01
`191 ds_xnotneg: sta scradd ;And store as the scrolling
`192 sta scrolltemp1 ;counter-addvalue
`193 lda scrollcsy
`194 bpl ds_ynotneg
`195 eor #$ff
`196 clc
`197 adc #$01
`198 ds_ynotneg: sta scrolltemp2
`199 cmp scradd ;Is Y-absolute greater?
`200 bcc ds_ynothigher ;If it is, use it as the
`201 sta scradd ;addvalue instead
`202 ds_ynothigher: lda scradd ;Scrolling at all?
`203 bne ds_not0
`204 ds_setsprpos: ldx #0 ;Calculate the subtract-value
`205 lda mapx ;for drawing sprites
`206 ds_sspxnotneg: stx scrposxh
`207 asl
`208 rol scrposxh
`209 asl
`210 rol scrposxh
`211 asl
`212 rol scrposxh
`213 asl
`Kendyl Román
`
`Ex. 1032
`
`5 of 28
`
`
`
`Ex. 1032
`http://cadaver.homeftp.net/games/mwsrc.zip/scroll.s
`
`214 rol scrposxh
`215 asl
`216 rol scrposxh
`217 sta scrposxl
`218 lda blockx
`219 asl
`220 asl
`221 asl
`222 adc scrposxl
`223 sta scrposxl
`224 bcc ds_ssp1
`225 inc scrposxh
`226 ds_ssp1: lda #24
`Ex. 1032
`227 clc
`228 adc scrollx
`http: //cadaver . homeftp . net/games/mwsrc . zip/scroll . s
`229 sta scrolltemp1
`230 lda scrposxl
`214
`ro;
`scrposxh
`231 sec
`as;
`215
`232 sbc scrolltemp1
`ro;
`216
`scrposxh
`sta
`233 sta scrposxl
`217
`scrposxl
`234 bcs ds_ssp2
`lda
`blockx
`218
`235 dec scrposxh
`as;
`219
`236 ds_ssp2: ldx #0
`220
`221
`237 ds_sspynotneg: stx scrposyh
`as;
`238 lda mapy
`222
`adc
`scrposx;
`239 asl
`223
`scrposx;
`240 rol scrposyh
`224
`ds_ssp1
`241 asl
`225
`inc
`scrposxh
`242 rol scrposyh
`#24
`226 ds_ssp1:
`243 asl
`227
`244 rol scrposyh
`scro"x
`228
`245 asl
`229
`scro"temp1
`246 rol scrposyh
`230
`scrposx;
`247 asl
`231
`248 rol scrposyh
`232
`scro"temp1
`249 sta scrposyl
`233
`scrposx;
`250 lda blocky
`234
`ds_ssp2
`251 asl
`235
`scrposxh
`252 asl
`#0
`236 ds_ssp2:
`253 asl
`scrposyh
`237 ds_sspynotneg:
`254 adc scrposyl
`238
`mapy
`255 sta scrposyl
`239
`256 bcc ds_ssp3
`240
`scrposyh
`241
`Kendyl Román
`242
`243
`244
`245
`
`scrposyh
`
`scrposyh
`
`Ex. 1032
`
`6 of 28
`
`
`
`Ex. 1032
`http://cadaver.homeftp.net/games/mwsrc.zip/scroll.s
`
`257 inc scrposyh
`258 ds_ssp3: lda #47
`259 clc
`260 adc scrolly
`261 sta scrolltemp1
`262 lda scrposyl
`263 sec
`264 sbc scrolltemp1
`265 sta scrposyl
`266 bcs ds_ssp4
`267 dec scrposyh
`268 ds_ssp4: rts
`269
`270 ds_not0: cmp #$02 ;Maximum speed 2?
`271 bne ds_not2
`272 lda scrolltemp1 ;If the speed in the
`273 cmp #$01 ;"other" axis is only 1,
`274 bne ds_xnot1 ;it must be increased
`275 asl scrollcsx
`276 ds_xnot1: lda scrolltemp2
`277 cmp #$01
`278 bne ds_ynot1
`279 asl scrollcsy
`280 ds_not2:
`281 ds_ynot1: ldx screen ;Which screen
`282 lda shiftjumptbllo,x ;Take the corresponding screen
`283 sta ds_shiftjump+1 ;shift routine
`284 lda shiftjumptblhi,x
`285 sta ds_shiftjump+2
`286 ldy #40 ;Y=source index
`287 lda scrollcsx ;Modify it according to the
`288 beq ds_nox ;scrolling direction
`289 bmi ds_left
`290 ds_right: lda #3
`291 sta scrollx
`292 iny
`293 jmp ds_nox
`294 ds_left: lda #4
`295 sta scrollx
`296 dey
`297 ds_nox: lda scrollcsy
`298 beq ds_noy
`299 bmi ds_up
`Kendyl Román
`
`Ex. 1032
`
`7 of 28
`
`
`
`Ex. 1032
`http://cadaver.homeftp.net/games/mwsrc.zip/scroll.s
`
`300 ds_down: lda #3
`301 sta scrolly
`302 tya
`303 clc
`304 adc #40
`305 tay
`306 jmp ds_noy
`307 ds_up: lda #4
`308 sta scrolly
`309 tya
`310 sec
`311 sbc #40
`312 tay
`313 ds_noy: sty shiftpos
`314 jmp ds_setsprpos
`315
`316 ;⁄ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒĿ
`317 ;≥SHIFTSCREEN ≥
`318 ;≥ ≥
`319 ;≥Performs "hard work" of scrolling. To be called during scorescreen! ≥
`320 ;≥ ≥
`321 ;≥Parameters: - ≥
`322 ;≥Returns: - ≥
`323 ;≥Modifies: A,X,Y ≥
`324 ;¿ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒŸ
`325
`326 shiftscreen: lda scrollx
`327 ora #$10
`328 sta r2_setx+1
`329 lda scrolly
`330 ora #$10
`331 sta r2_sety+1
`332 lda scradd ;If speed 0, do nothing
`333 beq ss_done
`334 lda scrcounter
`335 beq ss_firsthalf ;First or second half of
`336 cmp #$02 ;screen shifting?
`337 beq ss_secondhalf
`338 cmp #$04 ;Or colorscreen scrolling?
`339 beq ss_colors
`340 ss_done: rts
`341
`342 ss_firsthalf: ldx #0 ;First half now...
`Ex. 1032
`Kendyl Román
`
`8 of 28
`
`
`
`Ex. 1032
`http://cadaver.homeftp.net/games/mwsrc.zip/scroll.s
`
`343 lda #20
`344 ss_fh1: sta scrolltemp1
`345 ldy shiftpos
`346 ds_shiftjump: jmp ds_shift1
`347
`348 ss_secondhalf: ldx #20
`349 lda #39
`350 jmp ss_fh1
`351
`352 ss_colors: lda screen ;Swap screens now
`353 eor #$01
`354 sta screen
`355 lda scrollcsx
`356 beq ds_cnox
`357 bmi ds_cleft
`358 ds_cright: jsr ds_shiftcolright ;Scroll the color-RAM and
`359 jsr ds_drawright ;draw new graphics to the
`360 jmp ds_cnox ;borders
`361 ds_cleft: jsr ds_shiftcolleft
`362 jsr ds_drawleft
`363 ds_cnox: lda scrollcsy
`364 beq ds_cnoy
`365 bmi ds_cup
`366 ds_cdown: jsr ds_shiftcoldown
`367 jmp ds_drawdown
`368 ds_cup: jsr ds_shiftcolup
`369 jmp ds_drawup
`370 ds_cnoy: rts
`371
`372
`373
`374 ds_shift1:
`375 ds_shiftloop1:
`376 N SET 0
`377 REPEAT ROWS
`378 lda SCREEN1-40+N40,y
`379 sta SCREEN2+N40,x
`380 N SET N+1
`381 REPEND
`382 iny
`383 inx
`384 cpx scrolltemp1
`385 bne ds_shiftloop1
`Kendyl Román
`
`Ex. 1032
`
`9 of 28
`
`
`
`Ex. 1032
`http://cadaver.homeftp.net/games/mwsrc.zip/scroll.s
`
`386 sty shiftpos
`387 rts
`388
`389 ds_shift2: ldy shiftpos
`390 sta scrolltemp1
`391 ds_shiftloop2:
`392 N SET 0
`393 REPEAT ROWS
`394 lda SCREEN2-40+N40,y
`395 sta SCREEN1+N40,x
`396 N SET N+1
`397 REPEND
`398 iny
`399 inx
`400 cpx scrolltemp1
`401 bne ds_shiftloop2
`402 sty shiftpos
`403 rts
`404
`405 ds_drawleft: ldx mapy
`406 lda maptbllo,x
`407 sta maptemplo
`408 lda maptblhi,x
`409 sta maptemphi
`410 lda mapx
`411 clc
`412 adc maptemplo
`413 sta maptemplo
`414 bcc ds_dlcalcdone
`415 inc maptemphi
`416 ds_dlcalcdone: ldx screen
`417 lda #$00
`418 sta dsdl_sta+1
`419 lda scradrtblhi,x
`420 sta dsdl_sta+2
`421 lda #<COLORS
`422 sta dsdl_sta2+1
`423 lda #>COLORS
`424 sta dsdl_sta2+2
`425 lda blocky
`426 asl
`427 asl
`428 sta scrolltemp2
`Kendyl Román
`
`Ex. 1032
`
`10 of 28
`
`
`
`Ex. 1032
`http://cadaver.homeftp.net/games/mwsrc.zip/scroll.s
`
`429 ldx #ROWS-1
`430 ldy #0
`431 lda (maptemplo),y
`432 tay
`433 lda BLOCKCOLS,y
`434 sta dsdl_lda2+1
`435 lda blktbllo,y
`436 clc
`437 adc blockx
`438 sta dsdl_lda+1
`439 lda blktblhi,y
`440 sta dsdl_lda+2
`441 ldy scrolltemp2
`Ex. 1032
`442 dsdl_lda: lda $1000,y
`443 dsdl_sta: sta $1000
`http: //cadaver . homeftp . net/games/mwsrc . zip/scroll . s
`444 dsdl_lda2: lda #$00
`445 dsdl_sta2: sta $1000
`£29
`Ldx #ROWS—l
`446 dex
`£30
`Ldy #0
`447 bmi dsdl_ready
`£31
`;da (maptemplo),y
`448 lda dsdl_sta+1
`£32
`tay
`449 clc
`£33
`'da %LOCKCOLS,y
`450 adc #40
`£34
`sta dsdl_;da2+1
`451 sta dsdl_sta+1
`£35
`'da b'ktb'1o,y
`452 sta dsdl_sta2+1
`clc
`136
`453 bcc dsdl_not2
`adc b_oc x
`£37
`454 inc dsdl_sta+2
`138
`sta dsd'_'da+l
`455 inc dsdl_sta2+2
`£39
`'da b'ktb'hi,y
`456 clc
`£40
`sta dsd'_'da+2
`£41
`457 dsdl_not2: tya
`Ldy scrol;temp2
`458 adc #4
`'da:
`£42 dsd'
`Lda $1000,y
`459 cmp #16
`143 dsd;
`sta $1000
`460 beq dsdl_getblock
`144 dsd'
`'da2:
`Lda #$00
`461 tay
`£45 dsdj
`sta2:
`sta $1000
`462 jmp dsdl_lda
`dex
`£46
`£47
`463 dsdl_getblock: lda maptemplo
`bmi dsd;_ready
`464 clc
`£48
`lda dsd;_sta+1
`465 adc mapsx
`clc
`£49
`466 sta maptemplo
`£50
`adc #40
`467 bcc dsdl_not3
`£51
`sta dsd;_sta+1
`468 inc maptemphi
`£52
`sta dsd;_sta2+1
`469 dsdl_not3: ldy #0
`£53
`bcc dsd;_not2
`470 lda (maptemplo),y
`£54
`inc dsd;_sta+2
`471 tay
`£55
`inc dsd;_sta2+2
`clc
`156
`Kendyl Román
`157 dsdl_not2:
`158
`£59
`160
`
`cmp #16
`beq dsd;_getblock
`
`tya
`adc #4
`
`Ex. 1032
`
`11 of 28
`
`
`
`Ex. 1032
`http://cadaver.homeftp.net/games/mwsrc.zip/scroll.s
`
`472 lda BLOCKCOLS,y
`473 sta dsdl_lda2+1
`474 lda blktbllo,y
`475 clc
`476 adc blockx
`477 sta dsdl_lda+1
`478 lda blktblhi,y
`479 sta dsdl_lda+2
`480 ldy #0
`481 jmp dsdl_lda
`482 dsdl_ready: rts
`483
`484 ds_drawright: ldx mapy
`Ex. 1032
`485 lda maptbllo,x
`486 sta maptemplo
`http://cadaver.homeftp.net/games/mwsrc.zip/scro11.s
`487 lda maptblhi,x
`488 sta maptemphi
`172
`:LocKcoLs,y
`489 lda mapx
`173
`dsd1_;da2+l
`174
`490 clc
`b'ktb'1o,y
`491 adc #9
`175
`492 clc
`b;ockx
`176
`177
`493 adc maptemplo
`dsd'
`'da+1
`494 sta maptemplo
`178
`b ktb‘h1,y
`495 bcc ds_drcalcdone
`179
`dsd'_'da+2
`496 inc maptemphi
`180
`#0
`497 ds_drcalcdone: lda blockx
`dsd'
`'da
`181
`498 clc
`182
`dsd1_ready:
`499 adc #2
`183
`500 sta scrolltemp1
`184
`mapy
`ds_drawright:
`501 cmp #4
`185
`maptb;1o,x
`502 bcc dsdr_not1
`186
`maptemplo
`503 and #3
`187
`maptb;hi,x
`504 sta scrolltemp1
`188
`maptemphi
`505 lda maptemplo
`189
`mapx
`506 clc
`190
`507 adc #1
`191
`#9
`508 sta maptemplo
`192
`509 bcc dsdr_not1
`193
`maptemp;o
`510 inc maptemphi
`194
`maptemp;o
`511 dsdr_not1: ldx screen
`195
`ds_drca;cdone
`512 lda #38
`196
`inc
`maptemphi
`513 sta dsdr_sta+1
`blockx
`197
`ds_drca1cdone:
`514 lda scradrtblhi,x
`198
`adc
`199
`#2
`Kendyl Román
`sta
`500
`501
`502
`503
`
`scrolltempl
`#4
`dsdr_not1
`#3
`
`cmp
`
`Ex. 1032
`
`12 of 28
`
`
`
`Ex. 1032
`http://cadaver.homeftp.net/games/mwsrc.zip/scroll.s
`
`515 sta dsdr_sta+2
`516 lda #<(COLORS+38)
`517 sta dsdr_sta2+1
`518 lda #>(COLORS+38)
`519 sta dsdr_sta2+2
`520 lda blocky
`521 asl
`522 asl
`523 sta scrolltemp2
`524 ldx #ROWS-1
`525 ldy #0
`526 lda (maptemplo),y
`527 tay
`Ex. 1032
`528 lda BLOCKCOLS,y
`529 sta dsdr_lda2+1
`http: //cadaver . homeftp . net/games/mwsrc . zip/scroll . s
`530 lda blktbllo,y
`531 clc
`515
`sta dsdr_sta+2
`532 adc scrolltemp1
`516
`;da #<(COLORs+38)
`533 sta dsdr_lda+1
`517
`sta dsdr_sta2+1
`534 lda blktblhi,y
`518
`;da #>(COLORs+38)
`535 sta dsdr_lda+2
`519
`sta dsdr_sta2+2
`536 ldy scrolltemp2
`520
`Lda blocky
`537 dsdr_lda: lda $1000,y
`as;
`521
`as_
`538 dsdr_sta: sta $1000
`522
`539 dsdr_lda2: lda #$00
`523
`sta scro11temp2
`540 dsdr_sta2: sta $1000
`524
`;dx #ROWS—1
`541 dex
`525
`Ldy #0
`542 bmi dsdr_ready
`526
`;da (maptemp1o),y
`543 lda dsdr_sta+1
`527
`tay
`544 clc
`528
`'da %LOCKCOLS,y
`545 adc #40
`529
`sta dsdr_;da2+1
`546 sta dsdr_sta+1
`530
`'da b1ktb'1o,y
`547 sta dsdr_sta2+1
`clc
`531
`548 bcc dsdr_not2
`532
`adc scro1;temp1
`549 inc dsdr_sta+2
`533
`sta dsdr_;da+1
`550 inc dsdr_sta2+2
`534
`'da b1ktb'hi,y
`551 clc
`535
`sta dsdr_;da+2
`552 dsdr_not2: tya
`536
`Ldy scro1;temp2
`553 adc #4
`537 dsdr_;da:
`Lda $1000,y
`554 cmp #16
`sta $1000
`538 dsdr_sta:
`555 beq dsdr_getblock
`Lda #$00
`539 dsdr_;da2:
`556 tay
`sta $1000
`540 dsdr_sta2:
`557 jmp dsdr_lda
`541
`dex
`542
`bmi dsdr_ready
`Kendyl Román
`543
`1da dsdr_sta+1
`544
`clc
`545
`adc #40
`546
`sta dsdr_sta+1
`
`Ex. 1032
`
`13 of 28
`
`
`
`Ex. 1032
`http://cadaver.homeftp.net/games/mwsrc.zip/scroll.s
`
`558 dsdr_getblock: lda maptemplo
`559 clc
`560 adc mapsx
`561 sta maptemplo
`562 bcc dsdr_not3
`563 inc maptemphi
`564 dsdr_not3: ldy #0
`565 lda (maptemplo),y
`566 tay
`567 lda BLOCKCOLS,y
`568 sta dsdr_lda2+1
`569 lda blktbllo,y
`570 clc
`Ex. 1032
`571 adc scrolltemp1
`572 sta dsdr_lda+1
`http://cadaver.homeftp.net/games/mwsrc.zip/scro11.s
`573 lda blktblhi,y
`574 sta dsdr_lda+2
`lda
`558
`dsdr_getb1ock:
`maptemp;o
`575 ldy #0
`c1c
`559
`576 jmp dsdr_lda
`adc
`560
`mapsx
`sta
`577 dsdr_ready: rts
`561
`maptemp;o
`578
`bcc
`562
`dsdr_not3
`579 ds_drawup: ldx mapy
`563
`inc
`maptemphi
`580 lda maptbllo,x
`564
`#0
`dsdr_not3:
`Ldy
`581 sta maptemplo
`Lda
`565
`(maptemp1o),y
`582 lda maptblhi,x
`566
`tay
`583 sta maptemphi
`'da
`567
`:LocKcoLs,y
`sta
`584 ldy mapx
`568
`dsdr_;da2+1
`585 lda blocky
`'da
`569
`b1ktb'1o,y
`586 asl
`c1c
`570
`587 asl
`571
`adc scro1;temp1
`588 sta scrolltemp1
`572
`dsdr_;da+1
`589 ldx screen
`573
`b1ktb'hi,y
`590 lda scradrtblhi,x
`574
`dsdr_;da+2
`591 sta dsdu_sta+2
`575
`#0
`592 ldx #0
`576
`dsdr_;da
`593 lda (maptemplo),y
`577
`dsdr_ready:
`594 iny
`578
`595 sty mapindex
`579
`mapy
`ds_drawup:
`596 tay
`580
`maptb;1o,x
`597 lda BLOCKCOLS,y
`581
`maptemplo
`598 sta dsdu_lda2+1
`582
`maptb;hi,x
`599 lda blktbllo,y
`583
`maptemphi
`600 clc
`584
`mapx
`585
`blocky
`Kendyl Román
`586
`587
`588
`589
`
`scrolltempl
`screen
`
`Ex. 1032
`
`14 of 28
`
`
`
`Ex. 1032
`http://cadaver.homeftp.net/games/mwsrc.zip/scroll.s
`
`601 adc scrolltemp1
`602 sta dsdu_lda+1
`603 lda blktblhi,y
`604 sta dsdu_lda+2
`605 ldy blockx
`606 dsdu_lda: lda $1000,y
`607 dsdu_sta: sta SCREEN1,x
`608 dsdu_lda2: lda #$00
`609 sta COLORS,x
`610 inx
`611 cpx #39
`612 beq dsdu_ready
`613 iny
`Ex. 1032
`614 cpy #4
`615 bne dsdu_lda
`http: //cadaver . homeftp . net/games/mwsrc . zip/scroll . s
`616 dsdu_getblock: ldy mapindex
`617 inc mapindex
`601
`adc scro1;temp1
`618 lda (maptemplo),y
`602
`sta dsdu_;da+1
`619 tay
`603
`'da b'ktb'hi,y
`620 lda BLOCKCOLS,y
`604
`sta dsdu_;da+2
`621 sta dsdu_lda2+1
`605
`'dy b'ockx
`622 lda blktbllo,y
`606
`dsdu_;da:
`Lda $1000,y
`623 clc
`607
`dsdu_sta:
`sta SCRfifiN1,x
`624 adc scrolltemp1
`608
`Lda #$00
`dsdu_;da2:
`625 sta dsdu_lda+1
`609
`sta COLORS,x
`626 lda blktblhi,y
`inx
`610
`627 sta dsdu_lda+2
`611
`cpx #39
`628 ldy #0
`612
`beq dsdu_ready
`629 jmp dsdu_lda
`613
`iny
`630 dsdu_ready: rts
`614
`cpy #4
`631
`615
`bne dsdu_1da
`632 ds_drawdown: lda mapy
`616
`dsdu_getb1ock:
`Ldy mapindex
`633 clc
`617
`inc mapindex
`634 adc #4
`618
`Lda
`(maptemp1o),y
`635 tax
`619
`tay
`636 lda blocky
`620
`'da 1LOCKCOLS,y
`637 clc
`621
`sta dsdu_;da2+1
`638 adc #1
`622
`'da b1ktb'1o,y
`639 cmp #4
`c1c
`623
`640 bcc dsdd_notover
`624
`adc scro1;temp1
`641 sec
`625
`sta dsdu_;da+1
`642 sbc #4
`626
`'da b1ktb'hi,y
`643 inx
`627
`sta dsdu_;da+2
`628
`Ldy #0
`Kendyl Román
`629
`jmp dsdu_;da
`rts
`630
`631
`632
`
`dsdu_ready:
`
`ds_drawdown:
`
`lda mapy
`
`Ex. 1032
`
`15 of 28
`
`
`
`Ex. 1032
`http://cadaver.homeftp.net/games/mwsrc.zip/scroll.s
`
`644 dsdd_notover: asl
`645 asl
`646 sta scrolltemp1
`647 lda maptbllo,x
`648 sta maptemplo
`649 lda maptblhi,x
`650 sta maptemphi
`651 ldy mapx
`652 ldx screen
`653 lda scradrtblhi,x
`654 clc
`655 adc #$02
`656 sta dsdd_sta+2
`Ex. 1032
`657 ldx #0
`658 lda (maptemplo),y
`http://cadaver.homeftp.net/games/mwsrc.zip/scro11.s
`659 iny
`660 sty mapindex
`644
`dsdd_notover:
`661 tay
`645
`662 lda BLOCKCOLS,y
`646
`scro1;temp1
`663 sta dsdd_lda2+1
`647
`maptb;1o,x
`664 lda blktbllo,y
`648
`maptemplo
`665 clc
`649
`maptb;hi,x
`666 adc scrolltemp1
`650
`maptemphi
`667 sta dsdd_lda+1
`651
`mapx
`screen
`668 lda blktblhi,y
`652
`669 sta dsdd_lda+2
`653
`scradrtb1hi,x
`670 ldy blockx
`654
`671 dsdd_lda: lda $1000,y
`655
`#$02
`672 dsdd_sta: sta SCREEN1+ROWS40-40,x
`656
`dsdd_sta+2
`673 dsdd_lda2: lda #$00
`657
`#0
`674 sta COLORS+ROWS40-40,x
`658
`(maptemp1o),y
`675 inx
`659
`676 cpx #39
`660
`mapindex
`677 beq dsdd_ready
`661
`678 iny
`662
`:LocKcoLs,y
`679 cpy #4
`663
`_da2+1
`dsdd_I
`680 bne dsdd_lda
`b1ktb'
`664
`1o,y
`681 dsdd_getblock: ldy mapindex
`665
`682 inc mapindex
`scroli
`666
`_temp1
`683 lda (maptemplo),y
`_da+1
`667
`dsdd_i
`684 tay
`b'ktb'
`668
`hi,y
`685 lda BLOCKCOLS,y
`669
`dsdd_I_da+2
`686 sta dsdd_lda2+1
`b ockx
`670
`671
`dsdd_;da:
`$1000,y
`Kendyl Román
`672
`dsdd_sta:
`SCRfifiN1+ROWS40-40,x
`673
`#$00
`dsdd_;da2:
`674
`COLORS+ROWS40-40,x
`675
`
`Ex. 1032
`
`16 of 28
`
`
`
`Ex. 1032
`ht