Prev: 50154 Up: Map Next: 50667
50210: Duel Bonus Round
Used by the routine at 50112.
Duel_Prep 50210 LD HL,50154 Copies 51 bytes of data from Duel_Data to Dueller_01 (and across all three duellists).
50213 LD DE,23488
50216 LD BC,51
50219 LDIR
50221 POP DE
50222 POP BC
50223 LD A,B
50224 LD IX,23488 Calls Update_Duel_Timer with Dueller_01.
50228 CALL Update_Duel_Timer
50231 LD A,C
50232 LD IX,23505 Calls Update_Duel_Timer with Dueller_02.
50236 CALL Update_Duel_Timer
50239 LD A,D
50240 LD IX,23522 Calls Update_Duel_Timer with Dueller_03.
50244 CALL Update_Duel_Timer
50247 XOR A Reset the flags (writes 0 to Duel_Bang_Flag, Duel_Lose_Life and Duel_Extra_Life).
50248 LD HL,50914
50251 LD (HL),A
50252 INC HL
50253 LD (HL),A
50254 INC HL
50255 LD (HL),A
50256 LD A,(50209) 50209.
50259 OR 1
50261 CP 32
50263 LD DE,1
50266 JR NC,Duel_Clear_Screen
50268 LD B,A
50269 LD DE,32
Duel_Prep_Loop 50272 DEC DE
50273 DJNZ Duel_Prep_Loop
Duel_Clear_Screen 50275 LD (50478),DE ....
Clears down the screen buffer.
50279 LD HL,16384 Writes 0 to all 6911 bytes of the screen buffer (i.e. "blanks it").
50282 LD DE,16385
50285 LD BC,6911
50288 XOR A
50289 LD (HL),A
50290 LDIR
Writes the attributes for the playfield (sky, grass, footer).
50292 LD HL,22656 Writes 40 to 22656 in the attribute buffer 384 times...
Value Ink Paper Bright
0 5 0 0
50295 LD DE,22657
50298 LD BC,384
50301 LD (HL),40
50303 LDIR
50305 LD (HL),32 ...continuing, writes 32 128 times...
Value Ink Paper Bright
0 4 0 0
50307 LD BC,128
50310 LDIR
50312 LD (HL),7 ...and finally, writes 7 127 times.
Value Ink Paper Bright
7 0 0 0
50314 LD BC,127
50317 LDIR
Creates the footer.
50319 LD HL,50773 Point to Playfield_Lives and print using Duel_Print_Lives.
50322 CALL Duel_Print_Lives
50325 CALL Draw_Lives_Images_Alias
50328 LD HL,50765 Point to Playfield_Score and prints using Print_TwoToneText_Alias.
Value Ink Paper Bright
7 7 0 0
3 3 0 0
50331 LD DE,20672
50334 LD BC,1795
50337 CALL Print_TwoToneText_Alias
50340 CALL Draw_Score_Alias Writes the players score.
Initialise duellers.
50343 LD IX,23488 Initialise Dueller_01 (draws frame 1).
50347 LD A,(IX+10)
50350 CALL Duel_Draw_Bandit_Prep
50353 LD IX,23505 Initialise Dueller_02 (draws frame 1).
50357 LD A,(IX+10)
50360 CALL Duel_Draw_Bandit_Prep
50363 LD IX,23522 Initialise Dueller_03 (draws frame 1).
50367 LD A,(IX+10)
50370 CALL Duel_Draw_Bandit_Prep
Count down 5-4-3-2-1...0!
Countdown_Initialise 50373 LD A,53 Initialise countdown to "5" seconds (53 in ASCII), hold this at Duel_Timer.
Countdown_Loop 50375 PUSH AF
50376 LD (50912),A
50379 CALL Duel_Print_Countdown
50382 LD B,49 Short halt loop (1 second pause).
Countdown_Halt_Loop 50384 HALT
50385 DJNZ Countdown_Halt_Loop
50387 POP AF Keep looping back to Countdown_Loop until the countdown is "0" (48 in ASCII).
50388 DEC A
50389 CP 48
50391 JR NZ,Countdown_Loop
50393 LD A,32 Blank the countdown timer by printing a "SPACE" (32 in ASCII) over the top of it.
50395 LD (50912),A
50398 CALL Duel_Print_Countdown
50401 JR Duel_Start Jump to Duel_Start and start the duel!
Duel_Loop 50403 LD IX,23488 Calls Duel_Actions with Dueller_01.
50407 CALL Duel_Actions
50410 LD IX,23505 Calls Duel_Actions with Dueller_02.
50414 CALL Duel_Actions
50417 LD IX,23522 Calls Duel_Actions with Dueller_03.
50421 CALL Duel_Actions
50424 RET Return.
DRAW!
Duel_Start 50425 LD DE,(50478) DE=50478 and push it on the stack.
Duel_Start_Loop 50429 PUSH DE
50430 CALL Duel_Loop
50433 POP DE
50434 DEC DE
50435 LD A,D
50436 OR E
50437 JR NZ,Duel_Start_Loop
50439 LD IX,23488
50443 CALL Duel_Prep_1
50446 LD IX,23505
50450 CALL Duel_Prep_1
50453 LD IX,23522
50457 CALL Duel_Prep_1
50460 LD IX,23488
50464 LD A,(IX+8)
50467 OR (IX+25)
50470 OR (IX+42)
50473 JP Z,Duel_Complete
50476 JR Duel_Start
50478 DEFW 31
Duel_Actions 50480 CALL Duel_Action_01
50483 CALL Duel_Action_04
50486 CALL Duel_Action_02
50489 CALL Duel_Action_04
50492 CALL Duel_Action_03
50495 CALL Duel_Action_04
50498 RET Return.
Duel_Action_01 50499 CALL Jump_Control_Method Calls Jump_Control_Method.
50502 BIT 4,A Return if bit 4 of A is zero.
50504 RET Z
50505 BIT 0,A If bit 0 is not zero then return setting A to 3.
50507 LD A,3
50509 RET NZ
50510 XOR A Set A to zero and return.
50511 RET
Duel_Action_02 50512 CALL Jump_Control_Method Calls Jump_Control_Method.
50515 BIT 4,A Return if bit 4 of A is zero.
50517 RET Z
50518 BIT 1,A If bit 1 is not zero then return setting A to 1.
50520 LD A,1
50522 RET NZ
50523 XOR A Set A to zero and return.
50524 RET
Duel_Action_03 50525 CALL Jump_Control_Method
50528 BIT 4,A
50530 RET Z
50531 AND 3
50533 LD A,0
50535 RET NZ
50536 LD A,2
50538 RET Return.
Duel_Action_04 50539 CP (IX+3) If the dueller position has been changed to zero then jump to Duel_Dunno.
50542 JR Z,Duel_Dunno
50544 LD (IX+13),0
50548 RET Return.
Duel_Dunno 50549 LD A,(IX+13)
50552 AND A
50553 RET NZ
50554 LD A,1
50556 LD (IX+13),A
50559 LD (IX+0),A Set dueller state to 1.
50562 RET Return.
This entry point is used by the routines at Print_BonusScore and Dueller_Shot.
Duel_Prep_0 50563 PUSH IX
50565 CALL Shot_Sound_01_Alias
50568 POP IX
50570 RET
Duel_Prep_1 50571 LD A,(IX+8) If IX+$08 is zero then return.
50574 AND A
50575 RET Z
50576 LD A,(IX+9) If dueller frame index is 1 then jump to Duel_Prep_2.
50579 DEC A
50580 JR Z,Duel_Prep_2
50582 DEC A If dueller frame index is 2 then jump to Duel_Prep_3.
50583 JR Z,Duel_Prep_3
50585 DEC A If dueller frame index is 3 then jump to Duel_Prep_4.
50586 JR Z,Duel_Prep_4
50588 DEC A If dueller frame index is 4 then jump to Duel_Prep_5.
50589 JR Z,Duel_Prep_5
50591 JR Duel_Prep_6 Jump to Duel_Prep_6.
Duel_Prep_2 50593 LD HL,50917 Dueller_Shot.
50596 CALL Dueller_Down
50599 DEC (IX+1)
50602 RET NZ
50603 INC (IX+9)
50606 LD A,(IX+11)
50609 CALL Duel_Draw_Bandit_Prep
50612 RET
Duel_Prep_3 50613 DEC (IX+16)
50616 RET NZ
50617 INC (IX+9)
50620 RET
Duel_Prep_4 50621 LD HL,50678
50624 CALL Dueller_Down
50627 DEC (IX+2)
50630 RET NZ
50631 LD (IX+8),A
50634 INC A
50635 LD (50914),A
50638 RET
Duel_Prep_5 50639 DEC (IX+14)
50642 RET NZ
50643 INC (IX+9)
50646 LD A,(IX+12)
50649 CALL Duel_Draw_Bandit_Prep
50652 RET
Duel_Prep_6 50653 DEC (IX+15)
50656 RET NZ
50657 LD A,2
50659 CALL Duel_Draw_Bandit_Prep
50662 LD (IX+8),0
50666 RET
Prev: 50154 Up: Map Next: 50667