Prev: ED13 Up: Map Next: ED8A
ED2A: See if we've reached a break, and display a message if so
Used by the routine at 8184.
ED2A LD A,($ECF5) Get the index of the next reward screen. (ECF5)
ED2D ADD A,A Double it to get a word offset
ED2E LD E,A Put this in DE.
ED2F LD D,$00
ED31 LD HL,$ECF6 Add the base address of the reward value buffer. (ECF6)
ED34 ADD HL,DE
ED35 LD A,($ECFF) Get the "tens" part of the total money earned.
ED38 SUB (HL) Subtract the "tens" value.
ED39 INC HL Move to the next entry containsing the "hundreds"
ED3A LD A,($ECFE) Get the "hundreds" part of the total money earned.
ED3D SBC A,(HL) Subtract the "hundreds" value, accounting for any carry with the "tens".
ED3E RET C Return if the value is greater than our current earnings.
We've got enough money, so display a graphic.
ED3F LD BC,$0000 Pause for a bit.
ED42 DEC BC
ED43 NOP
ED44 NOP
ED45 LD A,B
ED46 OR C
ED47 JR NZ,$ED42
ED49 CALL $B902 Clear the playing area.
ED4C LD HL,$ED00 Add the word offset previously stored in DE to the base address of the message buffer. (ED00)
ED4F ADD HL,DE
ED50 LD E,(HL) Put the actual address in DE.
ED51 INC HL
ED52 LD D,(HL)
ED53 EX DE,HL Swap DE and HL.
ED54 LD DE,$0000 Set the position to top left.
ED57 CALL $B8C4 Print the string pointed to by HL.
ED5A CALL $B9AC Draw the screen.
ED5D CALL $EEA2 Update the sprite buffers.
ED60 LD A,($ECF5) Get the index of the next reward screen. (ECF5)
ED63 ADD A,A Double it and add 65 to get an appropriate index for the reward screen moving graphics.
ED64 ADD A,$65
ED66 LD IX,$ED06 Point IX at the movement table for the reward screens. (ED06)
ED6A LD B,$03 Three rounds to draw.
ED6C PUSH BC Store BC.
ED6D LD BC,$F5CA Point BC at the bounds for the moving graphics.
ED70 CALL $EF35 Update the moving objects.
ED73 CALL $A8A0 Put the object in the sprite buffer.
ED76 POP BC Restore BC.
ED77 DJNZ $ED6C Loop back while there's more to display.
ED79 CALL $B9FB Put the sprites on screen.
ED7C CALL $ABD7 Was a key pressed?
ED7F OR A
ED80 JR Z,$ED5D If not, loop back to draw some more.
ED82 LD HL,$ECF5 Move onto the next reward screen index.
ED85 INC (HL)
ED86 CALL $B952 Draw the room.
ED89 RET Return.
Prev: ED13 Up: Map Next: ED8A