Routines |
Prev: 54280 | Up: Map | Next: 54504 |
|
||||
WriteSceneToShadowBuffer | 54281 | LD BC,0 | BC=0000. | |
Self-modifying code. These lines populate the value for a LoaD command below. The values relate to areas of the shadow screen buffer:
|
||||
54284 | LD A,107 | Write 107 to: | ||
54286 | LD (54389),A | |||
54289 | LD (54454),A | |||
54292 | CALL WriteSceneToShadowBuffer_Loop_1 | Call WriteSceneToShadowBuffer_Loop_1. | ||
54295 | LD A,115 | Write 115 to: | ||
54297 | LD (54389),A | |||
54300 | LD (54454),A | |||
54303 | CALL WriteSceneToShadowBuffer_Loop_1 | Call WriteSceneToShadowBuffer_Loop_1. | ||
54306 | LD A,123 | Write 123 to: | ||
54308 | LD (54389),A | |||
54311 | LD (54454),A | |||
WriteSceneToShadowBuffer_Loop_1 | 54314 | LD A,137 | A=137. | |
54316 | EX AF,AF' | Exchange the AF register with the shadow AF register. | ||
54317 | LD A,B | A=B. | ||
54318 | ADD A,104 | A+=104. | ||
54320 | LD H,A | H=A. | ||
54321 | LD L,C | L=C. | ||
54322 | LD D,0 | D=0. | ||
54324 | LD A,(HL) | Jump to WriteSceneToShadowBuffer_Loop_3 if *HL is zero. | ||
54325 | AND A | |||
54326 | JP Z,WriteSceneToShadowBuffer_Loop_3 | |||
54329 | LD (HL),D | Write D to *HL. | ||
54330 | LD A,96 | Write 96 to *53792. | ||
54332 | LD (53792),A | |||
54335 | DEC H | Decrease H by three. | ||
54336 | DEC H | |||
54337 | DEC H | |||
54338 | LD A,(HL) | Jump to WriteSceneToShadowBuffer_Loop_2 if *HL is not zero. | ||
54339 | AND A | |||
54340 | JP NZ,WriteSceneToShadowBuffer_Loop_2 | |||
54343 | LD A,32 | Write 32 to *53792. | ||
54345 | LD (53792),A | |||
54348 | DEC H | Decrease H by three. | ||
54349 | DEC H | |||
54350 | DEC H | |||
54351 | LD A,(HL) | Jump to WriteSceneToShadowBuffer_Loop_2 if *HL is not zero. | ||
54352 | AND A | |||
54353 | JP NZ,WriteSceneToShadowBuffer_Loop_2 | |||
54356 | XOR A | Write 0 to *53792. | ||
54357 | LD (53792),A | |||
54360 | DEC H | Decrease H by three. | ||
54361 | DEC H | |||
54362 | DEC H | |||
54363 | LD A,134 | A=134. | ||
54365 | EX AF,AF' | Exchange the AF register with the shadow AF register. | ||
54366 | LD A,(HL) | A=*HL. | ||
WriteSceneToShadowBuffer_Loop_2 | 54367 | AND %01111111 | Keep only bits 0-6. | |
54369 | LD E,A | E=A. | ||
54370 | LD A,(HL) | A=*HL. | ||
54371 | LD (53794),A | Write A to *53794. | ||
54374 | LD H,D | H=D. | ||
54375 | LD L,E | L=E. | ||
54376 | ADD HL,HL | HL*=8+DE. | ||
54377 | ADD HL,HL | |||
54378 | ADD HL,HL | |||
54379 | ADD HL,DE | |||
54380 | CP 128 | Jump to WriteSceneToShadowBuffer_0 if A is higher than 128. | ||
54382 | JP NC,WriteSceneToShadowBuffer_0 | |||
54385 | CALL 54504 | Call 54504. | ||
54388 | LD D,0 | D=0 (as above). | ||
54390 | LD A,(HL) | A=*HL. | ||
54391 | LD (DE),A | Write A to *DE. | ||
54392 | INC HL | Increment HL by one. | ||
54393 | INC D | Increment D by one. | ||
54394 | LD A,(HL) | A=*HL. | ||
54395 | LD (DE),A | Write A to *DE. | ||
54396 | INC HL | Increment HL by one. | ||
54397 | INC D | Increment D by one. | ||
54398 | LD A,(HL) | A=*HL. | ||
54399 | LD (DE),A | Write A to *DE. | ||
54400 | INC HL | Increment HL by one. | ||
54401 | INC D | Increment D by one. | ||
54402 | LD A,(HL) | A=*HL. | ||
54403 | LD (DE),A | Write A to *DE. | ||
54404 | INC HL | Increment HL by one. | ||
54405 | INC D | Increment D by one. | ||
54406 | LD A,(HL) | A=*HL. | ||
54407 | LD (DE),A | Write A to *DE. | ||
54408 | INC HL | Increment HL by one. | ||
54409 | INC D | Increment D by one. | ||
54410 | LD A,(HL) | A=*HL. | ||
54411 | LD (DE),A | Write A to *DE. | ||
54412 | INC HL | Increment HL by one. | ||
54413 | INC D | Increment D by one. | ||
54414 | LD A,(HL) | A=*HL. | ||
54415 | LD (DE),A | Write A to *DE. | ||
54416 | INC HL | Increment HL by one. | ||
54417 | INC D | Increment D by one. | ||
54418 | LD A,(HL) | A=*HL. | ||
54419 | LD (DE),A | Write A to *DE. | ||
WriteSceneToShadowBuffer_Loop_3 | 54420 | INC C | Increment C by one. | |
54421 | JP NZ,WriteSceneToShadowBuffer_Loop_1 | Jump to WriteSceneToShadowBuffer_Loop_1 if {} is not zero. | ||
54424 | INC B | Increment B by one. | ||
54425 | RET | Return. | ||
WriteSceneToShadowBuffer_0 | 54426 | CALL 54504 | Call 54504. | |
54429 | PUSH BC | Stash BC on the stack. | ||
54430 | LD A,C | A=C. | ||
54431 | EXX | Switch to the shadow registers. | ||
54432 | LD C,A | C=A. | ||
54433 | EX AF,AF' | Exchange the AF register with the shadow AF register. | ||
54434 | XOR C | Reset the bits from C. | ||
54435 | AND %00000011 | Keep only bits 0-1. | ||
54437 | LD C,A | C=A. | ||
54438 | ADD A,A | A*=8+C. | ||
54439 | ADD A,A | |||
54440 | ADD A,A | |||
54441 | ADD A,C | |||
54442 | LD B,0 | B=0. | ||
54444 | LD C,A | C=A. | ||
54445 | LD HL,35648 | HL=35648. | ||
54448 | ADD HL,BC | HL+=BC. | ||
54449 | INC L | Increment L by one. | ||
54450 | PUSH HL | Stash HL on the stack. | ||
54451 | EXX | Switch back to the normal registers. | ||
54452 | POP BC | Restore BC from the stack. | ||
54453 | LD D,0 | D=0 (as above). | ||
54455 | LD A,(BC) | A=*BC. | ||
54456 | OR (HL) | Set the bits from *HL. | ||
54457 | LD (DE),A | Write A to *DE. | ||
54458 | INC HL | Increment HL by one. | ||
54459 | INC BC | Increment BC by one. | ||
54460 | INC D | Increment D by one. | ||
54461 | LD A,(BC) | A=*BC. | ||
54462 | OR (HL) | Set the bits from *HL. | ||
54463 | LD (DE),A | Write A to *DE. | ||
54464 | INC HL | Increment HL by one. | ||
54465 | INC BC | Increment BC by one. | ||
54466 | INC D | Increment D by one. | ||
54467 | LD A,(BC) | A=*BC. | ||
54468 | OR (HL) | Set the bits from *HL. | ||
54469 | LD (DE),A | Write A to *DE. | ||
54470 | INC HL | Increment HL by one. | ||
54471 | INC BC | Increment BC by one. | ||
54472 | INC D | Increment D by one. | ||
54473 | LD A,(BC) | A=*BC. | ||
54474 | OR (HL) | Set the bits from *HL. | ||
54475 | LD (DE),A | Write A to *DE. | ||
54476 | INC HL | Increment HL by one. | ||
54477 | INC BC | Increment BC by one. | ||
54478 | INC D | Increment D by one. | ||
54479 | LD A,(BC) | A=*BC. | ||
54480 | OR (HL) | Set the bits from *HL. | ||
54481 | LD (DE),A | Write A to *DE. | ||
54482 | INC HL | Increment HL by one. | ||
54483 | INC BC | Increment BC by one. | ||
54484 | INC D | Increment D by one. | ||
54485 | LD A,(BC) | A=*BC. | ||
54486 | OR (HL) | Set the bits from *HL. | ||
54487 | LD (DE),A | Write A to *DE. | ||
54488 | INC HL | Increment HL by one. | ||
54489 | INC BC | Increment BC by one. | ||
54490 | INC D | Increment D by one. | ||
54491 | LD A,(BC) | A=*BC. | ||
54492 | OR (HL) | Set the bits from *HL. | ||
54493 | LD (DE),A | Write A to *DE. | ||
54494 | INC HL | Increment HL by one. | ||
54495 | INC BC | Increment BC by one. | ||
54496 | INC D | Increment D by one. | ||
54497 | LD A,(BC) | A=*BC. | ||
54498 | OR (HL) | Set the bits from *HL. | ||
54499 | LD (DE),A | Write A to *DE. | ||
54500 | POP BC | Restore BC from the stack. | ||
54501 | JP WriteSceneToShadowBuffer_Loop_3 | Jump to WriteSceneToShadowBuffer_Loop_3. |
Prev: 54280 | Up: Map | Next: 54504 |