Prev: 8C58 Up: Map Next: 8DF9
8D8F: Drives transitions
transition 8D8F LD A,($A231) Check transition_control
8D92 AND A Exit early if its zero
8D93 RET Z
8D94 DEC A Decrement it
8D95 JP Z,draw_mugshots If zero, call draw_mugshots
8D98 DEC A
8D99 JP Z,sub_8e42
8D9C DEC A
8D9D JP Z,fill_attributes Call fill_attributes
8DA0 LD A,$00 A = <self modified> - 1
8DA2 DEC A
8DA3 LD ($8DA1),A Self modify above
8DA6 JR NZ,transition_0
8DA8 LD ($A231),A transition_control = A
8DAB JR transition_1
transition_0 8DAD LD HL,($8DBB) }
8DB0 LD DE,$0008 Move to next frame? (self modified)
8DB3 ADD HL,DE
8DB4 LD ($8DBB),HL Set anim address? (self modify)
transition_1 8DB7 LD H,$FF
8DB9 EXX
8DBA LD HL,$0000
8DBD LD B,$08 8 chunks
transition_loop 8DBF LD A,(HL) Fetch a byte of anim?
8DC0 EXX Bank
8DC1 LD E,A Get it into E
8DC2 LD D,H Preserve H in D (which is safe)
8DC3 LD L,$FE Reset ptr
8DC5 CALL fade_chunk Draw a chunk
8DC8 LD L,$FE Reset ptr
8DCA LD A,H Move up (screen-wise) by 8
8DCB SUB $08
8DCD LD H,A
8DCE CALL fade_chunk Draw a chunk
8DD1 DEC D H = D - 1 -- drop down 1 row
8DD2 LD H,D
8DD3 EXX Unbank
8DD4 INC HL Next byte of anim
8DD5 DJNZ transition_loop Loop
8DD7 RET Return
fade_chunk 8DD8 LD C,$08 8 rows
fade_row_loop 8DDA LD B,$06 6 iterations (of 5 each) = 30 bytes written (~ a scanline)
fade_column_loop 8DDC LD A,(HL) OR E into the screen pixels
8DDD OR E
8DDE LD (HL),A
8DDF DEC L Repeat another four times
8DE0 LD A,(HL)
8DE1 OR E
8DE2 LD (HL),A
8DE3 DEC L
8DE4 LD A,(HL)
8DE5 OR E
8DE6 LD (HL),A
8DE7 DEC L
8DE8 LD A,(HL)
8DE9 OR E
8DEA LD (HL),A
8DEB DEC L
8DEC LD A,(HL)
8DED OR E
8DEE LD (HL),A
8DEF DEC L
8DF0 DJNZ fade_column_loop Loop
8DF2 DEC L Move to next start address
8DF3 DEC L
8DF4 DEC C Loop
8DF5 JP NZ,fade_row_loop
8DF8 RET Return
Prev: 8C58 Up: Map Next: 8DF9