Prev: 50413 Up: Map Next: 50882
50687: Draw Side Flames
Used by the routines at CheckPauseAndSilence and DrawShipTop.
Does nothing unless part 4 has been fitted. Draws the flame at the side of the ship when it is moving to the left or to the right, from the object at SideFlameObject, and sets its attribute with SetFlameAttributes. This is a best reading of the code.
DrawSideFlames 50687 LD A,(62961) The fourth part flag.
50690 AND A Return if A is zero.
50691 RET Z
50692 LD IX,50882 The side flame object.
50696 LD HL,0 HL=0.
50699 LD (23580),HL No saved row count.
50702 BIT 7,(IX+3) Jump to DrawSideFlames_Flame if bit 7 of offset 3 of IX is set.
50706 JR NZ,DrawSideFlames_Flame
50708 LD A,(23607) The controls.
50711 AND %00000011 Keep the bits of A that are set in 3.
50713 RET Z Return if the zero flag is set.
50714 JR DrawSideFlames_Update Jump to DrawSideFlames_Update.
DrawSideFlames_Flame 50716 CALL FetchSpriteType Call FetchSpriteType.
50719 LD (23580),A The flame sprite's width.
50722 LD HL,(50883) Fetch the word at 50883 into HL.
50725 LD IY,42561 The fifth aligned-row erase.
50729 BIT 6,(IX+3) Jump to DrawSideFlames_Update if bit 6 of offset 3 of IX is clear.
50733 JR Z,DrawSideFlames_Update
50735 LD IY,42948 The fifth mirrored-row erase.
50739 LD B,249 B=249.
DrawSideFlames_Update 50741 EXX Switch to the alternate registers.
50742 LD (IX+3),0 Store 0 at offset 3 of IX.
50746 LD A,(23607) The controls.
50749 AND %00000011 Keep the bits of A that are set in 3.
50751 JP Z,DrawSideFlames_Draw Jump to DrawSideFlames_Draw if the zero flag is set.
50754 LD A,(36691) The ship state.
50757 CP 10 Jump to DrawSideFlames_Draw if A is 10 or more.
50759 JR NC,DrawSideFlames_Draw
50761 LD A,(IX+6) Read offset 6 of IX.
50764 INC A Advance A.
50765 AND %00000111 Keep the bits of A that are set in 7.
50767 LD (IX+6),A Write A to offset 6 of IX.
50770 LD HL,51113 The flame frames.
50773 CALL AddAToHL Call AddAToHL.
50776 LD A,(HL) Read HL.
50777 ADD A,14 Add 14 to A.
50779 LD (IX+0),A Write A to offset 0 of IX.
50782 CALL FetchSpriteType Call FetchSpriteType.
50785 LD (23581),A The flame sprite's width.
50788 LD (IX+3),128 Store 128 at offset 3 of IX.
50792 LD IX,42636 The fifth aligned-row draw.
50796 LD A,(23608) The ship row.
50799 ADD A,8 Add 8 to A.
50801 LD H,A H=A.
50802 LD L,80 L=80.
50804 LD A,(23607) The controls.
50807 BIT 1,A Jump to DrawSideFlames_Draw2 if bit 1 of A is clear.
50809 JR Z,DrawSideFlames_Draw2
50811 LD L,152 L=152.
50813 LD B,249 B=249.
50815 LD A,192 A=192.
50817 LD (50885),A The side flame faces left.
50820 LD IX,42994 The fifth mirrored-row draw.
DrawSideFlames_Draw2 50824 LD (50886),HL The position of the side flame.
50827 CALL GetScreenAddress Call GetScreenAddress.
50830 LD (50883),HL The screen address of the side flame.
DrawSideFlames_Draw 50833 CALL DrawSpritesDirectly Call DrawSpritesDirectly.
50836 LD A,(50885) The side flame faces left.
50839 AND %10000000 Keep the bits of A that are set in 128.
50841 RET Z Return if the zero flag is set.
50842 LD HL,(50886) Fetch the word at 50886 into HL.
50845 LD A,L A=L.
50846 AND %11110000 Keep the bits of A that are set in 240.
50848 LD L,A L=A.
50849 LD A,H A=H.
50850 SUB 4 Subtract 4 from A.
50852 LD H,A H=A.
50853 LD A,(50888) The flame attribute.
This entry point is used by the routine at DrawMainFlame.
SetFlameAttributes 50856 EX DE,HL Swap DE and HL.
50857 LD HL,514 HL=514.
50860 LD (44801),HL Update the attribute area.
50863 LD HL,51099 The flame attributes.
50866 AND %00000111 Keep the bits of A that are set in 7.
50868 CALL AddAToHL Call AddAToHL.
50871 LD A,(HL) Read HL.
50872 EX DE,HL Swap DE and HL.
50873 LD (44803),A The attribute of the side flame.
50876 LD DE,44801 The attribute area.
50879 JP FillAttributes Jump to FillAttributes.
Prev: 50413 Up: Map Next: 50882