Routines |
Prev: 45215 | Up: Map | Next: 45463 |
|
||||
WriteSprite_ShadowBuffer | 45286 | EXX | Switch to the shadow registers. | |
45287 | LD E,(IY+35) | E=*IY+35. | ||
45290 | LD D,(IY+40) | D=*IY+40. | ||
45293 | LD (43067),SP | Write SP to Temp_StackPointer_Storage. | ||
45297 | LD H,(IY+0) | H=*IY+0. | ||
45300 | LD L,0 | L=0. | ||
45302 | SRL H | |||
45304 | RR L | |||
45306 | ADD HL,DE | |||
45307 | LD SP,HL | |||
45308 | LD A,(IY+5) | B=*IY+5. | ||
45311 | LD B,A | |||
45312 | AND %00000111 | Keep only bits 0-2. | ||
Self-modifying code.
|
||||
45314 | LD (45449),A | Write A to 45449. | ||
45317 | INC A | |||
45318 | LD (45353),A | |||
45321 | LD (45381),A | |||
45324 | LD A,B | |||
45325 | AND %11111000 | Keep only bits 3-7. | ||
45327 | RRCA | |||
45328 | RRCA | |||
45329 | RRCA | |||
Self-modifying code.
|
||||
45330 | LD (45435),A | Write A to 45435. | ||
45333 | ADD A,2 | |||
45335 | LD E,A | |||
45336 | LD C,32 | |||
45338 | LD L,(IY+10) | |||
45341 | LD H,0 | |||
45343 | ADD HL,HL | |||
45344 | ADD HL,HL | |||
45345 | ADD HL,HL | |||
45346 | ADD HL,HL | |||
45347 | ADD HL,HL | |||
45348 | LD D,99 | |||
45350 | ADD HL,DE | |||
WriteSprite_ShadowBuffer_0 | 45351 | POP DE | ||
45352 | LD B,0 | |||
45354 | DEC B | |||
45355 | JR Z,WriteSprite_ShadowBuffer_2 | |||
45357 | SCF | |||
45358 | LD A,255 | |||
WriteSprite_ShadowBuffer_1 | 45360 | RR E | ||
45362 | RR D | |||
45364 | RRA | |||
45365 | DJNZ WriteSprite_ShadowBuffer_1 | |||
45367 | AND (HL) | |||
45368 | LD (HL),A | |||
WriteSprite_ShadowBuffer_2 | 45369 | DEC HL | ||
45370 | LD A,(HL) | |||
45371 | AND D | |||
45372 | LD (HL),A | |||
45373 | DEC HL | |||
45374 | LD A,(HL) | |||
45375 | AND E | |||
45376 | LD (HL),A | |||
45377 | INC HL | |||
45378 | INC HL | |||
45379 | POP DE | |||
45380 | LD B,0 | |||
45382 | DEC B | |||
45383 | JR Z,WriteSprite_ShadowBuffer_4 | |||
45385 | XOR A | |||
WriteSprite_ShadowBuffer_3 | 45386 | SRL E | ||
45388 | RR D | |||
45390 | RRA | |||
45391 | DJNZ WriteSprite_ShadowBuffer_3 | |||
45393 | OR (HL) | |||
45394 | LD (HL),A | |||
WriteSprite_ShadowBuffer_4 | 45395 | DEC HL | ||
45396 | LD A,(HL) | |||
45397 | OR D | |||
45398 | LD (HL),A | |||
45399 | DEC HL | |||
45400 | LD A,(HL) | |||
45401 | OR E | |||
45402 | LD (HL),A | |||
45403 | LD DE,34 | |||
45406 | ADD HL,DE | |||
45407 | DEC C | |||
45408 | JP NZ,WriteSprite_ShadowBuffer_0 | |||
45411 | LD A,(IY+10) | |||
45414 | AND %00000111 | Keep only bits 0-2. | ||
45416 | JR Z,WriteSprite_ShadowBuffer_5 | |||
45418 | LD B,5 | |||
45420 | JR WriteSprite_ShadowBuffer_6 | |||
Characters are 4 characters tall.
|
||||
WriteSprite_ShadowBuffer_5 | 45422 | LD B,4 | B=4 (counter). | |
WriteSprite_ShadowBuffer_6 | 45424 | LD A,(IY+10) | A=*IY+10. | |
45427 | AND %11111000 | Keep only bits 3-7. | ||
45429 | LD H,0 | Create an offset in HL. | ||
45431 | LD L,A | |||
45432 | ADD HL,HL | HL=64256+(HL*4). | ||
45433 | ADD HL,HL | |||
45434 | LD DE,64256 | |||
45437 | ADD HL,DE | |||
45438 | LD DE,30 | DE=0030. | ||
Grab the characters attribute byte.
|
||||
45441 | LD C,(IY+30) | C=*IY+30. | ||
WriteSprite_ShadowBuffer_7 | 45444 | LD (HL),C | Write the attribute byte to the attribute buffer (*HL). | |
45445 | INC HL | Increment HL by one. | ||
45446 | LD (HL),C | Write the attribute byte to the attribute buffer (*HL). | ||
45447 | INC HL | Increment HL by one. | ||
This is modified from 45314.
|
||||
45448 | LD A,255 | B=255. | ||
45450 | OR A | |||
45451 | JR Z,WriteSprite_ShadowBuffer_8 | |||
45453 | LD (HL),C | |||
WriteSprite_ShadowBuffer_8 | 45454 | ADD HL,DE | ||
45455 | DJNZ WriteSprite_ShadowBuffer_7 | |||
45457 | EXX | Switch to the normal registers. | ||
45458 | LD SP,(43067) | Restore SP from Temp_StackPointer_Storage. | ||
45462 | RET | Return. |
Prev: 45215 | Up: Map | Next: 45463 |