Prev: AB61 Up: Map Next: AC6B
ABF5: The sparks over the robot (graphic 80)
Reached through UPDATES: the first part of the re-programming (SCENE_TOOL). Every eighth turn the sparks change colour, bright yellow or black by bit 3 of the turn counter, with a beep; after sixteen changes they go (graphic 1: rubbed out and emptied) and set SCENE_STATE to 1, which lets the tools swing.
COLOUR_SCENE_OBJECT is the update routine of the scene's pieces that do not move (graphics 85, 88 to 91: the can of oil, the robot's stand, its legs and top) and the last step of the others'. The scene's screen is bright red on black (GAME_ENDED), the colour of its frame, and each piece has its own colour: this paints the attribute cells a piece's picture covers (its width and height as last drawn, at its pixel place) with its colour at +10, bottom row first -- except any cell already bright green ($44), the hammer's colour, so the hammer stays green where it is over the robot. Nothing puts those cells back, so the robot's head is left green after the hammer's blows (seen in the simulator). It does nothing for a piece not drawn yet.
SCENE_SPARKS ABF5 LD A,(TURNS) not an eighth turn: only colour
ABF8 LD C,A
ABF9 AND $07
ABFB JR NZ,COLOUR_SCENE_OBJECT
ABFD BIT 3,C bright yellow, or black
ABFF JR Z,SCENE_SPARKS_0
AC01 ADD A,$46
SCENE_SPARKS_0 AC03 LD (IX+$10),A
AC06 CALL PLAIN_BEEP a beep
AC09 INC (IX+$11) sixteen changes
AC0C LD A,(IX+$11)
AC0F CP $10
AC11 JR NZ,COLOUR_SCENE_OBJECT
AC13 LD A,$01 the tools may start; the sparks go
AC15 LD (SCENE_STATE),A
AC18 LD (IX+$00),A
AC1B CALL COLOUR_SCENE_OBJECT colour its cells; redraw
AC1E JP SET_WIPE_AND_DRAW_FLAGS
This entry point is used by the routines at SCENE_ROBOT_TOP, OILED_ROBOT and SCENE_TOOL.
COLOUR_SCENE_OBJECT AC21 LD A,(IX+$18) not drawn yet
AC24 OR (IX+$19)
AC27 RET Z
AC28 LD L,(IX+$1A) the cells across: its width, one more if it starts inside a cell
AC2B LD B,(IX+$18)
AC2E LD A,L
AC2F AND $07
AC31 JR Z,SCENE_SPARKS_1
AC33 INC B
SCENE_SPARKS_1 AC34 LD H,(IX+$1B) the rows of cells from its bottom to its top
AC37 LD A,H
AC38 RRCA
AC39 RRCA
AC3A RRCA
AC3B AND $1F
AC3D LD C,A
AC3E LD A,(IX+$19)
AC41 DEC A
AC42 ADD A,H
AC43 RRCA
AC44 RRCA
AC45 RRCA
AC46 AND $1F
AC48 SUB C
AC49 INC A
AC4A LD C,A
AC4B CALL CALC_ATTRIB_ADDR the bottom-left cell's attribute; the colour
AC4E EX DE,HL
AC4F LD A,(IX+$10)
AC52 LD DE,$0020
SCENE_SPARKS_2 AC55 PUSH BC a row
AC56 PUSH HL
AC57 LD C,A
SCENE_SPARKS_3 AC58 LD A,(HL) each cell but a bright green one
AC59 CP $44
AC5B JR Z,SCENE_SPARKS_4
AC5D LD (HL),C
SCENE_SPARKS_4 AC5E INC L
AC5F DJNZ SCENE_SPARKS_3
AC61 LD A,C up a row, for each row
AC62 POP HL
AC63 POP BC
AC64 AND A
AC65 SBC HL,DE
AC67 DEC C
AC68 JR NZ,SCENE_SPARKS_2
AC6A RET
Prev: AB61 Up: Map Next: AC6B