Difference between revisions of "Tactics Ogre:ROM map"

From Data Crystal
Jump to: navigation, search
($84/CAF9 ?)
($80/B101 ?)
 
(85 intermediate revisions by the same user not shown)
Line 477: Line 477:
 
  $80/8C0D ED 73 05    SBC $0573
 
  $80/8C0D ED 73 05    SBC $0573
 
  $80/8C10 10 05      BPL $05      ; [$8C17] Branch if Positive
 
  $80/8C10 10 05      BPL $05      ; [$8C17] Branch if Positive
; Code is missing here
+
;code is missing here
 
  $80/8C17 85 0E      STA $0E      ; Store (positive) Difference of the V-Scrolls in $0E
 
  $80/8C17 85 0E      STA $0E      ; Store (positive) Difference of the V-Scrolls in $0E
 
  $80/8C19 05 0C      ORA $0C      ; With this, if any Bit in $0C or $0E is set, A will be != 0
 
  $80/8C19 05 0C      ORA $0C      ; With this, if any Bit in $0C or $0E is set, A will be != 0
 
  $80/8C1B D0 03      BNE $03      ; [$8C20] Branch if there was any difference between the buffers
 
  $80/8C1B D0 03      BNE $03      ; [$8C20] Branch if there was any difference between the buffers
 
  $80/8C1D 4C 1D 8D    JMP $8D1D    ; Exit
 
  $80/8C1D 4C 1D 8D    JMP $8D1D    ; Exit
  $80/8C20 E2 20      SEP #$20               A:0001 X:3300 Y:0002 P:envmxdizC
+
  $80/8C20 E2 20      SEP #$20     ; A = 8-bit
 
  $80/8C22 A5 67      LDA $67      ; ??? (seems to be always 8)
 
  $80/8C22 A5 67      LDA $67      ; ??? (seems to be always 8)
 
  $80/8C24 1A          INC A        ; ???
 
  $80/8C24 1A          INC A        ; ???
 
  $80/8C25 20 F0 A8    JSR $A8F0    ; Calculate the Square Number of A
 
  $80/8C25 20 F0 A8    JSR $A8F0    ; Calculate the Square Number of A
  $80/8C28 C2 20      REP #$20      ; 16-bit A
+
  $80/8C28 C2 20      REP #$20      ; A = 16-bit
 
  $80/8C2A 85 04      STA $04      ; ?? $04 = ($6C + 1)²  (= #$51)
 
  $80/8C2A 85 04      STA $04      ; ?? $04 = ($6C + 1)²  (= #$51)
 
  $80/8C2C A5 0C      LDA $0C      ; Load (positive) Difference of the H-Scrolls in $0C
 
  $80/8C2C A5 0C      LDA $0C      ; Load (positive) Difference of the H-Scrolls in $0C
 
  $80/8C2E 22 01 A9 80 JSL $80A901  ; Calculate the Square Number of 16-bit A
 
  $80/8C2E 22 01 A9 80 JSL $80A901  ; Calculate the Square Number of 16-bit A
  $80/8C32 D4 02      PEI ($02)    ; Buffer $00-$03 on Stack (which is the Square Number Result)
+
  $80/8C32 D4 02      PEI ($02)    ; Buffer $00-$03 (Square Number Result) on Stack
 
  $80/8C34 D4 00      PEI ($00)
 
  $80/8C34 D4 00      PEI ($00)
 
  $80/8C36 A5 0E      LDA $0E      ; Load (positive) Difference of the V-Scrolls in $0E
 
  $80/8C36 A5 0E      LDA $0E      ; Load (positive) Difference of the V-Scrolls in $0E
Line 531: Line 531:
 
  $80/8C84 89 01 00    BIT #$0001
 
  $80/8C84 89 01 00    BIT #$0001
 
  $80/8C87 F0 06      BEQ $06      ; [$8C8F] Branch if positive difference
 
  $80/8C87 F0 06      BEQ $06      ; [$8C8F] Branch if positive difference
; Code is missing here
+
;code is missing here
 
  $80/8C8F A5 0C      LDA $0C      ; Load (positive/negative) Difference of the H-Scrolls
 
  $80/8C8F A5 0C      LDA $0C      ; Load (positive/negative) Difference of the H-Scrolls
 
  $80/8C91 18          CLC
 
  $80/8C91 18          CLC
Line 546: Line 546:
 
  $80/8CAD EC 71 05    CPX $0571    ; Compare new H-Scroll to the old
 
  $80/8CAD EC 71 05    CPX $0571    ; Compare new H-Scroll to the old
 
  $80/8CB0 30 1A      BMI $1A      ; [$8CCC] Branch if the difference was negative = scroll value got less
 
  $80/8CB0 30 1A      BMI $1A      ; [$8CCC] Branch if the difference was negative = scroll value got less
; Code is missing here
+
;code is missing here
 
  $80/8CCC AD 71 05    LDA $0571    ; Load old H-Scroll
 
  $80/8CCC AD 71 05    LDA $0571    ; Load old H-Scroll
 
  $80/8CCF 29 F8 FF    AND #$FFF8    ; Remove lowest 3 Bits
 
  $80/8CCF 29 F8 FF    AND #$FFF8    ; Remove lowest 3 Bits
Line 554: Line 554:
 
  $80/8CD8 C5 00      CMP $00      ; Check if the difference between old and new H-Scroll is bigger than 8px
 
  $80/8CD8 C5 00      CMP $00      ; Check if the difference between old and new H-Scroll is bigger than 8px
 
  $80/8CDA F0 07      BEQ $07      ; [$8CE3] Branch if not
 
  $80/8CDA F0 07      BEQ $07      ; [$8CE3] Branch if not
; Code is missing here
+
;code is missing here
$80/8CDC E2 20      SEP #$20               A:00D8 X:00DF Y:0060 P:eNvmxdizc
+
$80/8CDC E2 20      SEP #$20     ; A = 8-bit
$80/8CDE 20 45 8D    JSR $8D45  [$80:8D45]  A:00D8 X:00DF Y:0060 P:eNvMxdizc
+
$80/8CDE 20 45 8D    JSR $8D45  [$80:8D45]  A:00D8 X:00DF Y:0060 P:eNvMxdizc
$80/8CE1 C2 20      REP #$20               A:0038 X:0006 Y:781B P:eNvMxdizc
+
$80/8CE1 C2 20      REP #$20     ; A = 16-bit
 
  $80/8CE3 AE 91 05    LDX $0591    ; X = BG1 H-Scroll
 
  $80/8CE3 AE 91 05    LDX $0591    ; X = BG1 H-Scroll
 
  $80/8CE6 AC 93 05    LDY $0593    ; Y = BG1 V-Scroll
 
  $80/8CE6 AC 93 05    LDY $0593    ; Y = BG1 V-Scroll
Line 571: Line 571:
 
  $80/8CFC C5 00      CMP $00      ; Check if the difference between old and new H-Scroll is bigger than 8px
 
  $80/8CFC C5 00      CMP $00      ; Check if the difference between old and new H-Scroll is bigger than 8px
 
  $80/8CFE F0 1D      BEQ $1D      ; [$8D1D] Exit
 
  $80/8CFE F0 1D      BEQ $1D      ; [$8D1D] Exit
; Code is missing here
+
;code is missing here
 
  $80/8D1D E2 20      SEP #$20
 
  $80/8D1D E2 20      SEP #$20
 
  $80/8D1F 60          RTS
 
  $80/8D1F 60          RTS
Line 2,664: Line 2,664:
 
== $80/A60E ? ==
 
== $80/A60E ? ==
  
Notes to crack the use of this subroutine:
+
NOTES:
 +
 
 +
A60E: "Case decider"
 +
A61A: $00!=0 $02 =0 $08!=0 Setup and Jump to 39
 +
A624: $00 =? $02!=0 $08!=0 Do this and then 39
 +
A639: $00!=0 $02 =0 $08!=0
 +
A648: $00 =? $02 =? $08 =0 ?
 +
A652: Exit
  
This has a case decider at its beginning
 
  
I think $08 and $00 contain a flag value in the beginning, and it might be that $00 is a start value and $08 is the end value?
 
  
 
  $80/A60E A5 08      LDA $08    [$00:0008]  A:00C0 X:000C Y:0001 P:envmxdizc
 
  $80/A60E A5 08      LDA $08    [$00:0008]  A:00C0 X:000C Y:0001 P:envmxdizc
Line 2,682: Line 2,687:
 
  $80/A621 7B          TDC          ; Clear 16-bit A
 
  $80/A621 7B          TDC          ; Clear 16-bit A
 
  $80/A622 80 15      BRA $15    [$A639]      A:0000 X:3300 Y:0014 P:envmxdiZC
 
  $80/A622 80 15      BRA $15    [$A639]      A:0000 X:3300 Y:0014 P:envmxdiZC
 +
 
  $80/A624 A9 01 00    LDA #$0001    ; Setup loop counters in $04/5 and $06/7
 
  $80/A624 A9 01 00    LDA #$0001    ; Setup loop counters in $04/5 and $06/7
 
  $80/A627 85 04      STA $04      ; ($04/5 gets ROLed at $80/A642, so: 16 loops)
 
  $80/A627 85 04      STA $04      ; ($04/5 gets ROLed at $80/A642, so: 16 loops)
Line 2,691: Line 2,697:
 
  $80/A631 90 02      BCC $02    [$A635]      A:0000 X:000C Y:0001 P:eNvmxdizc
 
  $80/A631 90 02      BCC $02    [$A635]      A:0000 X:000C Y:0001 P:eNvmxdizc
 
; Code is missing here
 
; Code is missing here
  $80/A635 26 06      ROL $06   [$00:0006]  A:0000 X:000C Y:0001 P:eNvmxdizc
+
  $80/A635 26 06      ROL $06       ; ROL Loop counter
 
  $80/A637 90 F3      BCC $F3    [$A62C]      A:0000 X:000C Y:0001 P:envmxdizc
 
  $80/A637 90 F3      BCC $F3    [$A62C]      A:0000 X:000C Y:0001 P:envmxdizc
  $80/A639 06 00      ASL $00   [$00:0000]  A:0060 X:000C Y:0001 P:envmxdiZC
+
  $80/A63B 2A          ROL A                   A:0060 X:000C Y:0001 P:envmxdiZc
+
  $80/A639 06 00      ASL $00       ; Roll MSB out of $00 in Carry
 +
  $80/A63B 2A          ROL A         ; Put Carry in A
 
  $80/A63C C5 08      CMP $08    [$00:0008]  A:00C0 X:000C Y:0001 P:envmxdizc
 
  $80/A63C C5 08      CMP $08    [$00:0008]  A:00C0 X:000C Y:0001 P:envmxdizc
  $80/A63E 90 02      BCC $02   [$A642]      A:00C0 X:000C Y:0001 P:envmxdiZC
+
  $80/A63E 90 02      BCC $02       ; [$A642]      A:00C0 X:000C Y:0001 P:envmxdiZC
 
  $80/A640 E5 08      SBC $08    [$00:0008]  A:00C0 X:000C Y:0001 P:envmxdiZC
 
  $80/A640 E5 08      SBC $08    [$00:0008]  A:00C0 X:000C Y:0001 P:envmxdiZC
 
  $80/A642 26 04      ROL $04      ; ROL Loop counter
 
  $80/A642 26 04      ROL $04      ; ROL Loop counter
Line 2,702: Line 2,709:
 
  $80/A646 80 0F      BRA $0F      ; [$A657] Else, exit
 
  $80/A646 80 0F      BRA $0F      ; [$A657] Else, exit
 
; Code is missing here
 
; Code is missing here
  $80/A652 64 04      STZ $04   [$00:0004]  A:0000 X:0000 Y:001C P:envmxdiZc
+
  $80/A652 64 04      STZ $04       ; Clear Loop Counters
  $80/A654 64 06      STZ $06   [$00:0006]  A:0000 X:0000 Y:001C P:envmxdiZc
+
  $80/A654 64 06      STZ $06
  $80/A656 7B          TDC                     A:0000 X:0000 Y:001C P:envmxdiZc
+
  $80/A656 7B          TDC           ; Clear 16-bit A
 
  $80/A657 60          RTS
 
  $80/A657 60          RTS
  
 
== $80/A65C ? ==
 
== $80/A65C ? ==
  
  $80/A65C DA          PHX                     A:0140 X:0000 Y:0000 P:envmxdizC
+
  $80/A65C DA          PHX           ; Buffer X and Y on Stack
  $80/A65D 5A          PHY                     A:0140 X:0000 Y:0000 P:envmxdizC
+
  $80/A65D 5A          PHY
  $80/A65E A9 01 00    LDA #$0001             A:0140 X:0000 Y:0000 P:envmxdizC
+
  $80/A65E A9 01 00    LDA #$0001   ; Setup "Roll Counters" for sixteen loops
  $80/A661 85 10      STA $10   [$00:0010]  A:0001 X:0000 Y:0000 P:envmxdizC
+
  $80/A661 85 10      STA $10
  $80/A663 85 12      STA $12   [$00:0012]  A:0001 X:0000 Y:0000 P:envmxdizC
+
  $80/A663 85 12      STA $12
  $80/A665 85 14      STA $14   [$00:0014]  A:0001 X:0000 Y:0000 P:envmxdizC
+
  $80/A665 85 14      STA $14
  $80/A667 85 16      STA $16   [$00:0016]  A:0001 X:0000 Y:0000 P:envmxdizC
+
  $80/A667 85 16      STA $16
 
  $80/A669 A0 00 00    LDY #$0000              A:0001 X:0000 Y:0000 P:envmxdizC
 
  $80/A669 A0 00 00    LDY #$0000              A:0001 X:0000 Y:0000 P:envmxdizC
 
  $80/A66C 06 06      ASL $06    [$00:0006]  A:0001 X:0000 Y:0000 P:envmxdiZC
 
  $80/A66C 06 06      ASL $06    [$00:0006]  A:0001 X:0000 Y:0000 P:envmxdiZC
Line 2,728: Line 2,735:
 
  $80/A678 90 01      BCC $01    [$A67B]      A:FEC0 X:0000 Y:0000 P:eNvmxdizc
 
  $80/A678 90 01      BCC $01    [$A67B]      A:FEC0 X:0000 Y:0000 P:eNvmxdizc
 
;code is missing here
 
;code is missing here
  $80/A67B 26 16      ROL $16   [$00:0016]  A:FEC0 X:0000 Y:0000 P:eNvmxdizc
+
  $80/A67B 26 16      ROL $16       ; "Increment" Counter
  $80/A67D 90 ED      BCC $ED   [$A66C]     A:FEC0 X:0000 Y:0000 P:envmxdizc
+
  $80/A67D 90 ED      BCC $ED       ; [$A66C] Loop for sixteen times
 
  $80/A67F 06 04      ASL $04    [$00:0004]  A:FEC0 X:0000 Y:0000 P:envmxdiZC
 
  $80/A67F 06 04      ASL $04    [$00:0004]  A:FEC0 X:0000 Y:0000 P:envmxdiZC
 
  $80/A681 98          TYA                    A:FEC0 X:0000 Y:0000 P:envmxdizc
 
  $80/A681 98          TYA                    A:FEC0 X:0000 Y:0000 P:envmxdizc
Line 2,742: Line 2,749:
 
  $80/A68E 90 03      BCC $03    [$A693]      A:FEC0 X:0000 Y:0000 P:eNvmxdizc
 
  $80/A68E 90 03      BCC $03    [$A693]      A:FEC0 X:0000 Y:0000 P:eNvmxdizc
 
;code is missing here
 
;code is missing here
  $80/A693 26 14      ROL $14   [$00:0014]  A:FEC0 X:0000 Y:0000 P:eNvmxdizc
+
  $80/A693 26 14      ROL $14       ; "Increment" Counter
  $80/A695 90 E8      BCC $E8   [$A67F]     A:FEC0 X:0000 Y:0000 P:envmxdizc
+
  $80/A695 90 E8      BCC $E8       ; [$A67F] Loop for sixteen times
 
  $80/A697 06 02      ASL $02    [$00:0002]  A:FEC0 X:0030 Y:0030 P:envmxdiZC
 
  $80/A697 06 02      ASL $02    [$00:0002]  A:FEC0 X:0030 Y:0030 P:envmxdiZC
 
  $80/A699 98          TYA                    A:FEC0 X:0030 Y:0030 P:envmxdiZc
 
  $80/A699 98          TYA                    A:FEC0 X:0030 Y:0030 P:envmxdiZc
Line 2,757: Line 2,764:
 
  $80/A6A8 85 06      STA $06    [$00:0006]  A:0180 X:0000 Y:0000 P:envmxdizC
 
  $80/A6A8 85 06      STA $06    [$00:0006]  A:0180 X:0000 Y:0000 P:envmxdizC
 
  $80/A6AA 9B          TXY                    A:0180 X:0000 Y:0000 P:envmxdizC
 
  $80/A6AA 9B          TXY                    A:0180 X:0000 Y:0000 P:envmxdizC
  $80/A6AB 26 12      ROL $12   [$00:0012]  A:FEC0 X:0060 Y:0060 P:eNvmxdizc
+
  $80/A6AB 26 12      ROL $12       ; "Increment" Counter
  $80/A6AD 90 E8      BCC $E8   [$A697]     A:FEC0 X:0060 Y:0060 P:envmxdizc
+
  $80/A6AD 90 E8      BCC $E8       ; [$A697] Loop for sixteen times
 
  $80/A6AF 06 00      ASL $00    [$00:0000]  A:FEF0 X:0000 Y:0000 P:envmxdiZC
 
  $80/A6AF 06 00      ASL $00    [$00:0000]  A:FEF0 X:0000 Y:0000 P:envmxdiZC
 
  $80/A6B1 98          TYA                    A:FEF0 X:0000 Y:0000 P:envmxdiZc
 
  $80/A6B1 98          TYA                    A:FEF0 X:0000 Y:0000 P:envmxdiZc
Line 2,772: Line 2,779:
 
  $80/A6C0 85 06      STA $06    [$00:0006]  A:0040 X:0000 Y:0000 P:envmxdizC
 
  $80/A6C0 85 06      STA $06    [$00:0006]  A:0040 X:0000 Y:0000 P:envmxdizC
 
  $80/A6C2 9B          TXY                    A:0040 X:0000 Y:0000 P:envmxdizC
 
  $80/A6C2 9B          TXY                    A:0040 X:0000 Y:0000 P:envmxdizC
  $80/A6C3 26 10      ROL $10   [$00:0010]  A:FF20 X:0000 Y:0000 P:eNvmxdizc
+
  $80/A6C3 26 10      ROL $10       ; "Increment" Counter
  $80/A6C5 90 E8      BCC $E8   [$A6AF]     A:FF20 X:0000 Y:0000 P:envmxdizc
+
  $80/A6C5 90 E8      BCC $E8       ; [$A6AF] Loop for sixteen times
  $80/A6C7 7A          PLY                     A:FF40 X:0000 Y:0000 P:envmxdizC
+
  $80/A6C7 7A          PLY           ; Restore Y and X from stack
  $80/A6C8 FA          PLX                     A:FF40 X:0000 Y:0000 P:envmxdiZC
+
  $80/A6C8 FA          PLX
  $80/A6C9 60          RTS                     A:FF40 X:0000 Y:0000 P:envmxdiZC
+
  $80/A6C9 60          RTS
  
 
== $80/A787 ? ==
 
== $80/A787 ? ==
Line 2,860: Line 2,867:
 
== $80/A80F ? ==
 
== $80/A80F ? ==
  
  $80/A80F 5A          PHY                     A:0140 X:0000 Y:0000 P:envmxdizC
+
  $80/A80F 5A          PHY           ; Buffer Y on stack
 
  $80/A810 A0 00 00    LDY #$0000              A:0140 X:0000 Y:0000 P:envmxdizC
 
  $80/A810 A0 00 00    LDY #$0000              A:0140 X:0000 Y:0000 P:envmxdizC
 
  $80/A813 A5 02      LDA $02    [$00:0002]  A:0140 X:0000 Y:0000 P:envmxdiZC
 
  $80/A813 A5 02      LDA $02    [$00:0002]  A:0140 X:0000 Y:0000 P:envmxdiZC
Line 2,867: Line 2,874:
 
  $80/A823 A5 08      LDA $08    [$00:0008]  A:0030 X:0000 Y:0000 P:envmxdizC
 
  $80/A823 A5 08      LDA $08    [$00:0008]  A:0030 X:0000 Y:0000 P:envmxdizC
 
  $80/A825 10 07      BPL $07    [$A82E]      A:0140 X:0000 Y:0000 P:envmxdizC
 
  $80/A825 10 07      BPL $07    [$A82E]      A:0140 X:0000 Y:0000 P:envmxdizC
 +
;code is missing here
 
  $80/A82E 20 0E A6    JSR $A60E  [$80:A60E]  A:0140 X:0000 Y:0000 P:envmxdizC
 
  $80/A82E 20 0E A6    JSR $A60E  [$80:A60E]  A:0140 X:0000 Y:0000 P:envmxdizC
 
  $80/A831 98          TYA                    A:0080 X:0000 Y:0000 P:envmxdizC
 
  $80/A831 98          TYA                    A:0080 X:0000 Y:0000 P:envmxdizC
 
  $80/A832 4A          LSR A                  A:0000 X:0000 Y:0000 P:envmxdiZC
 
  $80/A832 4A          LSR A                  A:0000 X:0000 Y:0000 P:envmxdiZC
 
  $80/A833 90 0A      BCC $0A    [$A83F]      A:0000 X:0000 Y:0000 P:envmxdiZc
 
  $80/A833 90 0A      BCC $0A    [$A83F]      A:0000 X:0000 Y:0000 P:envmxdiZc
  $80/A83F 7A          PLY                     A:0000 X:0000 Y:0000 P:envmxdiZc
+
;code is missing here
  $80/A840 6B          RTL                     A:0000 X:0000 Y:0000 P:envmxdiZc
+
  $80/A83F 7A          PLY           ; Restore Y from stack
 +
  $80/A840 6B          RTL
  
 
== $80/A86F ? ==
 
== $80/A86F ? ==
Line 2,895: Line 2,904:
  
 
This is executed with 16-bit A.
 
This is executed with 16-bit A.
 +
 +
First, this subroutine checks if the two multiplicants in $00-3 and $04-7 are positive. if '''not''', this subroutine turns them into positive numbers.
  
 
  $80/A886 A0 00 00    LDY #$0000              A:00C0 X:000C Y:000C P:envmxdizc
 
  $80/A886 A0 00 00    LDY #$0000              A:00C0 X:000C Y:000C P:envmxdizc
 
  $80/A889 A5 02      LDA $02        ; $00-3 contain a number that gets multiplied
 
  $80/A889 A5 02      LDA $02        ; $00-3 contain a number that gets multiplied
  $80/A88B 10 0C      BPL $0C        ; [$A899] Check if MSB is set (negative number?)
+
  $80/A88B 10 0C      BPL $0C        ; [$A899] Branch if number is positive
  $80/A88D 7B          TDC                     A:FFFF X:0004 Y:0000 P:eNvmxdizC
+
  $80/A88D 7B          TDC           ; Clear 16-bit A
  $80/A88E 38          SEC                     A:0000 X:0004 Y:0000 P:envmxdiZC
+
  $80/A88E 38          SEC           ; Set Carry for subtraction
  $80/A88F E5 00      SBC $00   [$00:0000]  A:0000 X:0004 Y:0000 P:envmxdiZC
+
  $80/A88F E5 00      SBC $00       ; Turn number positive
  $80/A891 85 00      STA $00   [$00:0000]  A:0012 X:0004 Y:0000 P:envmxdizc
+
  $80/A891 85 00      STA $00
  $80/A893 7B          TDC                     A:0012 X:0004 Y:0000 P:envmxdizc
+
  $80/A893 7B          TDC
  $80/A894 E5 02      SBC $02   [$00:0002]  A:0000 X:0004 Y:0000 P:envmxdiZc
+
  $80/A894 E5 02      SBC $02
  $80/A896 85 02      STA $02   [$00:0002]  A:0000 X:0004 Y:0000 P:envmxdiZc
+
  $80/A896 85 02      STA $02
  $80/A898 C8          INY                     A:0000 X:0004 Y:0000 P:envmxdiZc
+
  $80/A898 C8          INY           ; Increment Y (counter for negative numbers)
 
  $80/A899 A5 06      LDA $06        ; $04-7 contain a number that gets multiplied
 
  $80/A899 A5 06      LDA $06        ; $04-7 contain a number that gets multiplied
  $80/A89B 10 0C      BPL $0C        ; [$A8A9] Check if MSB is set (negative number?)
+
  $80/A89B 10 0C      BPL $0C        ; [$A8A9] Branch if number is positive
  $80/A89D 7B          TDC                     A:FFFF X:0004 Y:0000 P:eNvmxdizc
+
  $80/A89D 7B          TDC           ; Clear 16-bit A
  $80/A89E 38          SEC                     A:0000 X:0004 Y:0000 P:envmxdiZc
+
  $80/A89E 38          SEC           ; Set Carry for subtraction
  $80/A89F E5 04      SBC $04   [$00:0004]  A:0000 X:0004 Y:0000 P:envmxdiZC
+
  $80/A89F E5 04      SBC $04       ; Turn number positive
  $80/A8A1 85 04      STA $04   [$00:0004]  A:2666 X:0004 Y:0000 P:envmxdizc
+
  $80/A8A1 85 04      STA $04
  $80/A8A3 7B          TDC                     A:2666 X:0004 Y:0000 P:envmxdizc
+
  $80/A8A3 7B          TDC
  $80/A8A4 E5 06      SBC $06   [$00:0006]  A:0000 X:0004 Y:0000 P:envmxdiZc
+
  $80/A8A4 E5 06      SBC $06
  $80/A8A6 85 06      STA $06   [$00:0006]  A:0000 X:0004 Y:0000 P:envmxdiZc
+
  $80/A8A6 85 06      STA $06
  $80/A8A8 C8          INY                     A:0000 X:0004 Y:0000 P:envmxdiZc
+
  $80/A8A8 C8          INY           ; Increment Y (counter for negative numbers)
 
  $80/A8A9 A5 0A      LDA $0A    [$00:000A]  A:00B8 X:000C Y:0000 P:envmxdizc
 
  $80/A8A9 A5 0A      LDA $0A    [$00:000A]  A:00B8 X:000C Y:0000 P:envmxdizc
 
  $80/A8AB 10 0C      BPL $0C    [$A8B9]      A:00C0 X:000C Y:0000 P:envmxdizc
 
  $80/A8AB 10 0C      BPL $0C    [$A8B9]      A:00C0 X:000C Y:0000 P:envmxdizc
Line 2,936: Line 2,947:
 
  $80/A8D4 85 08      STA $08
 
  $80/A8D4 85 08      STA $08
 
  $80/A8D6 20 5C A6    JSR $A65C  [$80:A65C]  A:0000 X:000C Y:0000 P:envmxdiZc
 
  $80/A8D6 20 5C A6    JSR $A65C  [$80:A65C]  A:0000 X:000C Y:0000 P:envmxdiZc
  $80/A8D9 98          TYA                     A:FF94 X:000C Y:0000 P:envmxdizC
+
  $80/A8D9 98          TYA           ; Transfer counter of negative numbers in A
  $80/A8DA 4A          LSR A                   A:0000 X:000C Y:0000 P:envmxdiZC
+
  $80/A8DA 4A          LSR A         ; Check if there was one multiplicant of both was negative
  $80/A8DB 90 0A      BCC $0A   [$A8E7]     A:0000 X:000C Y:0000 P:envmxdiZc
+
  $80/A8DB 90 0A      BCC $0A       ; [$A8E7] Exit if not
 
  $80/A8DD 7B          TDC                    A:0000 X:0004 Y:0001 P:envmxdiZC
 
  $80/A8DD 7B          TDC                    A:0000 X:0004 Y:0001 P:envmxdiZC
 
  $80/A8DE E5 10      SBC $10    [$00:0010]  A:0000 X:0004 Y:0001 P:envmxdiZC
 
  $80/A8DE E5 10      SBC $10    [$00:0010]  A:0000 X:0004 Y:0001 P:envmxdiZC
Line 2,945: Line 2,956:
 
  $80/A8E3 E5 12      SBC $12    [$00:0012]  A:0000 X:0004 Y:0001 P:envmxdiZc
 
  $80/A8E3 E5 12      SBC $12    [$00:0012]  A:0000 X:0004 Y:0001 P:envmxdiZc
 
  $80/A8E5 85 12      STA $12    [$00:0012]  A:FFFF X:0004 Y:0001 P:eNvmxdizc
 
  $80/A8E5 85 12      STA $12    [$00:0012]  A:FFFF X:0004 Y:0001 P:eNvmxdizc
  $80/A8E7 6B          RTL                     A:0000 X:000C Y:0000 P:envmxdiZc
+
  $80/A8E7 6B          RTL
  
 
== $80/A8F0 Calculate the Square Number of A ==
 
== $80/A8F0 Calculate the Square Number of A ==
Line 3,056: Line 3,067:
 
  $80/ABFA AB          PLB          ; Restore Data Bank
 
  $80/ABFA AB          PLB          ; Restore Data Bank
 
  $80/ABFB 6B          RTL
 
  $80/ABFB 6B          RTL
 +
 +
== $80/ABFC ? ==
 +
 +
$80/ABFC A5 02      LDA $02    [$00:0002]  A:0000 X:3300 Y:0002 P:envmxdiZC
 +
$80/ABFE D0 05      BNE $05    [$AC05]      A:0000 X:3300 Y:0002 P:envmxdiZC
 +
$80/AC00 A5 00      LDA $00    [$00:0000]  A:0000 X:3300 Y:0002 P:envmxdiZC
 +
$80/AC02 4C A9 AB    JMP $ABA9  [$80:ABA9]  A:001A X:3300 Y:0002 P:envmxdizC
 +
;code is missing here
  
 
== $80/AD39 RNG? ==
 
== $80/AD39 RNG? ==
Line 3,319: Line 3,338:
 
  $80/B0FE 4C 27 B0    JMP $B027  [$80:B027]  A:0000 X:0581 Y:0008 P:enVMxdIZC
 
  $80/B0FE 4C 27 B0    JMP $B027  [$80:B027]  A:0000 X:0581 Y:0008 P:enVMxdIZC
  
== $80/B101 ? ==
+
== $80/B101 OAM Update ==
  
  $80/B101 A5 37      LDA $37   [$00:0037]  A:00F2 X:26C0 Y:002E P:eNvMxdIzC
+
This only updates the first ten sprites!
  $80/B103 89 02      BIT #$02               A:0003 X:26C0 Y:002E P:envMxdIzC
+
 
  $80/B105 F0 2D      BEQ $2D   [$B134]     A:0003 X:26C0 Y:002E P:envMxdIzC
+
  $80/B101 A5 37      LDA $37       ; Load OAM Update Flag register
 +
  $80/B103 89 02      BIT #$02     ; Check Flag for regular OAM Updates
 +
  $80/B105 F0 2D      BEQ $2D       ; [$B134] Exit if not
 
  $80/B107 A2 00 00    LDX #$0000    ; Set OAM Address to #$0000
 
  $80/B107 A2 00 00    LDX #$0000    ; Set OAM Address to #$0000
 
  $80/B10A 8E 02 21    STX $2102
 
  $80/B10A 8E 02 21    STX $2102
  $80/B10D 9C 04 43    STZ $4304 [$80:4304]  A:0003 X:0000 Y:002E P:envMxdIZC
+
  $80/B10D 9C 04 43    STZ $4304     ; Source Bank: $00
  $80/B110 AD B9 05    LDA $05B9 [$80:05B9]  A:0003 X:0000 Y:002E P:envMxdIZC
+
  $80/B110 AD B9 05    LDA $05B9     ; Check if value in the Frame Counter is odd or even
  $80/B113 4A          LSR A                   A:00A5 X:0000 Y:002E P:eNvMxdIzC
+
  $80/B113 4A          LSR A
  $80/B114 A2 00 01    LDX #$0100             A:0052 X:0000 Y:002E P:envMxdIzC
+
  $80/B114 A2 00 01    LDX #$0100   ; Use OAM Buffer 1 if even
  $80/B117 90 03      BCC $03   [$B11C]     A:0052 X:0100 Y:002E P:envMxdIzC
+
  $80/B117 90 03      BCC $03       ; [$B11C]
  $80/B119 A2 20 03    LDX #$0320             A:0052 X:0100 Y:002E P:envMxdIzC
+
  $80/B119 A2 20 03    LDX #$0320   ; Use OAM Buffer 2 if odd
  $80/B11C 8E 02 43    STX $4302 [$80:4302]  A:0052 X:0320 Y:002E P:envMxdIzC
+
  $80/B11C 8E 02 43    STX $4302
 
  $80/B11F A9 04      LDA #$04      ; DMA Destination: OAM --- $(21)04
 
  $80/B11F A9 04      LDA #$04      ; DMA Destination: OAM --- $(21)04
 
  $80/B121 8D 01 43    STA $4301
 
  $80/B121 8D 01 43    STA $4301
 
  $80/B124 A2 40 00    LDX #$0040    ; Transfer #$40 Byte
 
  $80/B124 A2 40 00    LDX #$0040    ; Transfer #$40 Byte
 
  $80/B127 8E 05 43    STX $4305
 
  $80/B127 8E 05 43    STX $4305
  $80/B12A A9 00      LDA #$00               A:0004 X:0040 Y:002E P:envMxdIzC
+
  $80/B12A A9 00      LDA #$00     ; DMA Settings
  $80/B12C 8D 00 43    STA $4300 [$80:4300]  A:0000 X:0040 Y:002E P:envMxdIZC
+
  $80/B12C 8D 00 43    STA $4300
 
  $80/B12F A9 01      LDA #$01      ; ACTIVATE DMA
 
  $80/B12F A9 01      LDA #$01      ; ACTIVATE DMA
 
  $80/B131 8D 0B 42    STA $420B
 
  $80/B131 8D 0B 42    STA $420B
Line 4,680: Line 4,701:
 
== $80/CE66 ? ==
 
== $80/CE66 ? ==
  
  $80/CE66 8B          PHB                     A:0000 X:0004 Y:339D P:envMxdiZC
+
  $80/CE66 8B          PHB           ; Buffer Program Bank on stack
  $80/CE67 4B          PHK                     A:0000 X:0004 Y:339D P:envMxdiZC
+
  $80/CE67 4B          PHK           ; Set Program Bank to $80
  $80/CE68 AB          PLB                     A:0000 X:0004 Y:339D P:envMxdiZC
+
  $80/CE68 AB          PLB
  $80/CE69 48          PHA                     A:0000 X:0004 Y:339D P:eNvMxdizC
+
  $80/CE69 48          PHA           ; Buffer 16-bit A on stack
  $80/CE6A EB          XBA                     A:0000 X:0004 Y:339D P:eNvMxdizC
+
  $80/CE6A EB          XBA
  $80/CE6B 48          PHA                     A:0000 X:0004 Y:339D P:envMxdiZC
+
  $80/CE6B 48          PHA
 
  $80/CE6C A6 91      LDX $91    [$00:0091]  A:0000 X:0004 Y:339D P:envMxdiZC
 
  $80/CE6C A6 91      LDX $91    [$00:0091]  A:0000 X:0004 Y:339D P:envMxdiZC
 
  $80/CE6E BD DF 19    LDA $19DF,x[$80:19E3]  A:0000 X:0004 Y:339D P:envMxdizC
 
  $80/CE6E BD DF 19    LDA $19DF,x[$80:19E3]  A:0000 X:0004 Y:339D P:envMxdizC
 
  $80/CE71 89 40      BIT #$40                A:0040 X:0004 Y:339D P:envMxdizC
 
  $80/CE71 89 40      BIT #$40                A:0040 X:0004 Y:339D P:envMxdizC
 
  $80/CE73 D0 08      BNE $08    [$CE7D]      A:0040 X:0004 Y:339D P:envMxdizC
 
  $80/CE73 D0 08      BNE $08    [$CE7D]      A:0040 X:0004 Y:339D P:envMxdizC
 +
;code is missing here
 
  $80/CE7D BC 3E 1E    LDY $1E3E,x[$80:1E42]  A:0040 X:0004 Y:339D P:envMxdizC
 
  $80/CE7D BC 3E 1E    LDY $1E3E,x[$80:1E42]  A:0040 X:0004 Y:339D P:envMxdizC
 
  $80/CE80 B9 04 07    LDA $0704,y[$80:0708]  A:0040 X:0004 Y:0004 P:envMxdizC
 
  $80/CE80 B9 04 07    LDA $0704,y[$80:0708]  A:0040 X:0004 Y:0004 P:envMxdizC
Line 4,763: Line 4,785:
 
  $80/CF74 DA          PHX                    A:FFFF X:0006 Y:0006 P:eNvMxdizC
 
  $80/CF74 DA          PHX                    A:FFFF X:0006 Y:0006 P:eNvMxdizC
 
  $80/CF75 20 21 CE    JSR $CE21  [$80:CE21]  A:FFFF X:0006 Y:0006 P:eNvMxdizC
 
  $80/CF75 20 21 CE    JSR $CE21  [$80:CE21]  A:FFFF X:0006 Y:0006 P:eNvMxdizC
  $80/CF78 FA          PLX                     A:FFFF X:0008 Y:0008 P:eNvMxdizC
+
  $80/CF78 FA          PLX           ; Restore Original 16-bit A in X from stack
  $80/CF79 AB          PLB                     A:FFFF X:0006 Y:0008 P:envMxdizC
+
  $80/CF79 AB          PLB           ; Restore Program Bank from stack
  $80/CF7A 6B          RTL                     A:FFFF X:0006 Y:0008 P:eNvMxdizC
+
  $80/CF7A 6B          RTL
  
 
== $80/CF7B ? ==
 
== $80/CF7B ? ==
Line 4,824: Line 4,846:
 
  $80/D0A6 90 07      BCC $07    [$D0AF]      A:0013 X:0006 Y:0020 P:envMxdizc
 
  $80/D0A6 90 07      BCC $07    [$D0AF]      A:0013 X:0006 Y:0020 P:envMxdizc
 
  $80/D0A8 20 A7 D1    JSR $D1A7  [$80:D1A7]  A:00FF X:0006 Y:002C P:envMxdiZC
 
  $80/D0A8 20 A7 D1    JSR $D1A7  [$80:D1A7]  A:00FF X:0006 Y:002C P:envMxdiZC
  $80/D0AB 90 F6      BCC $F6    [$D0A3]     A:00FF X:0006 Y:0002 P:envMxdiZC
+
  $80/D0AB 90 F6      BCC $F6    ; [$D0A3] Branch if no Error has occured
  $80/D0AD 80 71      BRA $71    [$D120]     A:00FF X:0006 Y:0002 P:envMxdiZC
+
  $80/D0AD 80 71      BRA $71    ; [$D120] Branch if Error has occured
 
  $80/D0AF DE 03 09    DEC $0903,x[$80:0909]  A:0008 X:0006 Y:001A P:envMxdizc
 
  $80/D0AF DE 03 09    DEC $0903,x[$80:0909]  A:0008 X:0006 Y:001A P:envMxdizc
 
  $80/D0B2 BD 04 0A    LDA $0A04,x[$80:0A0A]  A:0008 X:0006 Y:001A P:envMxdizc
 
  $80/D0B2 BD 04 0A    LDA $0A04,x[$80:0A0A]  A:0008 X:0006 Y:001A P:envMxdizc
Line 4,948: Line 4,970:
  
 
== $80/D1A7 ? ==
 
== $80/D1A7 ? ==
 +
 +
This subroutine uses the Carry as Error Flag
  
 
  $80/D1A7 A0 DF D2    LDY #$D2DF    ; Setup 24-bit address $7E/D2DF in [$20]
 
  $80/D1A7 A0 DF D2    LDY #$D2DF    ; Setup 24-bit address $7E/D2DF in [$20]
Line 4,957: Line 4,981:
 
  $80/D1B4 A8          TAY                    A:0000 X:0006 Y:D2DF P:envMxdiZc
 
  $80/D1B4 A8          TAY                    A:0000 X:0006 Y:D2DF P:envMxdiZc
 
  $80/D1B5 B7 20      LDA [$20],y[$7E:D2DF]  A:0000 X:0006 Y:0000 P:envMxdiZc
 
  $80/D1B5 B7 20      LDA [$20],y[$7E:D2DF]  A:0000 X:0006 Y:0000 P:envMxdiZc
  $80/D1B7 C9 FF      CMP #$FF               A:000D X:0006 Y:0000 P:envMxdizc
+
  $80/D1B7 C9 FF      CMP #$FF     ; Error?
  $80/D1B9 D0 03      BNE $03   [$D1BE]     A:000D X:0006 Y:0000 P:envMxdizc
+
  $80/D1B9 D0 03      BNE $03       ; [$D1BE] Branch if not
  $80/D1BB 4C 5C D2    JMP $D25C [$80:D25C]  A:00FF X:0006 Y:0002 P:envMxdiZC
+
  $80/D1BB 4C 5C D2    JMP $D25C     ; Error: Set Carry (Error Flag) and Exit
 
  $80/D1BE 9D C4 08    STA $08C4,x[$80:08CA]  A:000D X:0006 Y:0000 P:envMxdizc
 
  $80/D1BE 9D C4 08    STA $08C4,x[$80:08CA]  A:000D X:0006 Y:0000 P:envMxdizc
 
  $80/D1C1 C8          INY                    A:000D X:0006 Y:0000 P:envMxdizc
 
  $80/D1C1 C8          INY                    A:000D X:0006 Y:0000 P:envMxdizc
Line 4,969: Line 4,993:
 
  $80/D1CB 9D 04 0E    STA $0E04,x[$80:0E0A]  A:0002 X:0006 Y:0002 P:envMxdizc
 
  $80/D1CB 9D 04 0E    STA $0E04,x[$80:0E0A]  A:0002 X:0006 Y:0002 P:envMxdizc
 
  $80/D1CE B7 20      LDA [$20],y[$7E:D2E1]  A:0002 X:0006 Y:0002 P:envMxdizc
 
  $80/D1CE B7 20      LDA [$20],y[$7E:D2E1]  A:0002 X:0006 Y:0002 P:envMxdizc
  $80/D1D0 C9 FF      CMP #$FF               A:00FF X:0006 Y:0002 P:eNvMxdizc
+
  $80/D1D0 C9 FF      CMP #$FF     ; Exit Command?
  $80/D1D2 D0 03      BNE $03   [$D1D7]     A:00FF X:0006 Y:0002 P:envMxdiZC
+
  $80/D1D2 D0 03      BNE $03       ; [$D1D7] Branch if not
  $80/D1D4 4C 58 D2    JMP $D258 [$80:D258]  A:00FF X:0006 Y:0002 P:envMxdiZC
+
  $80/D1D4 4C 58 D2    JMP $D258     ; Else, clear Carry (Error Flag) and Exit
 
;code is missing here
 
;code is missing here
  $80/D20F A8          TAY                     A:0006 X:0044 Y:0002 P:envMxdizc
+
  $80/D20F A8          TAY           ; Transfer Figure Number in Y as Load Index
  $80/D210 B9 AE 17    LDA $17AE,y[$80:17B4]   A:0006 X:0044 Y:0006 P:envMxdizc
+
  $80/D210 B9 AE 17    LDA $17AE,y  ; Check Figure's Character Sprite
  $80/D213 F0 43      BEQ $43   [$D258]     A:003B X:0044 Y:0006 P:envMxdizc
+
  $80/D213 F0 43      BEQ $43       ; [$D258] If empty, clear Carry (Error Flag) and Exit
 
  $80/D215 C9 F0      CMP #$F0                A:003B X:0044 Y:0006 P:envMxdizc
 
  $80/D215 C9 F0      CMP #$F0                A:003B X:0044 Y:0006 P:envMxdizc
  $80/D217 B0 16      BCS $16   [$D22F]     A:003B X:0044 Y:0006 P:envMxdizc
+
  $80/D217 B0 16      BCS $16       ; [$D22F] Branch if equal or higher
 
  $80/D219 B9 DE 19    LDA $19DE,y[$80:19E4]  A:003B X:0044 Y:0006 P:envMxdizc
 
  $80/D219 B9 DE 19    LDA $19DE,y[$80:19E4]  A:003B X:0044 Y:0006 P:envMxdizc
 
  $80/D21C 89 01      BIT #$01                A:0000 X:0044 Y:0006 P:envMxdiZc
 
  $80/D21C 89 01      BIT #$01                A:0000 X:0044 Y:0006 P:envMxdiZc
Line 4,983: Line 5,007:
 
  $80/D220 B9 DF 19    LDA $19DF,y[$80:19E5]  A:0000 X:0044 Y:0006 P:envMxdiZc
 
  $80/D220 B9 DF 19    LDA $19DF,y[$80:19E5]  A:0000 X:0044 Y:0006 P:envMxdiZc
 
  $80/D223 89 20      BIT #$20                A:0040 X:0044 Y:0006 P:envMxdizc
 
  $80/D223 89 20      BIT #$20                A:0040 X:0044 Y:0006 P:envMxdizc
  $80/D225 D0 31      BNE $31   [$D258]     A:0040 X:0044 Y:0006 P:envMxdiZc
+
  $80/D225 D0 31      BNE $31       ; [$D258] clear Carry (Error Flag) and Exit
 
  $80/D227 B9 2E 1A    LDA $1A2E,y[$80:1A34]  A:0040 X:0044 Y:0006 P:envMxdiZc
 
  $80/D227 B9 2E 1A    LDA $1A2E,y[$80:1A34]  A:0040 X:0044 Y:0006 P:envMxdiZc
 
  $80/D22A 4A          LSR A                  A:0000 X:0044 Y:0006 P:envMxdiZc
 
  $80/D22A 4A          LSR A                  A:0000 X:0044 Y:0006 P:envMxdiZc
 
  $80/D22B C5 02      CMP $02    [$00:0002]  A:0000 X:0044 Y:0006 P:envMxdiZc
 
  $80/D22B C5 02      CMP $02    [$00:0002]  A:0000 X:0044 Y:0006 P:envMxdiZc
  $80/D22D D0 29      BNE $29   [$D258]     A:0000 X:0044 Y:0006 P:envMxdiZC
+
  $80/D22D D0 29      BNE $29       ; [$D258] clear Carry (Error Flag) and Exit
 
  $80/D22F BE 3E 1E    LDX $1E3E,y[$80:1E44]  A:0000 X:0044 Y:0006 P:envMxdiZC
 
  $80/D22F BE 3E 1E    LDX $1E3E,y[$80:1E44]  A:0000 X:0044 Y:0006 P:envMxdiZC
 
  $80/D232 BD C4 08    LDA $08C4,x[$80:08CA]  A:0000 X:0006 Y:0006 P:envMxdizC
 
  $80/D232 BD C4 08    LDA $08C4,x[$80:08CA]  A:0000 X:0006 Y:0006 P:envMxdizC
 
  $80/D235 C9 FF      CMP #$FF                A:000A X:0006 Y:0006 P:envMxdizC
 
  $80/D235 C9 FF      CMP #$FF                A:000A X:0006 Y:0006 P:envMxdizC
  $80/D237 D0 1F      BNE $1F   [$D258]     A:000A X:0006 Y:0006 P:envMxdizc
+
  $80/D237 D0 1F      BNE $1F       ; [$D258] clear Carry (Error Flag) and Exit
 
;code is missing here
 
;code is missing here
 
  $80/D258 A6 3B      LDX $3B    [$00:003B]  A:00FF X:0006 Y:0002 P:envMxdiZC
 
  $80/D258 A6 3B      LDX $3B    [$00:003B]  A:00FF X:0006 Y:0002 P:envMxdiZC
  $80/D25A 18          CLC                     A:00FF X:0006 Y:0002 P:envMxdizC
+
  $80/D25A 18          CLC           ; Clear Carry (Error Flag)
  $80/D25B 60          RTS                     A:00FF X:0006 Y:0002 P:envMxdizc
+
  $80/D25B 60          RTS
  $80/D25C 38          SEC                     A:00FF X:0006 Y:0002 P:envMxdiZC
+
  $80/D25C 38          SEC           ; Set Carry (Error Flag)
  $80/D25D 60          RTS                     A:00FF X:0006 Y:0002 P:envMxdiZC
+
  $80/D25D 60          RTS
  
 
== $80/D358 ? ==
 
== $80/D358 ? ==
Line 5,156: Line 5,180:
 
== $80/D522 ? ==
 
== $80/D522 ? ==
  
  $80/D522 5A          PHY                     A:0034 X:0006 Y:0004 P:envMxdizc
+
  $80/D522 5A          PHY           ; Buffer Y on Stack
  $80/D523 D4 00      PEI ($00)       [$0800]      A:0034 X:0006 Y:0004 P:envMxdizc
+
  $80/D523 D4 00      PEI ($00)     ; Buffer $00/$01 on stack
 
  $80/D525 20 3F C2    JSR $C23F  [$80:C23F]  A:0034 X:0006 Y:0004 P:envMxdizc
 
  $80/D525 20 3F C2    JSR $C23F  [$80:C23F]  A:0034 X:0006 Y:0004 P:envMxdizc
 
  $80/D528 A0 00 00    LDY #$0000              A:0004 X:0006 Y:0004 P:envMxdizc
 
  $80/D528 A0 00 00    LDY #$0000              A:0004 X:0006 Y:0004 P:envMxdizc
 
  $80/D52B 90 1B      BCC $1B    [$D548]      A:0004 X:0006 Y:0000 P:envMxdiZc
 
  $80/D52B 90 1B      BCC $1B    [$D548]      A:0004 X:0006 Y:0000 P:envMxdiZc
 
;code is missing here
 
;code is missing here
  $80/D548 E2 20      SEP #$20               A:0004 X:0006 Y:0000 P:envMxdiZc
+
  $80/D548 E2 20      SEP #$20     ; A = 8-bit
  $80/D54A 98          TYA                     A:0004 X:0006 Y:0000 P:envMxdiZc
+
  $80/D54A 98          TYA           ; Transfer Y into A
  $80/D54B 7A          PLY                     A:0000 X:0006 Y:0000 P:envMxdiZc
+
  $80/D54B 7A          PLY           ; Restore $00/01 from Stack
  $80/D54C 84 00      STY $00   [$00:0000]  A:0000 X:0006 Y:0800 P:envMxdizc
+
  $80/D54C 84 00      STY $00
  $80/D54E 7A          PLY                     A:0000 X:0006 Y:0800 P:envMxdizc
+
  $80/D54E 7A          PLY           ; Restore Y from Stack
  $80/D54F 60          RTS                     A:0000 X:0006 Y:0004 P:envMxdizc
+
  $80/D54F 60          RTS
  
== $80/D550 ? ==
+
== $80/D550 ? Compare two Sprite numbers ==
  
  $80/D550 A0 00 00    LDY #$0000             A:0800 X:0008 Y:0006 P:envMxdiZC
+
  $80/D550 A0 00 00    LDY #$0000   ; Clear Load Index (Y)
 
  $80/D553 B9 83 0E    LDA $0E83,y[$80:0E83]  A:0800 X:0008 Y:0000 P:envMxdiZC
 
  $80/D553 B9 83 0E    LDA $0E83,y[$80:0E83]  A:0800 X:0008 Y:0000 P:envMxdiZC
  $80/D556 30 27      BMI $27      ; [$D57F] Exit if negative
+
  $80/D556 30 27      BMI $27      ; [$D57F] Exit if Sprite(?) is negative
 
  $80/D558 C5 3B      CMP $3B    [$00:003B]  A:0802 X:0008 Y:0000 P:envMxdizC
 
  $80/D558 C5 3B      CMP $3B    [$00:003B]  A:0802 X:0008 Y:0000 P:envMxdizC
 
  $80/D55A F0 04      BEQ $04    [$D560]      A:0802 X:0008 Y:0000 P:eNvMxdizc
 
  $80/D55A F0 04      BEQ $04    [$D560]      A:0802 X:0008 Y:0000 P:eNvMxdizc
  $80/D55C C8          INY                     A:0802 X:0008 Y:0000 P:eNvMxdizc
+
  $80/D55C C8          INY           ; Increment Load Index twice
  $80/D55D C8          INY                     A:0802 X:0008 Y:0001 P:envMxdizc
+
  $80/D55D C8          INY
  $80/D55E 80 F3      BRA $F3   [$D553]     A:0802 X:0008 Y:0002 P:envMxdizc
+
  $80/D55E 80 F3      BRA $F3       ; [$D553] Do next figure
 
  $80/D560 84 00      STY $00    [$00:0000]  A:0808 X:0008 Y:0008 P:envMxdiZC
 
  $80/D560 84 00      STY $00    [$00:0000]  A:0808 X:0008 Y:0008 P:envMxdiZC
  $80/D562 C8          INY                     A:0808 X:0008 Y:0008 P:envMxdiZC
+
  $80/D562 C8          INY           ; Increment Load Index twice
  $80/D563 C8          INY                     A:0808 X:0008 Y:0009 P:envMxdizC
+
  $80/D563 C8          INY
 
  $80/D564 B9 83 0E    LDA $0E83,y[$80:0E8D]  A:0808 X:0008 Y:000A P:envMxdizC
 
  $80/D564 B9 83 0E    LDA $0E83,y[$80:0E8D]  A:0808 X:0008 Y:000A P:envMxdizC
  $80/D567 30 16      BMI $16   [$D57F]     A:08FF X:0008 Y:000A P:eNvMxdizC
+
  $80/D567 30 16      BMI $16       ; [$D57F] Exit if Sprite(?) is negative
 
  $80/D569 DD C4 08    CMP $08C4,x[$80:08CC]  A:0804 X:0008 Y:0008 P:envMxdizC
 
  $80/D569 DD C4 08    CMP $08C4,x[$80:08CC]  A:0804 X:0008 Y:0008 P:envMxdizC
 
  $80/D56C F0 04      BEQ $04    [$D572]      A:0804 X:0008 Y:0008 P:eNvMxdizc
 
  $80/D56C F0 04      BEQ $04    [$D572]      A:0804 X:0008 Y:0008 P:eNvMxdizc
  $80/D56E C8          INY                     A:0804 X:0008 Y:0008 P:eNvMxdizc
+
  $80/D56E C8          INY           ; Increment Load Index twice
  $80/D56F C8          INY                     A:0804 X:0008 Y:0009 P:envMxdizc
+
  $80/D56F C8          INY
  $80/D570 80 F2      BRA $F2   [$D564]     A:0804 X:0008 Y:000A P:envMxdizc
+
  $80/D570 80 F2      BRA $F2       ; [$D564] Do next figure
 
;code is missing here
 
;code is missing here
  $80/D57F 60          RTS                     A:08FF X:0008 Y:000A P:eNvMxdizC
+
  $80/D57F 60          RTS
  
 
== $80/D580 ? ==
 
== $80/D580 ? ==
Line 6,021: Line 6,045:
 
  $81/80D6 22 60 A4 80 JSL $80A460[$80:A460]  A:0002 X:3300 Y:FFFE P:envMxdizC
 
  $81/80D6 22 60 A4 80 JSL $80A460[$80:A460]  A:0002 X:3300 Y:FFFE P:envMxdizC
 
  $81/80DA 22 E8 95 80 JSL $8095E8[$80:95E8]  A:E008 X:0000 Y:B060 P:envMxdizc
 
  $81/80DA 22 E8 95 80 JSL $8095E8[$80:95E8]  A:E008 X:0000 Y:B060 P:envMxdizc
  $81/80DE 22 8A A1 80 JSL $80A18A[$80:A18A]   A:FF20 X:1744 Y:000A P:envMxdizC
+
  $81/80DE 22 8A A1 80 JSL $80A18A  ; Wait for NMI
 
  $81/80E2 22 2A 80 81 JSL $81802A[$81:802A]  A:FF80 X:1744 Y:000A P:envMxdizc
 
  $81/80E2 22 2A 80 81 JSL $81802A[$81:802A]  A:FF80 X:1744 Y:000A P:envMxdizc
 
  $81/80E6 7A          PLY          ; Restore $0D-$02 and Y from Stack
 
  $81/80E6 7A          PLY          ; Restore $0D-$02 and Y from Stack
Line 6,053: Line 6,077:
 
  $81/8112 F0 04      BEQ $04    [$8118]      A:0004 X:3911 Y:0002 P:envMxdizC
 
  $81/8112 F0 04      BEQ $04    [$8118]      A:0004 X:3911 Y:0002 P:envMxdizC
 
  $81/8114 C9 04      CMP #$04                A:0004 X:3911 Y:0002 P:envMxdizC
 
  $81/8114 C9 04      CMP #$04                A:0004 X:3911 Y:0002 P:envMxdizC
  $81/8116 D0 26      BNE $26   [$813E]     A:0004 X:3911 Y:0002 P:envMxdiZC
+
  $81/8116 D0 26      BNE $26       ; [$813E] Exit if not equal
 
  $81/8118 BD 01 00    LDA $0001,x[$7E:3912]  A:0004 X:3911 Y:0002 P:envMxdiZC
 
  $81/8118 BD 01 00    LDA $0001,x[$7E:3912]  A:0004 X:3911 Y:0002 P:envMxdiZC
 
  $81/811B 1A          INC A                  A:0001 X:3911 Y:0002 P:envMxdizC
 
  $81/811B 1A          INC A                  A:0001 X:3911 Y:0002 P:envMxdizC
Line 6,064: Line 6,088:
 
  $81/8126 86 5C      STX $5C    [$00:005C]  A:0004 X:3919 Y:0004 P:envmxdizc
 
  $81/8126 86 5C      STX $5C    [$00:005C]  A:0004 X:3919 Y:0004 P:envmxdizc
 
  $81/8128 E2 20      SEP #$20                A:0004 X:3919 Y:0004 P:envmxdizc
 
  $81/8128 E2 20      SEP #$20                A:0004 X:3919 Y:0004 P:envmxdizc
  $81/812A 22 8A A1 80 JSL $80A18A[$80:A18A]   A:0004 X:3919 Y:0004 P:envMxdizc
+
  $81/812A 22 8A A1 80 JSL $80A18A  ; Wait for NMI
 
  $81/812E 22 92 A4 80 JSL $80A492[$80:A492]  A:0080 X:3919 Y:0004 P:envMxdizc
 
  $81/812E 22 92 A4 80 JSL $80A492[$80:A492]  A:0080 X:3919 Y:0004 P:envMxdizc
 
  $81/8132 22 E8 95 80 JSL $8095E8[$80:95E8]  A:0008 X:0060 Y:0004 P:envMxdizc
 
  $81/8132 22 E8 95 80 JSL $8095E8[$80:95E8]  A:0008 X:0060 Y:0004 P:envMxdizc
  $81/8136 22 8A A1 80 JSL $80A18A[$80:A18A]   A:FF20 X:1744 Y:000A P:envMxdizC
+
  $81/8136 22 8A A1 80 JSL $80A18A  ; Wait for NMI
 
  $81/813A 22 72 80 81 JSL $818072[$81:8072]  A:FF80 X:1744 Y:000A P:envMxdizc
 
  $81/813A 22 72 80 81 JSL $818072[$81:8072]  A:FF80 X:1744 Y:000A P:envMxdizc
  $81/813E 7A          PLY          ; Restore Y, C and A from Stack
+
  $81/813E 7A          PLY          ; Restore Y, X and A from Stack
 
  $81/813F FA          PLX
 
  $81/813F FA          PLX
 
  $81/8140 68          PLA
 
  $81/8140 68          PLA
Line 8,719: Line 8,743:
 
  $81/A8EF C2 21      REP #$21      ; A = 16-bit, Clear Carry
 
  $81/A8EF C2 21      REP #$21      ; A = 16-bit, Clear Carry
 
  $81/A8F1 BD 45 00    LDA $0045,x[$7E:461E]  A:0000 X:45D9 Y:0000 P:envmxdizc
 
  $81/A8F1 BD 45 00    LDA $0045,x[$7E:461E]  A:0000 X:45D9 Y:0000 P:envmxdizc
  $81/A8F4 85 20      STA $20   [$00:0020]  A:4C99 X:45D9 Y:0000 P:envmxdizc
+
  $81/A8F4 85 20      STA $20       ; Set Decompression Store address
 
  $81/A8F6 BD 15 02    LDA $0215,x[$7E:47EE]  A:4C99 X:45D9 Y:0000 P:envmxdizc
 
  $81/A8F6 BD 15 02    LDA $0215,x[$7E:47EE]  A:4C99 X:45D9 Y:0000 P:envmxdizc
  $81/A8F9 0A          ASL A                   A:0879 X:45D9 Y:0000 P:envmxdizc
+
  $81/A8F9 0A          ASL A         ; Multiply by 3
  $81/A8FA 7D 15 02    ADC $0215,x[$7E:47EE]  A:10F2 X:45D9 Y:0000 P:envmxdizc
+
  $81/A8FA 7D 15 02    ADC $0215,x
  $81/A8FD AA          TAX                     A:196B X:45D9 Y:0000 P:envmxdizc
+
  $81/A8FD AA          TAX           ; Use as Load index (each entry is 3 bytes in size)
  $81/A8FE BF 00 80 A3 LDA $A38000,x[$A3:996B] A:196B X:196B Y:0000 P:envmxdizc
+
  $81/A8FE BF 00 80 A3 LDA $A38000,x
 
  $81/A902 A8          TAY          ; Buffer Compressed Data Address in Y
 
  $81/A902 A8          TAY          ; Buffer Compressed Data Address in Y
 
  $81/A903 E2 20      SEP #$20      ; A = 8-bit
 
  $81/A903 E2 20      SEP #$20      ; A = 8-bit
Line 8,731: Line 8,755:
 
  $81/A90B A2 00 D4    LDX #$D400    ; Decompression Command address is $A1/D400
 
  $81/A90B A2 00 D4    LDX #$D400    ; Decompression Command address is $A1/D400
 
  $81/A90E 86 23      STX $23
 
  $81/A90E 86 23      STX $23
  $81/A910 A9 7E      LDA #$7E      ; Decompression Store address on  
+
  $81/A910 A9 7E      LDA #$7E      ; Decompression Store address on Bank $7E
 
  $81/A912 85 22      STA $22
 
  $81/A912 85 22      STA $22
 
  $81/A914 A9 A1      LDA #$A1
 
  $81/A914 A9 A1      LDA #$A1
Line 8,773: Line 8,797:
 
  $81/A970 F0 04      BEQ $04    [$A976]      A:FF00 X:45D9 Y:03AA P:eNvMxdizc
 
  $81/A970 F0 04      BEQ $04    [$A976]      A:FF00 X:45D9 Y:03AA P:eNvMxdizc
 
  $81/A972 C9 03      CMP #$03                A:FF00 X:45D9 Y:03AA P:eNvMxdizc
 
  $81/A972 C9 03      CMP #$03                A:FF00 X:45D9 Y:03AA P:eNvMxdizc
  $81/A974 D0 59      BNE $59   [$A9CF]     A:FF00 X:45D9 Y:03AA P:eNvMxdizc
+
  $81/A974 D0 59      BNE $59       ; [$A9CF] Branch and exit if not equal
  $81/A9CF 60          RTS                     A:FF00 X:45D9 Y:03AA P:eNvMxdizc
+
;code is missing here
 +
  $81/A9CF 60          RTS
  
 
== $81/A9D0 ? ==
 
== $81/A9D0 ? ==
Line 9,448: Line 9,473:
 
  $81/C3E6 60          RTS                    A:0000 X:45D9 Y:45D9 P:envMxdizc
 
  $81/C3E6 60          RTS                    A:0000 X:45D9 Y:45D9 P:envMxdizc
  
== $81/C3E7 ? ==
+
== $81/C3E7 ? Some flexible VRAM DMA ==
  
 
  $81/C3E7 A4 D8      LDY $D8    [$00:00D8]  A:FF00 X:3919 Y:41DB P:envMxdiZC
 
  $81/C3E7 A4 D8      LDY $D8    [$00:00D8]  A:FF00 X:3919 Y:41DB P:envMxdiZC
Line 9,459: Line 9,484:
 
  $81/C3F8 86 0E      STX $0E    [$00:000E]  A:5C00 X:0080 Y:45D9 P:envmxdizc
 
  $81/C3F8 86 0E      STX $0E    [$00:000E]  A:5C00 X:0080 Y:45D9 P:envmxdizc
 
  $81/C3FA B0 23      BCS $23    [$C41F]      A:5C00 X:0080 Y:45D9 P:envmxdizc
 
  $81/C3FA B0 23      BCS $23    [$C41F]      A:5C00 X:0080 Y:45D9 P:envmxdizc
  $81/C3FC A8          TAY                     A:5C00 X:0080 Y:45D9 P:envmxdizc
+
  $81/C3FC A8          TAY           ; Transfer in Y as VRAM Destination Address
 
  $81/C3FD E5 D6      SBC $D6    [$00:00D6]  A:5C00 X:0080 Y:5C00 P:envmxdizc
 
  $81/C3FD E5 D6      SBC $D6    [$00:00D6]  A:5C00 X:0080 Y:5C00 P:envmxdizc
 
  $81/C3FF 49 FF FF    EOR #$FFFF              A:FFEF X:0080 Y:5C00 P:eNvmxdizc
 
  $81/C3FF 49 FF FF    EOR #$FFFF              A:FFEF X:0080 Y:5C00 P:eNvmxdizc
Line 9,467: Line 9,492:
 
  $81/C408 38          SEC                    A:FFDF X:0080 Y:5C00 P:eNvmxdizc
 
  $81/C408 38          SEC                    A:FFDF X:0080 Y:5C00 P:eNvmxdizc
 
  $81/C409 65 5C      ADC $5C    [$00:005C]  A:FFDF X:0080 Y:5C00 P:eNvmxdizC
 
  $81/C409 65 5C      ADC $5C    [$00:005C]  A:FFDF X:0080 Y:5C00 P:eNvmxdizC
  $81/C40B AA          TAX                     A:5299 X:0080 Y:5C00 P:envmxdizC
+
  $81/C40B AA          TAX           ; Transfer in X as VRAM DAM Source Address
  $81/C40C E2 20      SEP #$20               A:5299 X:5299 Y:5C00 P:envmxdizC
+
  $81/C40C E2 20      SEP #$20     ; A = 8-bit
  $81/C40E A9 7E      LDA #$7E               A:5299 X:5299 Y:5C00 P:envMxdizC
+
  $81/C40E A9 7E      LDA #$7E     ; VRAM DMA Source Bank: $7E
  $81/C410 22 24 9F 80 JSL $809F24[$80:9F24]   A:527E X:5299 Y:5C00 P:envMxdizC
+
  $81/C410 22 24 9F 80 JSL $809F24  ; VRAM DMA
 
  $81/C414 C2 20      REP #$20                A:5280 X:0000 Y:5C00 P:envMxdizc
 
  $81/C414 C2 20      REP #$20                A:5280 X:0000 Y:5C00 P:envMxdizc
 
  $81/C416 A6 D8      LDX $D8    [$00:00D8]  A:5280 X:0000 Y:5C00 P:envmxdizc
 
  $81/C416 A6 D8      LDX $D8    [$00:00D8]  A:5280 X:0000 Y:5C00 P:envmxdizc
Line 9,477: Line 9,502:
 
  $81/C41D 80 61      BRA $61    [$C480]      A:5C10 X:45D9 Y:5C00 P:envmxdizc
 
  $81/C41D 80 61      BRA $61    [$C480]      A:5C10 X:45D9 Y:5C00 P:envmxdizc
 
;code is missing here
 
;code is missing here
  $81/C480 E2 20      SEP #$20               A:5870 X:3919 Y:3919 P:envmxdiZC
+
  $81/C480 E2 20      SEP #$20     ; A = 8-bit
  $81/C482 AD 6A 05    LDA $056A [$7E:056A]  A:5870 X:3919 Y:3919 P:envMxdiZC
+
  $81/C482 AD 6A 05    LDA $056A     ; Is FBLANK active?
  $81/C485 10 04      BPL $04   [$C48B]     A:580F X:3919 Y:3919 P:envMxdizC
+
  $81/C485 10 04      BPL $04       ; [$C48B] Branch and exit if not
 
;code is missing here
 
;code is missing here
 
  $81/C48B A6 D8      LDX $D8    [$00:00D8]  A:580F X:3919 Y:3919 P:envMxdizC
 
  $81/C48B A6 D8      LDX $D8    [$00:00D8]  A:580F X:3919 Y:3919 P:envMxdizC
  $81/C48D 60          RTS                     A:580F X:3919 Y:3919 P:envMxdizC
+
  $81/C48D 60          RTS
  
 
== $81/C491 ? ==
 
== $81/C491 ? ==
Line 10,484: Line 10,509:
 
  7F 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91
 
  7F 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91
  
== $81/EF8F ? ==
+
== $81/EF8F ? Check if bit is set ==
  
A contains the Data Bank for this subroutine
+
A contains the Data Bank for this subroutine, X contains an address, Y contains additional data. This loads from the address in A/X and checks if a bit is set, that is corresponding to Y.
  
 
  $81/EF8F 8B          PHB          ; Preserve Data Bank
 
  $81/EF8F 8B          PHB          ; Preserve Data Bank
 
  $81/EF90 48          PHA          ; Set Data Bank to what is in A
 
  $81/EF90 48          PHA          ; Set Data Bank to what is in A
 
  $81/EF91 AB          PLB
 
  $81/EF91 AB          PLB
  $81/EF92 C2 20      REP #$20               A:0099 X:905E Y:000D P:eNvMxdizc
+
  $81/EF92 C2 20      REP #$20     ; A = 16-bit
 
  $81/EF94 98          TYA                    A:0099 X:905E Y:000D P:eNvmxdizc
 
  $81/EF94 98          TYA                    A:0099 X:905E Y:000D P:eNvmxdizc
  $81/EF95 4A          LSR A                   A:000D X:905E Y:000D P:envmxdizc
+
  $81/EF95 4A          LSR A         ; Divide value by 8
  $81/EF96 4A          LSR A                   A:0006 X:905E Y:000D P:envmxdizC
+
  $81/EF96 4A          LSR A
  $81/EF97 4A          LSR A                   A:0003 X:905E Y:000D P:envmxdizc
+
  $81/EF97 4A          LSR A
  $81/EF98 48          PHA                     A:0001 X:905E Y:000D P:envmxdizC
+
  $81/EF98 48          PHA           ; Buffer it on stack
 
  $81/EF99 8A          TXA                    A:0001 X:905E Y:000D P:envmxdizC
 
  $81/EF99 8A          TXA                    A:0001 X:905E Y:000D P:envmxdizC
 
  $81/EF9A 18          CLC                    A:905E X:905E Y:000D P:eNvmxdizC
 
  $81/EF9A 18          CLC                    A:905E X:905E Y:000D P:eNvmxdizC
  $81/EF9B 63 01      ADC $01,s [$00:1FE7]  A:905E X:905E Y:000D P:eNvmxdizc
+
  $81/EF9B 63 01      ADC $01,s     ; Add div-by-8-value
  $81/EF9D 83 01      STA $01,s [$00:1FE7]  A:905F X:905E Y:000D P:eNvmxdizc
+
  $81/EF9D 83 01      STA $01,s     ; Store result on Stack
  $81/EF9F E2 20      SEP #$20               A:905F X:905E Y:000D P:eNvmxdizc
+
  $81/EF9F E2 20      SEP #$20     ; A = 8-bit
  $81/EFA1 7B          TDC                     A:905F X:905E Y:000D P:eNvMxdizc
+
  $81/EFA1 7B          TDC           ; Clear 16-bit A
 
  $81/EFA2 98          TYA                    A:0000 X:905E Y:000D P:envMxdiZc
 
  $81/EFA2 98          TYA                    A:0000 X:905E Y:000D P:envMxdiZc
 
  $81/EFA3 29 07      AND #$07                A:000D X:905E Y:000D P:envMxdizc
 
  $81/EFA3 29 07      AND #$07                A:000D X:905E Y:000D P:envMxdizc
Line 10,512: Line 10,537:
 
  $81/EFAF 23 01      AND $01,s  [$00:1FE8]  A:0000 X:905F Y:000D P:envMxdiZc
 
  $81/EFAF 23 01      AND $01,s  [$00:1FE8]  A:0000 X:905F Y:000D P:envMxdiZc
 
  $81/EFB1 C9 01      CMP #$01                A:0000 X:905F Y:000D P:envMxdiZc
 
  $81/EFB1 C9 01      CMP #$01                A:0000 X:905F Y:000D P:envMxdiZc
  $81/EFB3 68          PLA                     A:0000 X:905F Y:000D P:eNvMxdizc
+
  $81/EFB3 68          PLA           ; (Restore A from Stack)
  $81/EFB4 AB          PLB                     A:0020 X:905F Y:000D P:envMxdizc
+
  $81/EFB4 AB          PLB           ; Restore Data Bank from Stack
  $81/EFB5 6B          RTL                     A:0020 X:905F Y:000D P:envMxdizc
+
  $81/EFB5 6B          RTL
 +
 +
$81/EFB6 01
 +
$81/EFB7 02
 +
$81/EFB8 04
 +
$81/EFB9 08
 +
$81/EFBA 10
 +
$81/EFBB 20
 +
$81/EFBC 40
 +
$81/EFBD 80
  
 
== $81/F3C4 Fade Screen Out ==
 
== $81/F3C4 Fade Screen Out ==
Line 12,450: Line 12,484:
 
== $82/EBA5 ? ==
 
== $82/EBA5 ? ==
  
  $82/EBA5 C2 20      REP #$20               A:0008 X:002E Y:0026 P:envMxdiZC
+
  $82/EBA5 C2 20      REP #$20     ; A = 16-bit
 
  $82/EBA7 AD DC 16    LDA $16DC  [$82:16DC]  A:0008 X:002E Y:0026 P:envmxdiZC
 
  $82/EBA7 AD DC 16    LDA $16DC  [$82:16DC]  A:0008 X:002E Y:0026 P:envmxdiZC
 
  $82/EBAA 38          SEC                    A:0000 X:002E Y:0026 P:envmxdiZC
 
  $82/EBAA 38          SEC                    A:0000 X:002E Y:0026 P:envmxdiZC
Line 12,459: Line 12,493:
 
  $82/EBE4 38          SEC                    A:0022 X:002E Y:0026 P:envmxdizc
 
  $82/EBE4 38          SEC                    A:0022 X:002E Y:0026 P:envmxdizc
 
  $82/EBE5 ED E2 16    SBC $16E2  [$82:16E2]  A:0022 X:002E Y:0026 P:envmxdizC
 
  $82/EBE5 ED E2 16    SBC $16E2  [$82:16E2]  A:0022 X:002E Y:0026 P:envmxdizC
  $82/EBE8 90 2F      BCC $2F   [$EC19]     A:0014 X:002E Y:0026 P:envmxdizC
+
  $82/EBE8 90 2F      BCC $2F       ; [$EC19] Exit
 
  $82/EBEA 85 00      STA $00    [$00:0000]  A:0014 X:002E Y:0026 P:envmxdizC
 
  $82/EBEA 85 00      STA $00    [$00:0000]  A:0014 X:002E Y:0026 P:envmxdizC
 
  $82/EBEC AD E8 16    LDA $16E8  [$82:16E8]  A:0014 X:002E Y:0026 P:envmxdizC
 
  $82/EBEC AD E8 16    LDA $16E8  [$82:16E8]  A:0014 X:002E Y:0026 P:envmxdizC
Line 12,480: Line 12,514:
 
  $82/EC0B 4A          LSR A                  A:0070 X:002E Y:0026 P:envmxdizc
 
  $82/EC0B 4A          LSR A                  A:0070 X:002E Y:0026 P:envmxdizc
 
  $82/EC0C 85 06      STA $06    [$00:0006]  A:0038 X:002E Y:0026 P:envmxdizc
 
  $82/EC0C 85 06      STA $06    [$00:0006]  A:0038 X:002E Y:0026 P:envmxdizc
  $82/EC0E E2 20      SEP #$20               A:0038 X:002E Y:0026 P:envmxdizc
+
  $82/EC0E E2 20      SEP #$20     ; A = 8-bit
 
  $82/EC10 A9 02      LDA #$02                A:0038 X:002E Y:0026 P:envMxdizc
 
  $82/EC10 A9 02      LDA #$02                A:0038 X:002E Y:0026 P:envMxdizc
 
  $82/EC12 20 04 F1    JSR $F104  [$82:F104]  A:0002 X:002E Y:0026 P:envMxdizc
 
  $82/EC12 20 04 F1    JSR $F104  [$82:F104]  A:0002 X:002E Y:0026 P:envMxdizc
  $82/EC15 22 8A A1 80 JSL $80A18A[$80:A18A]   A:01B8 X:002A Y:7E20 P:envMxdiZc
+
  $82/EC15 22 8A A1 80 JSL $80A18A  ; Wait for NMI
  $82/EC19 E2 20      SEP #$20               A:0058 X:0014 Y:0000 P:eNvMxdizC
+
  $82/EC19 E2 20      SEP #$20     ; A = 8-bit
  $82/EC1B 60          RTS                     A:0058 X:0014 Y:0000 P:eNvMxdizC
+
  $82/EC1B 60          RTS
  
 
== $82/F0FC ? ==
 
== $82/F0FC ? ==
Line 13,225: Line 13,259:
 
  $82/F862 22 46 F4 82 JSL $82F446[$82:F446]  A:3700 X:0060 Y:0000 P:envMxdizc
 
  $82/F862 22 46 F4 82 JSL $82F446[$82:F446]  A:3700 X:0060 Y:0000 P:envMxdizc
 
  $82/F866 A2 00 00    LDX #$0000
 
  $82/F866 A2 00 00    LDX #$0000
  $82/F869 8E 91 05    STX $0591    ; Set back BG1 H-Scroll
+
  $82/F869 8E 91 05    STX $0591    ; Reset BG1 H-Scroll
  $82/F86C 8E 93 05    STX $0593    ; Set back BG1 V-Scroll
+
  $82/F86C 8E 93 05    STX $0593    ; Reset BG1 V-Scroll
  $82/F86F 8E 95 05    STX $0595    ; Set back BG2 H-Scroll
+
  $82/F86F 8E 95 05    STX $0595    ; Reset BG2 H-Scroll
  $82/F872 8E 97 05    STX $0597    ; Set back BG2 V-Scroll
+
  $82/F872 8E 97 05    STX $0597    ; Reset BG2 V-Scroll
 
  $82/F875 22 8A A1 80 JSL $80A18A  ; Change Bank, wait for NMI and execute code built in WRAM
 
  $82/F875 22 8A A1 80 JSL $80A18A  ; Change Bank, wait for NMI and execute code built in WRAM
 
  $82/F879 22 84 EB 82 JSL $82EB84[$82:EB84]  A:0780 X:0000 Y:5800 P:eNvMxdizc
 
  $82/F879 22 84 EB 82 JSL $82EB84[$82:EB84]  A:0780 X:0000 Y:5800 P:eNvMxdizc
 
  $82/F87D 68          PLA                    A:0780 X:0000 Y:FFFF P:eNvMxdizc
 
  $82/F87D 68          PLA                    A:0780 X:0000 Y:FFFF P:eNvMxdizc
 
  $82/F87E 85 09      STA $09    [$00:0009]  A:0700 X:0000 Y:FFFF P:envMxdiZc
 
  $82/F87E 85 09      STA $09    [$00:0009]  A:0700 X:0000 Y:FFFF P:envMxdiZc
  $82/F880 A2 00 00    LDX #$0000             A:0700 X:0000 Y:FFFF P:envMxdiZc
+
  $82/F880 A2 00 00    LDX #$0000   ; Clear X (to use it as a Loop Counter)
  $82/F883 DA          PHX                     A:0700 X:0000 Y:FFFF P:envMxdiZc
+
  $82/F883 DA          PHX           ; Buffer Load Index/Loop Counter on stack
  $82/F884 C2 20      REP #$20               A:0700 X:0000 Y:FFFF P:envMxdiZc
+
  $82/F884 C2 20      REP #$20     ; A = 16-bit
 
  $82/F886 BF DF DB 7E LDA $7EDBDF,x[$7E:DBDF] A:0700 X:0000 Y:FFFF P:envmxdiZc
 
  $82/F886 BF DF DB 7E LDA $7EDBDF,x[$7E:DBDF] A:0700 X:0000 Y:FFFF P:envmxdiZc
 
  $82/F88A AA          TAX                    A:004B X:0000 Y:FFFF P:envmxdizc
 
  $82/F88A AA          TAX                    A:004B X:0000 Y:FFFF P:envmxdizc
  $82/F88B E2 20      SEP #$20               A:004B X:004B Y:FFFF P:envmxdizc
+
  $82/F88B E2 20      SEP #$20     ; A = 8-bit
  $82/F88D BF 00 CC 7F LDA $7FCC00,x   ; Load value from Terrain Type Map
+
  $82/F88D BF 00 CC 7F LDA $7FCC00,x ; Load value from Terrain Type Map
 
  $82/F891 30 24      BMI $24    [$F8B7]      A:0014 X:004B Y:FFFF P:envMxdizc
 
  $82/F891 30 24      BMI $24    [$F8B7]      A:0014 X:004B Y:FFFF P:envMxdizc
 
  $82/F893 A5 09      LDA $09    [$00:0009]  A:0014 X:004B Y:FFFF P:envMxdizc
 
  $82/F893 A5 09      LDA $09    [$00:0009]  A:0014 X:004B Y:FFFF P:envMxdizc
Line 13,245: Line 13,279:
 
;code is missing here
 
;code is missing here
 
  $82/F89D 9B          TXY                    A:0000 X:004B Y:FFFF P:envMxdiZc
 
  $82/F89D 9B          TXY                    A:0000 X:004B Y:FFFF P:envMxdiZc
  $82/F89E C2 20      REP #$20               A:0000 X:004B Y:004B P:envMxdizc
+
  $82/F89E C2 20      REP #$20     ; A = 16-bit
 
  $82/F8A0 AD BE 16    LDA $16BE  [$82:16BE]  A:0000 X:004B Y:004B P:envmxdizc
 
  $82/F8A0 AD BE 16    LDA $16BE  [$82:16BE]  A:0000 X:004B Y:004B P:envmxdizc
 
  $82/F8A3 EB          XBA                    A:0000 X:004B Y:004B P:envmxdiZc
 
  $82/F8A3 EB          XBA                    A:0000 X:004B Y:004B P:envmxdiZc
Line 13,251: Line 13,285:
 
  $82/F8A5 4A          LSR A                  A:0000 X:004B Y:004B P:envmxdiZc
 
  $82/F8A5 4A          LSR A                  A:0000 X:004B Y:004B P:envmxdiZc
 
  $82/F8A6 4A          LSR A                  A:0000 X:004B Y:004B P:envmxdiZc
 
  $82/F8A6 4A          LSR A                  A:0000 X:004B Y:004B P:envmxdiZc
  $82/F8A7 E2 20      SEP #$20               A:0000 X:004B Y:004B P:envmxdiZc
+
  $82/F8A7 E2 20      SEP #$20     ; A = 8-bit
  $82/F8A9 1F 00 D4 7F ORA $7FD400,x   ; Add "Object" Type Map
+
  $82/F8A9 1F 00 D4 7F ORA $7FD400,x ; Add "Object" Type Map
 
  $82/F8AD AA          TAX                    A:0002 X:004B Y:004B P:envMxdizc
 
  $82/F8AD AA          TAX                    A:0002 X:004B Y:004B P:envMxdizc
  $82/F8AE 7B          TDC             ; Clear 16-bit A
+
  $82/F8AE 7B          TDC           ; Clear 16-bit A
 
  $82/F8AF BF DD 8D 8B LDA $8B8DDD,x[$8B:8DDF] A:0000 X:0002 Y:004B P:envMxdiZc
 
  $82/F8AF BF DD 8D 8B LDA $8B8DDD,x[$8B:8DDF] A:0000 X:0002 Y:004B P:envMxdiZc
 
  $82/F8B3 BB          TYX                    A:0007 X:0002 Y:004B P:envMxdizc
 
  $82/F8B3 BB          TYX                    A:0007 X:0002 Y:004B P:envMxdizc
 
  $82/F8B4 20 45 E7    JSR $E745  [$82:E745]  A:0007 X:004B Y:004B P:envMxdizc
 
  $82/F8B4 20 45 E7    JSR $E745  [$82:E745]  A:0007 X:004B Y:004B P:envMxdizc
  $82/F8B7 FA          PLX                     A:0002 X:0BBA Y:005C P:envMxdizc
+
  $82/F8B7 FA          PLX           ; Pull Load Index/Loop Counter from stack
  $82/F8B8 E8          INX                     A:0002 X:0000 Y:005C P:envMxdiZc
+
  $82/F8B8 E8          INX           ; Increment it twice
  $82/F8B9 E8          INX                     A:0002 X:0001 Y:005C P:envMxdizc
+
  $82/F8B9 E8          INX
  $82/F8BA EC EC 16    CPX $16EC [$82:16EC]  A:0002 X:0002 Y:005C P:envMxdizc
+
  $82/F8BA EC EC 16    CPX $16EC     ; Is the Loop Limit reached?
  $82/F8BD 90 C4      BCC $C4   [$F883]     A:0002 X:0002 Y:005C P:eNvMxdizc
+
  $82/F8BD 90 C4      BCC $C4       ; [$F883] Loop if not
 
  $82/F8BF 20 A5 EB    JSR $EBA5  [$82:EBA5]  A:0007 X:002E Y:0120 P:envMxdiZC
 
  $82/F8BF 20 A5 EB    JSR $EBA5  [$82:EBA5]  A:0007 X:002E Y:0120 P:envMxdiZC
  $82/F8C2 A9 71      LDA #$71      ; BG1 Tilemap $7000
+
  $82/F8C2 A9 71      LDA #$71      ; BG1 Tilemap at $7000
 
  $82/F8C4 8D 8B 05    STA $058B
 
  $82/F8C4 8D 8B 05    STA $058B
 
  $82/F8C7 A9 79      LDA #$79      ; BG2 Tilemap at $7800
 
  $82/F8C7 A9 79      LDA #$79      ; BG2 Tilemap at $7800
Line 13,406: Line 13,440:
  
 
This is about some color calculation. $20-22 and $23-25 both contain 24-addresses to colors.
 
This is about some color calculation. $20-22 and $23-25 both contain 24-addresses to colors.
 +
 +
$7EB140,x 1st color RED - 2nd color RED    000x.xxxx
 +
$7EB141,x 2nd color RED                    xxxx.x000
 +
$7EB160,x 1st color BLUE - 2nd color BLUE  000x.xxxx
 +
$7EB161,x 2nd color BLUE                    xxxx.x000
 +
$7EB180,x 1st color GREEN - 2nd color GREEN 000x.xxxx
 +
$7EB181,x 2nd color GREEN                  xxxx.x000
 +
  
 
  $83/A990 7B          TDC          ; Clear 16-bit A
 
  $83/A990 7B          TDC          ; Clear 16-bit A
 
  $83/A991 AD A6 17    LDA $17A6    ; Load number of colors to do
 
  $83/A991 AD A6 17    LDA $17A6    ; Load number of colors to do
  $83/A994 AA          TAX           ; Store number of colors to do in $06 and clear $07
+
  $83/A994 AA          TAX
$83/A995 86 06      STX $06    [$00:0006]  A:0010 X:0010 Y:9E53 P:envMxdizC
+
$83/A995 86 06      STX $06      ; Store number of colors to do in $06 and clear $07
 
  $83/A997 AD A7 17    LDA $17A7    ; (Load a Load Index)
 
  $83/A997 AD A7 17    LDA $17A7    ; (Load a Load Index)
 
  $83/A99A C2 20      REP #$20      ; 16-bit A
 
  $83/A99A C2 20      REP #$20      ; 16-bit A
 
  $83/A99C 0A          ASL A        ; Multiply Load Index by 2 (values are 2 bytes in size)
 
  $83/A99C 0A          ASL A        ; Multiply Load Index by 2 (values are 2 bytes in size)
 
  $83/A99D A8          TAY          ; Transfer in Y
 
  $83/A99D A8          TAY          ; Transfer in Y
  $83/A99E A2 00 00    LDX #$0000             A:0000 X:0010 Y:0000 P:envmxdiZc
+
  $83/A99E A2 00 00    LDX #$0000   ; Clear X (use as store index)
 
  $83/A9A1 C2 20      REP #$20      ; 16-bit A again (necessary for loops)
 
  $83/A9A1 C2 20      REP #$20      ; 16-bit A again (necessary for loops)
  $83/A9A3 B7 23      LDA [$23],y[$9C:DCD4]  A:0000 X:0000 Y:0000 P:envmxdiZc
+
  $83/A9A3 B7 23      LDA [$23],y   ; Buffer 1st color in $02/$03
  $83/A9A5 85 02      STA $02   [$00:0002]  A:0042 X:0000 Y:0000 P:envmxdizc
+
  $83/A9A5 85 02      STA $02
 
+
  $83/A9A7 B7 20      LDA [$20],y   ; Buffer 2nd color in $00/$01
  $83/A9A7 B7 20      LDA [$20],y[$00:124B]  A:0042 X:0000 Y:0000 P:envmxdizc
+
  $83/A9A9 85 00      STA $00
  $83/A9A9 85 00      STA $00   [$00:0000]  A:0000 X:0000 Y:0000 P:envmxdiZc
+
  $83/A9AB E2 20      SEP #$20     ; A = 16-bit
buffer color
+
  $83/A9AD 29 1F      AND #$1F     ; Exempt RED Color Segment
  $83/A9AB E2 20      SEP #$20               A:0000 X:0000 Y:0000 P:envmxdiZc
+
  $83/A9AF 85 04      STA $04       ; Buffer 2nd color RED in $04
  $83/A9AD 29 1F      AND #$1F               A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $83/A9B1 0A          ASL A         ; Roll value left thrice
  $83/A9AF 85 04      STA $04   [$00:0004]  A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $83/A9B2 0A          ASL A
exempt color
+
  $83/A9B3 0A          ASL A
  $83/A9B1 0A          ASL A                   A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $83/A9B4 9F 41 B1 7E STA $7EB141,x ; Buffer that value
  $83/A9B2 0A          ASL A                   A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $83/A9B8 A5 02      LDA $02       ; Load 1st color
  $83/A9B3 0A          ASL A                   A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $83/A9BA 29 1F      AND #$1F     ; Exempt RED Color Segment
  $83/A9B4 9F 41 B1 7E STA $7EB141,x[$7E:B141] A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $83/A9BC 38          SEC           ; Subtract 2nd color RED
 
+
  $83/A9BD E5 04      SBC $04
  $83/A9B8 A5 02      LDA $02   [$00:0002]  A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $83/A9BF 9F 40 B1 7E STA $7EB140,x ; Buffer result
  $83/A9BA 29 1F      AND #$1F               A:0042 X:0000 Y:0000 P:envMxdizc
+
  $83/A9BC 38          SEC                     A:0002 X:0000 Y:0000 P:envMxdizc
+
  $83/A9C3 C2 20      REP #$20     ; A = 16-bit
  $83/A9BD E5 04      SBC $04   [$00:0004]  A:0002 X:0000 Y:0000 P:envMxdizC
+
  $83/A9C5 A5 00      LDA $00       ; Load 2nd color
  $83/A9BF 9F 40 B1 7E STA $7EB140,x[$7E:B140] A:0002 X:0000 Y:0000 P:envMxdizC
+
  $83/A9C7 29 E0 03    AND #$03E0   ; Exempt GREEN Color Segment
 
+
  $83/A9CA 85 04      STA $04       ; Buffer it in $04/$05
  $83/A9C3 C2 20      REP #$20               A:0002 X:0000 Y:0000 P:envMxdizC
+
  $83/A9CC 4A          LSR A         ; Roll value right twice
  $83/A9C5 A5 00      LDA $00   [$00:0000]  A:0002 X:0000 Y:0000 P:envmxdizC
+
  $83/A9CD 4A          LSR A
  $83/A9C7 29 E0 03    AND #$03E0             A:0000 X:0000 Y:0000 P:envmxdiZC
+
  $83/A9CE E2 20      SEP #$20     ; A = 8-bit
  $83/A9CA 85 04      STA $04   [$00:0004]  A:0000 X:0000 Y:0000 P:envmxdiZC
+
  $83/A9D0 9F 81 B1 7E STA $7EB181,x ; Buffer that value
  $83/A9CC 4A          LSR A                   A:0000 X:0000 Y:0000 P:envmxdiZC
+
  $83/A9D4 C2 20      REP #$20     ; A = 16-bit
  $83/A9CD 4A          LSR A                   A:0000 X:0000 Y:0000 P:envmxdiZc
+
  $83/A9D6 A5 02      LDA $02       ; Load 1st color
  $83/A9CE E2 20      SEP #$20               A:0000 X:0000 Y:0000 P:envmxdiZc
+
  $83/A9D8 29 E0 03    AND #$03E0   ; Exempt GREEN Color Segment
  $83/A9D0 9F 81 B1 7E STA $7EB181,x[$7E:B181] A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $83/A9DB 38          SEC           ; Subtract 2nd color GREEN
  $83/A9D4 C2 20      REP #$20               A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $83/A9DC E5 04      SBC $04
  $83/A9D6 A5 02      LDA $02   [$00:0002]  A:0000 X:0000 Y:0000 P:envmxdiZc
+
  $83/A9DE 4A          LSR A         ; Roll result into position
  $83/A9D8 29 E0 03    AND #$03E0             A:0042 X:0000 Y:0000 P:envmxdizc
+
  $83/A9DF 4A          LSR A
  $83/A9DB 38          SEC                     A:0040 X:0000 Y:0000 P:envmxdizc
+
  $83/A9E0 4A          LSR A
  $83/A9DC E5 04      SBC $04   [$00:0004]  A:0040 X:0000 Y:0000 P:envmxdizC
+
  $83/A9E1 4A          LSR A
  $83/A9DE 4A          LSR A                   A:0040 X:0000 Y:0000 P:envmxdizC
+
  $83/A9E2 4A          LSR A
  $83/A9DF 4A          LSR A                   A:0020 X:0000 Y:0000 P:envmxdizc
+
  $83/A9E3 E2 20      SEP #$20     ; A = 8-bit
  $83/A9E0 4A          LSR A                   A:0010 X:0000 Y:0000 P:envmxdizc
+
  $83/A9E5 9F 80 B1 7E STA $7EB180,x ; Buffer the result
  $83/A9E1 4A          LSR A                   A:0008 X:0000 Y:0000 P:envmxdizc
+
  $83/A9E9 A5 01      LDA $01       ; Load 2nd color high byte
  $83/A9E2 4A          LSR A                   A:0004 X:0000 Y:0000 P:envmxdizc
+
  $83/A9EB 29 7C      AND #$7C     ; Exempt BLUE Color Segment
  $83/A9E3 E2 20      SEP #$20               A:0002 X:0000 Y:0000 P:envmxdizc
+
  $83/A9ED 85 04      STA $04       ; Buffer 2nd color BLUE in $04
  $83/A9E5 9F 80 B1 7E STA $7EB180,x[$7E:B180] A:0002 X:0000 Y:0000 P:envMxdizc
+
  $83/A9EF 0A          ASL A         ; Roll value left once
  $83/A9E9 A5 01      LDA $01   [$00:0001]  A:0002 X:0000 Y:0000 P:envMxdizc
+
  $83/A9F0 9F 61 B1 7E STA $7EB161,x ; Buffer value
  $83/A9EB 29 7C      AND #$7C               A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $83/A9F4 A5 03      LDA $03       ; Load 1st color high byte
  $83/A9ED 85 04      STA $04   [$00:0004]  A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $83/A9F6 29 7C      AND #$7C     ; Exempt BLUE Color Segment
  $83/A9EF 0A          ASL A                   A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $83/A9F8 38          SEC           ; Subtract 2nd color BLUE
  $83/A9F0 9F 61 B1 7E STA $7EB161,x[$7E:B161] A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $83/A9F9 E5 04      SBC $04
  $83/A9F4 A5 03      LDA $03   [$00:0003]  A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $83/A9FB 10 06      BPL $06       ; [$AA03] Branch if the result is positive
  $83/A9F6 29 7C      AND #$7C               A:0000 X:0000 Y:0000 P:envMxdiZc
+
; code is missing here
  $83/A9F8 38          SEC                     A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $83/AA03 4A          LSR A         ; Roll result right twice
  $83/A9F9 E5 04      SBC $04   [$00:0004]  A:0000 X:0000 Y:0000 P:envMxdiZC
+
  $83/AA04 4A          LSR A
  $83/A9FB 10 06      BPL $06   [$AA03]     A:0000 X:0000 Y:0000 P:envMxdiZC
+
  $83/AA05 9F 60 B1 7E STA $7EB160,x ; Buffer result
  $83/AA03 4A          LSR A                   A:0000 X:0000 Y:0000 P:envMxdiZC
+
  $83/AA09 C8          INY           ; Increment Load Index twice
  $83/AA04 4A          LSR A                   A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $83/AA0A C8          INY
  $83/AA05 9F 60 B1 7E STA $7EB160,x[$7E:B160] A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $83/AA0B E8          INX           ; Increment Store Index twice
  $83/AA09 C8          INY                     A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $83/AA0C E8          INX
  $83/AA0A C8          INY                     A:0000 X:0000 Y:0001 P:envMxdizc
+
  $83/AA0D A5 00      LDA $00       ; This line could be removed!?!
  $83/AA0B E8          INX                     A:0000 X:0000 Y:0002 P:envMxdizc
+
  $83/AA0F C6 06      DEC $06       ; Decrement number of colors to do
  $83/AA0C E8          INX                     A:0000 X:0001 Y:0002 P:envMxdizc
+
  $83/AA11 D0 8E      BNE $8E       ; [$A9A1] Loop until counter runs out
  $83/AA0D A5 00      LDA $00   [$00:0000]  A:0000 X:0002 Y:0002 P:envMxdizc
+
  $83/AA13 60          RTS
  $83/AA0F C6 06      DEC $06   [$00:0006]  A:0000 X:0002 Y:0002 P:envMxdiZc
 
  $83/AA11 D0 8E      BNE $8E   [$A9A1]     A:0000 X:0002 Y:0002 P:envMxdizc
 
  $83/AA13 60          RTS                     A:0000 X:0020 Y:0020 P:envMxdiZc
 
  
 
== $83/AA14 ? ==
 
== $83/AA14 ? ==
Line 13,758: Line 13,797:
  
 
  $84/8254 A6 39      LDX $39    [$00:0039]  A:0002 X:0002 Y:8A14 P:envMxdizC
 
  $84/8254 A6 39      LDX $39    [$00:0039]  A:0002 X:0002 Y:8A14 P:envMxdizC
  $84/8256 22 38 A1 88 JSL $88A138[$88:A138]   A:0002 X:0000 Y:8A14 P:envMxdiZC
+
  $84/8256 22 38 A1 88 JSL $88A138  ; Load Figure's Character Class/Graphic Set number
  $84/825A DA          PHX                     A:0032 X:0000 Y:8A14 P:envMxdiZc
+
  $84/825A DA          PHX           ; Buffer X (Figure Number) on stack
  $84/825B C2 20      REP #$20               A:0032 X:0000 Y:8A14 P:envMxdiZc
+
  $84/825B C2 20      REP #$20     ; A = 16-bit
  $84/825D 0A          ASL A                   A:0032 X:0000 Y:8A14 P:envmxdiZc
+
  $84/825D 0A          ASL A         ; X = A * 4 (To use it as Load Index for...
  $84/825E 0A          ASL A                   A:0064 X:0000 Y:8A14 P:envmxdizc
+
  $84/825E 0A          ASL A         ; ... a Table with 4 byte entries)
  $84/825F AA          TAX                     A:00C8 X:0000 Y:8A14 P:envmxdizc
+
  $84/825F AA          TAX
  $84/8260 E2 20      SEP #$20               A:00C8 X:00C8 Y:8A14 P:envmxdizc
+
  $84/8260 E2 20      SEP #$20     ; A = 8-bit
  $84/8262 7B          TDC                     A:00C8 X:00C8 Y:8A14 P:envMxdizc
+
  $84/8262 7B          TDC           ; Clear 16-bit A
 
  $84/8263 BF 41 A6 84 LDA $84A641,x[$84:A709] A:0000 X:00C8 Y:8A14 P:envMxdiZc
 
  $84/8263 BF 41 A6 84 LDA $84A641,x[$84:A709] A:0000 X:00C8 Y:8A14 P:envMxdiZc
  $84/8267 FA          PLX                     A:001F X:00C8 Y:8A14 P:envMxdizc
+
  $84/8267 FA          PLX           ; Restore X (Figure Number from $39) from stack
 
  $84/8268 85 20      STA $20    [$00:0020]  A:001F X:0000 Y:8A14 P:envMxdiZc
 
  $84/8268 85 20      STA $20    [$00:0020]  A:001F X:0000 Y:8A14 P:envMxdiZc
 
  $84/826A 64 21      STZ $21    [$00:0021]  A:001F X:0000 Y:8A14 P:envMxdiZc
 
  $84/826A 64 21      STZ $21    [$00:0021]  A:001F X:0000 Y:8A14 P:envMxdiZc
 
  $84/826C B9 01 00    LDA $0001,y[$84:8A15]  A:001F X:0000 Y:8A14 P:envMxdiZc
 
  $84/826C B9 01 00    LDA $0001,y[$84:8A15]  A:001F X:0000 Y:8A14 P:envMxdiZc
 
  $84/826F D0 04      BNE $04    [$8275]      A:0006 X:0000 Y:8A14 P:envMxdizc
 
  $84/826F D0 04      BNE $04    [$8275]      A:0006 X:0000 Y:8A14 P:envMxdizc
 +
;code is missing here
 
  $84/8275 C9 03      CMP #$03                A:0006 X:0000 Y:8A14 P:envMxdizc
 
  $84/8275 C9 03      CMP #$03                A:0006 X:0000 Y:8A14 P:envMxdizc
 
  $84/8277 D0 0D      BNE $0D    [$8286]      A:0006 X:0000 Y:8A14 P:envMxdizC
 
  $84/8277 D0 0D      BNE $0D    [$8286]      A:0006 X:0000 Y:8A14 P:envMxdizC
$84/8286 4A          LSR A                  A:0006 X:0000 Y:8A14 P:envMxdizC
 
$84/8287 F0 06      BEQ $06    [$828F]      A:0003 X:0000 Y:8A14 P:envMxdizc
 
$84/8289 06 20      ASL $20    [$00:0020]  A:0003 X:0000 Y:8A14 P:envMxdizc
 
$84/828B 26 21      ROL $21    [$00:0021]  A:0003 X:0000 Y:8A14 P:envMxdizc
 
$84/828D 80 E6      BRA $E6    [$8275]      A:0003 X:0000 Y:8A14 P:envMxdiZc
 
 
  $84/8279 C2 21      REP #$21                A:0003 X:0000 Y:8A14 P:envMxdiZC
 
  $84/8279 C2 21      REP #$21                A:0003 X:0000 Y:8A14 P:envMxdiZC
 
  $84/827B A5 20      LDA $20    [$00:0020]  A:0003 X:0000 Y:8A14 P:envmxdiZc
 
  $84/827B A5 20      LDA $20    [$00:0020]  A:0003 X:0000 Y:8A14 P:envmxdiZc
Line 13,786: Line 13,821:
 
  $84/8282 E2 20      SEP #$20                A:00BA X:0000 Y:8A14 P:envmxdizc
 
  $84/8282 E2 20      SEP #$20                A:00BA X:0000 Y:8A14 P:envmxdizc
 
  $84/8284 80 09      BRA $09    [$828F]      A:00BA X:0000 Y:8A14 P:envMxdizc
 
  $84/8284 80 09      BRA $09    [$828F]      A:00BA X:0000 Y:8A14 P:envMxdizc
 +
$84/8286 4A          LSR A                  A:0006 X:0000 Y:8A14 P:envMxdizC
 +
$84/8287 F0 06      BEQ $06    [$828F]      A:0003 X:0000 Y:8A14 P:envMxdizc
 +
$84/8289 06 20      ASL $20    [$00:0020]  A:0003 X:0000 Y:8A14 P:envMxdizc
 +
$84/828B 26 21      ROL $21    [$00:0021]  A:0003 X:0000 Y:8A14 P:envMxdizc
 +
$84/828D 80 E6      BRA $E6    [$8275]      A:0003 X:0000 Y:8A14 P:envMxdiZc
 
  $84/828F C2 20      REP #$20                A:00BA X:0000 Y:8A14 P:envMxdizc
 
  $84/828F C2 20      REP #$20                A:00BA X:0000 Y:8A14 P:envMxdizc
 
  $84/8291 A5 20      LDA $20    [$00:0020]  A:00BA X:0000 Y:8A14 P:envmxdizc
 
  $84/8291 A5 20      LDA $20    [$00:0020]  A:00BA X:0000 Y:8A14 P:envmxdizc
Line 14,062: Line 14,102:
 
  $84/9B5E 80 06      BRA $06    [$9B66]      A:9B30 X:002A Y:0032 P:envMxdizc
 
  $84/9B5E 80 06      BRA $06    [$9B66]      A:9B30 X:002A Y:0032 P:envMxdizc
  
== $84/9B66 ? ==
+
== $84/9B66 Change Figure's Position ==
 +
 
 +
'''ONLY EXECUTED DURING BATTLE ANIMATIONS'''
 +
 
 +
A contains a 8-bit value. The High Nybble changes the Position on the NW to SE Axis, the Low Nybble changes the Position on the NE to SW Axis. These are "signed nybbles": The MSB of each Nybble (that is bit 3) decides whether or not this is a positive or negative value.
 +
 
 +
A = #$30: Move 3 on the NW to SE Axis
 +
A = #$0D: Move 3 in the other direction on the NE to SW Axis
  
  $84/9B66 48          PHA                     A:9BF1 X:002A Y:0018 P:eNvMxdizc
+
  $84/9B66 48          PHA           ; Buffer A on Stack
  $84/9B67 4A          LSR A                   A:9BF1 X:002A Y:0018 P:eNvMxdizc
+
  $84/9B67 4A          LSR A         ; Store Original A's High Nybble as Low Nybble in $00
  $84/9B68 4A          LSR A                   A:9B78 X:002A Y:0018 P:envMxdizC
+
  $84/9B68 4A          LSR A
  $84/9B69 4A          LSR A                   A:9B3C X:002A Y:0018 P:envMxdizc
+
  $84/9B69 4A          LSR A
  $84/9B6A 4A          LSR A                   A:9B1E X:002A Y:0018 P:envMxdizc
+
  $84/9B6A 4A          LSR A
  $84/9B6B 85 00      STA $00   [$00:0000]  A:9B0F X:002A Y:0018 P:envMxdizc
+
  $84/9B6B 85 00      STA $00
  $84/9B6D 68          PLA                     A:9B0F X:002A Y:0018 P:envMxdizc
+
  $84/9B6D 68          PLA           ; Restore A from Stack
  $84/9B6E 29 0F      AND #$0F               A:9BF1 X:002A Y:0018 P:eNvMxdizc
+
  $84/9B6E 29 0F      AND #$0F     ; Store Low Nybble in $01
  $84/9B70 85 01      STA $01   [$00:0001]  A:9B01 X:002A Y:0018 P:envMxdizc
+
  $84/9B70 85 01      STA $01
  $84/9B72 7B          TDC                     A:9B01 X:002A Y:0018 P:envMxdizc
+
  $84/9B72 7B          TDC           ; Clear 16-bit A
  $84/9B73 A5 00      LDA $00   [$00:0000]  A:0000 X:002A Y:0018 P:envMxdiZc
+
  $84/9B73 A5 00      LDA $00       ; Load High Nybble
  $84/9B75 89 08      BIT #$08               A:000F X:002A Y:0018 P:envMxdizc
+
  $84/9B75 89 08      BIT #$08     ; Branch if MSB of High Nybble was clear
  $84/9B77 F0 07      BEQ $07   [$9B80]     A:000F X:002A Y:0018 P:envMxdizc
+
  $84/9B77 F0 07      BEQ $07       ; [$9B80]
  $84/9B79 C2 20      REP #$20               A:000F X:002A Y:0018 P:envMxdizc
+
  $84/9B7B 09 F0 FF    ORA #$FFF0             A:000F X:002A Y:0018 P:envmxdizc
+
  $84/9B79 C2 20      REP #$20     ; A = 16-bit
  $84/9B7E E2 20      SEP #$20               A:FFFF X:002A Y:0018 P:eNvmxdizc
+
  $84/9B7B 09 F0 FF    ORA #$FFF0   ; Set every else bit
  $84/9B80 C2 21      REP #$21               A:FFFF X:002A Y:0018 P:eNvMxdizc
+
  $84/9B7E E2 20      SEP #$20     ; This line could be removed?
  $84/9B82 7D 03 0A    ADC $0A03,x[$8A:0A2D]   A:FFFF X:002A Y:0018 P:eNvmxdizc
+
  $84/9B85 9D 03 0A    STA $0A03,x[$8A:0A2D]   A:0000 X:002A Y:0018 P:envmxdiZC
+
  $84/9B80 C2 21      REP #$21     ; A = 16-bit + Set Carry
  $84/9B88 E2 20      SEP #$20               A:0000 X:002A Y:0018 P:envmxdiZC
+
  $84/9B82 7D 03 0A    ADC $0A03,x  ; Add Position - NW to SE Axis
  $84/9B8A 7B          TDC                     A:0000 X:002A Y:0018 P:envMxdiZC
+
  $84/9B85 9D 03 0A    STA $0A03,x  ; Store as Position - NW to SE Axis
  $84/9B8B A5 01      LDA $01   [$00:0001]  A:0000 X:002A Y:0018 P:envMxdiZC
+
  $84/9B88 E2 20      SEP #$20     ; A = 8-bit
  $84/9B8D 89 08      BIT #$08               A:0001 X:002A Y:0018 P:envMxdizC
+
  $84/9B8A 7B          TDC           ; Clear 16-bit A
  $84/9B8F F0 07      BEQ $07   [$9B98]     A:0001 X:002A Y:0018 P:envMxdiZC
+
  $84/9B8B A5 01      LDA $01       ; Load Low Nybble
  $84/9B91 C2 20      REP #$20               A:000F X:002A Y:0030 P:envMxdizC
+
  $84/9B8D 89 08      BIT #$08     ; Branch if MSB of Low Nybble was clear
  $84/9B93 09 F0 FF    ORA #$FFF0             A:000F X:002A Y:0030 P:envmxdizC
+
  $84/9B8F F0 07      BEQ $07       ; [$9B98]
  $84/9B96 E2 20      SEP #$20       ; Useless line?!
+
  $84/9B98 C2 21      REP #$21               A:0001 X:002A Y:0018 P:envMxdiZC
+
  $84/9B91 C2 20      REP #$20     ; A = 16-bit
  $84/9B9A 7D 43 0A    ADC $0A43,x[$8A:0A6D]   A:0001 X:002A Y:0018 P:envmxdiZc
+
  $84/9B93 09 F0 FF    ORA #$FFF0   ; Set every else bit
  $84/9B9D 9D 43 0A    STA $0A43,x[$8A:0A6D]   A:0001 X:002A Y:0018 P:envmxdizc
+
  $84/9B96 E2 20      SEP #$20     ; This line could be removed?
  $84/9BA0 E2 20      SEP #$20               A:0001 X:002A Y:0018 P:envmxdizc
+
 +
  $84/9B98 C2 21      REP #$21     ; A = 16-bit + Set Carry
 +
  $84/9B9A 7D 43 0A    ADC $0A43,x  ; Add Position - NE to SW Axis
 +
  $84/9B9D 9D 43 0A    STA $0A43,x  ; Store as Position - NE to SW Axis
 +
  $84/9BA0 E2 20      SEP #$20     ; A = 8-bit
 
  $84/9BA2 A6 3B      LDX $3B    [$00:003B]  A:0001 X:002A Y:0018 P:envMxdizc
 
  $84/9BA2 A6 3B      LDX $3B    [$00:003B]  A:0001 X:002A Y:0018 P:envMxdizc
 
  $84/9BA4 98          TYA                    A:0001 X:002A Y:0018 P:envMxdizc
 
  $84/9BA4 98          TYA                    A:0001 X:002A Y:0018 P:envMxdizc
Line 14,154: Line 14,205:
 
  $84/9C07 80 07      BRA $07    [$9C10]      A:0040 X:0040 Y:0007 P:envMxdiZc
 
  $84/9C07 80 07      BRA $07    [$9C10]      A:0040 X:0040 Y:0007 P:envMxdiZc
 
;code is missing here
 
;code is missing here
  $84/9C10 22 8A A1 80 JSL $80A18A[$80:A18A]   A:0040 X:0040 Y:0007 P:envMxdiZc
+
  $84/9C10 22 8A A1 80 JSL $80A18A  ; Wait for NMI
 
  $84/9C14 A6 3B      LDX $3B    [$00:003B]  A:0080 X:0040 Y:0007 P:eNvMxdizc
 
  $84/9C14 A6 3B      LDX $3B    [$00:003B]  A:0080 X:0040 Y:0007 P:eNvMxdizc
 
  $84/9C16 BD 04 07    LDA $0704,x[$8B:070A]  A:0080 X:0006 Y:0007 P:envMxdizc
 
  $84/9C16 BD 04 07    LDA $0704,x[$8B:070A]  A:0080 X:0006 Y:0007 P:envMxdizc
Line 14,181: Line 14,232:
 
  $84/9C49 9C CE 11    STZ $11CE  [$8B:11CE]  A:4404 X:FC00 Y:4440 P:eNvMxdizc
 
  $84/9C49 9C CE 11    STZ $11CE  [$8B:11CE]  A:4404 X:FC00 Y:4440 P:eNvMxdizc
 
  $84/9C4C 9C CB 11    STZ $11CB  [$8B:11CB]  A:4404 X:FC00 Y:4440 P:eNvMxdizc
 
  $84/9C4C 9C CB 11    STZ $11CB  [$8B:11CB]  A:4404 X:FC00 Y:4440 P:eNvMxdizc
  $84/9C4F A9 04      LDA #$04               A:4404 X:FC00 Y:4440 P:eNvMxdizc
+
  $84/9C4F A9 04      LDA #$04     ; Setup Loop Counter for VRAM DMAs
  $84/9C51 85 00      STA $00   [$00:0000]  A:4404 X:FC00 Y:4440 P:envMxdizc
+
  $84/9C51 85 00      STA $00
  $84/9C53 A9 80      LDA #$80               A:4404 X:FC00 Y:4440 P:envMxdizc
+
  $84/9C53 A9 80      LDA #$80     ; VRAM DMA Settings ($2115): 16-bit transfer
  $84/9C55 85 0E      STA $0E   [$00:000E]  A:4480 X:FC00 Y:4440 P:eNvMxdizc
+
  $84/9C55 85 0E      STA $0E
  $84/9C57 E2 20      SEP #$20               A:4480 X:FC00 Y:4440 P:eNvMxdizc
+
  $84/9C57 E2 20      SEP #$20     ; A = 8-bit
  $84/9C59 A2 40 00    LDX #$0040             A:4480 X:FC00 Y:4440 P:eNvMxdizc
+
  $84/9C59 A2 40 00    LDX #$0040   ; VRAM DMA Number of bytes to transfer: #$40
  $84/9C5C 86 0C      STX $0C   [$00:000C]  A:4480 X:0040 Y:4440 P:envMxdizc
+
  $84/9C5C 86 0C      STX $0C
  $84/9C5E A4 02      LDY $02   [$00:0002]  A:4480 X:0040 Y:4440 P:envMxdizc
+
  $84/9C5E A4 02      LDY $02       ; Load DMA VRAM Destination from $02
  $84/9C60 A6 04      LDX $04   [$00:0004]  A:4480 X:0040 Y:4440 P:envMxdizc
+
  $84/9C60 A6 04      LDX $04       ; Load DMA Source Address from $04
  $84/9C62 A9 7F      LDA #$7F               A:4480 X:FC00 Y:4440 P:eNvMxdizc
+
  $84/9C62 A9 7F      LDA #$7F     ; DMA Source Bank: $7F
  $84/9C64 22 24 9F 80 JSL $809F24[$80:9F24]   A:447F X:FC00 Y:4440 P:envMxdizc
+
  $84/9C64 22 24 9F 80 JSL $809F24  ; VRAM DMA
  $84/9C68 C6 00      DEC $00   [$00:0000]  A:FC80 X:0000 Y:4440 P:eNvMxdizc
+
  $84/9C68 C6 00      DEC $00       ; Decrement Loop Counter
  $84/9C6A F0 35      BEQ $35   [$9CA1]     A:FC80 X:0000 Y:4440 P:envMxdizc
+
  $84/9C6A F0 35      BEQ $35       ; [$9CA1] Exit if Counter ran out
  $84/9C6C C2 21      REP #$21               A:FC80 X:0000 Y:4440 P:envMxdizc
+
  $84/9C6C C2 21      REP #$21     ; A = 16-bit, Clear Carry
 
  $84/9C6E A5 0C      LDA $0C    [$00:000C]  A:FC80 X:0000 Y:4440 P:envmxdizc
 
  $84/9C6E A5 0C      LDA $0C    [$00:000C]  A:FC80 X:0000 Y:4440 P:envmxdizc
 
  $84/9C70 65 04      ADC $04    [$00:0004]  A:0040 X:0000 Y:4440 P:envmxdizc
 
  $84/9C70 65 04      ADC $04    [$00:0004]  A:0040 X:0000 Y:4440 P:envmxdizc
Line 14,322: Line 14,373:
 
  $84/9E3D 60          RTS
 
  $84/9E3D 60          RTS
  
== $84/9E64 ? ==
+
== $84/9E3E ? ==
 +
 
 +
$84/9E3E DA          PHX                    A:3ABC X:3BBC Y:39BC P:envmxdizc
 +
$84/9E3F A6 06      LDX $06    [$00:0006]  A:3ABC X:3BBC Y:39BC P:envmxdizc
 +
$84/9E41 A5 02      LDA $02    [$00:0002]  A:3ABC X:8000 Y:39BC P:eNvmxdizc
 +
$84/9E43 C9 00 10    CMP #$1000              A:1040 X:8000 Y:39BC P:envmxdizc
 +
$84/9E46 90 0A      BCC $0A    [$9E52]      A:1040 X:8000 Y:39BC P:envmxdizC
 +
$84/9E48 AD 88 05    LDA $0588  [$84:0588]  A:1040 X:8000 Y:39BC P:envmxdizC
 +
$84/9E4B 29 18 00    AND #$0018              A:0902 X:8000 Y:39BC P:envmxdizC
 +
$84/9E4E EB          XBA                    A:0000 X:8000 Y:39BC P:envmxdiZC
 +
$84/9E4F 0A          ASL A                  A:0000 X:8000 Y:39BC P:envmxdiZC
 +
$84/9E50 65 02      ADC $02    [$00:0002]  A:0000 X:8000 Y:39BC P:envmxdiZc
 +
$84/9E52 85 06      STA $06    [$00:0006]  A:1040 X:8000 Y:39BC P:envmxdizc
 +
$84/9E54 AD 88 05    LDA $0588  [$84:0588]  A:1040 X:8000 Y:39BC P:envmxdizc
 +
$84/9E57 29 07 00    AND #$0007              A:0902 X:8000 Y:39BC P:envmxdizc
 +
$84/9E5A 4A          LSR A                  A:0002 X:8000 Y:39BC P:envmxdizc
 +
$84/9E5B 6A          ROR A                  A:0001 X:8000 Y:39BC P:envmxdizc
 +
$84/9E5C 6A          ROR A                  A:0000 X:8000 Y:39BC P:envmxdiZC
 +
$84/9E5D 6A          ROR A                  A:8000 X:8000 Y:39BC P:eNvmxdizc
 +
$84/9E5E 65 06      ADC $06    [$00:0006]  A:4000 X:8000 Y:39BC P:envmxdizc
 +
$84/9E60 86 06      STX $06    [$00:0006]  A:5040 X:8000 Y:39BC P:envmxdizc
 +
$84/9E62 FA          PLX                    A:5040 X:8000 Y:39BC P:envmxdizc
 +
$84/9E63 60          RTS                    A:5040 X:3BBC Y:39BC P:envmxdizc
 +
 
 +
== $84/9E64 ? Use Jump Table ==
  
 
  $84/9E64 8B          PHB          ; Buffer Data Bank on Stack
 
  $84/9E64 8B          PHB          ; Buffer Data Bank on Stack
Line 14,332: Line 14,407:
 
  $84/9E6B AA          TAX
 
  $84/9E6B AA          TAX
 
  $84/9E6C FC 71 9E    JSR ($9E71,x)
 
  $84/9E6C FC 71 9E    JSR ($9E71,x)
  $84/9E6F AB          PLB                     A:0100 X:A800 Y:6300 P:envMxdiZc
+
  $84/9E6F AB          PLB           ; Restore Data Bank from Stack
  $84/9E70 6B          RTL                     A:0100 X:A800 Y:6300 P:eNvMxdizc
+
  $84/9E70 6B          RTL
  
  $84/9E71 81 9E --- Entry #$00 - $9E81
+
  $84/9E71 81 9E --- Entry #$00 - $9E81 - MVN Loop (any byte sized MVNs)
  $84/9E73 A9 9E --- Entry #$01 - $9EA9
+
  $84/9E73 A9 9E --- Entry #$01 - $9EA9 - MVN Loop (#$40 byte MVNs)
 
  $84/9E75 D2 9E --- Entry #$02 - $9ED2
 
  $84/9E75 D2 9E --- Entry #$02 - $9ED2
 
  $84/9E77 D8 9E --- Entry #$03 - $9ED8
 
  $84/9E77 D8 9E --- Entry #$03 - $9ED8
 
  $84/9E79 DE 9E --- Entry #$04 - $9EDE
 
  $84/9E79 DE 9E --- Entry #$04 - $9EDE
  $84/9E7B 53 9F --- Entry #$05 - $9E53
+
  $84/9E7B 53 9F --- Entry #$05 - $9F53
  $84/9E7D 56 9F --- Entry #$06 - $9E56
+
  $84/9E7D 56 9F --- Entry #$06 - $9F56
  $84/9E7F 5C 9F --- Entry #$07 - $9E5C
+
  $84/9E7F 5C 9F --- Entry #$07 - $9F5C
  
== $84/9EA9 ? ==
+
== $84/9E81 ? MVN Loop (any size) ==
  
  $84/9E81 7B          TDC                     A:47D9 X:47D9 Y:45D9 P:envMxdizc
+
  $84/9E81 7B          TDC           ; Clear 16-bit A
 
  $84/9E82 A5 01      LDA $01    [$00:0001]  A:0000 X:47D9 Y:45D9 P:envMxdiZc
 
  $84/9E82 A5 01      LDA $01    [$00:0001]  A:0000 X:47D9 Y:45D9 P:envMxdiZc
  $84/9E84 C2 20      REP #$20               A:0004 X:47D9 Y:45D9 P:envMxdizc
+
  $84/9E84 C2 20      REP #$20     ; A = 16-bit
  $84/9E86 EB          XBA                     A:0004 X:47D9 Y:45D9 P:envmxdizc
+
  $84/9E86 EB          XBA           ; Multiply by 4
  $84/9E87 4A          LSR A                   A:0400 X:47D9 Y:45D9 P:envmxdiZc
+
  $84/9E87 4A          LSR A
  $84/9E88 4A          LSR A                   A:0200 X:47D9 Y:45D9 P:envmxdizc
+
  $84/9E88 4A          LSR A
 
  $84/9E89 85 04      STA $04    [$00:0004]  A:0100 X:47D9 Y:45D9 P:envmxdizc
 
  $84/9E89 85 04      STA $04    [$00:0004]  A:0100 X:47D9 Y:45D9 P:envmxdizc
  $84/9E8B D4 02      PEI ($02)       [$0100]      A:0100 X:47D9 Y:45D9 P:envmxdizc
+
  $84/9E8B D4 02      PEI ($02)     ; Buffer $02/$03 on Stack
 
  $84/9E8D 48          PHA                    A:0100 X:47D9 Y:45D9 P:envmxdizc
 
  $84/9E8D 48          PHA                    A:0100 X:47D9 Y:45D9 P:envmxdizc
  $84/9E8E E2 20      SEP #$20               A:0100 X:47D9 Y:45D9 P:envmxdizc
+
  $84/9E8E E2 20      SEP #$20     ; A = 8-bit
  $84/9E90 20 62 9F    JSR $9F62 [$84:9F62]  A:0100 X:47D9 Y:45D9 P:envMxdizc
+
  $84/9E90 20 62 9F    JSR $9F62     ; Build MVN Command in WRAM and execute it (any size)
  $84/9E93 C2 21      REP #$21               A:0000 X:46D9 Y:6200 P:envMxdiZC
+
  $84/9E93 C2 21      REP #$21     ; A = 16-bit + Clear Carry
 
  $84/9E95 68          PLA                    A:0000 X:46D9 Y:6200 P:envmxdiZc
 
  $84/9E95 68          PLA                    A:0000 X:46D9 Y:6200 P:envmxdiZc
 
  $84/9E96 85 04      STA $04    [$00:0004]  A:0100 X:46D9 Y:6200 P:envmxdizc
 
  $84/9E96 85 04      STA $04    [$00:0004]  A:0100 X:46D9 Y:6200 P:envmxdizc
 
  $84/9E98 68          PLA                    A:0100 X:46D9 Y:6200 P:envmxdizc
 
  $84/9E98 68          PLA                    A:0100 X:46D9 Y:6200 P:envmxdizc
  $84/9E99 D4 02      PEI ($02)       [$0400]      A:0100 X:46D9 Y:6200 P:envmxdizc
+
  $84/9E99 D4 02      PEI ($02) [$0400]      A:0100 X:46D9 Y:6200 P:envmxdizc
 
  $84/9E9B 69 00 02    ADC #$0200              A:0100 X:46D9 Y:6200 P:envmxdizc
 
  $84/9E9B 69 00 02    ADC #$0200              A:0100 X:46D9 Y:6200 P:envmxdizc
 
  $84/9E9E 85 02      STA $02    [$00:0002]  A:0300 X:46D9 Y:6200 P:envmxdizc
 
  $84/9E9E 85 02      STA $02    [$00:0002]  A:0300 X:46D9 Y:6200 P:envmxdizc
  $84/9EA0 E2 20      SEP #$20               A:0300 X:46D9 Y:6200 P:envmxdizc
+
  $84/9EA0 E2 20      SEP #$20     ; A = 8-bit
  $84/9EA2 20 62 9F    JSR $9F62 [$84:9F62]  A:0300 X:46D9 Y:6200 P:envMxdizc
+
  $84/9EA2 20 62 9F    JSR $9F62     ; Build MVN Command in WRAM and execute it (any size)
  $84/9EA5 7A          PLY                     A:0000 X:47D9 Y:6400 P:envMxdiZC
+
  $84/9EA5 7A          PLY           ; Restore $02/$03 from Stack
  $84/9EA6 84 02      STY $02   [$00:0002]  A:0000 X:47D9 Y:0400 P:envMxdizC
+
  $84/9EA6 84 02      STY $02
  $84/9EA8 60          RTS                     A:0000 X:47D9 Y:0400 P:envMxdizC
+
  $84/9EA8 60          RTS
  
== $84/9EA9 ? ==
+
== $84/9EA9 ? MVN Loop (#$40 bytes) ==
  
  $84/9EA9 20 D4 9F    JSR $9FD4 [$84:9FD4]  A:0002 X:0002 Y:AB74 P:envMxdizc
+
$01  contains the Loop counter
  $84/9EAC C2 21      REP #$21               A:A640 X:A640 Y:6040 P:eNvMxdizc
+
$02/3 contain the MVN Destination Address on Bank $7E (minus #$6000)
  $84/9EAE A5 02      LDA $02   [$00:0002]  A:A640 X:A640 Y:6040 P:eNvmxdizc
+
$20/1 contain the MVN Source Address
  $84/9EB0 48          PHA                     A:0000 X:A640 Y:6040 P:envmxdiZc
+
$22  contains the MVN Source Bank
  $84/9EB1 69 00 02    ADC #$0200             A:0000 X:A640 Y:6040 P:envmxdiZc
+
 
  $84/9EB4 85 02      STA $02   [$00:0002]  A:0200 X:A640 Y:6040 P:envmxdizc
+
  $84/9EA9 20 D4 9F    JSR $9FD4     ; Build MVN Command in WRAM and execute it (#$40 bytes)
  $84/9EB6 E2 20      SEP #$20               A:0200 X:A640 Y:6040 P:envmxdizc
+
  $84/9EAC C2 21      REP #$21     ; A = 16-bit + Clear Carry
  $84/9EB8 20 D4 9F    JSR $9FD4 [$84:9FD4]  A:0200 X:A640 Y:6040 P:envMxdizc
+
  $84/9EAE A5 02      LDA $02       ; Load MVN Destination Address
  $84/9EBB C2 21      REP #$21               A:A680 X:A680 Y:6240 P:eNvMxdizc
+
  $84/9EB0 48          PHA           ; Buffer MVN Destination Address on Stack
  $84/9EBD 68          PLA                     A:A680 X:A680 Y:6240 P:eNvmxdizc
+
  $84/9EB1 69 00 02    ADC #$0200   ; Add #$200 to Destination Address
  $84/9EBE 69 40 00    ADC #$0040             A:0000 X:A680 Y:6240 P:envmxdiZc
+
  $84/9EB4 85 02      STA $02       ; Set as Destination Address for second MVN
 +
  $84/9EB6 E2 20      SEP #$20     ; A = 8-bit
 +
  $84/9EB8 20 D4 9F    JSR $9FD4     ; Build MVN Command in WRAM and execute it (#$40 bytes)
 +
  $84/9EBB C2 21      REP #$21     ; A = 16-bit + Clear Carry
 +
  $84/9EBD 68          PLA           ; Restore MVN Destination Address from Stack
 +
  $84/9EBE 69 40 00    ADC #$0040   ; ??? Test if there waz sum latchin' or wut
 
  $84/9EC1 89 00 02    BIT #$0200              A:0040 X:A680 Y:6240 P:envmxdizc
 
  $84/9EC1 89 00 02    BIT #$0200              A:0040 X:A680 Y:6240 P:envmxdizc
  $84/9EC4 F0 03      BEQ $03   [$9EC9]     A:0040 X:A680 Y:6240 P:envmxdiZc
+
  $84/9EC4 F0 03      BEQ $03       ; [$9EC9]
 
;code is missing here
 
;code is missing here
  $84/9EC9 85 02      STA $02   [$00:0002]  A:0040 X:A680 Y:6240 P:envmxdiZc
+
  $84/9EC9 85 02      STA $02       ; Store MVN Destination Address
  $84/9ECB E2 20      SEP #$20               A:0040 X:A680 Y:6240 P:envmxdiZc
+
  $84/9ECB E2 20      SEP #$20     ; A = 8-bit
  $84/9ECD C6 01      DEC $01   [$00:0001]  A:0040 X:A680 Y:6240 P:envMxdiZc
+
  $84/9ECD C6 01      DEC $01       ; Decrement Loop Counter
  $84/9ECF D0 D8      BNE $D8   [$9EA9]     A:0040 X:A680 Y:6240 P:envMxdizc
+
  $84/9ECF D0 D8      BNE $D8       ; [$9EA9] Loop if Counter hasn't reached 0
  $84/9ED1 60          RTS                     A:0100 X:A800 Y:6300 P:envMxdiZc
+
  $84/9ED1 60          RTS
  
 
== $84/9ED2 ? ==
 
== $84/9ED2 ? ==
  
 
  $84/9ED2 20 06 A2    JSR $A206  [$84:A206]  A:0004 X:0004 Y:AB7A P:envMxdizc
 
  $84/9ED2 20 06 A2    JSR $A206  [$84:A206]  A:0004 X:0004 Y:AB7A P:envMxdizc
  $84/9ED5 4C 81 9E    JMP $9E81  [$84:9E81]  A:47D9 X:47D9 Y:45D9 P:envMxdizc
+
  $84/9ED5 4C 81 9E    JMP $9E81     ; MVN Loop (any size)
 +
 
 +
== $84/9EDE ? ==
 +
 
 +
$84/9EDE 7B          TDC                    A:000A X:000A Y:ACDD P:envMxdizc
 +
$84/9EDF A5 01      LDA $01    [$00:0001]  A:0000 X:000A Y:ACDD P:envMxdiZc
 +
$84/9EE1 C2 20      REP #$20                A:0004 X:000A Y:ACDD P:envMxdizc
 +
$84/9EE3 EB          XBA                    A:0004 X:000A Y:ACDD P:envmxdizc
 +
$84/9EE4 4A          LSR A                  A:0400 X:000A Y:ACDD P:envmxdiZc
 +
$84/9EE5 4A          LSR A                  A:0200 X:000A Y:ACDD P:envmxdizc
 +
$84/9EE6 85 04      STA $04    [$00:0004]  A:0100 X:000A Y:ACDD P:envmxdizc
 +
$84/9EE8 C2 20      REP #$20                A:0100 X:000A Y:ACDD P:envmxdizc
 +
$84/9EEA A5 02      LDA $02    [$00:0002]  A:0100 X:000A Y:ACDD P:envmxdizc
 +
$84/9EEC 29 FF 01    AND #$01FF              A:0C00 X:000A Y:ACDD P:envmxdizc
 +
$84/9EEF 49 FF 01    EOR #$01FF              A:0000 X:000A Y:ACDD P:envmxdiZc
 +
$84/9EF2 1A          INC A                  A:01FF X:000A Y:ACDD P:envmxdizc
 +
$84/9EF3 C5 04      CMP $04    [$00:0004]  A:0200 X:000A Y:ACDD P:envmxdizc
 +
$84/9EF5 90 02      BCC $02    [$9EF9]      A:0200 X:000A Y:ACDD P:envmxdizC
 +
$84/9EF7 A5 04      LDA $04    [$00:0004]  A:0200 X:000A Y:ACDD P:envmxdizC
 +
$84/9EF9 85 0C      STA $0C    [$00:000C]  A:0100 X:000A Y:ACDD P:envmxdizC
 +
$84/9EFB 18          CLC                    A:0100 X:000A Y:ACDD P:envmxdizC
 +
$84/9EFC 65 20      ADC $20    [$00:0020]  A:0100 X:000A Y:ACDD P:envmxdizc
 +
$84/9EFE 90 0B      BCC $0B    [$9F0B]      A:C100 X:000A Y:ACDD P:eNvmxdizc
 +
$84/9F0B E2 20      SEP #$20                A:C100 X:000A Y:ACDD P:eNvmxdizc
 +
$84/9F0D 8B          PHB                    A:C100 X:000A Y:ACDD P:eNvMxdizc
 +
$84/9F0E A5 22      LDA $22    [$00:0022]  A:C100 X:000A Y:ACDD P:eNvMxdizc
 +
$84/9F10 85 AE      STA $AE    [$00:00AE]  A:C1BC X:000A Y:ACDD P:eNvMxdizc
 +
$84/9F12 A9 7E      LDA #$7E                A:C1BC X:000A Y:ACDD P:eNvMxdizc
 +
$84/9F14 85 AD      STA $AD    [$00:00AD]  A:C17E X:000A Y:ACDD P:envMxdizc
 +
$84/9F16 A9 54      LDA #$54                A:C17E X:000A Y:ACDD P:envMxdizc
 +
$84/9F18 85 AC      STA $AC    [$00:00AC]  A:C154 X:000A Y:ACDD P:envMxdizc
 +
$84/9F1A A9 60      LDA #$60                A:C154 X:000A Y:ACDD P:envMxdizc
 +
$84/9F1C 85 AF      STA $AF    [$00:00AF]  A:C160 X:000A Y:ACDD P:envMxdizc
 +
$84/9F1E C2 21      REP #$21                A:C160 X:000A Y:ACDD P:envMxdizc
 +
  $84/9F20 A5 02      LDA $02    [$00:0002]  A:C160 X:000A Y:ACDD P:envmxdizc
 +
$84/9F22 69 00 60    ADC #$6000              A:0C00 X:000A Y:ACDD P:envmxdizc
 +
$84/9F25 A8          TAY                    A:6C00 X:000A Y:ACDD P:envmxdizc
 +
$84/9F26 A5 0C      LDA $0C    [$00:000C]  A:6C00 X:000A Y:6C00 P:envmxdizc
 +
$84/9F28 3A          DEC A                  A:0100 X:000A Y:6C00 P:envmxdizc
 +
$84/9F29 A6 20      LDX $20    [$00:0020]  A:00FF X:000A Y:6C00 P:envmxdizc
 +
$84/9F2B 20 AC 00    JSR $00AC  [$84:00AC]  A:00FF X:C000 Y:6C00 P:eNvmxdizc
 +
$84/9F2E E2 20      SEP #$20                A:FFFF X:C100 Y:6D00 P:eNvmxdizc
 +
$84/9F30 AB          PLB                    A:FFFF X:C100 Y:6D00 P:eNvMxdizc
 +
$84/9F31 C2 21      REP #$21                A:FFFF X:C100 Y:6D00 P:eNvMxdizc
 +
$84/9F33 A5 0C      LDA $0C    [$00:000C]  A:FFFF X:C100 Y:6D00 P:eNvmxdizc
 +
$84/9F35 65 20      ADC $20    [$00:0020]  A:0100 X:C100 Y:6D00 P:envmxdizc
 +
$84/9F37 90 05      BCC $05    [$9F3E]      A:C100 X:C100 Y:6D00 P:eNvmxdizc
 +
$84/9F3E 85 20      STA $20    [$00:0020]  A:C100 X:C100 Y:6D00 P:eNvmxdizc
 +
$84/9F40 18          CLC                    A:C100 X:C100 Y:6D00 P:eNvmxdizc
 +
$84/9F41 A5 0C      LDA $0C    [$00:000C]  A:C100 X:C100 Y:6D00 P:eNvmxdizc
 +
$84/9F43 65 02      ADC $02    [$00:0002]  A:0100 X:C100 Y:6D00 P:envmxdizc
 +
$84/9F45 85 02      STA $02    [$00:0002]  A:0D00 X:C100 Y:6D00 P:envmxdizc
 +
$84/9F47 A5 04      LDA $04    [$00:0004]  A:0D00 X:C100 Y:6D00 P:envmxdizc
 +
$84/9F49 38          SEC                    A:0100 X:C100 Y:6D00 P:envmxdizc
 +
$84/9F4A E5 0C      SBC $0C    [$00:000C]  A:0100 X:C100 Y:6D00 P:envmxdizC
 +
$84/9F4C 85 04      STA $04    [$00:0004]  A:0000 X:C100 Y:6D00 P:envmxdiZC
 +
$84/9F4E E2 20      SEP #$20                A:0000 X:C100 Y:6D00 P:envmxdiZC
 +
$84/9F50 D0 96      BNE $96    [$9EE8]      A:0000 X:C100 Y:6D00 P:envMxdiZC
 +
$84/9F52 60          RTS                    A:0000 X:C100 Y:6D00 P:envMxdiZC
 +
 
 +
 
 +
== $84/9F53 ? ==
 +
 
 +
$84/9F53 4C DE 9E    JMP $9EDE  [$84:9EDE]  A:000A X:000A Y:ACDD P:envMxdizc
 +
 
 +
== $84/9F56 ? ==
 +
 
 +
$84/9F56 20 4C A2    JSR $A24C  [$84:A24C]  A:000C X:000C Y:ACE7 P:envMxdizc
 +
$84/9F59 4C DE 9E    JMP $9EDE  [$84:9EDE]  A:4202 X:423C Y:41BC P:envMxdizc
 +
 
 +
== $84/9F62 Build MVN Command in WRAM and execute it (any size) ==
  
== $84/9F62 ? ==
+
Other than the MVN Command at $84/9FD4, this one isn't bound to #$40 bytes, but can do any number of bytes.
 +
 
 +
$02/3 contain the Destination Address on Bank $7E (minus #$6000)
 +
$0C/D contain the ACTUAL number of bytes to transfer (DEC A for MVN gets done later)
 +
$20/1 contain the Source Address
 +
$22  contains the Source Bank
  
 
  $84/9F62 C2 20      REP #$20                A:0100 X:47D9 Y:45D9 P:envMxdizc
 
  $84/9F62 C2 20      REP #$20                A:0100 X:47D9 Y:45D9 P:envMxdizc
Line 14,413: Line 14,568:
 
;code is missing here
 
;code is missing here
 
  $84/9F85 E2 20      SEP #$20                A:46D9 X:47D9 Y:45D9 P:envmxdizc
 
  $84/9F85 E2 20      SEP #$20                A:46D9 X:47D9 Y:45D9 P:envmxdizc
  $84/9F87 8B          PHB                     A:46D9 X:47D9 Y:45D9 P:envMxdizc
+
  $84/9F87 8B          PHB           ; Buffer Data Bank on Stack
  $84/9F88 A5 22      LDA $22   [$00:0022]  A:46D9 X:47D9 Y:45D9 P:envMxdizc
+
  $84/9F88 A5 22      LDA $22       ; Set $22 as MVN Source Bank
  $84/9F8A 85 AE      STA $AE   [$00:00AE]  A:467E X:47D9 Y:45D9 P:envMxdizc
+
  $84/9F8A 85 AE      STA $AE
  $84/9F8C A9 7E      LDA #$7E               A:467E X:47D9 Y:45D9 P:envMxdizc
+
  $84/9F8C A9 7E      LDA #$7E     ; Set Bank $7E as MVN Destination Bank
  $84/9F8E 85 AD      STA $AD   [$00:00AD]  A:467E X:47D9 Y:45D9 P:envMxdizc
+
  $84/9F8E 85 AD      STA $AD
  $84/9F90 A9 54      LDA #$54               A:467E X:47D9 Y:45D9 P:envMxdizc
+
  $84/9F90 A9 54      LDA #$54     ; #$54 = MVN
  $84/9F92 85 AC      STA $AC   [$00:00AC]  A:4654 X:47D9 Y:45D9 P:envMxdizc
+
  $84/9F92 85 AC      STA $AC
  $84/9F94 A9 60      LDA #$60               A:4654 X:47D9 Y:45D9 P:envMxdizc
+
  $84/9F94 A9 60      LDA #$60     ; #$60 = RTS
  $84/9F96 85 AF      STA $AF   [$00:00AF]  A:4660 X:47D9 Y:45D9 P:envMxdizc
+
  $84/9F96 85 AF      STA $AF
  $84/9F98 C2 21      REP #$21               A:4660 X:47D9 Y:45D9 P:envMxdizc
+
  $84/9F98 C2 21      REP #$21     ; A = 16-bit + Clear Carry
  $84/9F9A A5 02      LDA $02   [$00:0002]  A:4660 X:47D9 Y:45D9 P:envmxdizc
+
  $84/9F9A A5 02      LDA $02       ; Load Destination Address
  $84/9F9C 69 00 60    ADC #$6000             A:0100 X:47D9 Y:45D9 P:envmxdizc
+
  $84/9F9C 69 00 60    ADC #$6000   ; Add #$6000 to Destination Address
  $84/9F9F A8          TAY                     A:6100 X:47D9 Y:45D9 P:envmxdizc
+
  $84/9F9F A8          TAY           ; Transfer in Y (MVN Destination Address)
  $84/9FA0 A5 0C      LDA $0C   [$00:000C]  A:6100 X:47D9 Y:6100 P:envmxdizc
+
  $84/9FA0 A5 0C      LDA $0C       ; Load Number of Bytes to do for MVN
  $84/9FA2 3A          DEC A                   A:0100 X:47D9 Y:6100 P:envmxdizc
+
  $84/9FA2 3A          DEC A         ; Decrement because MVN does always one more than told
  $84/9FA3 A6 20      LDX $20   [$00:0020]  A:00FF X:47D9 Y:6100 P:envmxdizc
+
  $84/9FA3 A6 20      LDX $20       ; Load MVN Source Address
  $84/9FA5 20 AC 00    JSR $00AC [$84:00AC]  A:00FF X:45D9 Y:6100 P:envmxdizc
+
  $84/9FA5 20 AC 00    JSR $00AC     ; EXECUTE MVN COMMAND
  $84/9FA8 E2 20      SEP #$20               A:FFFF X:46D9 Y:6200 P:envmxdizc
+
  $84/9FA8 E2 20      SEP #$20     ; this line could be removed?
  $84/9FAA AB          PLB                     A:FFFF X:46D9 Y:6200 P:envMxdizc
+
  $84/9FAA AB          PLB           ; Restore Data Bank
  $84/9FAB C2 21      REP #$21               A:FFFF X:46D9 Y:6200 P:eNvMxdizc
+
  $84/9FAB C2 21      REP #$21     ; this line could be removed? Replace with CLC?
 
  $84/9FAD A5 0C      LDA $0C    [$00:000C]  A:FFFF X:46D9 Y:6200 P:eNvmxdizc
 
  $84/9FAD A5 0C      LDA $0C    [$00:000C]  A:FFFF X:46D9 Y:6200 P:eNvmxdizc
 
  $84/9FAF 65 20      ADC $20    [$00:0020]  A:0100 X:46D9 Y:6200 P:envmxdizc
 
  $84/9FAF 65 20      ADC $20    [$00:0020]  A:0100 X:46D9 Y:6200 P:envmxdizc
 
  $84/9FB1 90 05      BCC $05    [$9FB8]      A:46D9 X:46D9 Y:6200 P:envmxdizc
 
  $84/9FB1 90 05      BCC $05    [$9FB8]      A:46D9 X:46D9 Y:6200 P:envmxdizc
 +
;code missing here
 
  $84/9FB8 85 20      STA $20    [$00:0020]  A:46D9 X:46D9 Y:6200 P:envmxdizc
 
  $84/9FB8 85 20      STA $20    [$00:0020]  A:46D9 X:46D9 Y:6200 P:envmxdizc
 
  $84/9FBA A5 0C      LDA $0C    [$00:000C]  A:46D9 X:46D9 Y:6200 P:envmxdizc
 
  $84/9FBA A5 0C      LDA $0C    [$00:000C]  A:46D9 X:46D9 Y:6200 P:envmxdizc
Line 14,451: Line 14,607:
 
  $84/9FD3 60          RTS                    A:0000 X:46D9 Y:6200 P:envMxdiZC
 
  $84/9FD3 60          RTS                    A:0000 X:46D9 Y:6200 P:envMxdiZC
  
== $84/9FD4 ? Build MVN Command in WRAM and execute it ==
+
== $84/9FD4 Build MVN Command in WRAM and execute it (#$40 bytes)==
 +
 
 +
Transfers #$40 bytes of data from wherever to $7E/6xxx
 +
 
 +
$02/3 contain the Destination Address on Bank $7E (minus #$6000)
 +
$20/1 contain the Source Address
 +
$22  contains the Source Bank
  
 
  $84/9FD4 8B          PHB          ; Buffer Data Bank on Stack
 
  $84/9FD4 8B          PHB          ; Buffer Data Bank on Stack
  $84/9FD5 A5 22      LDA $22   [$00:0022]  A:0002 X:0002 Y:AB74 P:envMxdizc
+
  $84/9FD5 A5 22      LDA $22       ; Set $22 as MVN Source Bank
  $84/9FD7 85 AE      STA $AE   [$00:00AE]  A:00BA X:0002 Y:AB74 P:eNvMxdizc
+
  $84/9FD7 85 AE      STA $AE
  $84/9FD9 A9 7E      LDA #$7E               A:00BA X:0002 Y:AB74 P:eNvMxdizc
+
  $84/9FD9 A9 7E      LDA #$7E     ; Set Bank $7E as MVN Destination Bank
  $84/9FDB 85 AD      STA $AD   [$00:00AD]  A:007E X:0002 Y:AB74 P:envMxdizc
+
  $84/9FDB 85 AD      STA $AD
 
  $84/9FDD A9 54      LDA #$54      ; #$54 = MVN
 
  $84/9FDD A9 54      LDA #$54      ; #$54 = MVN
 
  $84/9FDF 85 AC      STA $AC
 
  $84/9FDF 85 AC      STA $AC
 
  $84/9FE1 A9 60      LDA #$60      ; #$60 = RTS
 
  $84/9FE1 A9 60      LDA #$60      ; #$60 = RTS
 
  $84/9FE3 85 AF      STA $AF
 
  $84/9FE3 85 AF      STA $AF
  $84/9FE5 C2 21      REP #$21               A:0060 X:0002 Y:AB74 P:envMxdizc
+
  $84/9FE5 C2 21      REP #$21     ; A = 16-bit + Clear Carry
  $84/9FE7 A5 02      LDA $02   [$00:0002]  A:0060 X:0002 Y:AB74 P:envmxdizc
+
  $84/9FE7 A5 02      LDA $02       ; Load Destination Address
  $84/9FE9 69 00 60    ADC #$6000             A:0000 X:0002 Y:AB74 P:envmxdiZc
+
  $84/9FE9 69 00 60    ADC #$6000   ; Add #$6000 to Destination Address
  $84/9FEC A8          TAY                     A:6000 X:0002 Y:AB74 P:envmxdizc
+
  $84/9FEC A8          TAY           ; Transfer in Y (MVN Destination Address)
  $84/9FED A9 3F 00    LDA #$003F             A:6000 X:0002 Y:6000 P:envmxdizc
+
  $84/9FED A9 3F 00    LDA #$003F   ; Transfer #$40 bytes via MVN
  $84/9FF0 A6 20      LDX $20   [$00:0020]  A:003F X:0002 Y:6000 P:envmxdizc
+
  $84/9FF0 A6 20      LDX $20       ; Load MVN Source Address
  $84/9FF2 20 AC 00    JSR $00AC    ; Execute MVN-Command
+
  $84/9FF2 20 AC 00    JSR $00AC    ; EXECUTE MVN-COMMAND
  $84/9FF5 E2 20      SEP #$20      ; This line could be removed?!?!?!?!?!
+
  $84/9FF5 E2 20      SEP #$20      ; this line could be removed?
 
  $84/9FF7 AB          PLB          ; Restore Data Bank
 
  $84/9FF7 AB          PLB          ; Restore Data Bank
  $84/9FF8 C2 21      REP #$21               A:FFFF X:A640 Y:6040 P:eNvMxdizc
+
  $84/9FF8 C2 21      REP #$21     ; this line could be removed? Replace with CLC?
  $84/9FFA A9 40 00    LDA #$0040             A:FFFF X:A640 Y:6040 P:eNvmxdizc
+
  $84/9FFA A9 40 00    LDA #$0040   ; Add #$40 to Source Address
  $84/9FFD 65 20      ADC $20   [$00:0020]  A:0040 X:A640 Y:6040 P:envmxdizc
+
  $84/9FFD 65 20      ADC $20
  $84/9FFF 90 05      BCC $05   [$A006]     A:A640 X:A640 Y:6040 P:eNvmxdizc
+
  $84/9FFF 90 05      BCC $05       ; [$A006] Branch if no Bank Latch has occurred
  $84/A006 85 20      STA $20   [$00:0020]  A:A640 X:A640 Y:6040 P:eNvmxdizc
+
;code is missing here
  $84/A008 E2 20      SEP #$20               A:A640 X:A640 Y:6040 P:eNvmxdizc
+
  $84/A006 85 20      STA $20       ; Store back incremented Source Address
  $84/A00A 60          RTS                     A:A640 X:A640 Y:6040 P:eNvMxdizc
+
  $84/A008 E2 20      SEP #$20     ; A = 8-bit
 +
  $84/A00A 60          RTS
  
 
== $84/A00B ? ==
 
== $84/A00B ? ==
Line 14,501: Line 14,664:
 
  $84/A026 89 A1 --- Entry #$07 - $A189
 
  $84/A026 89 A1 --- Entry #$07 - $A189
  
== $84/A206 ? ==
+
== $84/A206 ? MVN Loop (any size) preparation ==
  
  $84/A206 A6 20      LDX $20   [$00:0020]  A:0004 X:0004 Y:AB7A P:envMxdizc
+
  $84/A206 A6 20      LDX $20       ; Buffer $20 in X
  $84/A208 A4 5C      LDY $5C   [$00:005C]  A:0004 X:0A98 Y:AB7A P:envMxdizc
+
  $84/A208 A4 5C      LDY $5C       ; Set $20 (MVN Source Address) to $5C
  $84/A20A 84 20      STY $20   [$00:0020]  A:0004 X:0A98 Y:45D9 P:envMxdizc
+
  $84/A20A 84 20      STY $20
  $84/A20C A9 7E      LDA #$7E               A:0004 X:0A98 Y:45D9 P:envMxdizc
+
  $84/A20C A9 7E      LDA #$7E     ; MVN Source Bank: $7E
  $84/A20E 85 22      STA $22   [$00:0022]  A:007E X:0A98 Y:45D9 P:envMxdizc
+
  $84/A20E 85 22      STA $22
 
  $84/A210 A5 01      LDA $01    [$00:0001]  A:007E X:0A98 Y:45D9 P:envMxdizc
 
  $84/A210 A5 01      LDA $01    [$00:0001]  A:007E X:0A98 Y:45D9 P:envMxdizc
  $84/A212 85 00      STA $00   [$00:0000]  A:0004 X:0A98 Y:45D9 P:envMxdizc
+
  $84/A212 85 00      STA $00       ; Setup as Loop Counter
 
  $84/A214 A0 02 80    LDY #$8002              A:0004 X:0A98 Y:45D9 P:envMxdizc
 
  $84/A214 A0 02 80    LDY #$8002              A:0004 X:0A98 Y:45D9 P:envMxdizc
 
  $84/A217 84 23      STY $23    [$00:0023]  A:0004 X:0A98 Y:8002 P:eNvMxdizc
 
  $84/A217 84 23      STY $23    [$00:0023]  A:0004 X:0A98 Y:8002 P:eNvMxdizc
Line 14,530: Line 14,693:
 
  $84/A238 65 20      ADC $20    [$00:0020]  A:0080 X:0A9B Y:0080 P:envmxdizc
 
  $84/A238 65 20      ADC $20    [$00:0020]  A:0080 X:0A9B Y:0080 P:envmxdizc
 
  $84/A23A 85 20      STA $20    [$00:0020]  A:4659 X:0A9B Y:0080 P:envmxdizc
 
  $84/A23A 85 20      STA $20    [$00:0020]  A:4659 X:0A9B Y:0080 P:envmxdizc
  $84/A23C E2 20      SEP #$20               A:4659 X:0A9B Y:0080 P:envmxdizc
+
  $84/A23C E2 20      SEP #$20     ; A = 8-bit
  $84/A23E C6 00      DEC $00   [$00:0000]  A:4659 X:0A9B Y:0080 P:envMxdizc
+
  $84/A23E C6 00      DEC $00       ; Decrement Loop Counter
  $84/A240 D0 D2      BNE $D2   [$A214]     A:4659 X:0A9B Y:0080 P:envMxdizc
+
  $84/A240 D0 D2      BNE $D2       ; [$A214] Loop until Counter ran out
 
  $84/A242 A6 20      LDX $20    [$00:0020]  A:47D9 X:0AA4 Y:0080 P:envMxdiZc
 
  $84/A242 A6 20      LDX $20    [$00:0020]  A:47D9 X:0AA4 Y:0080 P:envMxdiZc
 
  $84/A244 A4 5C      LDY $5C    [$00:005C]  A:47D9 X:47D9 Y:0080 P:envMxdizc
 
  $84/A244 A4 5C      LDY $5C    [$00:005C]  A:47D9 X:47D9 Y:0080 P:envMxdizc
Line 14,538: Line 14,701:
 
  $84/A248 86 5C      STX $5C    [$00:005C]  A:47D9 X:47D9 Y:45D9 P:envMxdizc
 
  $84/A248 86 5C      STX $5C    [$00:005C]  A:47D9 X:47D9 Y:45D9 P:envMxdizc
 
  $84/A24A 18          CLC                    A:47D9 X:47D9 Y:45D9 P:envMxdizc
 
  $84/A24A 18          CLC                    A:47D9 X:47D9 Y:45D9 P:envMxdizc
  $84/A24B 60          RTS                    A:47D9 X:47D9 Y:45D9 P:envMxdizc
+
  $84/A24B 60          RTS
 +
 
 +
== $84/A24C ? ==
 +
 
 +
$84/A24C A5 01      LDA $01    [$00:0001]  A:000C X:000C Y:ACE7 P:envMxdizc
 +
$84/A24E 48          PHA                    A:0002 X:000C Y:ACE7 P:envMxdizc
 +
$84/A24F 1A          INC A                  A:0002 X:000C Y:ACE7 P:envMxdizc
 +
$84/A250 4A          LSR A                  A:0003 X:000C Y:ACE7 P:envMxdizc
 +
$84/A251 85 01      STA $01    [$00:0001]  A:0001 X:000C Y:ACE7 P:envMxdizC
 +
$84/A253 20 06 A2    JSR $A206    ; MVN Loop (any size) preparation
 +
$84/A256 68          PLA                    A:423C X:423C Y:41BC P:envMxdizc
 +
$84/A257 85 01      STA $01    [$00:0001]  A:4202 X:423C Y:41BC P:envMxdizc
 +
$84/A259 60          RTS                    A:4202 X:423C Y:41BC P:envMxdizc
  
 
== $84/A331 ? ==
 
== $84/A331 ? ==
Line 14,609: Line 14,784:
 
  $84/A3C3 BF 42 A6 84 LDA $84A642,x[$84:A712] A:0021 X:00D0 Y:0001 P:envMxdizc
 
  $84/A3C3 BF 42 A6 84 LDA $84A642,x[$84:A712] A:0021 X:00D0 Y:0001 P:envMxdizc
 
  $84/A3C7 85 1D      STA $1D    [$00:001D]  A:0000 X:00D0 Y:0001 P:envMxdiZc
 
  $84/A3C7 85 1D      STA $1D    [$00:001D]  A:0000 X:00D0 Y:0001 P:envMxdiZc
  $84/A3C9 8B          PHB                     A:0000 X:00D0 Y:0001 P:envMxdiZc
+
  $84/A3C9 8B          PHB           ; Buffer Data Bank on Stack
  $84/A3CA A9 84      LDA #$84               A:0000 X:00D0 Y:0001 P:envMxdiZc
+
  $84/A3CA A9 84      LDA #$84     ; Set Data Bank to #$84
  $84/A3CC 48          PHA                     A:0084 X:00D0 Y:0001 P:eNvMxdizc
+
  $84/A3CC 48          PHA
  $84/A3CD AB          PLB                     A:0084 X:00D0 Y:0001 P:eNvMxdizc
+
  $84/A3CD AB          PLB
  $84/A3CE 7B          TDC                     A:0084 X:00D0 Y:0001 P:eNvMxdizc
+
  $84/A3CE 7B          TDC           ; Clear 16-bit A
 
  $84/A3CF A5 1F      LDA $1F    [$00:001F]  A:0000 X:00D0 Y:0001 P:envMxdiZc
 
  $84/A3CF A5 1F      LDA $1F    [$00:001F]  A:0000 X:00D0 Y:0001 P:envMxdiZc
  $84/A3D1 C2 20      REP #$20               A:0000 X:00D0 Y:0001 P:envMxdiZc
+
  $84/A3D1 C2 20      REP #$20     ; A = 16-bit
  $84/A3D3 0A          ASL A                   A:0000 X:00D0 Y:0001 P:envmxdiZc
+
  $84/A3D3 0A          ASL A         ; Multiply by 2 and use it as Load Index
  $84/A3D4 A8          TAY                     A:0000 X:00D0 Y:0001 P:envmxdiZc
+
  $84/A3D4 A8          TAY
 
  $84/A3D5 B9 53 A9    LDA $A953,y[$84:A953]  A:0000 X:00D0 Y:0000 P:envmxdiZc
 
  $84/A3D5 B9 53 A9    LDA $A953,y[$84:A953]  A:0000 X:00D0 Y:0000 P:envmxdiZc
 
  $84/A3D8 A8          TAY                    A:AB6E X:00D0 Y:0000 P:eNvmxdizc
 
  $84/A3D8 A8          TAY                    A:AB6E X:00D0 Y:0000 P:eNvmxdizc
 
  $84/A3D9 64 10      STZ $10    [$00:0010]  A:AB6E X:00D0 Y:AB6E P:eNvmxdizc
 
  $84/A3D9 64 10      STZ $10    [$00:0010]  A:AB6E X:00D0 Y:AB6E P:eNvmxdizc
 
  $84/A3DB 64 12      STZ $12    [$00:0012]  A:AB6E X:00D0 Y:AB6E P:eNvmxdizc
 
  $84/A3DB 64 12      STZ $12    [$00:0012]  A:AB6E X:00D0 Y:AB6E P:eNvmxdizc
  $84/A3DD E2 20      SEP #$20               A:AB6E X:00D0 Y:AB6E P:eNvmxdizc
+
  $84/A3DD E2 20      SEP #$20     ; A = 8-bit
 
  $84/A3DF 64 14      STZ $14    [$00:0014]  A:AB6E X:00D0 Y:AB6E P:eNvMxdizc
 
  $84/A3DF 64 14      STZ $14    [$00:0014]  A:AB6E X:00D0 Y:AB6E P:eNvMxdizc
  $84/A3E1 C2 20      REP #$20               A:AB6E X:00D0 Y:AB6E P:eNvMxdizc
+
  $84/A3E1 C2 20      REP #$20     ; A = 16-bit
 
  $84/A3E3 B9 00 00    LDA $0000,y[$84:AB6E]  A:AB6E X:00D0 Y:AB6E P:eNvmxdizc
 
  $84/A3E3 B9 00 00    LDA $0000,y[$84:AB6E]  A:AB6E X:00D0 Y:AB6E P:eNvmxdizc
 
  $84/A3E6 85 00      STA $00    [$00:0000]  A:8086 X:00D0 Y:AB6E P:eNvmxdizc
 
  $84/A3E6 85 00      STA $00    [$00:0000]  A:8086 X:00D0 Y:AB6E P:eNvmxdizc
  $84/A3E8 E2 20      SEP #$20               A:8086 X:00D0 Y:AB6E P:eNvmxdizc
+
  $84/A3E8 E2 20      SEP #$20     ; A = 8-bit
 
  $84/A3EA C9 80      CMP #$80                A:8086 X:00D0 Y:AB6E P:eNvMxdizc
 
  $84/A3EA C9 80      CMP #$80                A:8086 X:00D0 Y:AB6E P:eNvMxdizc
 
  $84/A3EC B0 5A      BCS $5A    [$A448]      A:8086 X:00D0 Y:AB6E P:envMxdizC
 
  $84/A3EC B0 5A      BCS $5A    [$A448]      A:8086 X:00D0 Y:AB6E P:envMxdizC
Line 14,634: Line 14,809:
 
  $84/A3F2 B0 38      BCS $38    [$A42C]      A:0402 X:000E Y:B5AF P:envMxdiZC
 
  $84/A3F2 B0 38      BCS $38    [$A42C]      A:0402 X:000E Y:B5AF P:envMxdiZC
 
;code is missing here
 
;code is missing here
  $84/A42C C2 21      REP #$21               A:0402 X:000E Y:B5AF P:envMxdiZC
+
  $84/A42C C2 21      REP #$21     ; A = 16-bit + Clear Carry
 
  $84/A42E B9 02 00    LDA $0002,y[$84:B5B1]  A:0402 X:000E Y:B5AF P:envmxdiZc
 
  $84/A42E B9 02 00    LDA $0002,y[$84:B5B1]  A:0402 X:000E Y:B5AF P:envmxdiZc
 
  $84/A431 65 10      ADC $10    [$00:0010]  A:1208 X:000E Y:B5AF P:envmxdizc
 
  $84/A431 65 10      ADC $10    [$00:0010]  A:1208 X:000E Y:B5AF P:envmxdizc
Line 14,641: Line 14,816:
 
  $84/A436 65 20      ADC $20    [$00:0020]  A:2410 X:000E Y:B5AF P:envmxdizc
 
  $84/A436 65 20      ADC $20    [$00:0020]  A:2410 X:000E Y:B5AF P:envmxdizc
 
  $84/A438 85 20      STA $20    [$00:0020]  A:3618 X:000E Y:B5AF P:envmxdizc
 
  $84/A438 85 20      STA $20    [$00:0020]  A:3618 X:000E Y:B5AF P:envmxdizc
  $84/A43A E2 20      SEP #$20               A:3618 X:000E Y:B5AF P:envmxdizc
+
  $84/A43A E2 20      SEP #$20     ; A = 8-bit
 
  $84/A43C 5A          PHY                    A:3618 X:000E Y:B5AF P:envMxdizc
 
  $84/A43C 5A          PHY                    A:3618 X:000E Y:B5AF P:envMxdizc
 
  $84/A43D 22 0B A0 84 JSL $84A00B[$84:A00B]  A:3618 X:000E Y:B5AF P:envMxdizc
 
  $84/A43D 22 0B A0 84 JSL $84A00B[$84:A00B]  A:3618 X:000E Y:B5AF P:envMxdizc
Line 14,684: Line 14,859:
 
  $84/A490 69 B7      ADC #$B7                A:E001 X:0002 Y:AB74 P:eNvMxdizc
 
  $84/A490 69 B7      ADC #$B7                A:E001 X:0002 Y:AB74 P:eNvMxdizc
 
  $84/A492 85 22      STA $22    [$00:0022]  A:E0B8 X:0002 Y:AB74 P:eNvMxdizc
 
  $84/A492 85 22      STA $22    [$00:0022]  A:E0B8 X:0002 Y:AB74 P:eNvMxdizc
  $84/A494 C2 21      REP #$21               A:E0B8 X:0002 Y:AB74 P:eNvMxdizc
+
  $84/A494 C2 21      REP #$21     ; A = 16-bit + Clear Carry
 
  $84/A496 A5 12      LDA $12    [$00:0012]  A:E0B8 X:0002 Y:AB74 P:eNvmxdizc
 
  $84/A496 A5 12      LDA $12    [$00:0012]  A:E0B8 X:0002 Y:AB74 P:eNvmxdizc
 
  $84/A498 65 20      ADC $20    [$00:0020]  A:4600 X:0002 Y:AB74 P:envmxdizc
 
  $84/A498 65 20      ADC $20    [$00:0020]  A:4600 X:0002 Y:AB74 P:envmxdizc
 
  $84/A49A 09 00 80    ORA #$8000              A:2600 X:0002 Y:AB74 P:envmxdizC
 
  $84/A49A 09 00 80    ORA #$8000              A:2600 X:0002 Y:AB74 P:envmxdizC
 
  $84/A49D 85 20      STA $20    [$00:0020]  A:A600 X:0002 Y:AB74 P:eNvmxdizC
 
  $84/A49D 85 20      STA $20    [$00:0020]  A:A600 X:0002 Y:AB74 P:eNvmxdizC
  $84/A49F E2 20      SEP #$20               A:A600 X:0002 Y:AB74 P:eNvmxdizC
+
  $84/A49F E2 20      SEP #$20     ; A = 8-bit
 
  $84/A4A1 A5 14      LDA $14    [$00:0014]  A:A600 X:0002 Y:AB74 P:eNvMxdizC
 
  $84/A4A1 A5 14      LDA $14    [$00:0014]  A:A600 X:0002 Y:AB74 P:eNvMxdizC
 
  $84/A4A3 65 22      ADC $22    [$00:0022]  A:A601 X:0002 Y:AB74 P:envMxdizC
 
  $84/A4A3 65 22      ADC $22    [$00:0022]  A:A601 X:0002 Y:AB74 P:envMxdizC
 
  $84/A4A5 85 22      STA $22    [$00:0022]  A:A6BA X:0002 Y:AB74 P:eNvMxdizc
 
  $84/A4A5 85 22      STA $22    [$00:0022]  A:A6BA X:0002 Y:AB74 P:eNvMxdizc
 
  $84/A4A7 80 10      BRA $10    [$A4B9]      A:A6BA X:0002 Y:AB74 P:eNvMxdizc
 
  $84/A4A7 80 10      BRA $10    [$A4B9]      A:A6BA X:0002 Y:AB74 P:eNvMxdizc
  $84/A4A9 C2 21      REP #$21               A:0402 X:0002 Y:AB7A P:envMxdiZC
+
  $84/A4A9 C2 21      REP #$21     ; A = 16-bit + Clear Carry
 
  $84/A4AB B9 02 00    LDA $0002,y[$84:AB7C]  A:0402 X:0002 Y:AB7A P:envmxdiZc
 
  $84/A4AB B9 02 00    LDA $0002,y[$84:AB7C]  A:0402 X:0002 Y:AB7A P:envmxdiZc
 
  $84/A4AE 65 10      ADC $10    [$00:0010]  A:0280 X:0002 Y:AB7A P:envmxdizc
 
  $84/A4AE 65 10      ADC $10    [$00:0010]  A:0280 X:0002 Y:AB7A P:envmxdizc
Line 14,701: Line 14,876:
 
  $84/A4B3 65 20      ADC $20    [$00:0020]  A:0710 X:0002 Y:AB7A P:envmxdizc
 
  $84/A4B3 65 20      ADC $20    [$00:0020]  A:0710 X:0002 Y:AB7A P:envmxdizc
 
  $84/A4B5 85 20      STA $20    [$00:0020]  A:0A98 X:0002 Y:AB7A P:envmxdizc
 
  $84/A4B5 85 20      STA $20    [$00:0020]  A:0A98 X:0002 Y:AB7A P:envmxdizc
  $84/A4B7 E2 20      SEP #$20               A:0A98 X:0002 Y:AB7A P:envmxdizc
+
  $84/A4B7 E2 20      SEP #$20     ; A = 8-bit
 
  $84/A4B9 5A          PHY                    A:A6BA X:0002 Y:AB74 P:eNvMxdizc
 
  $84/A4B9 5A          PHY                    A:A6BA X:0002 Y:AB74 P:eNvMxdizc
 
  $84/A4BA 22 64 9E 84 JSL $849E64[$84:9E64]  A:A6BA X:0002 Y:AB74 P:eNvMxdizc
 
  $84/A4BA 22 64 9E 84 JSL $849E64[$84:9E64]  A:A6BA X:0002 Y:AB74 P:eNvMxdizc
Line 14,715: Line 14,890:
 
  $84/A4CD C8          INY                    A:4601 X:0002 Y:AB72 P:envMxdizc
 
  $84/A4CD C8          INY                    A:4601 X:0002 Y:AB72 P:envMxdizc
 
  $84/A4CE C8          INY                    A:4601 X:0002 Y:AB73 P:eNvMxdizc
 
  $84/A4CE C8          INY                    A:4601 X:0002 Y:AB73 P:eNvMxdizc
  $84/A4CF 4C 5E A4    JMP $A45E [$84:A45E]  A:4601 X:0002 Y:AB74 P:eNvMxdizc
+
  $84/A4CF 4C 5E A4    JMP $A45E     ; Loop
  $84/A4D2 C2 21      REP #$21               A:86FF X:4DD9 Y:AB92 P:envMxdiZC
+
  $84/A4D2 C2 21      REP #$21     ; A = 16-bit + Clear Carry
 
  $84/A4D4 A9 20 01    LDA #$0120              A:86FF X:4DD9 Y:AB92 P:envmxdiZc
 
  $84/A4D4 A9 20 01    LDA #$0120              A:86FF X:4DD9 Y:AB92 P:envmxdiZc
 
  $84/A4D7 65 3F      ADC $3F    [$00:003F]  A:0120 X:4DD9 Y:AB92 P:envmxdizc
 
  $84/A4D7 65 3F      ADC $3F    [$00:003F]  A:0120 X:4DD9 Y:AB92 P:envmxdizc
Line 14,722: Line 14,897:
 
  $84/A4DC 85 3F      STA $3F    [$00:003F]  A:1040 X:4DD9 Y:AB92 P:envmxdizc
 
  $84/A4DC 85 3F      STA $3F    [$00:003F]  A:1040 X:4DD9 Y:AB92 P:envmxdizc
 
  $84/A4DE C9 01 20    CMP #$2001              A:1040 X:4DD9 Y:AB92 P:envmxdizc
 
  $84/A4DE C9 01 20    CMP #$2001              A:1040 X:4DD9 Y:AB92 P:envmxdizc
  $84/A4E1 E2 20      SEP #$20               A:1040 X:4DD9 Y:AB92 P:eNvmxdizc
+
  $84/A4E1 E2 20      SEP #$20     ; A = 8-bit
  $84/A4E3 90 04      BCC $04   [$A4E9]     A:1040 X:4DD9 Y:AB92 P:eNvMxdizc
+
  $84/A4E3 90 04      BCC $04       ; [$A4E9] Exit if less
 
;code is missing here
 
;code is missing here
  $84/A4E9 AB          PLB                     A:1040 X:4DD9 Y:AB92 P:eNvMxdizc
+
  $84/A4E9 AB          PLB           ; Restore Data Bank from Stack
  $84/A4EA 6B          RTL                     A:1040 X:4DD9 Y:AB92 P:eNvMxdizc
+
  $84/A4EA 6B          RTL
  
 
== $84/A4EB ? ==
 
== $84/A4EB ? ==
Line 14,749: Line 14,924:
 
== $84/A506 ? ==
 
== $84/A506 ? ==
  
  $84/A506 7B          TDC                     A:0000 X:0000 Y:AB6F P:envMxdiZC
+
  $84/A506 7B          TDC           ; Clear 16-bit A
 
  $84/A507 A5 01      LDA $01    [$00:0001]  A:0000 X:0000 Y:AB6F P:envMxdiZC
 
  $84/A507 A5 01      LDA $01    [$00:0001]  A:0000 X:0000 Y:AB6F P:envMxdiZC
  $84/A509 EB          XBA                     A:0002 X:0000 Y:AB6F P:envMxdizC
+
  $84/A509 EB          XBA           ; Multiply by #$20
  $84/A50A C2 20      REP #$20               A:0200 X:0000 Y:AB6F P:envMxdiZC
+
  $84/A50A C2 20      REP #$20     ; A = 16-bit
  $84/A50C 4A          LSR A                   A:0200 X:0000 Y:AB6F P:envmxdiZC
+
  $84/A50C 4A          LSR A
  $84/A50D 4A          LSR A                   A:0100 X:0000 Y:AB6F P:envmxdizc
+
  $84/A50D 4A          LSR A
  $84/A50E 4A          LSR A                   A:0080 X:0000 Y:AB6F P:envmxdizc
+
  $84/A50E 4A          LSR A
  $84/A50F E2 20      SEP #$20               A:0040 X:0000 Y:AB6F P:envmxdizc
+
  $84/A50F E2 20      SEP #$20     ; A = 8-bit
 
  $84/A511 65 3F      ADC $3F    [$00:003F]  A:0040 X:0000 Y:AB6F P:envMxdizc
 
  $84/A511 65 3F      ADC $3F    [$00:003F]  A:0040 X:0000 Y:AB6F P:envMxdizc
 
  $84/A513 85 3F      STA $3F    [$00:003F]  A:0040 X:0000 Y:AB6F P:envMxdizc
 
  $84/A513 85 3F      STA $3F    [$00:003F]  A:0040 X:0000 Y:AB6F P:envMxdizc
 
  $84/A515 EB          XBA                    A:0040 X:0000 Y:AB6F P:envMxdizc
 
  $84/A515 EB          XBA                    A:0040 X:0000 Y:AB6F P:envMxdizc
  $84/A516 69 00      ADC #$00               A:4000 X:0000 Y:AB6F P:envMxdiZc
+
  $84/A516 69 00      ADC #$00     ; Add Carry from previous addition
 
  $84/A518 0A          ASL A                  A:4000 X:0000 Y:AB6F P:envMxdiZc
 
  $84/A518 0A          ASL A                  A:4000 X:0000 Y:AB6F P:envMxdiZc
 
  $84/A519 65 40      ADC $40    [$00:0040]  A:4000 X:0000 Y:AB6F P:envMxdiZc
 
  $84/A519 65 40      ADC $40    [$00:0040]  A:4000 X:0000 Y:AB6F P:envMxdiZc
Line 14,766: Line 14,941:
 
  $84/A51D C8          INY                    A:4010 X:0000 Y:AB6F P:envMxdizc
 
  $84/A51D C8          INY                    A:4010 X:0000 Y:AB6F P:envMxdizc
 
  $84/A51E C8          INY                    A:4010 X:0000 Y:AB70 P:eNvMxdizc
 
  $84/A51E C8          INY                    A:4010 X:0000 Y:AB70 P:eNvMxdizc
  $84/A51F 60          RTS                     A:4010 X:0000 Y:AB71 P:eNvMxdizc
+
  $84/A51F 60          RTS
  
 
== $84/A56D ? ==
 
== $84/A56D ? ==
Line 14,802: Line 14,977:
 
  $84/A59C C8          INY                    A:000D X:000E Y:AC55 P:eNvMxdizc
 
  $84/A59C C8          INY                    A:000D X:000E Y:AC55 P:eNvMxdizc
 
  $84/A59D 60          RTS                    A:000D X:000E Y:AC56 P:eNvMxdizc
 
  $84/A59D 60          RTS                    A:000D X:000E Y:AC56 P:eNvMxdizc
 +
 +
== $84/A59E ? ==
 +
 +
$84/A59E 5A          PHY                    A:0010 X:0010 Y:B491 P:envMxdizC
 +
$84/A59F C2 20      REP #$20                A:0010 X:0010 Y:B491 P:envMxdizC
 +
$84/A5A1 A5 3F      LDA $3F    [$00:003F]  A:0010 X:0010 Y:B491 P:envmxdizC
 +
$84/A5A3 38          SEC                    A:1080 X:0010 Y:B491 P:envmxdizC
 +
$84/A5A4 E9 00 08    SBC #$0800              A:1080 X:0010 Y:B491 P:envmxdizC
 +
$84/A5A7 A8          TAY                    A:0880 X:0010 Y:B491 P:envmxdizC
 +
$84/A5A8 E2 20      SEP #$20                A:0880 X:0010 Y:0880 P:envmxdizC
 +
$84/A5AA 22 F9 CA 84 JSL $84CAF9[$84:CAF9]  A:0880 X:0010 Y:0880 P:envMxdizC
 +
$84/A5AE 48          PHA                    A:0012 X:0010 Y:0880 P:envMxdizc
 +
$84/A5AF 7B          TDC                    A:0012 X:0010 Y:0880 P:envMxdizc
 +
$84/A5B0 AD E7 1E    LDA $1EE7  [$84:1EE7]  A:0000 X:0010 Y:0880 P:envMxdiZc
 +
$84/A5B3 A8          TAY                    A:0000 X:0010 Y:0880 P:envMxdiZc
 +
$84/A5B4 68          PLA                    A:0000 X:0010 Y:0000 P:envMxdiZc
 +
$84/A5B5 99 E9 1E    STA $1EE9,y[$84:1EE9]  A:0012 X:0010 Y:0000 P:envMxdizc
 +
$84/A5B8 7A          PLY                    A:0012 X:0010 Y:0000 P:envMxdizc
 +
$84/A5B9 C8          INY                    A:0012 X:0010 Y:B491 P:eNvMxdizc
 +
$84/A5BA 60          RTS                    A:0012 X:0010 Y:B492 P:eNvMxdizc
  
 
== $84/A5BB ? ==
 
== $84/A5BB ? ==
Line 15,165: Line 15,360:
 
  $84/BD3B 85 22      STA $22    [$00:0022]  A:007E X:45D9 Y:0004 P:envMxdizc
 
  $84/BD3B 85 22      STA $22    [$00:0022]  A:007E X:45D9 Y:0004 P:envMxdizc
 
  $84/BD3D A6 02      LDX $02    [$00:0002]  A:007E X:45D9 Y:0004 P:envMxdizc
 
  $84/BD3D A6 02      LDX $02    [$00:0002]  A:007E X:45D9 Y:0004 P:envMxdizc
  $84/BD3F 22 38 A1 88 JSL $88A138[$88:A138]   A:007E X:0004 Y:0004 P:envMxdizc
+
  $84/BD3F 22 38 A1 88 JSL $88A138  ; Load Figure's Character Class/Graphic Set number
 
  $84/BD43 BC 3E 1E    LDY $1E3E,x[$84:1E42]  A:0034 X:0004 Y:0004 P:envMxdizc
 
  $84/BD43 BC 3E 1E    LDY $1E3E,x[$84:1E42]  A:0034 X:0004 Y:0004 P:envMxdizc
 
  $84/BD46 EB          XBA                    A:0034 X:0004 Y:0004 P:envMxdizc
 
  $84/BD46 EB          XBA                    A:0034 X:0004 Y:0004 P:envMxdizc
Line 15,535: Line 15,730:
 
  $84/C2BC C9 02      CMP #$02                A:0001 X:0004 Y:0001 P:envMxdizc
 
  $84/C2BC C9 02      CMP #$02                A:0001 X:0004 Y:0001 P:envMxdizc
 
  $84/C2BE D0 09      BNE $09    [$C2C9]      A:0001 X:0004 Y:0001 P:eNvMxdizc
 
  $84/C2BE D0 09      BNE $09    [$C2C9]      A:0001 X:0004 Y:0001 P:eNvMxdizc
  $84/C2C9 22 38 A1 88 JSL $88A138[$88:A138]   A:0001 X:0004 Y:0001 P:eNvMxdizc
+
  $84/C2C9 22 38 A1 88 JSL $88A138  ; Load Figure's Character Class/Graphic Set number
  $84/C2CD EB          XBA                     A:0034 X:0004 Y:0001 P:envMxdizc
+
  $84/C2CD EB          XBA           ; Clear High Byte
  $84/C2CE A9 00      LDA #$00               A:3400 X:0004 Y:0001 P:envMxdiZc
+
  $84/C2CE A9 00      LDA #$00
  $84/C2D0 EB          XBA                     A:3400 X:0004 Y:0001 P:envMxdiZc
+
  $84/C2D0 EB          XBA
 
  $84/C2D1 DA          PHX                    A:0034 X:0004 Y:0001 P:envMxdizc
 
  $84/C2D1 DA          PHX                    A:0034 X:0004 Y:0001 P:envMxdizc
 
  $84/C2D2 22 87 A3 84 JSL $84A387[$84:A387]  A:0034 X:0004 Y:0001 P:envMxdizc
 
  $84/C2D2 22 87 A3 84 JSL $84A387[$84:A387]  A:0034 X:0004 Y:0001 P:envMxdizc
Line 15,901: Line 16,096:
 
  $85/832F AB          PLB          ; Restore Data Bank
 
  $85/832F AB          PLB          ; Restore Data Bank
 
  $85/8330 6B          RTL
 
  $85/8330 6B          RTL
 +
 +
== $85/84E9 ? ==
 +
 +
$85/84E9 8B          PHB                    A:3600 X:0080 Y:007E P:envMxdiZC
 +
$85/84EA 4B          PHK                    A:3600 X:0080 Y:007E P:envMxdiZC
 +
$85/84EB AB          PLB                    A:3600 X:0080 Y:007E P:envMxdiZC
 +
$85/84EC 20 F1 84    JSR $84F1  [$85:84F1]  A:3600 X:0080 Y:007E P:eNvMxdizC
 +
$85/84EF AB          PLB                    A:C8F8 X:0008 Y:0020 P:envMxdiZc
 +
$85/84F0 6B          RTL                    A:C8F8 X:0008 Y:0020 P:eNvMxdizc
 +
 +
== $85/84F1 ? ==
 +
 +
$85/84F1 E2 30      SEP #$30                A:3600 X:0080 Y:007E P:eNvMxdizC
 +
$85/84F3 0A          ASL A                  A:3600 X:0080 Y:007E P:eNvMXdizC
 +
$85/84F4 0A          ASL A                  A:3600 X:0080 Y:007E P:envMXdiZc
 +
$85/84F5 0A          ASL A                  A:3600 X:0080 Y:007E P:envMXdiZc
 +
$85/84F6 AA          TAX                    A:3600 X:0080 Y:007E P:envMXdiZc
 +
$85/84F7 A9 08      LDA #$08                A:3600 X:0000 Y:007E P:envMXdiZc
 +
$85/84F9 85 02      STA $02    [$00:0002]  A:3608 X:0000 Y:007E P:envMXdizc
 +
$85/84FB 7B          TDC                    A:3608 X:0000 Y:007E P:envMXdizc
 +
$85/84FC A8          TAY                    A:0000 X:0000 Y:007E P:envMXdiZc
 +
$85/84FD DA          PHX                    A:0000 X:0000 Y:0000 P:envMXdiZc
 +
$85/84FE BF 57 AB 85 LDA $85AB57,x[$85:AB57] A:0000 X:0000 Y:0000 P:envMXdiZc
 +
$85/8502 85 00      STA $00    [$00:0000]  A:0000 X:0000 Y:0000 P:envMXdiZc
 +
$85/8504 29 07      AND #$07                A:0000 X:0000 Y:0000 P:envMXdiZc
 +
$85/8506 D0 08      BNE $08    [$8510]      A:0000 X:0000 Y:0000 P:envMXdiZc
 +
$85/8508 A9 0C      LDA #$0C                A:0000 X:0000 Y:0000 P:envMXdiZc
 +
$85/850A 99 02 01    STA $0102,y[$85:0102]  A:000C X:0000 Y:0000 P:envMXdizc
 +
$85/850D 7B          TDC                    A:000C X:0000 Y:0000 P:envMXdizc
 +
$85/850E 80 08      BRA $08    [$8518]      A:0000 X:0000 Y:0000 P:envMXdiZc
 +
;code is missing here
 +
$85/8518 99 03 01    STA $0103,y[$85:0103]  A:0000 X:0000 Y:0000 P:envMXdiZc
 +
$85/851B A5 00      LDA $00    [$00:0000]  A:0000 X:0000 Y:0000 P:envMXdiZc
 +
$85/851D 4A          LSR A                  A:0000 X:0000 Y:0000 P:envMXdiZc
 +
$85/851E 4A          LSR A                  A:0000 X:0000 Y:0000 P:envMXdiZc
 +
$85/851F 4A          LSR A                  A:0000 X:0000 Y:0000 P:envMXdiZc
 +
$85/8520 29 07      AND #$07                A:0000 X:0000 Y:0000 P:envMXdiZc
 +
$85/8522 D0 08      BNE $08    [$852C]      A:0000 X:0000 Y:0000 P:envMXdiZc
 +
$85/8524 A9 0C      LDA #$0C                A:0000 X:0000 Y:0000 P:envMXdiZc
 +
$85/8526 99 22 03    STA $0322,y[$85:0322]  A:000C X:0000 Y:0000 P:envMXdizc
 +
$85/8529 7B          TDC                    A:000C X:0000 Y:0000 P:envMXdizc
 +
$85/852A 80 08      BRA $08    [$8534]      A:0000 X:0000 Y:0000 P:envMXdiZc
 +
;code is missing here
 +
$85/8534 99 23 03    STA $0323,y[$85:0323]  A:0000 X:0000 Y:0000 P:envMXdiZc
 +
$85/8537 C2 20      REP #$20                A:0000 X:0000 Y:0000 P:envMXdiZc
 +
$85/8539 98          TYA                    A:0000 X:0000 Y:0000 P:envmXdiZc
 +
$85/853A AA          TAX                    A:0000 X:0000 Y:0000 P:envmXdiZc
 +
$85/853B A5 00      LDA $00    [$00:0000]  A:0000 X:0000 Y:0000 P:envmXdiZc
 +
$85/853D 89 C0 00    BIT #$00C0              A:0200 X:0000 Y:0000 P:envmXdizc
 +
$85/8540 D0 09      BNE $09    [$854B]      A:0200 X:0000 Y:0000 P:envmXdiZc
 +
$85/8542 BF 17 AB 85 LDA $85AB17,x[$85:AB17] A:0200 X:0000 Y:0000 P:envmXdiZc
 +
$85/8546 99 00 01    STA $0100,y[$85:0100]  A:38CC X:0000 Y:0000 P:envmXdizc
 +
$85/8549 80 0B      BRA $0B    [$8556]      A:38CC X:0000 Y:0000 P:envmXdizc
 +
;code is missing here
 +
$85/8556 99 20 03    STA $0320,y[$85:0320]  A:38CC X:0000 Y:0000 P:envmXdizc
 +
$85/8559 E2 20      SEP #$20                A:38CC X:0000 Y:0000 P:envmXdizc
 +
$85/855B FA          PLX                    A:38CC X:0000 Y:0000 P:envMXdizc
 +
$85/855C C8          INY                    A:38CC X:0000 Y:0000 P:envMXdiZc
 +
$85/855D C8          INY                    A:38CC X:0000 Y:0001 P:envMXdizc
 +
$85/855E C8          INY                    A:38CC X:0000 Y:0002 P:envMXdizc
 +
$85/855F C8          INY                    A:38CC X:0000 Y:0003 P:envMXdizc
 +
$85/8560 E8          INX                    A:38CC X:0000 Y:0004 P:envMXdizc
 +
$85/8561 C6 02      DEC $02    [$00:0002]  A:38CC X:0001 Y:0004 P:envMXdizc
 +
$85/8563 D0 98      BNE $98    [$84FD]      A:38CC X:0001 Y:0004 P:envMXdizc
 +
$85/8565 C2 10      REP #$10                A:C8F8 X:0008 Y:0020 P:envMXdiZc
 +
$85/8567 60          RTS                    A:C8F8 X:0008 Y:0020 P:envMxdiZc
  
 
== $85/FD4F ? ==
 
== $85/FD4F ? ==
Line 16,522: Line 16,783:
 
  $86/9B6F A6 91      LDX $91    [$00:0091]  A:0105 X:0004 Y:0001 P:envMxdizc
 
  $86/9B6F A6 91      LDX $91    [$00:0091]  A:0105 X:0004 Y:0001 P:envMxdizc
 
  $86/9B71 22 AC C2 84 JSL $84C2AC[$84:C2AC]  A:0105 X:0004 Y:0001 P:envMxdizc
 
  $86/9B71 22 AC C2 84 JSL $84C2AC[$84:C2AC]  A:0105 X:0004 Y:0001 P:envMxdizc
  $86/9B75 22 8A A1 80 JSL $80A18A[$80:A18A]   A:1001 X:0004 Y:0001 P:eNvMxdizc
+
  $86/9B75 22 8A A1 80 JSL $80A18A  ; Wait for NMI
 
  $86/9B79 A5 9E      LDA $9E    [$00:009E]  A:1080 X:0004 Y:0001 P:eNvMxdizc
 
  $86/9B79 A5 9E      LDA $9E    [$00:009E]  A:1080 X:0004 Y:0001 P:eNvMxdizc
 
  $86/9B7B 85 0E      STA $0E    [$00:000E]  A:1000 X:0004 Y:0001 P:envMxdiZc
 
  $86/9B7B 85 0E      STA $0E    [$00:000E]  A:1000 X:0004 Y:0001 P:envMxdiZc
Line 16,600: Line 16,861:
 
  $86/9C12 A6 91      LDX $91      ; Restore Figure Number from $92/$93
 
  $86/9C12 A6 91      LDX $91      ; Restore Figure Number from $92/$93
 
  $86/9C14 22 AC C2 84 JSL $84C2AC[$84:C2AC]  A:007E X:000C Y:0002 P:envMxdizc
 
  $86/9C14 22 AC C2 84 JSL $84C2AC[$84:C2AC]  A:007E X:000C Y:0002 P:envMxdizc
  $86/9C18 22 8A A1 80 JSL $80A18A[$80:A18A]   A:0002 X:000C Y:0002 P:eNvMxdizC
+
  $86/9C18 22 8A A1 80 JSL $80A18A  ; Wait for NMI
 
  $86/9C1C A5 9E      LDA $9E    [$00:009E]  A:0080 X:000C Y:0002 P:eNvMxdizc
 
  $86/9C1C A5 9E      LDA $9E    [$00:009E]  A:0080 X:000C Y:0002 P:eNvMxdizc
 
  $86/9C1E 48          PHA                    A:0009 X:000C Y:0002 P:envMxdizc
 
  $86/9C1E 48          PHA                    A:0009 X:000C Y:0002 P:envMxdizc
Line 18,223: Line 18,484:
 
  $88/A137 6B          RTL
 
  $88/A137 6B          RTL
  
== $88/A138 ? ==
+
== $88/A138 Load Figure's Character Class/Graphic Set number ==
  
X contains a Figure Number
+
At the end, A contains the Graphic Set number or the Character Class number of the Figure number in X. It depends on the table at $88/A702. The Figure number is the index for this table. If the Figure's value on this table is #$FF, A contain the Graphic Set number in the end, else it keeps the Character Class number.
 +
 
 +
I think this is relevant for VIP figures that use standard graphic sets. They look the same as the "background actors", but have a unique name/character class. But I can be totally wrong.
  
 
  $88/A138 BD AF 17    LDA $17AF,x  ; Load Figure's Character Class Number
 
  $88/A138 BD AF 17    LDA $17AF,x  ; Load Figure's Character Class Number
Line 18,243: Line 18,506:
 
  $88/A151 83 02      STA $02,s
 
  $88/A151 83 02      STA $02,s
 
  $88/A153 68          PLA          ; Remove Character Class Number from Stack
 
  $88/A153 68          PLA          ; Remove Character Class Number from Stack
  $88/A154 68          PLA          ; Remove Graphic Set Number from Stack
+
  $88/A154 68          PLA          ; Remove (Character Class or) Graphic Set Number from Stack
  $88/A155 FA          PLX          ; Remove Figure Number from Stack
+
  $88/A155 FA          PLX          ; Load Figure Number from Stack in X
 
  $88/A156 6B          RTL
 
  $88/A156 6B          RTL
  
Line 18,380: Line 18,643:
 
== $88/A5D9 ? ==
 
== $88/A5D9 ? ==
  
  $88/A5D9 DA          PHX                     A:0004 X:0004 Y:0004 P:envMxdizc
+
  $88/A5D9 DA          PHX           ; Buffer X (Figure number) on stack
  $88/A5DA 22 38 A1 88 JSL $88A138[$88:A138]  A:0004 X:0004 Y:0004 P:envMxdizc
+
  $88/A5DA 22 38 A1 88 JSL $88A138   ; Load Figure's Character Class/Graphic Set number
  $88/A5DE AA          TAX                     A:0034 X:0004 Y:0004 P:envMxdizc
+
  $88/A5DE AA          TAX           ; Transfer Figure's Character Class/Graphic Set number in X
 
  $88/A5DF BF F2 A8 88 LDA $88A8F2,x[$88:A926] A:0034 X:0034 Y:0004 P:envMxdizc
 
  $88/A5DF BF F2 A8 88 LDA $88A8F2,x[$88:A926] A:0034 X:0034 Y:0004 P:envMxdizc
  $88/A5E3 FA          PLX                     A:0001 X:0034 Y:0004 P:envMxdizc
+
  $88/A5E3 FA          PLX           ; Restore X (Figure Number) from stack
  $88/A5E4 6B          RTL                     A:0001 X:0004 Y:0004 P:envMxdizc
+
  $88/A5E4 6B          RTL
  
 
== $88/A702 ? Data Table, Character Graphic Set related ==
 
== $88/A702 ? Data Table, Character Graphic Set related ==
Line 18,406: Line 18,669:
 
  00 00 00 00 00 00 00 00 00 00 00 00 DC DD DE DF
 
  00 00 00 00 00 00 00 00 00 00 00 00 DC DD DE DF
 
  E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED DE EF
 
  E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED DE EF
 +
 +
== $88/A8F2 ? Data Table ==
 +
 +
00 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
 +
01 01 01 01 01 01 04 05 05 06 01 01 01 01 01 10
 +
10 10 10 10 11 10 12 14 14 17 18 16 15 13 01 01
 +
01 01 01 01 01 01 01 01 01 01 06 01 01 01 01 01
 +
01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
 +
01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
 +
01 01 01 01 01 01 01 01 01 01 01 01 01 11 16 14
 +
12 01 01 01 12 13 14 14 16 06 11 14 14 10 11 12
 +
13 17 18 12 14 10 15 14 12 15 13 01 01 01 01 01
 +
01 01 01 01 01 01 01 01 01 01 01 01 14 14 01 01
 +
01 01 01 01 01 01 01 01 14 14 01 01 01 01 06 01
 +
01 01 01 01 01 01 01 01 01 01 06 01 01 01 01 01
 +
01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
 +
01 01 01 01 01 01 01 01 01 01 01 01 0C 0C 0C 0C
 +
0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C
  
 
== $88/A9E2 List for 88/A3D1 ==
 
== $88/A9E2 List for 88/A3D1 ==
Line 18,970: Line 19,251:
 
  $8F/80A2 A9 FC      LDA #$FC                A:00FF X:0042 Y:9E57 P:eNvMxdIzc
 
  $8F/80A2 A9 FC      LDA #$FC                A:00FF X:0042 Y:9E57 P:eNvMxdIzc
 
  $8F/80A4 85 F5      STA $F5    [$00:00F5]  A:00FC X:0042 Y:9E57 P:eNvMxdIzc
 
  $8F/80A4 85 F5      STA $F5    [$00:00F5]  A:00FC X:0042 Y:9E57 P:eNvMxdIzc
  $8F/80A6 22 CE 83 8F JSL $8F83CE[$8F:83CE]   A:00FC X:0042 Y:9E57 P:eNvMxdIzc
+
  $8F/80A6 22 CE 83 8F JSL $8F83CE  ; Check for signals from the SPC
  $8F/80AA B0 F6      BCS $F6   [$80A2]     A:0000 X:0042 Y:9E57 P:envMxdIZC
+
  $8F/80AA B0 F6      BCS $F6       ; [$80A2] Loop if there is a signal
 
  $8F/80AC A0 CC 33    LDY #$33CC    ; Wait for SPC ready signal #$33CC in $2140/1
 
  $8F/80AC A0 CC 33    LDY #$33CC    ; Wait for SPC ready signal #$33CC in $2140/1
 
  $8F/80AF CC 40 21    CPY $2140
 
  $8F/80AF CC 40 21    CPY $2140
Line 19,074: Line 19,355:
 
  $8F/83CD 60          RTS                    A:0002 X:33CC Y:9E7A P:envMxdIzC
 
  $8F/83CD 60          RTS                    A:0002 X:33CC Y:9E7A P:envMxdIzC
  
== $8F/83CE Sound-related stuff ==
+
== $8F/83CE Sound-related stuff / Check for Signals from SPC ==
  
  $8F/83CE A5 FA      LDA $FA   [$00:00FA]  A:0000 X:0000 Y:001C P:envMxdiZc
+
  $8F/83CE A5 FA      LDA $FA       ; Check buffered $2143 value
  $8F/83D0 30 38      BMI $38   [$840A]     A:0027 X:0000 Y:001C P:envMxdizc
+
  $8F/83D0 30 38      BMI $38       ; [$840A] Exit (w/ flag) if negative
  $8F/83D2 F0 36      BEQ $36   [$840A]     A:0027 X:0000 Y:001C P:envMxdizc
+
  $8F/83D2 F0 36      BEQ $36       ; [$840A] Exit (w/ flag) if zero
  $8F/83D4 AD 43 21    LDA $2143 [$8F:2143]  A:0027 X:0000 Y:001C P:envMxdizc
+
  $8F/83D4 AD 43 21    LDA $2143     ; Check current $2143 value
  $8F/83D7 30 31      BMI $31   [$840A]     A:0027 X:0000 Y:001C P:envMxdizc
+
  $8F/83D7 30 31      BMI $31       ; [$840A] Exit (w/ flag) if negative
  $8F/83D9 F0 32      BEQ $32   [$840D]     A:0027 X:0000 Y:001C P:envMxdizc
+
  $8F/83D9 F0 32      BEQ $32       ; [$840D] ???
  $8F/83DB C5 FA      CMP $FA   [$00:00FA]  A:0027 X:0000 Y:001C P:envMxdizc
+
  $8F/83DB C5 FA      CMP $FA       ; Compare to buffered $2143 value
  $8F/83DD D0 2B      BNE $2B   [$840A]     A:0027 X:0000 Y:001C P:envMxdiZC
+
  $8F/83DD D0 2B      BNE $2B       ; [$840A] Exit if they are the same
  $8F/83DF A5 F5      LDA $F5   [$00:00F5]  A:0027 X:0000 Y:001C P:envMxdiZC
+
  $8F/83DF A5 F5      LDA $F5       ; Check if buffers for $2140/1/2 are zero
  $8F/83E1 05 F6      ORA $F6   [$00:00F6]  A:0000 X:0000 Y:001C P:envMxdiZC
+
  $8F/83E1 05 F6      ORA $F6
  $8F/83E3 05 F7      ORA $F7   [$00:00F7]  A:0000 X:0000 Y:001C P:envMxdiZC
+
  $8F/83E3 05 F7      ORA $F7
  $8F/83E5 F0 21      BEQ $21   [$8408]     A:0000 X:0000 Y:001C P:envMxdiZC
+
  $8F/83E5 F0 21      BEQ $21       ; [$8408] Exit (w/o flag) if zero
 +
;code is missing here
 +
$8F/8408 18          CLC          ; Clear Carry (Flag)
 +
$8F/8409 6B          RTL
 +
$8F/840A 7B          TDC          ; Clear 16-bit A
 +
$8F/840B 38          SEC          ; Set Carry (Flag)
 +
$8F/840C 6B          RTL
 
;code is missing here
 
;code is missing here
$8F/8408 18          CLC                    A:0000 X:0000 Y:001C P:envMxdiZC
 
$8F/8409 6B          RTL                    A:0000 X:0000 Y:001C P:envMxdiZc
 
$8F/840A 7B          TDC                    A:0004 X:0000 Y:26C0 P:eNvMxdizc
 
$8F/840B 38          SEC                    A:0000 X:0000 Y:26C0 P:envMxdiZc
 
$8F/840C 6B          RTL                    A:0000 X:0000 Y:26C0 P:envMxdiZC
 
  
 
== $8F/83DB Sound-related stuff ==
 
== $8F/83DB Sound-related stuff ==
Line 19,127: Line 19,409:
 
  $8F/8412 4B          PHK          ; Set Data Bank to $8F
 
  $8F/8412 4B          PHK          ; Set Data Bank to $8F
 
  $8F/8413 AB          PLB
 
  $8F/8413 AB          PLB
  $8F/8414 E2 20      SEP #$20               A:A100 X:05DD Y:0004 P:eNvMxdIzc
+
  $8F/8414 E2 20      SEP #$20     ; A = 8-bit
 
  $8F/8416 A5 F9      LDA $F9    [$00:00F9]  A:A100 X:05DD Y:0004 P:eNvMxdIzc
 
  $8F/8416 A5 F9      LDA $F9    [$00:00F9]  A:A100 X:05DD Y:0004 P:eNvMxdIzc
 
  $8F/8418 30 0F      BMI $0F    [$8429]      A:A100 X:05DD Y:0004 P:envMxdIZc
 
  $8F/8418 30 0F      BMI $0F    [$8429]      A:A100 X:05DD Y:0004 P:envMxdIZc
 
  $8F/841A F0 06      BEQ $06    [$8422]      A:A100 X:05DD Y:0004 P:envMxdIZc
 
  $8F/841A F0 06      BEQ $06    [$8422]      A:A100 X:05DD Y:0004 P:envMxdIZc
 
;code is missing here
 
;code is missing here
  $8F/8422 22 CE 83 8F JSL $8F83CE[$8F:83CE]   A:A100 X:05DD Y:0004 P:envMxdIZc
+
  $8F/8422 22 CE 83 8F JSL $8F83CE  ; Check for signals from the SPC
 
  $8F/8426 AB          PLB          ; Restore Data Bank and Status Register
 
  $8F/8426 AB          PLB          ; Restore Data Bank and Status Register
 
  $8F/8427 28          PLP
 
  $8F/8427 28          PLP
Line 19,265: Line 19,547:
 
  $99/87F9 AB          PLB
 
  $99/87F9 AB          PLB
 
  $99/87FA 20 23 8A    JSR $8A23  [$99:8A23]  A:FF7E X:3300 Y:000A P:envMxdizc
 
  $99/87FA 20 23 8A    JSR $8A23  [$99:8A23]  A:FF7E X:3300 Y:000A P:envMxdizc
  $99/87FD C2 20      REP #$20               A:0000 X:3300 Y:3762 P:envMxdiZc
+
  $99/87FD C2 20      REP #$20     ; A = 16-bit
 
  $99/87FF A6 E1      LDX $E1    [$00:00E1]  A:0000 X:3300 Y:3762 P:envmxdiZc
 
  $99/87FF A6 E1      LDX $E1    [$00:00E1]  A:0000 X:3300 Y:3762 P:envmxdiZc
  $99/8801 A5 E3      LDA $E3   [$00:00E3]  A:0000 X:3300 Y:3762 P:envmxdizc
+
  $99/8801 A5 E3      LDA $E3       ; Store 24-bit Data Load Address back
  $99/8803 9D 06 00    STA $0006,x[$7E:3306]  A:3762 X:3300 Y:3762 P:envmxdizc
+
  $99/8803 9D 06 00    STA $0006,x
  $99/8806 E2 20      SEP #$20               A:3762 X:3300 Y:3762 P:envmxdizc
+
  $99/8806 E2 20      SEP #$20     ; A = 8-bit
  $99/8808 A5 E5      LDA $E5   [$00:00E5]  A:3762 X:3300 Y:3762 P:envMxdizc
+
  $99/8808 A5 E5      LDA $E5
  $99/880A 9D 08 00    STA $0008,x[$7E:3308]  A:377E X:3300 Y:3762 P:envMxdizc
+
  $99/880A 9D 08 00    STA $0008,x
 
  $99/880D 20 80 C8    JSR $C880  [$99:C880]  A:377E X:3300 Y:3762 P:envMxdizc
 
  $99/880D 20 80 C8    JSR $C880  [$99:C880]  A:377E X:3300 Y:3762 P:envMxdizc
 
  $99/8810 A6 E1      LDX $E1    [$00:00E1]  A:FF01 X:1758 Y:000A P:envMxdizC
 
  $99/8810 A6 E1      LDX $E1    [$00:00E1]  A:FF01 X:1758 Y:000A P:envMxdizC
Line 19,280: Line 19,562:
 
== $99/8A23 ? ==
 
== $99/8A23 ? ==
  
  $99/8A23 E2 20      SEP #$20               A:937E X:932C Y:0100 P:envMxdizC
+
This sets up a 24-bit data load address in [$E3] and loads another value. If the value is != #$00, it is used as a Jump Index for the 1st Jump Table. Else, the first byte at [$E3] is checked. If that one is != #$FF, it is used as a Jump Index for the 2nd Jump Table.
  $99/8A25 A6 E1      LDX $E1   [$00:00E1]  A:937E X:932C Y:0100 P:envMxdizC
+
 
  $99/8A27 BC 06 00    LDY $0006,x[$7E:3306]   A:937E X:3300 Y:0100 P:envMxdizC
+
  $99/8A23 E2 20      SEP #$20     ; A = 8-bit
  $99/8A2A 84 E3      STY $E3   [$00:00E3]  A:937E X:3300 Y:375A P:envMxdizC
+
  $99/8A25 A6 E1      LDX $E1       ; Load Data Load Index in X
  $99/8A2C BD 08 00    LDA $0008,x[$7E:3308]  A:937E X:3300 Y:375A P:envMxdizC
+
  $99/8A27 BC 06 00    LDY $0006,x   ; Setup a 24-bit address in [$E3]
  $99/8A2F 85 E5      STA $E5   [$00:00E5]  A:937E X:3300 Y:375A P:envMxdizC
+
  $99/8A2A 84 E3      STY $E3       ; (In this case, it is $7E/375A)
  $99/8A31 E2 20      SEP #$20               A:937E X:3300 Y:375A P:envMxdizC
+
  $99/8A2C BD 08 00    LDA $0008,x
  $99/8A33 A6 E1      LDX $E1   [$00:00E1]  A:937E X:3300 Y:375A P:envMxdizC
+
  $99/8A2F 85 E5      STA $E5
  $99/8A35 7B          TDC                     A:937E X:3300 Y:375A P:envMxdizC
+
  $99/8A31 E2 20      SEP #$20     ; A = 8-bit
 +
  $99/8A33 A6 E1      LDX $E1       ; Load Data Load Index in X
 +
  $99/8A35 7B          TDC           ; Clear 16-bit A
 
  $99/8A36 BD 0B 00    LDA $000B,x[$7E:330B]  A:0000 X:3300 Y:375A P:envMxdiZC
 
  $99/8A36 BD 0B 00    LDA $000B,x[$7E:330B]  A:0000 X:3300 Y:375A P:envMxdiZC
 
  $99/8A39 F0 0A      BEQ $0A    [$8A45]      A:0000 X:3300 Y:375A P:envMxdiZC
 
  $99/8A39 F0 0A      BEQ $0A    [$8A45]      A:0000 X:3300 Y:375A P:envMxdiZC
 
  $99/8A3B 3A          DEC A                  A:0006 X:3300 Y:3762 P:envMxdizc
 
  $99/8A3B 3A          DEC A                  A:0006 X:3300 Y:3762 P:envMxdizc
  $99/8A3C C2 20      REP #$20               A:0005 X:3300 Y:3762 P:envMxdizc
+
  $99/8A3C C2 20      REP #$20     ; A = 16-bit
  $99/8A3E 0A          ASL A                   A:0005 X:3300 Y:3762 P:envmxdizc
+
  $99/8A3E 0A          ASL A         ; Transform it to a Jump Table Index
  $99/8A3F AA          TAX                     A:000A X:3300 Y:3762 P:envmxdizc
+
  $99/8A3F AA          TAX           ; (Multiply by 2 and transfer to X)
  $99/8A40 E2 20      SEP #$20               A:000A X:000A Y:3762 P:envmxdizc
+
  $99/8A40 E2 20      SEP #$20     ; A = 8-bit
  $99/8A42 7C 5D 8A    JMP ($8A5D,x)[$99:911B] A:000A X:000A Y:3762 P:envMxdizc
+
  $99/8A42 7C 5D 8A    JMP ($8A5D,x) ; Use 1st Jump Table
  $99/8A45 7B          TDC                     A:0000 X:3300 Y:375A P:envMxdiZC
+
 +
  $99/8A45 7B          TDC           ; Clear 16-bit A
 
  $99/8A46 A7 E3      LDA [$E3]  [$7E:375A]  A:0000 X:3300 Y:375A P:envMxdiZC
 
  $99/8A46 A7 E3      LDA [$E3]  [$7E:375A]  A:0000 X:3300 Y:375A P:envMxdiZC
 
  $99/8A48 C9 FF      CMP #$FF                A:0065 X:3300 Y:375A P:envMxdizC
 
  $99/8A48 C9 FF      CMP #$FF                A:0065 X:3300 Y:375A P:envMxdizC
 
  $99/8A4A D0 08      BNE $08    [$8A54]      A:0065 X:3300 Y:375A P:envMxdizc
 
  $99/8A4A D0 08      BNE $08    [$8A54]      A:0065 X:3300 Y:375A P:envMxdizc
 
;code is missing here
 
;code is missing here
  $99/8A54 C2 20      REP #$20               A:0065 X:3300 Y:375A P:envMxdizc
+
  $99/8A54 C2 20      REP #$20     ; A = 16-bit
  $99/8A56 0A          ASL A                   A:0065 X:3300 Y:375A P:envmxdizc
+
  $99/8A56 0A          ASL A         ; Transform it to a Jump Table Index
  $99/8A57 AA          TAX                     A:00CA X:3300 Y:375A P:envmxdizc
+
  $99/8A57 AA          TAX           ; (Multiply by 2 and transfer to X)
  $99/8A58 E6 E3      INC $E3   [$00:00E3]  A:00CA X:00CA Y:375A P:envmxdizc
+
  $99/8A58 E6 E3      INC $E3       ; Increment Data Load Address
  $99/8A5A 7C 77 8A    JMP ($8A77,x)[$99:901B] A:00CA X:00CA Y:375A P:envmxdizc
+
  $99/8A5A 7C 77 8A    JMP ($8A77,x) ; Use 2nd Jump Table
 +
 
 +
1st Jump Table
  
 
  $99/8A5D BC 90 --- Entry #$00 - $90BC
 
  $99/8A5D BC 90 --- Entry #$00 - $90BC
Line 19,321: Line 19,608:
 
  $99/8A73 B3 91 --- Entry #$0B - $91B3
 
  $99/8A73 B3 91 --- Entry #$0B - $91B3
 
  $99/8A75 EA 91 --- Entry #$0C - $91EA
 
  $99/8A75 EA 91 --- Entry #$0C - $91EA
 +
 +
2nd Jump Table
  
 
  $99/8A77 01 92 --- Entry #$00 - $9210
 
  $99/8A77 01 92 --- Entry #$00 - $9210
Line 19,455: Line 19,744:
 
  $99/9039 22 F2 AE 80 JSL $80AEF2  ; Load Music
 
  $99/9039 22 F2 AE 80 JSL $80AEF2  ; Load Music
 
  $99/903D 80 14      BRA $14    [$9053]      A:0000 X:33CC Y:D686 P:envMxdizc
 
  $99/903D 80 14      BRA $14    [$9053]      A:0000 X:33CC Y:D686 P:envMxdizc
 +
; code is missing here
 
  $99/9053 68          PLA                    A:0000 X:33CC Y:D686 P:envMxdizc
 
  $99/9053 68          PLA                    A:0000 X:33CC Y:D686 P:envMxdizc
 
  $99/9054 8D AC 17    STA $17AC  [$7E:17AC]  A:0000 X:33CC Y:D686 P:envMxdiZc
 
  $99/9054 8D AC 17    STA $17AC  [$7E:17AC]  A:0000 X:33CC Y:D686 P:envMxdiZc
  $99/9057 C2 20      REP #$20               A:0000 X:33CC Y:D686 P:envMxdiZc
+
  $99/9057 C2 20      REP #$20     ; A = 16-bit
  $99/9059 E6 E3      INC $E3   [$00:00E3]  A:0000 X:33CC Y:D686 P:envmxdiZc
+
  $99/9059 E6 E3      INC $E3       ; Increment Data Load Address
  $99/905B 4C 31 8A    JMP $8A31 [$99:8A31]  A:0000 X:33CC Y:D686 P:envmxdizc
+
  $99/905B 4C 31 8A    JMP $8A31     ; Loop, use Jump Table again
  
 
== $99/910B ? ==
 
== $99/910B ? ==
Line 19,493: Line 19,783:
 
  $99/9154 A6 E1      LDX $E1    [$00:00E1]  A:0010 X:0010 Y:3765 P:envMxdizc
 
  $99/9154 A6 E1      LDX $E1    [$00:00E1]  A:0010 X:0010 Y:3765 P:envMxdizc
 
  $99/9156 BD C3 02    LDA $02C3,x[$7E:35C3]  A:0010 X:3300 Y:3765 P:envMxdizc
 
  $99/9156 BD C3 02    LDA $02C3,x[$7E:35C3]  A:0010 X:3300 Y:3765 P:envMxdizc
  $99/9159 F0 21      BEQ $21   [$917C]     A:0000 X:3300 Y:3765 P:envMxdiZc
+
  $99/9159 F0 21      BEQ $21       ; [$917C] Exit if #$00
 
  $99/915B 9E 0B 00    STZ $000B,x[$7E:330B]  A:0001 X:3300 Y:3765 P:envMxdizc
 
  $99/915B 9E 0B 00    STZ $000B,x[$7E:330B]  A:0001 X:3300 Y:3765 P:envMxdizc
 
  $99/915E 22 DA 82 81 JSL $8182DA[$81:82DA]  A:0001 X:3300 Y:3765 P:envMxdizc
 
  $99/915E 22 DA 82 81 JSL $8182DA[$81:82DA]  A:0001 X:3300 Y:3765 P:envMxdizc
 
  $99/9162 B0 09      BCS $09    [$916D]      A:A87E X:3300 Y:3C00 P:envMxdizc
 
  $99/9162 B0 09      BCS $09    [$916D]      A:A87E X:3300 Y:3C00 P:envMxdizc
 
  $99/9164 20 80 C8    JSR $C880  [$99:C880]  A:A87E X:3300 Y:3C00 P:envMxdizc
 
  $99/9164 20 80 C8    JSR $C880  [$99:C880]  A:A87E X:3300 Y:3C00 P:envMxdizc
  $99/9167 22 8A A1 80 JSL $80A18A[$80:A18A]   A:FF01 X:1758 Y:000A P:envMxdizC
+
  $99/9167 22 8A A1 80 JSL $80A18A  ; Wait for NMI and then loop
  $99/916B 80 F1      BRA $F1   [$915E]     A:FF80 X:1758 Y:000A P:envMxdizc
+
  $99/916B 80 F1      BRA $F1       ; [$915E]
 
  $99/916D A6 E1      LDX $E1    [$00:00E1]  A:0001 X:1758 Y:3C00 P:envMxdizC
 
  $99/916D A6 E1      LDX $E1    [$00:00E1]  A:0001 X:1758 Y:3C00 P:envMxdizC
 
  $99/916F A9 03      LDA #$03                A:0001 X:3300 Y:3C00 P:envMxdizC
 
  $99/916F A9 03      LDA #$03                A:0001 X:3300 Y:3C00 P:envMxdizC
Line 19,506: Line 19,796:
 
  $99/9176 9D 0C 00    STA $000C,x[$7E:330C]  A:000A X:3300 Y:3C00 P:envMxdizC
 
  $99/9176 9D 0C 00    STA $000C,x[$7E:330C]  A:000A X:3300 Y:3C00 P:envMxdizC
 
  $99/9179 9E 0D 00    STZ $000D,x[$7E:330D]  A:000A X:3300 Y:3C00 P:envMxdizC
 
  $99/9179 9E 0D 00    STZ $000D,x[$7E:330D]  A:000A X:3300 Y:3C00 P:envMxdizC
  $99/917C 60          RTS                     A:0000 X:3300 Y:3765 P:envMxdiZc
+
  $99/917C 60          RTS
  
 
== $99/9471 ? ==
 
== $99/9471 ? ==
  
  $99/9471 E2 20      SEP #$20               A:018C X:018C Y:3762 P:envmxdizc
+
  $99/9471 E2 20      SEP #$20     ; A = 8-bit
 
  $99/9473 A9 34      LDA #$34                A:018C X:018C Y:3762 P:envMxdizc
 
  $99/9473 A9 34      LDA #$34                A:018C X:018C Y:3762 P:envMxdizc
 
  $99/9475 80 10      BRA $10    [$9487]      A:0134 X:018C Y:3762 P:envMxdizc
 
  $99/9475 80 10      BRA $10    [$9487]      A:0134 X:018C Y:3762 P:envMxdizc
 
;code is missing here
 
;code is missing here
 
  $99/9487 48          PHA                    A:0134 X:018C Y:3762 P:envMxdizc
 
  $99/9487 48          PHA                    A:0134 X:018C Y:3762 P:envMxdizc
  $99/9488 C2 20      REP #$20               A:0134 X:018C Y:3762 P:envMxdizc
+
  $99/9488 C2 20      REP #$20     ; A = 16-bit
 
  $99/948A 20 81 D4    JSR $D481  [$99:D481]  A:0134 X:018C Y:3762 P:envmxdizc
 
  $99/948A 20 81 D4    JSR $D481  [$99:D481]  A:0134 X:018C Y:3762 P:envmxdizc
 
  $99/948D 18          CLC                    A:086F X:0000 Y:3762 P:envmxdizc
 
  $99/948D 18          CLC                    A:086F X:0000 Y:3762 P:envmxdizc
Line 19,523: Line 19,813:
 
  $99/9494 BD 01 00    LDA $0001,x[$7E:3301]  A:0879 X:3300 Y:3762 P:envmxdizc
 
  $99/9494 BD 01 00    LDA $0001,x[$7E:3301]  A:0879 X:3300 Y:3762 P:envmxdizc
 
  $99/9497 85 00      STA $00    [$00:0000]  A:0032 X:3300 Y:3762 P:envmxdizc
 
  $99/9497 85 00      STA $00    [$00:0000]  A:0032 X:3300 Y:3762 P:envmxdizc
  $99/9499 E6 E3      INC $E3   [$00:00E3]  A:0032 X:3300 Y:3762 P:envmxdizc
+
  $99/9499 E6 E3      INC $E3       ; Increment Data Load Address twice
  $99/949B E6 E3      INC $E3   [$00:00E3]  A:0032 X:3300 Y:3762 P:envmxdizc
+
  $99/949B E6 E3      INC $E3
  $99/949D E2 20      SEP #$20               A:0032 X:3300 Y:3762 P:envmxdizc
+
  $99/949D E2 20      SEP #$20     ; A = 8-bit
 
  $99/949F A4 B2      LDY $B2    [$00:00B2]  A:0032 X:3300 Y:3762 P:envMxdizc
 
  $99/949F A4 B2      LDY $B2    [$00:00B2]  A:0032 X:3300 Y:3762 P:envMxdizc
 
  $99/94A1 22 B0 D4 81 JSL $81D4B0[$81:D4B0]  A:0032 X:3300 Y:0879 P:envMxdizc
 
  $99/94A1 22 B0 D4 81 JSL $81D4B0[$81:D4B0]  A:0032 X:3300 Y:0879 P:envMxdizc
Line 19,535: Line 19,825:
 
  $99/94AF 68          PLA                    A:0000 X:3300 Y:0009 P:envMxdiZc
 
  $99/94AF 68          PLA                    A:0000 X:3300 Y:0009 P:envMxdiZc
 
  $99/94B0 22 31 93 9A JSL $9A9331[$9A:9331]  A:0034 X:3300 Y:0009 P:envMxdizc
 
  $99/94B0 22 31 93 9A JSL $9A9331[$9A:9331]  A:0034 X:3300 Y:0009 P:envMxdizc
  $99/94B4 86 39      STX $39   [$00:0039]  A:0034 X:0004 Y:0009 P:envMxdizc
+
  $99/94B4 86 39      STX $39       ; Store Figure Number in $39
 
  $99/94B6 BD 56 1A    LDA $1A56,x[$7E:1A5A]  A:0034 X:0004 Y:0009 P:envMxdizc
 
  $99/94B6 BD 56 1A    LDA $1A56,x[$7E:1A5A]  A:0034 X:0004 Y:0009 P:envMxdizc
 
  $99/94B9 85 B0      STA $B0    [$00:00B0]  A:0008 X:0004 Y:0009 P:envMxdizc
 
  $99/94B9 85 B0      STA $B0    [$00:00B0]  A:0008 X:0004 Y:0009 P:envMxdizc
  $99/94BB BD AE 17    LDA $17AE,x[$7E:17B2]   A:0008 X:0004 Y:0009 P:envMxdizc
+
  $99/94BB BD AE 17    LDA $17AE,x  ; Load Figure's Character Sprite number
 
  $99/94BE 22 86 EB 81 JSL $81EB86[$81:EB86]  A:0034 X:0004 Y:0009 P:envMxdizc
 
  $99/94BE 22 86 EB 81 JSL $81EB86[$81:EB86]  A:0034 X:0004 Y:0009 P:envMxdizc
 
  $99/94C2 85 08      STA $08    [$00:0008]  A:0032 X:0004 Y:0009 P:envMxdizc
 
  $99/94C2 85 08      STA $08    [$00:0008]  A:0032 X:0004 Y:0009 P:envMxdizc
Line 19,548: Line 19,838:
 
  $99/94D1 22 42 81 81 JSL $818142[$81:8142]  A:00AC X:0004 Y:0001 P:eNvMxdizC
 
  $99/94D1 22 42 81 81 JSL $818142[$81:8142]  A:00AC X:0004 Y:0001 P:eNvMxdizC
 
  $99/94D5 22 E8 95 80 JSL $8095E8[$80:95E8]  A:4503 X:0004 Y:0002 P:envMxdizC
 
  $99/94D5 22 E8 95 80 JSL $8095E8[$80:95E8]  A:4503 X:0004 Y:0002 P:envMxdizC
  $99/94D9 22 8A A1 80 JSL $80A18A[$80:A18A]   A:FF20 X:1758 Y:000A P:envMxdizC
+
  $99/94D9 22 8A A1 80 JSL $80A18A  ; Wait for NMI
 
  $99/94DD A6 E1      LDX $E1    [$00:00E1]  A:FF80 X:1758 Y:000A P:envMxdizc
 
  $99/94DD A6 E1      LDX $E1    [$00:00E1]  A:FF80 X:1758 Y:000A P:envMxdizc
 
  $99/94DF A9 09      LDA #$09                A:FF80 X:3300 Y:000A P:envMxdizc
 
  $99/94DF A9 09      LDA #$09                A:FF80 X:3300 Y:000A P:envMxdizc
 
  $99/94E1 9D 0B 00    STA $000B,x[$7E:330B]  A:FF09 X:3300 Y:000A P:envMxdizc
 
  $99/94E1 9D 0B 00    STA $000B,x[$7E:330B]  A:FF09 X:3300 Y:000A P:envMxdizc
  $99/94E4 60          RTS                     A:FF09 X:3300 Y:000A P:envMxdizc
+
  $99/94E4 60          RTS
  
 
== $99/9572 ? ==
 
== $99/9572 ? ==
Line 19,620: Line 19,910:
 
  $99/9623 C9 0F      CMP #$0F                A:0061 X:0002 Y:0000 P:envMxdizC
 
  $99/9623 C9 0F      CMP #$0F                A:0061 X:0002 Y:0000 P:envMxdizC
 
  $99/9625 F0 02      BEQ $02    [$9629]      A:0061 X:0002 Y:0000 P:envMxdizC
 
  $99/9625 F0 02      BEQ $02    [$9629]      A:0061 X:0002 Y:0000 P:envMxdizC
  $99/9627 80 4B      BRA $4B   [$9674]     A:0061 X:0002 Y:0000 P:envMxdizC
+
  $99/9627 80 4B      BRA $4B       ; [$9674] Else, exit
 
;code is missing here
 
;code is missing here
  $99/9674 60          RTS                     A:0061 X:0002 Y:0000 P:envMxdizC
+
  $99/9674 60          RTS
  
 
== $99/99A3 ? ==
 
== $99/99A3 ? ==
Line 19,638: Line 19,928:
 
  $99/99B6 BD 01 00    LDA $0001,x[$7E:3301]  A:087D X:3300 Y:37A6 P:envmxdizc
 
  $99/99B6 BD 01 00    LDA $0001,x[$7E:3301]  A:087D X:3300 Y:37A6 P:envmxdizc
 
  $99/99B9 85 00      STA $00    [$00:0000]  A:0032 X:3300 Y:37A6 P:envmxdizc
 
  $99/99B9 85 00      STA $00    [$00:0000]  A:0032 X:3300 Y:37A6 P:envmxdizc
  $99/99BB D4 5C      PEI ($5C)       [$3911]      A:0032 X:3300 Y:37A6 P:envmxdizc
+
  $99/99BB D4 5C      PEI ($5C) [$3911]      A:0032 X:3300 Y:37A6 P:envmxdizc
 
  $99/99BD 20 B3 D4    JSR $D4B3  [$99:D4B3]  A:0032 X:3300 Y:37A6 P:envmxdizc
 
  $99/99BD 20 B3 D4    JSR $D4B3  [$99:D4B3]  A:0032 X:3300 Y:37A6 P:envmxdizc
 
  $99/99C0 FA          PLX                    A:007E X:37A6 Y:0002 P:envmxdizC
 
  $99/99C0 FA          PLX                    A:007E X:37A6 Y:0002 P:envmxdizC
Line 19,670: Line 19,960:
 
  $99/99FF 22 C5 81 81 JSL $8181C5[$81:81C5]  A:00AB X:0000 Y:0001 P:eNvMxdizC
 
  $99/99FF 22 C5 81 81 JSL $8181C5[$81:81C5]  A:00AB X:0000 Y:0001 P:eNvMxdizC
 
  $99/9A03 22 E8 95 80 JSL $8095E8[$80:95E8]  A:3900 X:0000 Y:0002 P:envMxdizc
 
  $99/9A03 22 E8 95 80 JSL $8095E8[$80:95E8]  A:3900 X:0000 Y:0002 P:envMxdizc
  $99/9A07 22 8A A1 80 JSL $80A18A[$80:A18A]   A:FF20 X:1744 Y:000A P:envMxdizC
+
  $99/9A07 22 8A A1 80 JSL $80A18A  ; Wait for NMI
 
  $99/9A0B 68          PLA                    A:FF80 X:1744 Y:000A P:envMxdizc
 
  $99/9A0B 68          PLA                    A:FF80 X:1744 Y:000A P:envMxdizc
 
  $99/9A0C C9 BD      CMP #$BD                A:FF2F X:1744 Y:000A P:envMxdizc
 
  $99/9A0C C9 BD      CMP #$BD                A:FF2F X:1744 Y:000A P:envMxdizc
Line 19,923: Line 20,213:
 
  $99/BCC8 22 B0 A4 9B JSL $9BA4B0[$9B:A4B0]  A:12C0 X:0200 Y:0006 P:envMxdizC
 
  $99/BCC8 22 B0 A4 9B JSL $9BA4B0[$9B:A4B0]  A:12C0 X:0200 Y:0006 P:envMxdizC
 
  $99/BCCC 20 80 C8    JSR $C880  [$99:C880]  A:0000 X:0200 Y:0006 P:envMxdizC
 
  $99/BCCC 20 80 C8    JSR $C880  [$99:C880]  A:0000 X:0200 Y:0006 P:envMxdizC
  $99/BCCF 22 8A A1 80 JSL $80A18A[$80:A18A]   A:FF02 X:003C Y:0002 P:envMxdizC
+
  $99/BCCF 22 8A A1 80 JSL $80A18A  ; Wait for NMI
  $99/BCD3 C2 20      REP #$20               A:FF80 X:003C Y:0002 P:envMxdizc
+
  $99/BCD3 C2 20      REP #$20     ; A = 16-bit
  $99/BCD5 E6 E3      INC $E3   [$00:00E3]  A:FF80 X:003C Y:0002 P:envmxdizc
+
  $99/BCD5 E6 E3      INC $E3       ; Increment Data Load Address six times
  $99/BCD7 E6 E3      INC $E3   [$00:00E3]  A:FF80 X:003C Y:0002 P:envmxdizc
+
  $99/BCD7 E6 E3      INC $E3
  $99/BCD9 E6 E3      INC $E3   [$00:00E3]  A:FF80 X:003C Y:0002 P:envmxdizc
+
  $99/BCD9 E6 E3      INC $E3
  $99/BCDB E6 E3      INC $E3   [$00:00E3]  A:FF80 X:003C Y:0002 P:envmxdizc
+
  $99/BCDB E6 E3      INC $E3
  $99/BCDD E6 E3      INC $E3   [$00:00E3]  A:FF80 X:003C Y:0002 P:envmxdizc
+
  $99/BCDD E6 E3      INC $E3
  $99/BCDF E6 E3      INC $E3   [$00:00E3]  A:FF80 X:003C Y:0002 P:envmxdizc
+
  $99/BCDF E6 E3      INC $E3
 
  $99/BCE1 4C 31 8A    JMP $8A31  [$99:8A31]  A:FF80 X:003C Y:0002 P:envmxdizc
 
  $99/BCE1 4C 31 8A    JMP $8A31  [$99:8A31]  A:FF80 X:003C Y:0002 P:envmxdizc
  
Line 20,458: Line 20,748:
 
  $99/D31F 29 FC      AND #$FC                A:0000 X:3300 Y:0004 P:envMxdiZc
 
  $99/D31F 29 FC      AND #$FC                A:0000 X:3300 Y:0004 P:envMxdiZc
 
  $99/D321 99 DE 19    STA $19DE,y[$7E:19E2]  A:0000 X:3300 Y:0004 P:envMxdiZc
 
  $99/D321 99 DE 19    STA $19DE,y[$7E:19E2]  A:0000 X:3300 Y:0004 P:envMxdiZc
  $99/D324 22 8A A1 80 JSL $80A18A[$80:A18A]   A:0000 X:3300 Y:0004 P:envMxdiZc
+
  $99/D324 22 8A A1 80 JSL $80A18A  ; Wait for NMI
  $99/D328 60          RTS                     A:0080 X:3300 Y:0004 P:envMxdizc
+
  $99/D328 60          RTS
  
 
== $99/D39B ? ==
 
== $99/D39B ? ==
Line 20,494: Line 20,784:
 
  $99/D3D9 29 FC      AND #$FC                A:0000 X:331A Y:000C P:envMxdiZc
 
  $99/D3D9 29 FC      AND #$FC                A:0000 X:331A Y:000C P:envMxdiZc
 
  $99/D3DB 99 DE 19    STA $19DE,y[$7E:19EA]  A:0000 X:331A Y:000C P:envMxdiZc
 
  $99/D3DB 99 DE 19    STA $19DE,y[$7E:19EA]  A:0000 X:331A Y:000C P:envMxdiZc
  $99/D3DE 22 8A A1 80 JSL $80A18A[$80:A18A]   A:0000 X:331A Y:000C P:envMxdiZc
+
  $99/D3DE 22 8A A1 80 JSL $80A18A  ; Wait for NMI
  $99/D3E2 60          RTS                     A:0080 X:331A Y:000C P:envMxdizc
+
  $99/D3E2 60          RTS
  
 
== $99/D3E3 ? ==
 
== $99/D3E3 ? ==
Line 21,079: Line 21,369:
 
  $9A/803F A9 06      LDA #$06                A:0000 X:00FF Y:00FF P:envMxdiZc
 
  $9A/803F A9 06      LDA #$06                A:0000 X:00FF Y:00FF P:envMxdiZc
 
  $9A/8041 22 92 87 99 JSL $998792[$99:8792]  A:0006 X:00FF Y:00FF P:envMxdizc
 
  $9A/8041 22 92 87 99 JSL $998792[$99:8792]  A:0006 X:00FF Y:00FF P:envMxdizc
  $9A/8045 22 8A A1 80 JSL $80A18A[$80:A18A]   A:E80C X:FFFE Y:0320 P:envMxdizc
+
  $9A/8045 22 8A A1 80 JSL $80A18A  ; Wait for NMI
 
  $9A/8049 22 F5 87 99 JSL $9987F5[$99:87F5]  A:E880 X:FFFE Y:0320 P:envMxdizc
 
  $9A/8049 22 F5 87 99 JSL $9987F5[$99:87F5]  A:E880 X:FFFE Y:0320 P:envMxdizc
 
  $9A/804D C9 FF      CMP #$FF                A:FF03 X:3300 Y:0002 P:envMxdizC
 
  $9A/804D C9 FF      CMP #$FF                A:FF03 X:3300 Y:0002 P:envMxdizC
Line 21,754: Line 22,044:
 
  $9C/8DF5 69 C0 00    ADC #$00C0    ; ???
 
  $9C/8DF5 69 C0 00    ADC #$00C0    ; ???
 
  $9C/8DF8 AA          TAX          ; ???
 
  $9C/8DF8 AA          TAX          ; ???
  $9C/8DF9 E2 20      SEP #$20
+
  $9C/8DF9 E2 20      SEP #$20     ; A = 8-bit
 
  $9C/8DFB A9 20      LDA #$20      ; ???
 
  $9C/8DFB A9 20      LDA #$20      ; ???
 
  $9C/8DFD 85 00      STA $00      ; ???
 
  $9C/8DFD 85 00      STA $00      ; ???
Line 21,762: Line 22,052:
 
  $9C/8E0E 22 03 80 8F JSL $8F8003  ; ???
 
  $9C/8E0E 22 03 80 8F JSL $8F8003  ; ???
 
  $9C/8E12 64 E7      STZ $E7      ; ???
 
  $9C/8E12 64 E7      STZ $E7      ; ???
  $9C/8E14 9C 9C 17    STZ $179C    ; ???
+
  $9C/8E14 9C 9C 17    STZ $179C    ; Clear Register for Frame Counter
 
  $9C/8E17 9C E6 1E    STZ $1EE6    ; ???
 
  $9C/8E17 9C E6 1E    STZ $1EE6    ; ???
  $9C/8E1A 7B          TDC          ; ???
+
  $9C/8E1A 7B          TDC          ; Clear 16-bit A
  $9C/8E1B AA          TAX          ; ???
+
  $9C/8E1B AA          TAX          ; Clear X
 
  $9C/8E1C 8E 61 00    STX $0061    ; ???
 
  $9C/8E1C 8E 61 00    STX $0061    ; ???
 
  $9C/8E1F 8E 63 00    STX $0063    ; ???
 
  $9C/8E1F 8E 63 00    STX $0063    ; ???
Line 21,772: Line 22,062:
 
  $9C/8E29 8F 29 B2 7E STA $7EB229  ; ???
 
  $9C/8E29 8F 29 B2 7E STA $7EB229  ; ???
 
  $9C/8E2D 8F A9 B2 7E STA $7EB2A9  ; ???
 
  $9C/8E2D 8F A9 B2 7E STA $7EB2A9  ; ???
  $9C/8E31 EE C0 05    INC $05C0    ; ???
+
  $9C/8E31 EE C0 05    INC $05C0    ; Increment Intro Jump Table Index
 
  $9C/8E34 A9 00      LDA #$00      ; Deactivate FBLANK, Screen Brightness = 0%
 
  $9C/8E34 A9 00      LDA #$00      ; Deactivate FBLANK, Screen Brightness = 0%
 
  $9C/8E36 8D 00 21    STA $2100
 
  $9C/8E36 8D 00 21    STA $2100
Line 21,801: Line 22,091:
 
  $9C/8E69 60          RTS
 
  $9C/8E69 60          RTS
  
== $9C/8E6A GAME INTRO: Hermit Logo?/Music Start ==
+
== $9C/8E6A GAME INTRO: Hermit Logo/Music Start ==
  
 
The Tilemap for the Hermit Logo is already in VRAM Buffer (at $0C00). The BG2 Tilemap address ($2108, buffered in $058C) is already set to #$0C in the Game Intro step before (at $9C/8E49, or at $9C/8E5E to be exact).
 
The Tilemap for the Hermit Logo is already in VRAM Buffer (at $0C00). The BG2 Tilemap address ($2108, buffered in $058C) is already set to #$0C in the Game Intro step before (at $9C/8E49, or at $9C/8E5E to be exact).
Line 21,853: Line 22,143:
 
  $9C/8EC5 8E 9C 17    STX $179C    ; Reset Frame Counter
 
  $9C/8EC5 8E 9C 17    STX $179C    ; Reset Frame Counter
 
  $9C/8EC8 8E 9E 17    STX $179E  [$9C:179E]  A:0000 X:0000 Y:0020 P:envMxdiZc
 
  $9C/8EC8 8E 9E 17    STX $179E  [$9C:179E]  A:0000 X:0000 Y:0020 P:envMxdiZc
  $9C/8ECB 8E 95 05    STX $0595    ; BG2 Horizontal Scroll Register
+
  $9C/8ECB 8E 95 05    STX $0595    ; Set BG2 Horizontal Scroll Register to #$0000
  $9C/8ECE EE C0 05    INC $05C0    ; ??? Increment Jump Table Index
+
  $9C/8ECE EE C0 05    INC $05C0    ; Increment the overall pointer - do the next step in the Intro
 
  $9C/8ED1 60          RTS
 
  $9C/8ED1 60          RTS
  
== $9C/8ED2 ? ==
+
== $9C/8ED2 GAME INTRO: Quest Presents/Fade to Sky Intro ==
  
  $9C/8ED2 AE 9C 17    LDX $179C [$9C:179C]  A:0006 X:0006 Y:0020 P:envMxdizc
+
Like in the subroutine before, this subroutine handles different things depending on the value of a frame counter (in $179C).
  $9C/8ED5 E8          INX                     A:0006 X:0000 Y:0020 P:envMxdiZc
+
 
  $9C/8ED6 8E 9C 17    STX $179C [$9C:179C]  A:0006 X:0001 Y:0020 P:envMxdizc
+
* If the timer is <#0124, the screen fades in ($9C/87FB)
  $9C/8ED9 E0 AE 01    CPX #$01AE             A:0006 X:0001 Y:0020 P:envMxdizc
+
* If the timer has reached #$124, ?????????? ($9C/8F29)
  $9C/8EDC D0 44      BNE $44   [$8F22]     A:0006 X:0001 Y:0020 P:eNvMxdizc
+
* If the timer is between #$125 and #$1AD, ?????????? ($9C/8F34)
  $9C/8EDE A9 00      LDA #$00               A:0006 X:01AE Y:009B P:envMxdiZC
+
* If the timer has reached #$1AE, ?????????? ($9C/8EDE)
  $9C/8EE0 85 22      STA $22   [$00:0022]  A:0000 X:01AE Y:009B P:envMxdiZC
+
 
  $9C/8EE2 A2 EB 12    LDX #$12EB             A:0000 X:01AE Y:009B P:envMxdiZC
+
  $9C/8ED2 AE 9C 17    LDX $179C     ; Load Timer (Frame Counter)
  $9C/8EE5 86 20      STX $20   [$00:0020]  A:0000 X:12EB Y:009B P:envMxdizC
+
  $9C/8ED5 E8          INX           ; Inc Timer
  $9C/8EE7 A9 9C      LDA #$9C               A:0000 X:12EB Y:009B P:envMxdizC
+
  $9C/8ED6 8E 9C 17    STX $179C     ; Store incremented Timer back
  $9C/8EE9 85 25      STA $25   [$00:0025]  A:009C X:12EB Y:009B P:eNvMxdizC
+
  $9C/8ED9 E0 AE 01    CPX #$01AE   ; Has Timer reached #$01AE?
  $9C/8EEB A2 F4 DC    LDX #$DCF4             A:009C X:12EB Y:009B P:eNvMxdizC
+
  $9C/8EDC D0 44      BNE $44       ; [$8F22] Branch if not
  $9C/8EEE 86 23      STX $23   [$00:0023]  A:009C X:DCF4 Y:009B P:eNvMxdizC
+
  $9C/8EDE A9 00      LDA #$00     ; Setup 24-bit address of VGRAM buffer ($00/12EB) in [$20]
 +
  $9C/8EE0 85 22      STA $22
 +
  $9C/8EE2 A2 EB 12    LDX #$12EB
 +
  $9C/8EE5 86 20      STX $20
 +
  $9C/8EE7 A9 9C      LDA #$9C     ; Setup 24-bit address ($9C/DCF4) in [$23]
 +
  $9C/8EE9 85 25      STA $25
 +
  $9C/8EEB A2 F4 DC    LDX #$DCF4
 +
  $9C/8EEE 86 23      STX $23
 
  $9C/8EF0 22 14 AA 83 JSL $83AA14[$83:AA14]  A:009C X:DCF4 Y:009B P:eNvMxdizC
 
  $9C/8EF0 22 14 AA 83 JSL $83AA14[$83:AA14]  A:009C X:DCF4 Y:009B P:eNvMxdizC
  $9C/8EF4 7B          TDC                     A:0094 X:0020 Y:0020 P:eNvMxdizc
+
  $9C/8EF4 7B          TDC           ; Clear 16-bit A
  $9C/8EF5 AA          TAX                     A:0000 X:0020 Y:0020 P:envMxdiZc
+
  $9C/8EF5 AA          TAX           ; Clear X
  $9C/8EF6 8E 9C 17    STX $179C [$9C:179C]  A:0000 X:0000 Y:0020 P:envMxdiZc
+
  $9C/8EF6 8E 9C 17    STX $179C     ; Clear Frame Counter
  $9C/8EF9 8E 9E 17    STX $179E [$9C:179E]  A:0000 X:0000 Y:0020 P:envMxdiZc
+
  $9C/8EF9 8E 9E 17    STX $179E     ; Clear Special Frame Counter
  $9C/8EFC A9 1C      LDA #$1C               A:0000 X:0000 Y:0020 P:envMxdiZc
+
  $9C/8EFC A9 1C      LDA #$1C     ; BG1 Tilemap address: $1C00, no mirroring
  $9C/8EFE 8D 8B 05    STA $058B [$9C:058B]  A:001C X:0000 Y:0020 P:envMxdizc
+
  $9C/8EFE 8D 8B 05    STA $058B
  $9C/8F01 A9 06      LDA #$06               A:001C X:0000 Y:0020 P:envMxdizc
+
  $9C/8F01 A9 06      LDA #$06     ; BG2/3 on Main Screen
  $9C/8F03 8D A6 05    STA $05A6 [$9C:05A6]  A:0006 X:0000 Y:0020 P:envMxdizc
+
  $9C/8F03 8D A6 05    STA $05A6
  $9C/8F06 A9 01      LDA #$01               A:0006 X:0000 Y:0020 P:envMxdizc
+
  $9C/8F06 A9 01      LDA #$01     ; BG1 on Subscreen
  $9C/8F08 8D A7 05    STA $05A7 [$9C:05A7]  A:0001 X:0000 Y:0020 P:envMxdizc
+
  $9C/8F08 8D A7 05    STA $05A7
  $9C/8F0B A9 22      LDA #$22               A:0001 X:0000 Y:0020 P:envMxdizc
+
  $9C/8F0B A9 22      LDA #$22     ; NotMathWindow Mask
  $9C/8F0D 8D AA 05    STA $05AA [$9C:05AA]  A:0022 X:0000 Y:0020 P:envMxdizc
+
  $9C/8F0D 8D AA 05    STA $05AA
  $9C/8F10 A2 64 01    LDX #$0164             A:0022 X:0000 Y:0020 P:envMxdizc
+
  $9C/8F10 A2 64 01    LDX #$0164
  $9C/8F13 8E 91 05    STX $0591 [$9C:0591]  A:0022 X:0164 Y:0020 P:envMxdizc
+
  $9C/8F13 8E 91 05    STX $0591     ; BG1 Horizontal Scroll: #$0164
  $9C/8F16 8E 99 05    STX $0599 [$9C:0599]  A:0022 X:0164 Y:0020 P:envMxdizc
+
  $9C/8F16 8E 99 05    STX $0599     ; BG3 Horizontal Scroll: #$0164
 
  $9C/8F19 EE C0 05    INC $05C0    ; Increment the overall pointer - do the next step in the Intro
 
  $9C/8F19 EE C0 05    INC $05C0    ; Increment the overall pointer - do the next step in the Intro
 
  $9C/8F1C 60          RTS
 
  $9C/8F1C 60          RTS
  $9C/8F1D 9C A7 05    STZ $05A7 [$9C:05A7]  A:0007 X:017F Y:009B P:envMxdiZC
+
  $9C/8F1D 9C A7 05    STZ $05A7     ; Remove BG1 from Subscreen
  $9C/8F20 80 56      BRA $56   [$8F78]     A:0007 X:017F Y:009B P:envMxdiZC
+
  $9C/8F20 80 56      BRA $56       ; [$8F78] Increment Special Frame Counter/BG2 X-Scroll
  $9C/8F22 E0 24 01    CPX #$0124             A:0006 X:0001 Y:0020 P:eNvMxdizc
+
  $9C/8F22 E0 24 01    CPX #$0124   ; Has Timer reached #$0124?
  $9C/8F25 90 54      BCC $54      ; [$8F7B] Branch if less than #$0124
+
  $9C/8F25 90 54      BCC $54      ; [$8F7B] Branch if not (Screen fade in and exit)
  $9C/8F27 D0 0B      BNE $0B   [$8F34]     A:0006 X:0124 Y:0020 P:envMxdiZC
+
  $9C/8F27 D0 0B      BNE $0B       ; [$8F34] Branch if it is between #$0125 and #$01AD
 
  $9C/8F29 A9 01      LDA #$01                A:0006 X:0124 Y:0020 P:envMxdiZC
 
  $9C/8F29 A9 01      LDA #$01                A:0006 X:0124 Y:0020 P:envMxdiZC
 
  $9C/8F2B 8D 9E 17    STA $179E  [$9C:179E]  A:0001 X:0124 Y:0020 P:envMxdizC
 
  $9C/8F2B 8D 9E 17    STA $179E  [$9C:179E]  A:0001 X:0124 Y:0020 P:envMxdizC
Line 21,907: Line 22,204:
 
  $9C/8F42 8D 9E 17    STA $179E  [$9C:179E]  A:000F X:0124 Y:0020 P:envMxdizc
 
  $9C/8F42 8D 9E 17    STA $179E  [$9C:179E]  A:000F X:0124 Y:0020 P:envMxdizc
 
  $9C/8F45 EE 9F 17    INC $179F  [$9C:179F]  A:000F X:0124 Y:0020 P:envMxdizc
 
  $9C/8F45 EE 9F 17    INC $179F  [$9C:179F]  A:000F X:0124 Y:0020 P:envMxdizc
  $9C/8F48 A9 00      LDA #$00               A:000F X:0124 Y:0020 P:envMxdizc
+
  $9C/8F48 A9 00      LDA #$00     ; Setup 24-bit address of VGRAM buffer ($00/12EB) in [$20]
  $9C/8F4A 85 22      STA $22   [$00:0022]  A:0000 X:0124 Y:0020 P:envMxdiZc
+
  $9C/8F4A 85 22      STA $22
  $9C/8F4C A2 4B 12    LDX #$124B             A:0000 X:0124 Y:0020 P:envMxdiZc
+
  $9C/8F4C A2 4B 12    LDX #$124B
  $9C/8F4F 86 20      STX $20   [$00:0020]  A:0000 X:124B Y:0020 P:envMxdizc
+
  $9C/8F4F 86 20      STX $20
 
  $9C/8F51 22 76 A9 83 JSL $83A976[$83:A976]  A:0000 X:124B Y:0020 P:envMxdizc
 
  $9C/8F51 22 76 A9 83 JSL $83A976[$83:A976]  A:0000 X:124B Y:0020 P:envMxdizc
 
  $9C/8F55 A2 A0 00    LDX #$00A0              A:0C63 X:0020 Y:0020 P:eNvMxdizc
 
  $9C/8F55 A2 A0 00    LDX #$00A0              A:0C63 X:0020 Y:0020 P:eNvMxdizc
Line 21,923: Line 22,220:
 
  $9C/8F6C E0 B0 00    CPX #$00B0              A:0000 X:00A2 Y:009B P:envmxdizc
 
  $9C/8F6C E0 B0 00    CPX #$00B0              A:0000 X:00A2 Y:009B P:envmxdizc
 
  $9C/8F6F D0 E9      BNE $E9    [$8F5A]      A:0000 X:00A2 Y:009B P:eNvmxdizc
 
  $9C/8F6F D0 E9      BNE $E9    [$8F5A]      A:0000 X:00A2 Y:009B P:eNvmxdizc
  $9C/8F71 E2 20      SEP #$20               A:3DEF X:00B0 Y:009B P:envmxdiZC
+
  $9C/8F71 E2 20      SEP #$20     ; A = 8-bit
  $9C/8F73 A9 01      LDA #$01               A:3DEF X:00B0 Y:009B P:envMxdiZC
+
  $9C/8F73 A9 01      LDA #$01     ; Set Flag for CGRAM Update
  $9C/8F75 8D 49 12    STA $1249 [$9C:1249]  A:3D01 X:00B0 Y:009B P:envMxdizC
+
  $9C/8F75 8D 49 12    STA $1249
  $9C/8F78 4C 41 91    JMP $9141 [$9C:9141]  A:3D01 X:00B0 Y:009B P:envMxdizC
+
  $9C/8F78 4C 41 91    JMP $9141     ; Increment Special Frame Counter/BG2 X-Scroll
 
  $9C/8F7B 20 64 9C    JSR $9C64    ; Screen fade in
 
  $9C/8F7B 20 64 9C    JSR $9C64    ; Screen fade in
 
  $9C/8F7E 60          RTS
 
  $9C/8F7E 60          RTS
 +
 +
== $9C/8F7F GAME INTRO: Sky Intro? ==
 +
 +
$9C/8F7F 7B          TDC          ; Clear 16-bit A
 +
$9C/8F80 A8          TAY          ; Clear Y
 +
$9C/8F81 C2 20      REP #$20                A:0000 X:0008 Y:0000 P:envMxdiZc
 +
$9C/8F83 80 02      BRA $02    [$8F87]      A:0000 X:0008 Y:0000 P:envmxdiZc
 +
$9C/8F85 C8          INY                    A:0000 X:0008 Y:0000 P:eNvmxdizc
 +
$9C/8F86 C8          INY                    A:0000 X:0008 Y:0001 P:envmxdizc
 +
$9C/8F87 B9 DE 8F    LDA $8FDE,y[$9C:8FDE]  A:0000 X:0008 Y:0000 P:envmxdiZc
 +
$9C/8F8A 30 09      BMI $09    [$8F95]      A:0000 X:0008 Y:0000 P:envmxdiZc
 +
$9C/8F8C CD 9E 17    CMP $179E  [$9C:179E]  A:0000 X:0008 Y:0000 P:envmxdiZc
 +
$9C/8F8F F0 6D      BEQ $6D    [$8FFE]      A:0000 X:0008 Y:0000 P:envmxdiZC
 +
$9C/8F91 90 F2      BCC $F2    [$8F85]      A:0000 X:0008 Y:0000 P:eNvmxdizc
 +
$9C/8F93 80 78      BRA $78    [$900D]      A:00D4 X:0008 Y:0002 P:envmxdizC
 +
$9C/8F95 E2 20      SEP #$20                A:8000 X:0008 Y:000E P:eNvmxdizc
 +
$9C/8F97 A2 47 A0    LDX #$A047              A:8000 X:0008 Y:000E P:eNvMxdizc
 +
$9C/8F9A 86 20      STX $20    [$00:0020]  A:8000 X:A047 Y:000E P:eNvMxdizc
 +
$9C/8F9C A9 CB      LDA #$CB                A:8000 X:A047 Y:000E P:eNvMxdizc
 +
$9C/8F9E 85 22      STA $22    [$00:0022]  A:80CB X:A047 Y:000E P:eNvMxdizc
 +
$9C/8FA0 A9 08      LDA #$08                A:80CB X:A047 Y:000E P:eNvMxdizc
 +
$9C/8FA2 A2 A0 00    LDX #$00A0              A:8008 X:A047 Y:000E P:envMxdizc
 +
$9C/8FA5 20 53 90    JSR $9053  [$9C:9053]  A:8008 X:00A0 Y:000E P:envMxdizc
 +
$9C/8FA8 A9 00      LDA #$00                A:0001 X:00B0 Y:0010 P:envMxdizc
 +
$9C/8FAA 85 22      STA $22    [$00:0022]  A:0000 X:00B0 Y:0010 P:envMxdiZc
 +
$9C/8FAC A2 EB 12    LDX #$12EB              A:0000 X:00B0 Y:0010 P:envMxdiZc
 +
$9C/8FAF 86 20      STX $20    [$00:0020]  A:0000 X:12EB Y:0010 P:envMxdizc
 +
$9C/8FB1 A9 9C      LDA #$9C                A:0000 X:12EB Y:0010 P:envMxdizc
 +
$9C/8FB3 85 25      STA $25    [$00:0025]  A:009C X:12EB Y:0010 P:eNvMxdizc
 +
$9C/8FB5 A2 F4 DC    LDX #$DCF4              A:009C X:12EB Y:0010 P:eNvMxdizc
 +
$9C/8FB8 86 23      STX $23    [$00:0023]  A:009C X:DCF4 Y:0010 P:eNvMxdizc
 +
$9C/8FBA 22 14 AA 83 JSL $83AA14[$83:AA14]  A:009C X:DCF4 Y:0010 P:eNvMxdizc
 +
$9C/8FBE A9 0C      LDA #$0C                A:0094 X:0020 Y:0020 P:eNvMxdizc
 +
$9C/8FC0 8D 8B 05    STA $058B  [$9C:058B]  A:000C X:0020 Y:0020 P:envMxdizc
 +
$9C/8FC3 A9 02      LDA #$02                A:000C X:0020 Y:0020 P:envMxdizc
 +
$9C/8FC5 8D A6 05    STA $05A6  [$9C:05A6]  A:0002 X:0020 Y:0020 P:envMxdizc
 +
$9C/8FC8 A9 10      LDA #$10                A:0002 X:0020 Y:0020 P:envMxdizc
 +
$9C/8FCA 8D A7 05    STA $05A7  [$9C:05A7]  A:0010 X:0020 Y:0020 P:envMxdizc
 +
$9C/8FCD A9 02      LDA #$02                A:0010 X:0020 Y:0020 P:envMxdizc
 +
$9C/8FCF 8D AA 05    STA $05AA  [$9C:05AA]  A:0002 X:0020 Y:0020 P:envMxdizc
 +
$9C/8FD2 7B          TDC                    A:0002 X:0020 Y:0020 P:envMxdizc
 +
$9C/8FD3 AA          TAX                    A:0000 X:0020 Y:0020 P:envMxdiZc
 +
$9C/8FD4 8E 91 05    STX $0591  [$9C:0591]  A:0000 X:0000 Y:0020 P:envMxdiZc
 +
$9C/8FD7 8E 9C 17    STX $179C  [$9C:179C]  A:0000 X:0000 Y:0020 P:envMxdiZc
 +
$9C/8FDA EE C0 05    INC $05C0    ; Increment the overall pointer - do the next step in the Intro
 +
$9C/8FDD 60          RTS
 +
;code is missing here
 +
$9C/8FFE B9 EE 8F    LDA $8FEE,y[$9C:8FEE]  A:0000 X:0008 Y:0000 P:envmxdiZC
 +
$9C/9001 8D 91 05    STA $0591  [$9C:0591]  A:0164 X:0008 Y:0000 P:envmxdizC
 +
$9C/9004 3A          DEC A                  A:0164 X:0008 Y:0000 P:envmxdizC
 +
$9C/9005 8D 99 05    STA $0599  [$9C:0599]  A:0163 X:0008 Y:0000 P:envmxdizC
 +
$9C/9008 9C 9C 17    STZ $179C  [$9C:179C]  A:0163 X:0008 Y:0000 P:envmxdizC
 +
$9C/900B 84 0E      STY $0E    [$00:000E]  A:0163 X:0008 Y:0000 P:envmxdizC
 +
$9C/900D EE 9E 17    INC $179E  [$9C:179E]  A:0163 X:0008 Y:0000 P:envmxdizC
 +
$9C/9010 20 41 91    JSR $9141  [$9C:9141]  A:0163 X:0008 Y:0000 P:envmxdizC
 +
$9C/9013 7B          TDC                    A:0109 X:0008 Y:0000 P:eNvMxdizc
 +
$9C/9014 E2 20      SEP #$20                A:0000 X:0008 Y:0000 P:envMxdiZc
 +
$9C/9016 AD 9C 17    LDA $179C  [$9C:179C]  A:0000 X:0008 Y:0000 P:envMxdiZc
 +
$9C/9019 C9 10      CMP #$10                A:0000 X:0008 Y:0000 P:envMxdiZc
 +
$9C/901B B0 24      BCS $24    [$9041]      A:0000 X:0008 Y:0000 P:eNvMxdizc
 +
$9C/901D 85 00      STA $00    [$00:0000]  A:0000 X:0008 Y:0000 P:eNvMxdizc
 +
$9C/901F A9 0F      LDA #$0F                A:0000 X:0008 Y:0000 P:eNvMxdizc
 +
$9C/9021 38          SEC                    A:000F X:0008 Y:0000 P:envMxdizc
 +
$9C/9022 E5 00      SBC $00    [$00:0000]  A:000F X:0008 Y:0000 P:envMxdizC
 +
$9C/9024 C2 20      REP #$20                A:000F X:0008 Y:0000 P:envMxdizC
 +
$9C/9026 4A          LSR A                  A:000F X:0008 Y:0000 P:envmxdizC
 +
$9C/9027 0A          ASL A                  A:0007 X:0008 Y:0000 P:envmxdizC
 +
$9C/9028 0A          ASL A                  A:000E X:0008 Y:0000 P:envmxdizc
 +
$9C/9029 0A          ASL A                  A:001C X:0008 Y:0000 P:envmxdizc
 +
$9C/902A 0A          ASL A                  A:0038 X:0008 Y:0000 P:envmxdizc
 +
$9C/902B 18          CLC                    A:0070 X:0008 Y:0000 P:envmxdizc
 +
$9C/902C 69 F4 DC    ADC #$DCF4              A:0070 X:0008 Y:0000 P:envmxdizc
 +
$9C/902F 85 20      STA $20    [$00:0020]  A:DD64 X:0008 Y:0000 P:eNvmxdizc
 +
$9C/9031 E2 20      SEP #$20                A:DD64 X:0008 Y:0000 P:eNvmxdizc
 +
$9C/9033 A9 9C      LDA #$9C                A:DD64 X:0008 Y:0000 P:eNvMxdizc
 +
$9C/9035 85 22      STA $22    [$00:0022]  A:DD9C X:0008 Y:0000 P:eNvMxdizc
 +
$9C/9037 A9 08      LDA #$08                A:DD9C X:0008 Y:0000 P:eNvMxdizc
 +
$9C/9039 A2 A0 00    LDX #$00A0              A:DD08 X:0008 Y:0000 P:envMxdizc
 +
$9C/903C 20 53 90    JSR $9053  [$9C:9053]  A:DD08 X:00A0 Y:0000 P:envMxdizc
 +
$9C/903F 80 09      BRA $09    [$904A]      A:1801 X:00B0 Y:0010 P:envMxdizc
 +
$9C/9041 C9 C4      CMP #$C4                A:0010 X:0008 Y:0002 P:envMxdiZC
 +
$9C/9043 90 0A      BCC $0A    [$904F]      A:0010 X:0008 Y:0002 P:envMxdizc
 +
$9C/9045 38          SEC                    A:00C4 X:0008 Y:0002 P:envMxdiZC
 +
$9C/9046 E9 C4      SBC #$C4                A:00C4 X:0008 Y:0002 P:envMxdiZC
 +
$9C/9048 80 DA      BRA $DA    [$9024]      A:0000 X:0008 Y:0002 P:envMxdiZC
 +
$9C/904A A9 01      LDA #$01                A:1801 X:00B0 Y:0010 P:envMxdizc
 +
$9C/904C 8D 49 12    STA $1249  [$9C:1249]  A:1801 X:00B0 Y:0010 P:envMxdizc
 +
$9C/904F EE 9C 17    INC $179C  [$9C:179C]  A:1801 X:00B0 Y:0010 P:envMxdizc
 +
$9C/9052 60          RTS                    A:1801 X:00B0 Y:0010 P:envMxdizc
  
 
== $9C/9053 Transfer colors to CGRAM buffer ==
 
== $9C/9053 Transfer colors to CGRAM buffer ==
Line 21,957: Line 22,343:
 
  $9C/906C 8D 49 12    STA $1249
 
  $9C/906C 8D 49 12    STA $1249
 
  $9C/906F 60          RTS
 
  $9C/906F 60          RTS
 +
 +
== $9C/9141 GAME INTRO: Increment Special Frame Counter/BG2 X-Scroll ==
 +
 +
$9C/9141 E2 20      SEP #$20      ; A = 8-bit
 +
$9C/9143 EE 9A 17    INC $179A    ; Increment Special Frame Counter
 +
$9C/9146 AD 9A 17    LDA $179A    ; Has Special Frame Counter reached #$0A
 +
$9C/9149 C9 0A      CMP #$0A
 +
$9C/914B D0 08      BNE $08      ; [$9155] If not, exit
 +
$9C/914D 7B          TDC          ; Clear 16-bit A
 +
$9C/914E AE 95 05    LDX $0595    ; Load Buffered BG2 Horizontal Scroll value
 +
$9C/9151 E8          INX          ; Increment it
 +
$9C/9152 8E 95 05    STX $0595    ; Store it back
 +
$9C/9155 8D 9A 17    STA $179A    ; Reset Special Frame Counter
 +
$9C/9158 60          RTS
  
 
== $9C/9234 ? ==
 
== $9C/9234 ? ==
Line 22,382: Line 22,782:
  
 
= Bank $9E =
 
= Bank $9E =
== $9E/99CE ? ==
+
== $9E/99CE BATTLE: ? Movement-Possibilities related ==
  
 
  $9E/99CE 8B          PHB          ; Buffer Data Bank on Stack
 
  $9E/99CE 8B          PHB          ; Buffer Data Bank on Stack
Line 22,436: Line 22,836:
 
  $9E/9A57 BB          TYX                    A:0101 X:0006 Y:0006 P:envMxdizC
 
  $9E/9A57 BB          TYX                    A:0101 X:0006 Y:0006 P:envMxdizC
 
  $9E/9A58 22 9C 99 80 JSL $80999C[$80:999C]  A:0101 X:0006 Y:0006 P:envMxdizC
 
  $9E/9A58 22 9C 99 80 JSL $80999C[$80:999C]  A:0101 X:0006 Y:0006 P:envMxdizC
  $9E/9A5C AB          PLB                     A:8102 X:0006 Y:0006 P:eNvMxdizc
+
  $9E/9A5C AB          PLB           ; Restore Data Bank from Stack
  $9E/9A5D 6B          RTL                     A:8102 X:0006 Y:0006 P:envMxdizc
+
  $9E/9A5D 6B          RTL
  
 
== $9E/9B8F ? ==
 
== $9E/9B8F ? ==

Latest revision as of 06:22, 20 March 2019

Contents

ROM offsets

These are ROM offsets for the starting points of each section (all in hex), pretty sure it's headerless (latest ROM revision, has Lakmir's translation patch applied to it):

40c33 - Spell Areas
40cc9 - Spell Function Bytes
40fb7 - Spell Accuracy Types (Auto-Hit, Dex-Based, etc.)
4104d - Spell Cost Type (Whether it eats HP or MP, how much, etc.)
41179 - Spell Formula Table
4133B - Spell Elements (Fire, Air, Virtue, etc.)
42703 - Character Sprite pointers
429e3 - Character Name pointers
42ad2 - Job IDs
42bc2 - Starting Elements
42cb0 - Starting Alignments
42dbf - Number of Magic Slots
42ead - Starting Level
42f9b - Starting HP
430bb - HP Growth
4314b - Starting MP
4326b - MP Growth
432fb - Starting Strength
4338b - Strength Growth
4341b - Starting Vitality
434ab - Vitality Growth
4353b - Starting Intelligence
435cb - Intelligence Growth
4365b - Starting Mentality
436eb - Mentality Growth
4377b - Starting Agility
4380b - Agility Growth
4389b - Starting Dexterity
4392b - Dexterity Growth
43a4c - Class Weight Penalties
43add - Physical Resistance
43b6e - Air Resistance
43bff - Fire Resistance
43c90 - Earth Resistance
43d21 - Water Resistance
43db2 - Virtue Resistance
43e43 - Bane Resistance
43ef4 - Attack+ Capability
440b1 - Species Table
441a1 - Basic Indirect Attack Type
442b0 - Magic Set that can be equipped
443a0 - Class Special Attacks (Slot 1)
4448f - Class Special Attacks (Slot 2)
4457e - Class Special Attacks (Slot 3)
4466d - Class Special Attacks (Slot 4)
4475b - Movement Types
44849 - Movement Rates
44937 - Starting Loyalties
44a26 - Weather Tolerance
451da - Item Types
452ca - Item Elements
453ba - Weapon Handedness
454aa - Item Equip Slot Locations (Finger, Head, etc.)
45655 - Item Weights
4572e - Item Strength Modifiers (Atk. Power)
4580e - Item Intelligence Modifiers
458ee - Item Agility Modifiers
459ce - Item Dexterity Modifiers
45aae - Item Vitality Modifiers
45b8e - Item Mentality Modifiers
45c6e - Item Luck Modifiers
45d4e - Item Physical Resistance (Def. Power) (signed)
45e2e - Item Air Resistance (signed)
45f0e - Item Fire Resistance (signed)
45fee - Item Earth Resistance (signed)
460ce - Item Water Resistance (signed)
461ae - Item Virtue Resistance (signed)
4628e - Item Bane Resistance (signed)
4646f - Item Prices (multiplied by 10 in-game)
46612 - Item Strength Raise at Level Up
466e4 - Item Intelligence Raise at Level Up
467b4 - Item Agility Raise at Level Up
46884 - Item Dexterity Raise at Level Up
46956 - Item Vitality Raise at Level Up
46a26 - Item Mentality Raise at Level Up
46af6 - Item Luck Raise at Level Up
46bc6 - Item Special Effects (Stuns on hit, Anti-Dragon, etc.)
46cb6 - Item Special Skills (used in the Item menu)
46d86 - Item Status Guards (immunity to petrification, etc.)
46e76 - Item Passive Effects (wearer can fly, HP regen, etc.)
47047 - Spell MP cost/Targeting Information
47172 - Spell Schools (Hahnela, Ishtar, DragonGod, etc.)
47208 - Spell Ranges
4729e - Special Spell Conditions #1 (Summons, Line-of-sight spells, whether equipment is needed, etc.)
4732f - Spell Prices (multiplied by 10 in-game)
47431 - Spell Set Modifiers
474a1 - How the caster behaves when using the spell/skill. NOTE: Each half of the bytes here specifies one skill.
474f1 - Special Spell Conditions #2 (If equipment is needed, this specifies the type (swords, spears, etc.) NOTE: Each half of the bytes here specifies one skill.
ea0dc - Class Grids (determines what you can change into)
ebba7 - Denim's Base Class
ebca1 - Denim's Initial Equipment (Slot 1)
ebcac - Denim's Initial Equipment (Slot 2)
ebcb7 - Denim's Initial Equipment (Slot 3)
ebcc2 - Denim's Initial Equipment (Slot 4)
ebc94 - Denim's Initial Spells (doesn't insert into Magic menu, need to use a JMP routine to get anything out of it)
ed61e - Item Shop pointers/data
ed6d9 - Magic Shop pointers/data
f3195 - Job Stat Requirements (what's needed to change into that job stat-wise, might also cover alignment but I couldn't tell from a glance).

Bank $80

This is all taken from the Japanese V1.0 version

$80/8000 ROM Start

$00/8000 18          CLC           ; Switch to Native Mode
$00/8001 FB          XCE
$00/8002 78          SEI           ; Disable Interrupts
$00/8003 D8          CLD           ; Deactivate Decimal Mode (if accidentally turned on)
$00/8004 4B          PHK           ; Push Bank Register
$00/8005 AB          PLB           ; Pull Data Bank Register
$00/8006 E2 20       SEP #$20
$00/8008 C2 10       REP #$10
$00/800A A2 FF 1F    LDX #$1FFF    ; Set Stack to $7E:1FFF
$00/800D 9A          TXS
$00/800E F4 00 00    PEA $0000     ; Direct Page Register = #$0000
$00/8011 2B          PLD
$00/8012 9C 00 42    STZ $4200     ; Deactivate NMI / Auto-Joypad
$00/8015 9C AF 05    STZ $05AF     ; Backup for $4200?
$00/8018 20 6A 80    JSR $806A     ; De-activate HDMAs, FBLANK, Clear Screen Destination Registers

Clear $7E:2000 to $7E:FFFF

$00/801B A0 00 E0    LDY #$E000    ; DMA Size: #$E000
$00/801E 8C 05 43    STY $4305
$00/8021 A0 00 20    LDY #$2000    ; WRAM Destination: $(7E)2000
$00/8024 18          CLC           ; WRAM-Destination: Bank $7E
$00/8025 A2 69 80    LDX #$8069    ; DMA Source Address: $00/8069 (ROM: $0000.0069
$00/8028 A9 00       LDA #$00
$00/802A 22 A7 9D 80 JSL $809DA7   ; Long Branch to the DMA setup and activation
$00/802E A9 01       LDA #$01      ; Activate Fast ROM
$00/8030 8D 0D 42    STA $420D
$00/8033 22 00 80 8F JSL $8F8000   ; Jump to ??? (Sound Setup?)

$00/8037 64 59       STZ $59       ; ???
$00/8039 64 EA       STZ $EA
$00/803B C6 EA       DEC $EA       ; ??? ($EA = #$FF)
$00/803D A9 01       LDA #$01
$00/803F 85 51       STA $51       ; ??? ($51 = #$01)
$00/8041 78          SEI           ; Disable Interrupts (again)
$00/8042 D8          CLD           ; Deactivate Decimal Mode (again)
$00/8043 4B          PHK           ; Push Bank Register
$00/8044 AB          PLB           ; Pull Data Bank Register
$00/8045 E2 20       SEP #$20
$00/8047 C2 10       REP #$10
$00/8049 A2 00 02    LDX #$0200
$00/804C 8E 5F 05    STX $055F     ; ???
$00/804F 9C 00 42    STZ $4200     ; Deactivate NMI / Auto-Joypad (again)
$00/8052 9C AF 05    STZ $05AF     ; Backup for $4200?
$00/8055 20 6A 80    JSR $806A     ; De-activate HDMAs, FBLANK, Clear Screen Destination Registers 

$00/8058 A9 01       LDA #$01      ; Activate Fast ROM (again)
$00/805A 8D 0D 42    STA $420D
$00/805D AF F0 FF 00 LDA $00FFF0   ; = #$FF
$00/8061 8F F3 00 00 STA $0000F3   ; ???
$00/8065 5C 91 80 80 JMP $808091   ; Jump to ???

$80/8069 Clear Byte

$00/8069 00                        ; Clear Byte for $80/801B

$80/806A De-activate HDMAs, FBLANK, Clear Screen Destination Registers

$00/806A 9C 0C 42    STZ $420C     ; De-activate HDMAs
$00/806D 9C B0 05    STZ $05B0     ; Backup for $420C?
$00/8070 9C 86 05    STZ $0586     ; Backup for $420C?
$00/8073 A9 80       LDA #$80
$00/8075 8D 00 21    STA $2100     ; FBLANK
$00/8078 8D 87 05    STA $0587     ; Backup for $2100
$00/807B 8D 6A 05    STA $056A     ; Backup for $2100
$00/807E 9C 2C 21    STZ $212C     ; Clear Main Screen Destinations
$00/8081 9C 2D 21    STZ $212D     ; Clear Subscreen Destinations
$00/8084 60          RTS

$80/8085 NMI Handler

$00/8085 5C 7E AF 80 JMP $80AF7E   ; NMI Handler ("Jump to" Fast ROM)

$80/8091 ???

$80/8091 22 4A A1 80 JSL $80A14A   ; Long-Jump to Deactivation of NMI, Auto-Joypad & HDMAs
$80/8095 A2 FF 1F    LDX #$1FFF    ; Set Stack to $7E:1FFF
$80/8098 9A          TXS
$80/8099 F4 00 00    PEA $0000     ; Direct Page Register = #$0000
$80/809C 2B          PLD
$80/809D 4B          PHK           ; Push Bank Register
$80/809E AB          PLB           ; Pull Data Bank Register
$80/809F 22 B6 A1 80 JSL $80A1B6   ; Write Executable Code in WRAM
$80/80A3 A5 51       LDA $51    [$00:0051]   A:A16B X:05DD Y:0004 P:eNvMxdIzC
$80/80A5 F0 0C       BEQ $0C    [$80B3]      A:A101 X:05DD Y:0004 P:envMxdIzC
$80/80A7 C9 02       CMP #$02                A:A101 X:05DD Y:0004 P:envMxdIzC
$80/80A9 F0 04       BEQ $04    [$80AF]      A:A101 X:05DD Y:0004 P:eNvMxdIzc
$80/80AB A9 F8       LDA #$F8                A:A101 X:05DD Y:0004 P:eNvMxdIzc
$80/80AD 80 06       BRA $06    [$80B5]      A:A1F8 X:05DD Y:0004 P:eNvMxdIzc

Code is missing here

$80/80B5 85 F5       STA $F5    [$00:00F5]   A:A1F8 X:05DD Y:0004 P:eNvMxdIzc
$80/80B7 22 28 AF 80 JSL $80AF28[$80:AF28]   A:A1F8 X:05DD Y:0004 P:eNvMxdIzc
$80/80BB 22 14 AF 80 JSL $80AF14[$80:AF14]   A:0000 X:05DD Y:0004 P:eNvMxdIzc
$80/80BF E6 EA       INC $EA    [$00:00EA]   A:00FF X:33CC Y:9E7A P:eNvMxdIzc
$80/80C1 A5 EA       LDA $EA    [$00:00EA]   A:00FF X:33CC Y:9E7A P:envMxdIZc
$80/80C3 C9 05       CMP #$05                A:0000 X:33CC Y:9E7A P:envMxdIZc
$80/80C5 90 02       BCC $02    [$80C9]      A:0000 X:33CC Y:9E7A P:eNvMxdIzc

Code is missing here

$80/80C9 20 59 B7    JSR $B759  [$80:B759]   A:0000 X:33CC Y:9E7A P:eNvMxdIzc
$80/80CC 20 73 B6    JSR $B673     ; Clear Registers, clear WRAM Bank $7F
$80/80CF 20 4D B5    JSR $B54D     ; Clear Graphic Setup Registers
$80/80D2 20 CD B5    JSR $B5CD     ; ???
$80/80D5 7B          TDC                     A:E880 X:0320 Y:0000 P:envMxdIzC
$80/80D6 8F 12 BD 7E STA $7EBD12[$7E:BD12]   A:0000 X:0320 Y:0000 P:envMxdIZC
$80/80DA 8F 84 BD 7E STA $7EBD84[$7E:BD84]   A:0000 X:0320 Y:0000 P:envMxdIZC
$80/80DE AF 37 21 00 LDA $002137   ; ??? Makes the current H Counter value appear in $213C?
$80/80E2 AF 3C 21 00 LDA $00213C   ; ??? Current H Counter!?!
$80/80E6 22 65 AD 80 JSL $80AD65[$80:AD65]   A:0080 X:0320 Y:0000 P:eNvMxdIzC
$80/80EA 22 F1 98 80 JSL $8098F1[$80:98F1]   A:0413 X:0021 Y:0000 P:eNvMxdIzC
$80/80EE 9C BD 05    STZ $05BD     ; ??? Flag Register, at least related to CGRAM Updates
$80/80F1 9C 38 00    STZ $0038     ; ???
$80/80F4 9C BF 05    STZ $05BF     ; Set Main Jump Table Index to #$00
$80/80F7 9C C0 05    STZ $05C0     ; ??? Jump Table Index?
$80/80FA A9 80       LDA #$80      ; Activate FBLANK
$80/80FC 8D 87 05    STA $0587
$80/80FF 9C A6 05    STZ $05A6     ; Remove everything from Main Screen
$80/8102 9C A7 05    STZ $05A7     ; Remove everything from Subscreen
$80/8105 58          CLI           ; Enable Interrupts
$80/8106 20 2F A1    JSR $A12F     ; Activate NMI and Auto-Joypad Read
$80/8109 22 8A A1 80 JSL $80A18A   ; Change Bank, wait for NMI and execute code built in WRAM
$80/810D 22 8A A1 80 JSL $80A18A   ; Change Bank, wait for NMI and execute code built in WRAM
$80/8111 22 8A A1 80 JSL $80A18A   ; Change Bank, wait for NMI and execute code built in WRAM
$80/8115 22 4A A1 80 JSL $80A14A   ; Long Jump to Deactivate NMI, Auto-Joypad and HDMAs
$80/8119 AF F3 00 00 LDA $0000F3[$00:00F3]   A:0080 X:00FF Y:0000 P:eNvMxdizc
$80/811D 89 01       BIT #$01                A:00FF X:00FF Y:0000 P:eNvMxdizc
$80/811F D0 08       BNE $08    [$8129]      A:00FF X:00FF Y:0000 P:eNvMxdizc
code is missing here
$80/8129 58          CLI           ; Enable Interrupts
$80/812A 20 2F A1    JSR $A12F     ; Activate NMI and Auto-Joypad Read
$80/812D 22 98 A9 9D JSL $9DA998[$9D:A998]   A:0081 X:00FF Y:0000 P:eNvMxdiZc

$80/8131 Main Loop?

$80/8131 20 92 A1    JSR $A192     ; ??? Wait for the next NMI?
$80/8134 7B          TDC           ; Clear 16-bit A
$80/8135 AD BF 05    LDA $05BF     ; Load Main Jump Table Index and use it
$80/8138 0A          ASL A
$80/8139 AA          TAX
$80/813A FC 42 81    JSR ($8142,x) ; Jump to something on the Main Jump Table
$80/813D 20 72 8D    JSR $8D72     ; Fade Screen In or Out
$80/8140 80 EF       BRA $EF       ; [$8131]

$80/8142 Main Jump Table

67 81   $8167 - Entry #$00
82 81   $8182 - Entry #$01
C5 81   $81C5 - Entry #$02
02 85   $8502 - Entry #$03
F1 88   $88F1 - Entry #$04
66 81   $8166 - Entry #$05 - RTS
22 83   $8322 - Entry #$06
EC 88   $88EC - Entry #$07
C9 9C   $9CC9 - Entry #$08
FD 9C   $9CFD - Entry #$09
66 81   $8166 - Entry #$0A - RTS
66 81   $8166 - Entry #$0B - RTS
2F 84   $842F - Entry #$0C
66 81   $8166 - Entry #$0D - RTS
66 81   $8166 - Entry #$0E - RTS
F6 88   $88F6 - Entry #$10
2E 83   $832E - Entry #$11
8B 81   $818B - Entry #$12

$80/8166 Main Jump Table Entry #$05 - EMPTY

Is just a RTS

$80/81C5 ?

$80/81C5 20 39 AD    JSR $AD39     ; RNG?
$80/81C8 20 09 E0    JSR $E009  [$80:E009]   A:0015 X:0004 Y:000A P:envMxdizc
$80/81CB AD C0 05    LDA $05C0     ; (Some important(?) Jump Table Index value?)
$80/81CE D0 0C       BNE $0C       ; [$81DC] Skip next 4 subroutines if not empty
$80/81D0 20 BA B9    JSR $B9BA  [$80:B9BA]   A:0000 X:003E Y:000A P:envMxdiZc
$80/81D3 20 BE 9A    JSR $9ABE  [$80:9ABE]   A:00C9 X:0040 Y:0000 P:envMxdiZC
$80/81D6 20 0A 8A    JSR $8A0A     ; Scroll the Map due to Cursor Movement
$80/81D9 20 F3 8B    JSR $8BF3     ; Compare BG1 Scroll Buffers
$80/81DC 22 19 80 86 JSL $868019[$86:8019]   A:0000 X:003C Y:0000 P:envMxdiZC
$80/81E0 20 F0 95    JSR $95F0  [$80:95F0]   A:0001 X:0541 Y:0100 P:eNvMxdizC
$80/81E3 A9 01       LDA #$01      ; Set Flag for a CGRAM Update
$80/81E5 8D 49 12    STA $1249
$80/81E8 60          RTS

$80/8875 ?

$80/8875 BD AE 17    LDA $17AE,x[$80:17B0]   A:8107 X:0002 Y:0002 P:envMxdizc
$80/8878 22 B2 A4 88 JSL $88A4B2[$88:A4B2]   A:8135 X:0002 Y:0002 P:envMxdizc
$80/887C 90 1C       BCC $1C    [$889A]      A:8135 X:0002 Y:0002 P:eNvMxdizc
code is missing here
$80/889A 60          RTS                     A:8135 X:0002 Y:0002 P:eNvMxdizc

$80/8900 Increment Jump Table Index?

$80/8900 EE BF 05    INC $05BF     ; Increment one Jump Table Index...
$80/8903 9C C0 05    STZ $05C0     ; ... and set the other to zero?
$80/8906 60          RTS

$80/897D (?) BG1 Scroll related

$80/897D A2 20 00    LDX #$0020    ; (Maximum of rhombs on one axis?)
$80/8980 AD 91 05    LDA $0591     ; Load BG1 H-Scroll Low Byte
$80/8983 29 07       AND #$07      ; Check if any of the lowest three bits is set
$80/8985 F0 01       BEQ $01       ; [$8988] Branch if not
Code is missing here
$80/8988 8A          TXA                     A:1000 X:0020 Y:0001 P:envMxdiZC
$80/8989 85 00       STA $00    [$00:0000]   A:1020 X:0020 Y:0001 P:envMxdizC
$80/898B A0 1C 00    LDY #$001C    ; (Maximum of rhombs on the other axis?)
$80/898E AD 93 05    LDA $0593     ; Load BG1 V-Scroll Low Byte
$80/8991 29 07       AND #$07      ; Check if any of the lowest three bits is set
$80/8993 F0 01       BEQ $01       ; [$8996] Branch if not
$80/8995 C8          INY                     A:1804 X:0020 Y:001C P:envMxdizc
$80/8996 98          TYA                     A:1000 X:0020 Y:001C P:envMxdiZC
$80/8997 85 02       STA $02    [$00:0002]   A:101C X:0020 Y:001C P:envMxdizC
$80/8999 AE 91 05    LDX $0591     ; Copy BG1 H-Scroll in $04
$80/899C 86 04       STX $04
$80/899E AC 93 05    LDY $0593     ; Copy BG1 V-Scroll in $06
$80/89A1 84 06       STY $06
$80/89A3 A9 03       LDA #$03                A:101C X:01A0 Y:0110 P:envMxdizC
$80/89A5 22 FC F0 82 JSL $82F0FC[$82:F0FC]   A:1003 X:01A0 Y:0110 P:envMxdizC
$80/89A9 60          RTS


$80/89AA BATTLE: Long Jump to Check if the Cursor is in Screen Center

$80/89AA 8B          PHB           ; Buffer Data Bank on Stack
$80/89AB 4B          PHK           ; Set Data Bank to $80
$80/89AC AB          PLB
$80/89AD 20 B2 89    JSR $89B2     ; Check if the Cursor is in Screen Center
$80/89B0 AB          PLB           ; Restore Data Bank
$80/89B1 6B          RTL

$80/89B2 BATTLE: Check if the Cursor is in Screen Center

This checks if the Cursor is in the Center of the Screen.

If A is empty at the end, it is in center, if not, it's off center.

$80/89B2 A2 3C 00    LDX #$003C    ; Index of the Rhomb Marker for the Global Pos List
$80/89B5 A0 00 00    LDY #$0000    ; Clear Signal Register
$80/89B8 C2 20       REP #$20
$80/89BA BD 43 07    LDA $0743,x   ; Load the Global X-Position of the Rhomb Marker
$80/89BD 38          SEC           ; Subtract #$80 (no. of pixels between the screen center and border)
$80/89BE E9 80 00    SBC #$0080
$80/89C1 CD 91 05    CMP $0591     ; Compare with BG1 HScroll
$80/89C4 F0 01       BEQ $01       ; [$89C7] Branch if Cursor is in Center
$80/89C6 C8          INY           ; Set Signal - Not in Center!
$80/89C7 BD 83 07    LDA $0783,x   ; Load the Global Y-Position of the Rhomb Marker
$80/89CA 38          SEC           ; Subtract #$77 (about no. of pixels between the screen center and border)
$80/89CB E9 77 00    SBC #$0077
$80/89CE CD 93 05    CMP $0593     ; Compare with BG1 VScroll
$80/89D1 F0 01       BEQ $01       ; [$89D4] Branch if Cursor is in Center
$80/89D3 C8          INY           ; Set Signal - Not in Center!
$80/89D4 E2 20       SEP #$20
$80/89D6 98          TYA           ; Transfer the "Off-Center-Signal" in A
$80/89D7 60          RTS

$80/8A0A BATTLE: Scroll the Map due to Cursor Movement

$80/8A0A AE 91 05    LDX $0591     ; Copy the current BG1 HScroll value in $05FB
$80/8A0D 8E FB 05    STX $05FB
$80/8A10 AE 93 05    LDX $0593     ; Copy the current BG1 VScroll value in $05FD
$80/8A13 8E FD 05    STX $05FD
$80/8A16 AE 3D 00    LDX $003D  [$80:003D]   A:0E00 X:0048 Y:0014 P:envMxdizC
$80/8A19 10 1E       BPL $1E    [$8A39]      A:0E00 X:FFFF Y:0014 P:eNvMxdizC
$80/8A1B A5 60       LDA $60    [$00:0060]   A:0E00 X:FFFF Y:0014 P:eNvMxdizC
$80/8A1D D0 03       BNE $03    [$8A22]      A:0E01 X:FFFF Y:0014 P:envMxdizC
Code is missing here
$80/8A22 A2 3C 00    LDX #$003C    ; Index for the Rhomb Marker
$80/8A25 C2 20       REP #$20
$80/8A27 BD 43 07    LDA $0743,x   ; Load the Global X-Position of the Rhomb Marker
$80/8A2A 85 00       STA $00       ; Use $00 as Tempstore
$80/8A2C BD 83 07    LDA $0783,x   ; Load the Global Y-Position of the Rhomb Marker
$80/8A2F 38          SEC           ; ??? (Subtract 8 for unknown reasons)
$80/8A30 E9 08 00    SBC #$0008
$80/8A33 85 02       STA $02       ; Use $02 as Tempstore
$80/8A35 E2 20       SEP #$20
$80/8A37 80 0E       BRA $0E       ; [$8A47]
Code is missing here
$80/8A47 A0 00 00    LDY #$0000    ; Clear this Direction Flag Register
$80/8A4A C2 20       REP #$20
$80/8A4C A5 00       LDA $00       ; Load the Global X-Position of the Rhomb Marker
$80/8A4E 38          SEC           ; Subtract BG1 Horizontal Scroll
$80/8A4F ED 91 05    SBC $0591
$80/8A52 38          SEC           ; Subtract #$80 (half of Screen Width)
$80/8A53 E9 80 00    SBC #$0080
$80/8A56 10 05       BPL $05       ; [$8A5D] Branch if the cursor is to the right of the screen center
$80/8A58 49 FF FF    EOR #$FFFF    ; It's left to the center, so it's a negative value in A - turn it positive
$80/8A5B 1A          INC A         ; You have to add 1 after turning positive
$80/8A5C C8          INY           ; ??? Set flag for "it was negative"?
$80/8A5D C9 41 00    CMP #$0041    ; Check if the cursor is further than #$41px away from the center
$80/8A60 90 15       BCC $15       ; [$8A77] If not, branch
$80/8A62 A9 C0 00    LDA #$00C0    ; C0 is the border to the right where scrolling doesn't activate yet
$80/8A65 C0 00 00    CPY #$0000    ; Check if the cursor went out of the focus to the left or the right
$80/8A68 F0 03       BEQ $03       ; [$8A6D] Leave out the next line if it was to the right
$80/8A6A A9 40 00    LDA #$0040    ; Replace it with the address of the left border if it was to the left
$80/8A6D 38          SEC           ; Subtract the Global X-Position of the cursor 
$80/8A6E E5 00       SBC $00
$80/8A70 49 FF FF    EOR #$FFFF    ; Turn the result into a positive number
$80/8A73 1A          INC A
$80/8A74 8D 91 05    STA $0591     ; [$80:0591] Store it as the new BG1 H Scroll value
$80/8A77 A0 00 00    LDY #$0000    ; Clear this Direction Flag Register
$80/8A7A C2 20       REP #$20
$80/8A7C A5 02       LDA $02       ; Load the Global Y-Position of the Rhomb Marker
$80/8A7E 38          SEC           ; Subtract BG1 Vertical Scroll
$80/8A7F ED 93 05    SBC $0593
$80/8A82 38          SEC           ; Subtract #$6F (about half of Screen Height)
$80/8A83 E9 6F 00    SBC #$006F
$80/8A86 10 05       BPL $05       ; [$8A8D] Branch if the cursor is in the lower than the screen center
$80/8A88 49 FF FF    EOR #$FFFF    ; It's above the screen center, so turn the distance into a positive number...
$80/8A8B 1A          INC A
$80/8A8C C8          INY           ; ... and set the flag that it is above the center
$80/8A8D C9 29 00    CMP #$0029    ; Check if the cursor is further than #$29px away from the center
$80/8A90 90 15       BCC $15       ; [$8AA7] If not, branch
Code is missing here
$80/8AA7 AD 91 05    LDA $0591     ; Check if this subroutine changed BG1 HScroll Value
$80/8AAA CD FB 05    CMP $05FB
$80/8AAD D0 2A       BNE $2A       ; [$8AD9] Branch if it has
$80/8AAF AD 91 05    LDA $0591  [$80:0591]   A:0150 X:003C Y:0000 P:envmxdiZC
$80/8AB2 89 0F 00    BIT #$000F              A:0150 X:003C Y:0000 P:envmxdizC
$80/8AB5 F0 1D       BEQ $1D    [$8AD4]      A:0150 X:003C Y:0000 P:envmxdiZC
Code is missing here
$80/8AD4 9C FF 05    STZ $05FF     ; Clear $05FF - no distance to scroll
$80/8AD7 80 0A       BRA $0A       ; [$8AE3]
$80/8AD9 AD 91 05    LDA $0591     ; If the BG1 HScroll value has been changed, calculate the difference
$80/8ADC 38          SEC
$80/8ADD ED FB 05    SBC $05FB
$80/8AE0 8D FF 05    STA $05FF     ; And store it in $05FF (16-bit value, can be negative)
Code is missing here
$80/8AE3 AD 93 05    LDA $0593     ; Check if this subroutine changed BG1 VScroll Value
$80/8AE6 CD FD 05    CMP $05FD
$80/8AE9 D0 2A       BNE $2A       ; [$8B15] Branch if it has
$80/8AEB AD 93 05    LDA $0593  [$80:0593]   A:0048 X:003C Y:0000 P:envmxdiZC
$80/8AEE 89 07 00    BIT #$0007              A:0048 X:003C Y:0000 P:envmxdizC
$80/8AF1 F0 1D       BEQ $1D    [$8B10]      A:0048 X:003C Y:0000 P:envmxdiZC
Code is missing here
$80/8B10 9C 01 06    STZ $0601     ; Clear $0601 - no distance to scroll
$80/8B13 80 0A       BRA $0A       ; [$8B1F] Exit
Code is missing here
$80/8B1F E2 20       SEP #$20
$80/8B21 60          RTS

$80/8BEB Long Jump to Compare BG1 Scroll Buffers

$80/8BEB 8B          PHB           ; Buffer Program Bank
$80/8BEC 4B          PHK           ; Set $80 as Program Bank
$80/8BED AB          PLB
$80/8BEE 20 F3 8B    JSR $8BF3     ; Compare BG1 Scroll Buffers
$80/8BF1 AB          PLB           ; Restore Program Bank
$80/8BF2 6B          RTL

$80/8BF3 Compare BG1 Scroll Buffers

$80/8BF3 C2 20       REP #$20      ; A = 16 bit
$80/8BF5 A0 00 00    LDY #$0000              A:0048 X:003C Y:0000 P:envmxdiZC
$80/8BF8 AD 91 05    LDA $0591     ; Load BG1 HScroll Buffer
$80/8BFB 38          SEC           ; Subtract another BG1 HScroll Buffer
$80/8BFC ED 71 05    SBC $0571
$80/8BFF 10 06       BPL $06       ; [$8C07] Branch if Positive
$80/8C01 C8          INY           ; Increment twice to set Bit 1 in Y (negative signal)
$80/8C02 C8          INY
$80/8C03 49 FF FF    EOR #$FFFF    ; Turn the difference in a positive number
$80/8C06 1A          INC A         ; (INC A is part of the turning into a positive number)
$80/8C07 85 0C       STA $0C       ; Store (positive) Difference of the H-Scrolls in $0C
$80/8C09 AD 93 05    LDA $0593     ; Load BG1 VScroll Buffer
$80/8C0C 38          SEC           ; Subtract another BG1 VScroll Buffer
$80/8C0D ED 73 05    SBC $0573
$80/8C10 10 05       BPL $05       ; [$8C17] Branch if Positive
code is missing here
$80/8C17 85 0E       STA $0E       ; Store (positive) Difference of the V-Scrolls in $0E
$80/8C19 05 0C       ORA $0C       ; With this, if any Bit in $0C or $0E is set, A will be != 0
$80/8C1B D0 03       BNE $03       ; [$8C20] Branch if there was any difference between the buffers
$80/8C1D 4C 1D 8D    JMP $8D1D     ; Exit
$80/8C20 E2 20       SEP #$20      ; A = 8-bit
$80/8C22 A5 67       LDA $67       ; ??? (seems to be always 8)
$80/8C24 1A          INC A         ; ???
$80/8C25 20 F0 A8    JSR $A8F0     ; Calculate the Square Number of A
$80/8C28 C2 20       REP #$20      ; A = 16-bit
$80/8C2A 85 04       STA $04       ; ?? $04 = ($6C + 1)²   (= #$51)
$80/8C2C A5 0C       LDA $0C       ; Load (positive) Difference of the H-Scrolls in $0C
$80/8C2E 22 01 A9 80 JSL $80A901   ; Calculate the Square Number of 16-bit A
$80/8C32 D4 02       PEI ($02)     ; Buffer $00-$03 (Square Number Result) on Stack
$80/8C34 D4 00       PEI ($00)
$80/8C36 A5 0E       LDA $0E       ; Load (positive) Difference of the V-Scrolls in $0E
$80/8C38 22 01 A9 80 JSL $80A901   ; Calculate the Square Number of 16-bit A
$80/8C3C 18          CLC           ; Clear Carry
$80/8C3D 68          PLA           ; Pull the the two low bytes of the H-Scroll-Square Number
$80/8C3E 65 00       ADC $00       ; Add V-Scroll-Square Number low bytes
$80/8C40 85 00       STA $00       ; Store in $00/1
$80/8C42 68          PLA           ; Pull the the two high bytes of the H-Scroll-Square Number
$80/8C43 65 02       ADC $02       ; Add V-Scroll-Square Number high bytes
$80/8C45 85 02       STA $02       ; Store in $02/3
$80/8C47 A5 00       LDA $00       ; If the Low Bytes of the added Square Numbers is higher/same than $04...
$80/8C49 C5 04       CMP $04       ; ... then this CMP sets the Carry that gets subrtracted...
$80/8C4B A5 02       LDA $02       ; ... from the added Square Numbers High Bytes in these two lines
$80/8C4D E9 00 00    SBC #$0000
$80/8C50 90 25       BCC $25       ; [$8C77] Branch if this subtraction needed the borrow
$80/8C52 22 FC AB 80 JSL $80ABFC[$80:ABFC]   A:0000 X:003C Y:0002 P:envmxdiZC
$80/8C56 85 08       STA $08    [$00:0008]   A:0010 X:003C Y:0002 P:eNvmxdizC
$80/8C58 A5 67       LDA $67    [$00:0067]   A:0010 X:003C Y:0002 P:eNvmxdizC
$80/8C5A 29 FF 00    AND #$00FF              A:5508 X:003C Y:0002 P:envmxdizC
$80/8C5D 85 00       STA $00    [$00:0000]   A:0008 X:003C Y:0002 P:envmxdizC
$80/8C5F A5 0C       LDA $0C    [$00:000C]   A:0008 X:003C Y:0002 P:envmxdizC
$80/8C61 85 04       STA $04    [$00:0004]   A:0010 X:003C Y:0002 P:envmxdizC
$80/8C63 22 6F A8 80 JSL $80A86F[$80:A86F]   A:0010 X:003C Y:0002 P:envmxdizC
$80/8C67 A5 04       LDA $04    [$00:0004]   A:0000 X:003C Y:0002 P:eNvmxdizC
$80/8C69 85 0C       STA $0C    [$00:000C]   A:0008 X:003C Y:0002 P:envmxdizC
$80/8C6B A5 0E       LDA $0E    [$00:000E]   A:0008 X:003C Y:0002 P:envmxdizC
$80/8C6D 85 04       STA $04    [$00:0004]   A:0000 X:003C Y:0002 P:envmxdiZC
$80/8C6F 22 6F A8 80 JSL $80A86F[$80:A86F]   A:0000 X:003C Y:0002 P:envmxdiZC
$80/8C73 A5 04       LDA $04    [$00:0004]   A:0000 X:003C Y:0002 P:eNvmxdizc
$80/8C75 85 0E       STA $0E    [$00:000E]   A:0000 X:003C Y:0002 P:envmxdiZc
$80/8C77 98          TYA           ; Test if Bit 1 in Y is set (Signal for negative difference in H-Scroll)
$80/8C78 89 02 00    BIT #$0002
$80/8C7B F0 06       BEQ $06       ; [$8C83] Branch if positive difference
$80/8C7D 7B          TDC           ; Turn the Difference back into a negative value and store it in $0C
$80/8C7E 38          SEC
$80/8C7F E5 0C       SBC $0C
$80/8C81 85 0C       STA $0C
$80/8C83 98          TYA           ; Test if Bit 0 in Y is set (Signal for negative difference in V-Scroll)
$80/8C84 89 01 00    BIT #$0001
$80/8C87 F0 06       BEQ $06       ; [$8C8F] Branch if positive difference
code is missing here
$80/8C8F A5 0C       LDA $0C       ; Load (positive/negative) Difference of the H-Scrolls
$80/8C91 18          CLC
$80/8C92 6D 71 05    ADC $0571     ; Add BG1 H-Scroll
$80/8C95 8D 91 05    STA $0591     ; Set as BG1 H-Scroll
$80/8C98 8D 95 05    STA $0595     ; Set as BG2 H-Scroll
$80/8C9B A5 0E       LDA $0E       ; Load (positive/negative) Difference of the V-Scrolls
$80/8C9D 18          CLC
$80/8C9E 6D 73 05    ADC $0573     ; Add BG1 V-Scroll
$80/8CA1 8D 93 05    STA $0593     ; Set as BG1 V-Scroll
$80/8CA4 8D 97 05    STA $0597     ; Set as BG2 V-Scroll
$80/8CA7 AE 91 05    LDX $0591     ; X = BG1 H-Scroll
$80/8CAA AC 93 05    LDY $0593     ; Y = BG1 V-Scroll
$80/8CAD EC 71 05    CPX $0571     ; Compare new H-Scroll to the old
$80/8CB0 30 1A       BMI $1A       ; [$8CCC] Branch if the difference was negative = scroll value got less
code is missing here
$80/8CCC AD 71 05    LDA $0571     ; Load old H-Scroll
$80/8CCF 29 F8 FF    AND #$FFF8    ; Remove lowest 3 Bits
$80/8CD2 85 00       STA $00       ; Buffer in $00
$80/8CD4 8A          TXA           ; A = BG1 H-Scroll
$80/8CD5 29 F8 FF    AND #$FFF8    ; Remove lowest 3 Bits
$80/8CD8 C5 00       CMP $00       ; Check if the difference between old and new H-Scroll is bigger than 8px
$80/8CDA F0 07       BEQ $07       ; [$8CE3] Branch if not
code is missing here
$80/8CDC E2 20       SEP #$20      ; A = 8-bit
$80/8CDE 20 45 8D    JSR $8D45  [$80:8D45]   A:00D8 X:00DF Y:0060 P:eNvMxdizc
$80/8CE1 C2 20       REP #$20      ; A = 16-bit
$80/8CE3 AE 91 05    LDX $0591     ; X = BG1 H-Scroll
$80/8CE6 AC 93 05    LDY $0593     ; Y = BG1 V-Scroll
$80/8CE9 CC 73 05    CPY $0573     ; Compare new Y-Scroll to the old
$80/8CEC 30 1A       BMI $1A       ; [$8D08]  Branch if the difference was negative = scroll value got less
$80/8CEE AD 73 05    LDA $0573     ; Load old V-Scroll
$80/8CF1 3A          DEC A         ; ??? Decrement V-Scroll by 1 (why?)
$80/8CF2 29 F8 FF    AND #$FFF8    ; Remove lowest 3 Bits
$80/8CF5 85 00       STA $00       ; Buffer in $00
$80/8CF7 98          TYA           ; A = BG1 V-Scroll
$80/8CF8 3A          DEC A         ; ??? Decrement V-Scroll by 1 (why?)
$80/8CF9 29 F8 FF    AND #$FFF8    ; Remove lowest 3 Bits
$80/8CFC C5 00       CMP $00       ; Check if the difference between old and new H-Scroll is bigger than 8px
$80/8CFE F0 1D       BEQ $1D       ; [$8D1D] Exit
code is missing here
$80/8D1D E2 20       SEP #$20
$80/8D1F 60          RTS

$80/8D45 ?

The values that are stored in $04 and $06 (and that seem to be carried into this subroutine) are something like the BG1 H- and V-Scroll values (according to the subroutine at the end of $82F0FC).

$80/8D45 A9 01       LDA #$01                A:00D8 X:00DF Y:0060 P:eNvMxdizc
$80/8D47 85 00       STA $00    [$00:0000]   A:0001 X:00DF Y:0060 P:envMxdizc
$80/8D49 A9 1C       LDA #$1C                A:0001 X:00DF Y:0060 P:envMxdizc
$80/8D4B 85 02       STA $02    [$00:0002]   A:001C X:00DF Y:0060 P:envMxdizc
$80/8D4D 98          TYA                     A:001C X:00DF Y:0060 P:envMxdizc
$80/8D4E 29 07       AND #$07                A:0060 X:00DF Y:0060 P:envMxdizc
$80/8D50 F0 02       BEQ $02    [$8D54]      A:0000 X:00DF Y:0060 P:envMxdiZc
Code is missing here
$80/8D54 86 04       STX $04    [$00:0004]   A:0000 X:00DF Y:0060 P:envMxdiZc
$80/8D56 84 06       STY $06    [$00:0006]   A:0000 X:00DF Y:0060 P:envMxdiZc
$80/8D58 22 60 81 99 JSL $998160[$99:8160]   A:0000 X:00DF Y:0060 P:envMxdiZc
$80/8D5C 90 07       BCC $07    [$8D65]      A:0000 X:00DF Y:0060 P:envMxdizC
$80/8D5E A9 03       LDA #$03                A:0000 X:00DF Y:0060 P:envMxdizC
$80/8D60 22 FC F0 82 JSL $82F0FC[$82:F0FC]   A:0003 X:00DF Y:0060 P:envMxdizC
$80/8D64 60          RTS                     A:0038 X:0006 Y:781B P:eNvMxdizc

$80/8D6A Long Jump to Fade Screen In or Out

$80/8D6A 8B          PHB           ; Buffer Data Bank
$80/8D6B 4B          PHK           ; Set $80 as Data Bank
$80/8D6C AB          PLB
$80/8D6D 20 72 8D    JSR $8D72     ; Fade Screen In or Out
$80/8D70 AB          PLB           ; Restore Data Bank
$80/8D71 6B          RTL

$80/8D72 Fade Screen In or Out

$80/8D72 AD C2 05    LDA $05C2     ; Load Fade In/Out Flags
$80/8D75 89 01       BIT #$01      ; Is Fade In Flag set? (Bit 0)
$80/8D77 F0 16       BEQ $16       ; [$8D8F] Branch if not
$80/8D79 AD 87 05    LDA $0587     ; Load $2100 Buffer
$80/8D7C 29 0F       AND #$0F      ; Remove the FBLANK Bit, leave the Screen brightness
$80/8D7E 18          CLC           ; Turn Screen Brightness up by two degrees
$80/8D7F 69 02       ADC #$02
$80/8D81 C9 0F       CMP #$0F      ; Check if it surpassed the maximum
$80/8D83 90 05       BCC $05       ; [$8D8A] Branch if it didn't
$80/8D85 9C C2 05    STZ $05C2     ; Deactivate Fade In/Out Flags
$80/8D88 A9 0F       LDA #$0F      ; If brightness+2 surpasses the limit, set to max brightness
$80/8D8A 8D 87 05    STA $0587     ; Store it in $2100 buffer and then exit
$80/8D8D 80 18       BRA $18       ; [$8DA7] YOU CAN MAKE THIS SHORTER- remove the line above and branch to $8DA4
$80/8D8F 89 02       BIT #$02      ; Is Fade Out Flag set? (Bit 1)
$80/8D91 F0 14       BEQ $14       ; [$8DA7] ??? Exit if not
$80/8D93 AD 87 05    LDA $0587     ; Load $2100 Buffer
$80/8D96 30 07       BMI $07       ; [$8D9F] Branch if FBLANK is active
$80/8D98 38          SEC           ; Turn Brightness down by two degrees
$80/8D99 E9 02       SBC #$02
$80/8D9B F0 02       BEQ $02       ; [$8D9F] Activate FBLANK and exit if we reached 0 (or turned negative)
$80/8D9D 10 05       BPL $05       ; [$8DA4] If still positive, store new Brightness back and exit
$80/8D9F 9C C2 05    STZ $05C2     ; Deactivate Fade In/Out Flags
$80/8DA2 A9 80       LDA #$80      ; Activate FBLANK
$80/8DA4 8D 87 05    STA $0587
$80/8DA7 60          RTS

$80/8DA8 BATTLE: Load Palette Number for Color Cycling

$80/8DA8 8B          PHB           ; Buffer Data Bank
$80/8DA9 4B          PHK           ; Set $80 as Data Bank
$80/8DAA AB          PLB                     A:0000 X:0000 Y:0320 P:envMxdiZC
$80/8DAB A5 A3       LDA $A3    [$00:00A3]   A:0000 X:0000 Y:0320 P:eNvMxdizC
$80/8DAD 89 02       BIT #$02                A:0000 X:0000 Y:0320 P:envMxdiZC
$80/8DAF F0 0C       BEQ $0C    [$8DBD]      A:0000 X:0000 Y:0320 P:envMxdiZC
Code is missing here
$80/8DBD BD 56 1A    LDA $1A56,x[$80:1A56]   A:0000 X:0000 Y:0320 P:envMxdiZC
$80/8DC0 18          CLC                     A:0007 X:0000 Y:0320 P:envMxdizC
$80/8DC1 69 10       ADC #$10                A:0007 X:0000 Y:0320 P:envMxdizc
$80/8DC3 AB          PLB           ; Restore Data Bank
$80/8DC4 6B          RTL

$80/8DC5 BATTLE: Long Jump to Setup HDMA Data Tables for Color Cycling

$80/8DC5 8B          PHB           ; Buffer Data Bank
$80/8DC6 4B          PHK           ; Set $80 as Data Bank
$80/8DC7 AB          PLB
$80/8DC8 20 CD 8D    JSR $8DCD     ; Setup HDMA Data Tables for Color Cycling
$80/8DCB AB          PLB           ; Restore Data Bank
$80/8DCC 6B          RTL

$80/8DCD BATTLE: Setup HDMA Data Tables for Color Cycling

This prepares the Data Tables for two HDMAs that do color cycling.

The Data Tables are going to be at $7E/BEBE and $7E/C0BE (and $7E/BFBE and $7E/C1BE, more on that later). They will consist of two bytes CGRAM address followed by two bytes of Color Data.

The second half of the subroutine is executed twice: At $8DE6, it jumps to the next line as a subroutine; it executes everything and then reaches a RTS. This RTS moves it back to $8DE9 where it executes everything again. As the Store Index in X isn't changed, it goes on writing the same stuff in the registers after whose who where worked off in the first run.

$80/8DCD 7B          TDC           ; Clear 16-bit A
$80/8DCE A5 9C       LDA $9C       ; Load Index which Palette to use
$80/8DD0 C2 20       REP #$20      ; 16-bit A
$80/8DD2 29 FF 00    AND #$00FF    ; This line could be removed
$80/8DD5 0A          ASL A         ; Multiply by 2, each entry is 2 bytes in size
$80/8DD6 AA          TAX
$80/8DD7 BF EE E3 84 LDA $84E3EE,x ; Load Palette Address
$80/8DDB 85 20       STA $20       ; Setup Load Address for Palettes in $20/1
$80/8DDD E2 20       SEP #$20      ; 8-bit A
$80/8DDF A9 84       LDA #$84      ; Set Load Address Bank to $84 in $22
$80/8DE1 85 22       STA $22
$80/8DE3 A2 00 00    LDX #$0000    ; Clear Store Index
$80/8DE6 20 E9 8D    JSR $8DE9     ; EXECUTE THE REST OF THE SUBROUTINE TWICE

$80/8DE9 8B          PHB           ; Buffer Data Bank on Stack
$80/8DEA A9 7E       LDA #$7E      ; Set Data Bank to $7E
$80/8DEC 48          PHA
$80/8DED AB          PLB
$80/8DEE A0 00 00    LDY #$0000    ; Clear Data Load Index
$80/8DF1 A9 4E       LDA #$4E      ; Set as 1st color to change with the 1st table #$(00)4E
$80/8DF3 9D BF BE    STA $BEBF,x
$80/8DF6 A9 5E       LDA #$5E      ; Set as 2nd color to change with the 1st table #$(00)5E
$80/8DF8 9D C3 BE    STA $BEC3,x
$80/8DFB A9 6E       LDA #$6E      ; Set as 1st color to change with the 2nd table #$(00)6E
$80/8DFD 9D BF C0    STA $C0BF,x
$80/8E00 A9 7E       LDA #$7E      ; Set as 2nd color to change with the 2nd table #$(00)7E
$80/8E02 9D C3 C0    STA $C0C3,x
$80/8E05 C2 20       REP #$20      ; 16-bit A
$80/8E07 B7 20       LDA [$20],y   ; Load Byte (Color)
$80/8E09 9D C0 BE    STA $BEC0,x   ; Color for CGRAM entry #$004E
$80/8E0C 9D C4 BE    STA $BEC4,x   ; Color for CGRAM entry #$005E
$80/8E0F 9D C0 C0    STA $C0C0,x   ; Color for CGRAM entry #$006E
$80/8E12 9D C4 C0    STA $C0C4,x   ; Color for CGRAM entry #$007E
$80/8E15 8A          TXA           ; Increment Store Index by 8 - do the next 2 entries
$80/8E16 18          CLC
$80/8E17 69 08 00    ADC #$0008
$80/8E1A AA          TAX
$80/8E1B E2 20       SEP #$20      ; 8-bit A
$80/8E1D C8          INY           ; Increment Load Index for the next color twice
$80/8E1E C8          INY
$80/8E1F C0 20 00    CPY #$0020    ; Loop until it has done sixteen colors
$80/8E22 90 CD       BCC $CD       ; [$8DF1]
$80/8E24 88          DEY           ; Decrement Load Index for the next color twice - do the colors backwards
$80/8E25 88          DEY
$80/8E26 A9 4E       LDA #$4E      ; Set as 1st color to change with the 1st table #$(00)4E
$80/8E28 9D BF BE    STA $BEBF,x
$80/8E2B A9 5E       LDA #$5E      ; Set as 2nd color to change with the 1st table #$(00)5E
$80/8E2D 9D C3 BE    STA $BEC3,x
$80/8E30 A9 6E       LDA #$6E      ; Set as 1st color to change with the 2nd table #$(00)6E
$80/8E32 9D BF C0    STA $C0BF,x
$80/8E35 A9 7E       LDA #$7E      ; Set as 2nd color to change with the 2nd table #$(00)7E
$80/8E37 9D C3 C0    STA $C0C3,x
$80/8E3A C2 20       REP #$20      ; 16-bit A
$80/8E3C B7 20       LDA [$20],y   ; Load Byte (Color)
$80/8E3E 9D C0 BE    STA $BEC0,x   ; Color for CGRAM entry #$004E
$80/8E41 9D C4 BE    STA $BEC4,x   ; Color for CGRAM entry #$005E
$80/8E44 9D C0 C0    STA $C0C0,x   ; Color for CGRAM entry #$006E
$80/8E47 9D C4 C0    STA $C0C4,x   ; Color for CGRAM entry #$007E
$80/8E4A 8A          TXA           ; Increment Store Index by 8 - do the next 2 entries
$80/8E4B 18          CLC
$80/8E4C 69 08 00    ADC #$0008
$80/8E4F AA          TAX
$80/8E50 E2 20       SEP #$20      ; 8-bit A
$80/8E52 88          DEY           ; Decrement Load Index for the next color twice - do the colors backwards
$80/8E53 88          DEY
$80/8E54 10 D0       BPL $D0       ; [$8E26] Loop until it has done sixteen colors 
$80/8E56 C2 20       REP #$20      ; 16-bit A
$80/8E58 AD 93 05    LDA $0593     ; Copy BG1 V-Scroll value in $BE88
$80/8E5B 8D 88 BE    STA $BE88
$80/8E5E E2 20       SEP #$20      ; 8-bit A
$80/8E60 AB          PLB           ; Restore Data Bank from Stack
$80/8E61 60          RTS

$80/8E62 BATTLE: Color HDMA related

Executed while movement possibilities are shown

$80/8E62 8B          PHB           ; Buffer Data Bank on Stack - this line could be removed
$80/8E63 4B          PHK           ; Set Data Bank to $80 - this line could be removed
$80/8E64 AB          PLB           ; this line could be removed
$80/8E65 20 6A 8E    JSR $8E6A  [$80:8E6A]   A:0060 X:0200 Y:FFFE P:eNvMxdizc
$80/8E68 AB          PLB           ; Restore Data Bank - this line could be removed
$80/8E69 6B          RTL

$80/8E6A BATTLE: Color HDMA related

Executed while movement possibilities are shown

$80/8E6A 8B          PHB           ; Buffer Data Bank on Stack
$80/8E6B A9 7E       LDA #$7E      ; Set Data Bank to $7E - this line could be removed
$80/8E6D 48          PHA
$80/8E6E AB          PLB
$80/8E6F A2 8A BE    LDX #$BE8A              A:007E X:0200 Y:FFFE P:envMxdizc
$80/8E72 8E 84 BE    STX $BE84  [$7E:BE84]   A:007E X:BE8A Y:FFFE P:eNvMxdizc
$80/8E75 A2 00 00    LDX #$0000              A:007E X:BE8A Y:FFFE P:eNvMxdizc
$80/8E78 AD EE 05    LDA $05EE     ; Load $4209 Buffer (V Timer Low Byte)
$80/8E7B 48          PHA           ; Copy it on Stack
$80/8E7C C9 41       CMP #$41      ; Check if it is more than #$40
$80/8E7E 90 02       BCC $02       ; [$8E82] if not, use that value...
$80/8E80 A9 40       LDA #$40      ; ... else, use #$40
$80/8E82 09 80       ORA #$80                A:0040 X:0000 Y:FFFE P:envMxdizC
$80/8E84 9D 8A BE    STA $BE8A,x[$7E:BE8A]   A:00C0 X:0000 Y:FFFE P:eNvMxdizC
$80/8E87 9D 97 BE    STA $BE97,x[$7E:BE97]   A:00C0 X:0000 Y:FFFE P:eNvMxdizC
$80/8E8A 9D A4 BE    STA $BEA4,x[$7E:BEA4]   A:00C0 X:0000 Y:FFFE P:eNvMxdizC
$80/8E8D 9D B1 BE    STA $BEB1,x[$7E:BEB1]   A:00C0 X:0000 Y:FFFE P:eNvMxdizC
$80/8E90 E8          INX                     A:00C0 X:0000 Y:FFFE P:eNvMxdizC
$80/8E91 C2 20       REP #$20                A:00C0 X:0001 Y:FFFE P:envMxdizC
$80/8E93 A9 BE BE    LDA #$BEBE              A:00C0 X:0001 Y:FFFE P:envmxdizC
$80/8E96 9D 8A BE    STA $BE8A,x[$7E:BE8B]   A:BEBE X:0001 Y:FFFE P:eNvmxdizC
$80/8E99 9D A4 BE    STA $BEA4,x[$7E:BEA5]   A:BEBE X:0001 Y:FFFE P:eNvmxdizC
$80/8E9C A9 BE C0    LDA #$C0BE              A:BEBE X:0001 Y:FFFE P:eNvmxdizC
$80/8E9F 9D 97 BE    STA $BE97,x[$7E:BE98]   A:C0BE X:0001 Y:FFFE P:eNvmxdizC
$80/8EA2 9D B1 BE    STA $BEB1,x[$7E:BEB2]   A:C0BE X:0001 Y:FFFE P:eNvmxdizC
$80/8EA5 E2 20       SEP #$20                A:C0BE X:0001 Y:FFFE P:eNvmxdizC
$80/8EA7 E8          INX                     A:C0BE X:0001 Y:FFFE P:eNvMxdizC
$80/8EA8 E8          INX                     A:C0BE X:0002 Y:FFFE P:envMxdizC
$80/8EA9 68          PLA           ; Pull the Copy of the $4209 Buffer value from stack
$80/8EAA C9 41       CMP #$41
$80/8EAC 90 04       BCC $04       ; [$8EB2] Branch and go on if it is less than #$40
$80/8EAE E9 40       SBC #$40      ; Subtract #$40
$80/8EB0 80 C9       BRA $C9       ; [$8E7B] Loop
$80/8EB2 9E 8A BE    STZ $BE8A,x[$7E:BE96]   A:C01B X:000C Y:FFFE P:eNvMxdizc
$80/8EB5 9E 97 BE    STZ $BE97,x[$7E:BEA3]   A:C01B X:000C Y:FFFE P:eNvMxdizc
$80/8EB8 9E A4 BE    STZ $BEA4,x[$7E:BEB0]   A:C01B X:000C Y:FFFE P:eNvMxdizc
$80/8EBB 9E B1 BE    STZ $BEB1,x[$7E:BEBD]   A:C01B X:000C Y:FFFE P:eNvMxdizc
$80/8EBE 9C 86 BE    STZ $BE86  [$7E:BE86]   A:C01B X:000C Y:FFFE P:eNvMxdizc
$80/8EC1 A9 81       LDA #$81                A:C01B X:000C Y:FFFE P:eNvMxdizc
$80/8EC3 8D 87 BE    STA $BE87  [$7E:BE87]   A:C081 X:000C Y:FFFE P:eNvMxdizc
$80/8EC6 AB          PLB           ; Restore Data Bank - this line could be removed
$80/8EC7 60          RTS

$80/8EC8 BATTLE: Long Jump to Setup Color HDMAs

Executed while movement possibilities are shown

$80/8EC8 8B          PHB           ; Buffer Data Bank on Stack
$80/8EC9 4B          PHK           ; Set Data Bank to $80
$80/8ECA AB          PLB
$80/8ECB 20 D0 8E    JSR $8ED0     ; Setup Color HDMAs
$80/8ECE AB          PLB           ; Restore Data Bank
$80/8ECF 6B          RTL

$80/8ED0 BATTLE: Setup Color HDMAs

Executed while movement possibilities are shown

$80/8ED0 A9 43       LDA #$43      ; DMA Settings - Write 2 regs twice, use HDMA Table
$80/8ED2 8D 30 43    STA $4330
$80/8ED5 A9 21       LDA #$21      ; HDMA Destination: $2121/2 CGRAM Address/Data Register
$80/8ED7 8D 31 43    STA $4331
$80/8EDA A2 8A BE    LDX #$BE8A    ; HDMA Table at $7E/BE8A
$80/8EDD 8E 32 43    STX $4332
$80/8EE0 A9 7E       LDA #$7E
$80/8EE2 8D 34 43    STA $4334
$80/8EE5 A9 7E       LDA #$7E      ; Bytes to be transfered to CGRAM during HDMA are on Bank $7E
$80/8EE7 8D 37 43    STA $4337
$80/8EEA A9 08       LDA #$08      ; Add Activation Flag for the HDMA
$80/8EEC 0C B0 05    TSB $05B0
$80/8EEF A9 43       LDA #$43      ; DMA Settings - Write 2 regs twice, use HDMA Table
$80/8EF1 8D 20 43    STA $4320
$80/8EF4 A9 21       LDA #$21      ; HDMA Destination: $2121/2 CGRAM Address/Data Register
$80/8EF6 8D 21 43    STA $4321
$80/8EF9 A2 97 BE    LDX #$BE97    ; HDMA Table at $7E/BE97
$80/8EFC 8E 22 43    STX $4322
$80/8EFF A9 7E       LDA #$7E
$80/8F01 8D 24 43    STA $4324
$80/8F04 A9 7E       LDA #$7E      ; Bytes to be transfered to CGRAM during HDMA are on Bank $7E
$80/8F06 8D 27 43    STA $4327
$80/8F09 A9 04       LDA #$04      ; Add Activation Flag for the HDMA
$80/8F0B 0C B0 05    TSB $05B0
$80/8F0E 60          RTS

$80/8FA8 ???

$80/8FA8 A9 43       LDA #$43      ; DMA Options: HDMA, write 2 registers twice each
$80/8FAA 8D 70 43    STA $4370
$80/8FAD A9 21       LDA #$21      ; CGRAM Address (+ Data) Register (writes both twice)
$80/8FAF 8D 71 43    STA $4371
$80/8FB2 A2 00 B0    LDX #$B000    ; Source Address: $7E/B000
$80/8FB5 8E 72 43    STX $4372
$80/8FB8 A9 7E       LDA #$7E
$80/8FBA 8D 74 43    STA $4374
$80/8FBD A9 7E       LDA #$7E      ; HDMA Indirect Address Bank: $7E
$80/8FBF 8D 77 43    STA $4377
$80/8FC2 A9 80       LDA #$80      ; Set the bit for this DMA Channel in the HDMA activation flag buffer
$80/8FC4 0C B0 05    TSB $05B0
$80/8FC7 A9 43       LDA #$43      ; DMA Options: HDMA, write 2 registers twice each
$80/8FC9 8D 10 43    STA $4310
$80/8FCC A9 11       LDA #$11      ; BG3 H/V Scroll Registers
$80/8FCE 8D 11 43    STA $4311
$80/8FD1 A2 A0 B0    LDX #$B0A0    ; Source Address: $7E/B0A0
$80/8FD4 8E 12 43    STX $4312
$80/8FD7 A9 7E       LDA #$7E
$80/8FD9 8D 14 43    STA $4314
$80/8FDC A9 00       LDA #$00      ; HDMA Indirect Address Bank: $00
$80/8FDE 8D 17 43    STA $4317
$80/8FE1 A9 02       LDA #$02      ; Set the bit for this DMA Channel in the HDMA activation flag buffer
$80/8FE3 0C B0 05    TSB $05B0
$80/8FE6 A9 43       LDA #$43      ; DMA Options: HDMA, write 2 registers twice each
$80/8FE8 8D 60 43    STA $4360
$80/8FEB A9 0F       LDA #$0F      ; BG2 H/V Scroll Registers
$80/8FED 8D 61 43    STA $4361
$80/8FF0 A2 20 B0    LDX #$B020    ; Source Address: $7E/B020
$80/8FF3 8E 62 43    STX $4362
$80/8FF6 A9 7E       LDA #$7E
$80/8FF8 8D 64 43    STA $4364
$80/8FFB A9 00       LDA #$00      ; HDMA Indirect Address Bank: $00
$80/8FFD 8D 67 43    STA $4367
$80/9000 A9 40       LDA #$40      ; Set the bit for this DMA Channel in the HDMA activation flag buffer
$80/9002 0C B0 05    TSB $05B0
$80/9005 A9 43       LDA #$43      ; DMA Options: HDMA, write 2 registers twice each
$80/9007 8D 50 43    STA $4350
$80/900A A9 0D       LDA #$0D      ; BG1 H/V Scroll Registers
$80/900C 8D 51 43    STA $4351
$80/900F A2 20 B0    LDX #$B020    ; Source Address: $7E/B020
$80/9012 8E 52 43    STX $4352
$80/9015 A9 7E       LDA #$7E
$80/9017 8D 54 43    STA $4354
$80/901A A9 00       LDA #$00      ; HDMA Indirect Address Bank: $00
$80/901C 8D 57 43    STA $4357
$80/901F A9 20       LDA #$20      ; Set the bit for this DMA Channel in the HDMA activation flag buffer
$80/9021 0C B0 05    TSB $05B0
$80/9024 A2 00 B0    LDX #$B000    ; Set #$B000 in buffer for $4372
$80/9027 8E FC 16    STX $16FC
$80/902A A2 20 B0    LDX #$B020
$80/902D 8E FE 16    STX $16FE     ; Set #$B020 in buffer for $4362
$80/9030 8E 00 17    STX $1700     ; Set #$B020 in buffer for $4352
$80/9033 A2 A0 B0    LDX #$B0A0
$80/9036 8E 02 17    STX $1702     ; Set #$B0A0 in buffer for $4312
$80/9039 20 BA 96    JSR $96BA  [$80:96BA]   A:0020 X:B0A0 Y:001E P:eNvMxdizC
$80/903C 20 4A 96    JSR $964A  [$80:964A]   A:1700 X:B040 Y:000C P:eNvMxdizC
$80/903F EE FB 16    INC $16FB     ; Set Flag for $80/B1EF
$80/9042 60          RTS

$80/91D1 MVN-Transfer of #$4C0 bytes on Bank $7E

$80/91D1 AD 58 17    LDA $1758     ; Check if Bank-$7E-MVN-Transfer flag is set
$80/91D4 D0 1B       BNE $1B       ; [$91F1] Exit if it is
$80/91D6 8B          PHB           ; Buffer Data Bank on Stack
$80/91D7 DA          PHX           ; Buffer X and Y on Stack
$80/91D8 5A          PHY
$80/91D9 AE 59 17    LDX $1759     ; Load MVN Source Address
$80/91DC AC 5B 17    LDY $175B     ; Load MVN Destination Address
$80/91DF C2 20       REP #$20      ; A = 16-bit
$80/91E1 A9 BF 04    LDA #$04BF    ; Number of Bytes to transfer: #$04C0
$80/91E4 54 7E 7E    MVN 7E 7E     ; TRANSFER ON BANK $7E
$80/91E7 E2 20       SEP #$20      ; A = 8-bit
$80/91E9 7A          PLY           ; Restore Y and X from Stack
$80/91EA FA          PLX
$80/91EB AB          PLB           ; Restore Data Bank from Stack
$80/91EC A9 01       LDA #$01      ; Set Bank-$7E-MVN-Transfer flag
$80/91EE 8D 58 17    STA $1758
$80/91F1 6B          RTL

$80/91F2 ?

$80/91F2 8B          PHB           ; Buffer Data Bank on Stack
$80/91F3 4B          PHK           ; Set Data Bank to $80
$80/91F4 AB          PLB
$80/91F5 D4 00       PEI ($00)     ; Buffer $00-$07 on Stack
$80/91F7 D4 02       PEI ($02)
$80/91F9 D4 04       PEI ($04)
$80/91FB D4 06       PEI ($06)
$80/91FD 85 00       STA $00    [$00:0000]   A:000F X:0000 Y:002D P:eNvMxdizc
$80/91FF 22 D1 91 80 JSL $8091D1[$80:91D1]   A:000F X:0000 Y:002D P:eNvMxdizc
$80/9203 C2 21       REP #$21                A:FF01 X:0000 Y:002D P:envMxdizc
$80/9205 8A          TXA                     A:FF01 X:0000 Y:002D P:envmxdizc
$80/9206 6D 5B 17    ADC $175B  [$80:175B]   A:0000 X:0000 Y:002D P:envmxdiZc
$80/9209 AA          TAX                     A:C95F X:0000 Y:002D P:eNvmxdizc
$80/920A AD 5B 17    LDA $175B  [$80:175B]   A:C95F X:C95F Y:002D P:eNvmxdizc
$80/920D 69 80 03    ADC #$0380              A:C95F X:C95F Y:002D P:eNvmxdizc
$80/9210 85 04       STA $04    [$00:0004]   A:CCDF X:C95F Y:002D P:eNvmxdizc
$80/9212 AD 5B 17    LDA $175B  [$80:175B]   A:CCDF X:C95F Y:002D P:eNvmxdizc
$80/9215 69 C0 04    ADC #$04C0              A:C95F X:C95F Y:002D P:eNvmxdizc
$80/9218 85 06       STA $06    [$00:0006]   A:CE1F X:C95F Y:002D P:eNvmxdizc
$80/921A E2 20       SEP #$20                A:CE1F X:C95F Y:002D P:eNvmxdizc
$80/921C 7B          TDC                     A:CE1F X:C95F Y:002D P:eNvMxdizc
$80/921D AD EE 05    LDA $05EE  [$80:05EE]   A:0000 X:C95F Y:002D P:envMxdiZc
$80/9220 1A          INC A                   A:00DB X:C95F Y:002D P:eNvMxdizc
$80/9221 C2 20       REP #$20                A:00DC X:C95F Y:002D P:eNvMxdizc
$80/9223 0A          ASL A                   A:00DC X:C95F Y:002D P:eNvmxdizc
$80/9224 0A          ASL A                   A:01B8 X:C95F Y:002D P:envmxdizc
$80/9225 6D 5B 17    ADC $175B  [$80:175B]   A:0370 X:C95F Y:002D P:envmxdizc
$80/9228 85 02       STA $02    [$00:0002]   A:CCCF X:C95F Y:002D P:eNvmxdizc
$80/922A E4 02       CPX $02    [$00:0002]   A:CCCF X:C95F Y:002D P:eNvmxdizc
$80/922C 90 07       BCC $07    [$9235]      A:CCCF X:C95F Y:002D P:eNvmxdizc
code is missing here
$80/9235 E2 20       SEP #$20                A:CCCF X:C95F Y:002D P:eNvmxdizc
$80/9237 A0 00 00    LDY #$0000              A:CCCF X:C95F Y:002D P:eNvMxdizc
$80/923A A9 7E       LDA #$7E      ; Set Data Bank to $7E
$80/923C 48          PHA
$80/923D AB          PLB
$80/923E BD 00 00    LDA $0000,x[$7E:C95F]   A:CC7E X:C95F Y:0000 P:envMxdizc
$80/9241 10 1A       BPL $1A    [$925D]      A:CC00 X:C95F Y:0000 P:envMxdiZc
$80/9243 A9 01       LDA #$01                A:CCFF X:C963 Y:0000 P:eNvMxdizc
$80/9245 9D 00 00    STA $0000,x[$7E:C963]   A:CC01 X:C963 Y:0000 P:envMxdizc
$80/9248 B7 20       LDA [$20],y[$7E:52B7]   A:CC01 X:C963 Y:0000 P:envMxdizc
$80/924A 9D 01 00    STA $0001,x[$7E:C964]   A:CC11 X:C963 Y:0000 P:envMxdizc
$80/924D C8          INY                     A:CC11 X:C963 Y:0000 P:envMxdizc
$80/924E C2 20       REP #$20                A:CC11 X:C963 Y:0001 P:envMxdizc
$80/9250 B7 20       LDA [$20],y[$7E:52B8]   A:CC11 X:C963 Y:0001 P:envmxdizc
$80/9252 9D 02 00    STA $0002,x[$7E:C965]   A:0CA7 X:C963 Y:0001 P:envmxdizc
$80/9255 E2 20       SEP #$20                A:0CA7 X:C963 Y:0001 P:envmxdizc
$80/9257 C8          INY                     A:0CA7 X:C963 Y:0001 P:envMxdizc
$80/9258 C8          INY                     A:0CA7 X:C963 Y:0002 P:envMxdizc
$80/9259 C6 00       DEC $00    [$00:0000]   A:0CA7 X:C963 Y:0003 P:envMxdizc
$80/925B F0 18       BEQ $18    [$9275]      A:0CA7 X:C963 Y:0003 P:envMxdizc
$80/925D E8          INX                     A:CC00 X:C95F Y:0000 P:envMxdiZc
$80/925E E8          INX                     A:CC00 X:C960 Y:0000 P:eNvMxdizc
$80/925F E8          INX                     A:CC00 X:C961 Y:0000 P:eNvMxdizc
$80/9260 E8          INX                     A:CC00 X:C962 Y:0000 P:eNvMxdizc
$80/9261 E4 02       CPX $02    [$00:0002]   A:CC00 X:C963 Y:0000 P:eNvMxdizc
$80/9263 B0 06       BCS $06    [$926B]      A:CC00 X:C963 Y:0000 P:eNvMxdizc
$80/9265 E4 04       CPX $04    [$00:0004]   A:CC00 X:C963 Y:0000 P:eNvMxdizc
$80/9267 90 D5       BCC $D5    [$923E]      A:CC00 X:C963 Y:0000 P:eNvMxdizc
$80/926B E4 04       CPX $04    [$00:0004]   A:75ED X:D18F Y:0024 P:envMxdiZC
$80/926D B0 02       BCS $02    [$9271]      A:75ED X:D18F Y:0024 P:eNvMxdizc
$80/926F A6 04       LDX $04    [$00:0004]   A:75ED X:D18F Y:0024 P:eNvMxdizc
$80/9271 E4 06       CPX $06    [$00:0006]   A:75ED X:D19F Y:0024 P:eNvMxdizc
$80/9273 90 C9       BCC $C9    [$923E]      A:75ED X:D19F Y:0024 P:eNvMxdizc
$80/9275 C2 20       REP #$20                A:573A X:C99B Y:002D P:envMxdiZc
$80/9277 8A          TXA                     A:573A X:C99B Y:002D P:envmxdiZc
$80/9278 38          SEC                     A:C99B X:C99B Y:002D P:eNvmxdizc
$80/9279 ED 5B 17    SBC $175B  [$7E:175B]   A:C99B X:C99B Y:002D P:eNvmxdizC
$80/927C AA          TAX                     A:003C X:C99B Y:002D P:envmxdizC
$80/927D 68          PLA           ; Restore $07-$00 from Stack
$80/927E 85 06       STA $06
$80/9280 68          PLA
$80/9281 85 04       STA $04
$80/9283 68          PLA
$80/9284 85 02       STA $02
$80/9286 68          PLA
$80/9287 85 00       STA $00
$80/9289 E2 20       SEP #$20      ; A = 8-bit
$80/928B AB          PLB           ; Restore Data Bank from Stack
$80/928C 6B          RTL

$80/9331 ?

$80/9331 8B          PHB           ; Buffer Data Bank on Stack
$80/9332 4B          PHK           ; Set Data Bank to $80
$80/9333 AB          PLB
$80/9334 D4 00       PEI ($00)     ; Buffer $00-$07 on Stack
$80/9336 D4 02       PEI ($02)
$80/9338 D4 04       PEI ($04)
$80/933A D4 06       PEI ($06)
$80/933C 85 00       STA $00    [$00:0000]   A:000F X:0000 Y:45D9 P:eNvMxdizc
$80/933E 22 D1 91 80 JSL $8091D1[$80:91D1]   A:000F X:0000 Y:45D9 P:eNvMxdizc
$80/9342 C2 21       REP #$21                A:FF01 X:0000 Y:45D9 P:envMxdizc
$80/9344 8A          TXA                     A:FF01 X:0000 Y:45D9 P:envmxdizc
$80/9345 6D 5B 17    ADC $175B  [$80:175B]   A:0000 X:0000 Y:45D9 P:envmxdiZc
$80/9348 AA          TAX                     A:CE1F X:0000 Y:45D9 P:eNvmxdizc
$80/9349 AD 5B 17    LDA $175B  [$80:175B]   A:CE1F X:CE1F Y:45D9 P:eNvmxdizc
$80/934C 69 80 03    ADC #$0380              A:CE1F X:CE1F Y:45D9 P:eNvmxdizc
$80/934F 85 04       STA $04    [$00:0004]   A:D19F X:CE1F Y:45D9 P:eNvmxdizc
$80/9351 AD 5B 17    LDA $175B  [$80:175B]   A:D19F X:CE1F Y:45D9 P:eNvmxdizc
$80/9354 69 C0 04    ADC #$04C0              A:CE1F X:CE1F Y:45D9 P:eNvmxdizc
$80/9357 85 06       STA $06    [$00:0006]   A:D2DF X:CE1F Y:45D9 P:eNvmxdizc
$80/9359 E2 20       SEP #$20                A:D2DF X:CE1F Y:45D9 P:eNvmxdizc
$80/935B 7B          TDC                     A:D2DF X:CE1F Y:45D9 P:eNvMxdizc
$80/935C AD EE 05    LDA $05EE  [$80:05EE]   A:0000 X:CE1F Y:45D9 P:envMxdiZc
$80/935F 1A          INC A                   A:00DB X:CE1F Y:45D9 P:eNvMxdizc
$80/9360 C2 20       REP #$20                A:00DC X:CE1F Y:45D9 P:eNvMxdizc
$80/9362 0A          ASL A                   A:00DC X:CE1F Y:45D9 P:eNvmxdizc
$80/9363 0A          ASL A                   A:01B8 X:CE1F Y:45D9 P:envmxdizc
$80/9364 6D 5B 17    ADC $175B  [$80:175B]   A:0370 X:CE1F Y:45D9 P:envmxdizc
$80/9367 85 02       STA $02    [$00:0002]   A:D18F X:CE1F Y:45D9 P:eNvmxdizc
$80/9369 E4 02       CPX $02    [$00:0002]   A:D18F X:CE1F Y:45D9 P:eNvmxdizc
$80/936B 90 07       BCC $07    [$9374]      A:D18F X:CE1F Y:45D9 P:eNvmxdizc
code is missing here
$80/9374 E2 20       SEP #$20      ; A = 8-bit
$80/9376 A9 7E       LDA #$7E      ; Set Data Bank to $7E
$80/9378 48          PHA
$80/9379 AB          PLB
$80/937A BD 00 00    LDA $0000,x[$7E:CE1F]   A:D17E X:CE1F Y:45D9 P:envMxdizc
$80/937D F0 12       BEQ $12    [$9391]      A:D100 X:CE1F Y:45D9 P:envMxdiZc
$80/937F C9 FF       CMP #$FF                A:D101 X:CE23 Y:45D9 P:envMxdizc
$80/9381 F0 0E       BEQ $0E    [$9391]      A:D101 X:CE23 Y:45D9 P:envMxdizc
$80/9383 A9 FF       LDA #$FF                A:D101 X:CE23 Y:45D9 P:envMxdizc
$80/9385 9D 00 00    STA $0000,x[$7E:CE23]   A:D1FF X:CE23 Y:45D9 P:eNvMxdizc
$80/9388 A9 10       LDA #$10                A:D1FF X:CE23 Y:45D9 P:eNvMxdizc
$80/938A 9D 01 00    STA $0001,x[$7E:CE24]   A:D110 X:CE23 Y:45D9 P:envMxdizc
$80/938D C6 00       DEC $00    [$00:0000]   A:D110 X:CE23 Y:45D9 P:envMxdizc
$80/938F F0 18       BEQ $18    [$93A9]      A:D110 X:CE23 Y:45D9 P:envMxdizc
$80/9391 E8          INX                     A:D100 X:CE1F Y:45D9 P:envMxdiZc
$80/9392 E8          INX                     A:D100 X:CE20 Y:45D9 P:eNvMxdizc
$80/9393 E8          INX                     A:D100 X:CE21 Y:45D9 P:eNvMxdizc
$80/9394 E8          INX                     A:D100 X:CE22 Y:45D9 P:eNvMxdizc
$80/9395 E4 02       CPX $02    [$00:0002]   A:D100 X:CE23 Y:45D9 P:eNvMxdizc
$80/9397 B0 06       BCS $06    [$939F]      A:D100 X:CE23 Y:45D9 P:eNvMxdizc
$80/9399 E4 04       CPX $04    [$00:0004]   A:D100 X:CE23 Y:45D9 P:eNvMxdizc
$80/939B 90 DD       BCC $DD    [$937A]      A:D100 X:CE23 Y:45D9 P:eNvMxdizc
code is missing here
$80/939F E4 04       CPX $04    [$00:0004]   A:D1FF X:D18F Y:0000 P:envMxdiZC
$80/93A1 B0 02       BCS $02    [$93A5]      A:D1FF X:D18F Y:0000 P:eNvMxdizc
$80/93A3 A6 04       LDX $04    [$00:0004]   A:D1FF X:D18F Y:0000 P:eNvMxdizc
$80/93A5 E4 06       CPX $06    [$00:0006]   A:D1FF X:D19F Y:0000 P:eNvMxdizc
$80/93A7 90 D1       BCC $D1    [$937A]      A:D1FF X:D19F Y:0000 P:eNvMxdizc
$80/93A9 7A          PLY           ; Restore $07-$00 from Stack
$80/93AA 84 06       STY $06
$80/93AC 7A          PLY
$80/93AD 84 04       STY $04
$80/93AF 7A          PLY
$80/93B0 84 02       STY $02
$80/93B2 7A          PLY
$80/93B3 84 00       STY $00
$80/93B5 AB          PLB           ; Restore Data Bank from Stack
$80/93B6 6B          RTL

$80/95E8 ?

$80/95E8 8B          PHB                     A:0000 X:3300 Y:3C00 P:envMxdiZc
$80/95E9 4B          PHK                     A:0000 X:3300 Y:3C00 P:envMxdiZc
$80/95EA AB          PLB                     A:0000 X:3300 Y:3C00 P:envMxdiZc
$80/95EB 20 F0 95    JSR $95F0  [$80:95F0]   A:0000 X:3300 Y:3C00 P:eNvMxdizc
$80/95EE AB          PLB                     A:FF20 X:1758 Y:000A P:envMxdizC
$80/95EF 6B          RTL                     A:FF20 X:1758 Y:000A P:envMxdizC

$80/95F0 ?

$80/95F0 7B          TDC                     A:0000 X:3300 Y:3C00 P:eNvMxdizc
$80/95F1 AD F4 16    LDA $16F4  [$80:16F4]   A:0000 X:3300 Y:3C00 P:envMxdiZc
$80/95F4 29 7F       AND #$7F                A:0000 X:3300 Y:3C00 P:envMxdiZc
$80/95F6 AA          TAX                     A:0000 X:3300 Y:3C00 P:envMxdiZc
$80/95F7 BD A7 95    LDA $95A7,x[$80:95A7]   A:0000 X:0000 Y:3C00 P:envMxdiZc
$80/95FA 85 00       STA $00    [$00:0000]   A:00DB X:0000 Y:3C00 P:eNvMxdizc
$80/95FC 64 01       STZ $01    [$00:0001]   A:00DB X:0000 Y:3C00 P:eNvMxdizc
$80/95FE AE EE 05    LDX $05EE  [$80:05EE]   A:00DB X:0000 Y:3C00 P:eNvMxdizc
$80/9601 E4 00       CPX $00    [$00:0000]   A:00DB X:00DB Y:3C00 P:envMxdizc
$80/9603 F0 1A       BEQ $1A    [$961F]      A:00DB X:00DB Y:3C00 P:envMxdiZC
$80/961F 8E EE 05    STX $05EE  [$80:05EE]   A:00DB X:00DB Y:3C00 P:envMxdiZC
$80/9622 20 BA 96    JSR $96BA  [$80:96BA]   A:00DB X:00DB Y:3C00 P:envMxdiZC
$80/9625 20 4A 96    JSR $964A  [$80:964A]   A:1700 X:0000 Y:0009 P:envMxdiZC
$80/9628 EE FB 16    INC $16FB  [$80:16FB]   A:FF20 X:1758 Y:000A P:envMxdiZC
$80/962B 60          RTS                     A:FF20 X:1758 Y:000A P:envMxdizC

$80/964A ?

$80/964A AD F4 16    LDA $16F4  [$80:16F4]   A:1700 X:0000 Y:0009 P:envMxdiZC
$80/964D 29 7F       AND #$7F                A:1700 X:0000 Y:0009 P:envMxdiZC
$80/964F 8D 02 42    STA $4202  [$80:4202]   A:1700 X:0000 Y:0009 P:envMxdiZC
$80/9652 A9 0A       LDA #$0A                A:1700 X:0000 Y:0009 P:envMxdiZC
$80/9654 8D 03 42    STA $4203  [$80:4203]   A:170A X:0000 Y:0009 P:envMxdizC
$80/9657 A5 A2       LDA $A2    [$00:00A2]   A:170A X:0000 Y:0009 P:envMxdizC
$80/9659 89 02       BIT #$02                A:1708 X:0000 Y:0009 P:envMxdizC
$80/965B D0 2D       BNE $2D    [$968A]      A:1708 X:0000 Y:0009 P:envMxdiZC
$80/965D C2 20       REP #$20                A:1708 X:0000 Y:0009 P:envMxdiZC
$80/965F AE 04 17    LDX $1704  [$80:1704]   A:1708 X:0000 Y:0009 P:envmxdiZC
$80/9662 AC 16 42    LDY $4216  [$80:4216]   A:1708 X:171A Y:0009 P:envmxdizC
$80/9665 A9 05 00    LDA #$0005              A:1708 X:171A Y:0000 P:envmxdiZC
$80/9668 85 00       STA $00    [$00:0000]   A:0005 X:171A Y:0000 P:envmxdizC
$80/966A B9 7B 94    LDA $947B,y[$80:947B]   A:0005 X:171A Y:0000 P:envmxdizC
$80/966D 9D 00 00    STA $0000,x[$80:171A]   A:0000 X:171A Y:0000 P:envmxdiZC
$80/9670 18          CLC                     A:0000 X:171A Y:0000 P:envmxdiZC
$80/9671 B9 F3 94    LDA $94F3,y[$80:94F3]   A:0000 X:171A Y:0000 P:envmxdiZc
$80/9674 ED EE 05    SBC $05EE  [$80:05EE]   A:0000 X:171A Y:0000 P:envmxdiZc
$80/9677 18          CLC                     A:FF24 X:171A Y:0000 P:eNvmxdizc
$80/9678 69 80 00    ADC #$0080              A:FF24 X:171A Y:0000 P:eNvmxdizc
$80/967B 9D 02 00    STA $0002,x[$80:171C]   A:FFA4 X:171A Y:0000 P:eNvmxdizc
$80/967E C8          INY                     A:FFA4 X:171A Y:0000 P:eNvmxdizc
$80/967F C8          INY                     A:FFA4 X:171A Y:0001 P:envmxdizc
$80/9680 E8          INX                     A:FFA4 X:171A Y:0002 P:envmxdizc
$80/9681 E8          INX                     A:FFA4 X:171B Y:0002 P:envmxdizc
$80/9682 E8          INX                     A:FFA4 X:171C Y:0002 P:envmxdizc
$80/9683 E8          INX                     A:FFA4 X:171D Y:0002 P:envmxdizc
$80/9684 C6 00       DEC $00    [$00:0000]   A:FFA4 X:171E Y:0002 P:envmxdizc
$80/9686 D0 E2       BNE $E2    [$966A]      A:FFA4 X:171E Y:0002 P:envmxdizc
$80/9688 E2 20       SEP #$20                A:FFA0 X:172E Y:000A P:envmxdiZc
$80/968A A5 A2       LDA $A2    [$00:00A2]   A:FFA0 X:172E Y:000A P:envMxdiZc
$80/968C 89 04       BIT #$04                A:FF08 X:172E Y:000A P:envMxdizc
$80/968E D0 29       BNE $29       ; [$96B9] Exit
$80/9690 C2 20       REP #$20                A:FF08 X:172E Y:000A P:envMxdiZc
$80/9692 AE 2E 17    LDX $172E  [$80:172E]   A:FF08 X:172E Y:000A P:envmxdiZc
$80/9695 AC 16 42    LDY $4216  [$80:4216]   A:FF08 X:1744 Y:000A P:envmxdizc
$80/9698 A9 05 00    LDA #$0005              A:FF08 X:1744 Y:0000 P:envmxdiZc
$80/969B 85 00       STA $00    [$00:0000]   A:0005 X:1744 Y:0000 P:envmxdizc
$80/969D B9 7B 94    LDA $947B,y[$80:947B]   A:0005 X:1744 Y:0000 P:envmxdizc
$80/96A0 9D 00 00    STA $0000,x[$80:1744]   A:0000 X:1744 Y:0000 P:envmxdiZc
$80/96A3 18          CLC                     A:0000 X:1744 Y:0000 P:envmxdiZc
$80/96A4 B9 F3 94    LDA $94F3,y[$80:94F3]   A:0000 X:1744 Y:0000 P:envmxdiZc
$80/96A7 ED EE 05    SBC $05EE  [$80:05EE]   A:0000 X:1744 Y:0000 P:envmxdiZc
$80/96AA 9D 02 00    STA $0002,x[$80:1746]   A:FF24 X:1744 Y:0000 P:eNvmxdizc
$80/96AD C8          INY                     A:FF24 X:1744 Y:0000 P:eNvmxdizc
$80/96AE C8          INY                     A:FF24 X:1744 Y:0001 P:envmxdizc
$80/96AF E8          INX                     A:FF24 X:1744 Y:0002 P:envmxdizc
$80/96B0 E8          INX                     A:FF24 X:1745 Y:0002 P:envmxdizc
$80/96B1 E8          INX                     A:FF24 X:1746 Y:0002 P:envmxdizc
$80/96B2 E8          INX                     A:FF24 X:1747 Y:0002 P:envmxdizc
$80/96B3 C6 00       DEC $00    [$00:0000]   A:FF24 X:1748 Y:0002 P:envmxdizc
$80/96B5 D0 E6       BNE $E6    [$969D]      A:FF24 X:1748 Y:0002 P:envmxdizc
$80/96B7 E2 20       SEP #$20                A:FF20 X:1758 Y:000A P:envmxdiZC
$80/96B9 60          RTS                     A:FF20 X:1758 Y:000A P:envMxdiZC

$80/96BA ?

$80/96BA A9 DD       LDA #$DD                A:00DB X:00DB Y:3C00 P:envMxdiZC
$80/96BC 85 04       STA $04    [$00:0004]   A:00DD X:00DB Y:3C00 P:eNvMxdizC
$80/96BE A9 80       LDA #$80                A:00DD X:00DB Y:3C00 P:eNvMxdizC
$80/96C0 85 01       STA $01    [$00:0001]   A:0080 X:00DB Y:3C00 P:eNvMxdizC
$80/96C2 AE FC 16    LDX $16FC     ; Build a 24-bit address in [$20] for DMA channel 7
$80/96C5 86 20       STX $20
$80/96C7 A9 7E       LDA #$7E      ; (Is on bank $7E)
$80/96C9 85 22       STA $22
$80/96CB AD 58 17    LDA $1758     ; Flag for MVN-Transfer on Bank $7E - "set if #$00"
$80/96CE F0 0F       BEQ $0F       ; [$96DF] Branch if MVN-Transfer is about to be done
$80/96D0 AE 59 17    LDX $1759  [$80:1759]   A:0001 X:B000 Y:0002 P:envMxdizC
$80/96D3 AC 5B 17    LDY $175B  [$80:175B]   A:0001 X:CE1F Y:0002 P:eNvMxdizC
$80/96D6 8C 59 17    STY $1759  [$80:1759]   A:0001 X:CE1F Y:C95F P:eNvMxdizC
$80/96D9 8E 5B 17    STX $175B  [$80:175B]   A:0001 X:CE1F Y:C95F P:eNvMxdizC
$80/96DC 9C 58 17    STZ $1758  [$80:1758]   A:0001 X:CE1F Y:C95F P:eNvMxdizC
$80/96DF AD EE 05    LDA $05EE  [$80:05EE]   A:0000 X:B000 Y:3C00 P:envMxdiZC
$80/96E2 A0 00 00    LDY #$0000              A:00DB X:B000 Y:3C00 P:eNvMxdizC
$80/96E5 AE 59 17    LDX $1759     ; Transfer MVN-Transfer Source Address in $02
$80/96E8 86 02       STX $02
$80/96EA 20 10 98    JSR $9810  [$80:9810]   A:00DB X:CE1F Y:0000 P:eNvMxdizC
$80/96ED F0 11       BEQ $11    [$9700]      A:D102 X:CE1F Y:0006 P:envMxdizC
$80/96EF 48          PHA                     A:D102 X:CE1F Y:0006 P:envMxdizC
$80/96F0 C2 21       REP #$21                A:D102 X:CE1F Y:0006 P:envMxdizC
$80/96F2 AD 59 17    LDA $1759  [$80:1759]   A:D102 X:CE1F Y:0006 P:envmxdizc
$80/96F5 69 80 03    ADC #$0380              A:CE1F X:CE1F Y:0006 P:eNvmxdizc
$80/96F8 85 02       STA $02    [$00:0002]   A:D19F X:CE1F Y:0006 P:eNvmxdizc
$80/96FA E2 20       SEP #$20                A:D19F X:CE1F Y:0006 P:eNvmxdizc
$80/96FC 68          PLA                     A:D19F X:CE1F Y:0006 P:eNvMxdizc
$80/96FD 20 10 98    JSR $9810  [$80:9810]   A:D102 X:CE1F Y:0006 P:envMxdizc
$80/9700 AD F4 16    LDA $16F4  [$80:16F4]   A:D100 X:CE1F Y:0009 P:envMxdiZC
$80/9703 29 7F       AND #$7F                A:D100 X:CE1F Y:0009 P:envMxdiZC
$80/9705 8D 02 42    STA $4202  [$80:4202]   A:D100 X:CE1F Y:0009 P:envMxdiZC
$80/9708 A9 05       LDA #$05                A:D100 X:CE1F Y:0009 P:envMxdiZC
$80/970A 8D 03 42    STA $4203  [$80:4203]   A:D105 X:CE1F Y:0009 P:envMxdizC
$80/970D A5 A2       LDA $A2    [$00:00A2]   A:D105 X:CE1F Y:0009 P:envMxdizC
$80/970F 89 04       BIT #$04                A:D108 X:CE1F Y:0009 P:envMxdizC
$80/9711 D0 4E       BNE $4E    [$9761]      A:D108 X:CE1F Y:0009 P:envMxdiZC
$80/9713 A2 A0 B0    LDX #$B0A0              A:D108 X:CE1F Y:0009 P:envMxdiZC
$80/9716 EC 02 17    CPX $1702  [$80:1702]   A:D108 X:B0A0 Y:0009 P:eNvMxdizC
$80/9719 D0 03       BNE $03    [$971E]      A:D108 X:B0A0 Y:0009 P:eNvMxdizc
$80/971B A2 C0 B0    LDX #$B0C0              A:D108 X:B0A0 Y:0009 P:envMxdiZC
$80/971E 8E 02 17    STX $1702  [$80:1702]   A:D108 X:B0A0 Y:0009 P:eNvMxdizc
$80/9721 A2 30 17    LDX #$1730              A:D108 X:B0A0 Y:0009 P:eNvMxdizc
$80/9724 EC 2E 17    CPX $172E  [$80:172E]   A:D108 X:1730 Y:0009 P:envMxdizc
$80/9727 D0 03       BNE $03    [$972C]      A:D108 X:1730 Y:0009 P:envMxdiZC
$80/9729 A2 44 17    LDX #$1744              A:D108 X:1730 Y:0009 P:envMxdiZC
$80/972C 8E 2E 17    STX $172E  [$80:172E]   A:D108 X:1744 Y:0009 P:envMxdizC
$80/972F A9 DD       LDA #$DD                A:D108 X:1744 Y:0009 P:envMxdizC
$80/9731 85 04       STA $04    [$00:0004]   A:D1DD X:1744 Y:0009 P:eNvMxdizC
$80/9733 64 01       STZ $01    [$00:0001]   A:D1DD X:1744 Y:0009 P:eNvMxdizC
$80/9735 AE 02 17    LDX $1702  [$80:1702]   A:D1DD X:1744 Y:0009 P:eNvMxdizC
$80/9738 86 20       STX $20    [$00:0020]   A:D1DD X:B0A0 Y:0009 P:eNvMxdizC
$80/973A A9 7E       LDA #$7E                A:D1DD X:B0A0 Y:0009 P:eNvMxdizC
$80/973C 85 22       STA $22    [$00:0022]   A:D17E X:B0A0 Y:0009 P:envMxdizC
$80/973E A0 00 00    LDY #$0000              A:D17E X:B0A0 Y:0009 P:envMxdizC
$80/9741 A2 79 05    LDX #$0579              A:D17E X:B0A0 Y:0000 P:envMxdiZC
$80/9744 86 02       STX $02    [$00:0002]   A:D17E X:0579 Y:0000 P:envMxdizC
$80/9746 AD EE 05    LDA $05EE  [$80:05EE]   A:D17E X:0579 Y:0000 P:envMxdizC
$80/9749 20 10 98    JSR $9810  [$80:9810]   A:D1DB X:0579 Y:0000 P:eNvMxdizC
$80/974C F0 13       BEQ $13    [$9761]      A:0502 X:0579 Y:0006 P:envMxdizC
$80/974E AE 2E 17    LDX $172E  [$80:172E]   A:0502 X:0579 Y:0006 P:envMxdizC
$80/9751 86 02       STX $02    [$00:0002]   A:0502 X:1744 Y:0006 P:envMxdizC
$80/9753 AE 16 42    LDX $4216  [$80:4216]   A:0502 X:1744 Y:0006 P:envMxdizC
$80/9756 BD 6B 95    LDA $956B,x[$80:956B]   A:0502 X:0000 Y:0006 P:envMxdiZC
$80/9759 20 10 98    JSR $9810  [$80:9810]   A:0550 X:0000 Y:0006 P:envMxdizC
$80/975C F0 03       BEQ $03    [$9761]      A:1700 X:0000 Y:0009 P:envMxdiZC
code is missing here
$80/9761 A5 A2       LDA $A2    [$00:00A2]   A:1700 X:0000 Y:0009 P:envMxdiZC
$80/9763 89 02       BIT #$02                A:1708 X:0000 Y:0009 P:envMxdizC
$80/9765 D0 4E       BNE $4E       ; [$97B5] Leave this part out if Bit 1 is set
$80/9767 A2 20 B0    LDX #$B020              A:1708 X:0000 Y:0009 P:envMxdiZC
$80/976A EC FE 16    CPX $16FE  [$80:16FE]   A:1708 X:B020 Y:0009 P:eNvMxdizC
$80/976D D0 03       BNE $03    [$9772]      A:1708 X:B020 Y:0009 P:eNvMxdizc
$80/976F A2 40 B0    LDX #$B040              A:1708 X:B020 Y:0009 P:envMxdiZC
$80/9772 8E FE 16    STX $16FE  [$80:16FE]   A:1708 X:B020 Y:0009 P:eNvMxdizc
$80/9775 A2 06 17    LDX #$1706              A:1708 X:B020 Y:0009 P:eNvMxdizc
$80/9778 EC 04 17    CPX $1704  [$80:1704]   A:1708 X:1706 Y:0009 P:envMxdizc
$80/977B D0 03       BNE $03    [$9780]      A:1708 X:1706 Y:0009 P:envMxdiZC
$80/977D A2 1A 17    LDX #$171A              A:1708 X:1706 Y:0009 P:envMxdiZC
$80/9780 8E 04 17    STX $1704  [$80:1704]   A:1708 X:171A Y:0009 P:envMxdizC
$80/9783 A9 DD       LDA #$DD                A:1708 X:171A Y:0009 P:envMxdizC
$80/9785 85 04       STA $04    [$00:0004]   A:17DD X:171A Y:0009 P:eNvMxdizC
$80/9787 64 01       STZ $01    [$00:0001]   A:17DD X:171A Y:0009 P:eNvMxdizC
$80/9789 AE FE 16    LDX $16FE  [$80:16FE]   A:17DD X:171A Y:0009 P:eNvMxdizC
$80/978C 86 20       STX $20    [$00:0020]   A:17DD X:B020 Y:0009 P:eNvMxdizC
$80/978E A9 7E       LDA #$7E                A:17DD X:B020 Y:0009 P:eNvMxdizC
$80/9790 85 22       STA $22    [$00:0022]   A:177E X:B020 Y:0009 P:envMxdizC
$80/9792 A0 00 00    LDY #$0000              A:177E X:B020 Y:0009 P:envMxdizC
$80/9795 A2 75 05    LDX #$0575              A:177E X:B020 Y:0000 P:envMxdiZC
$80/9798 86 02       STX $02    [$00:0002]   A:177E X:0575 Y:0000 P:envMxdizC
$80/979A AD EE 05    LDA $05EE  [$80:05EE]   A:177E X:0575 Y:0000 P:envMxdizC
$80/979D 20 10 98    JSR $9810  [$80:9810]   A:17DB X:0575 Y:0000 P:eNvMxdizC
$80/97A0 F0 13       BEQ $13    [$97B5]      A:0502 X:0575 Y:0006 P:envMxdizC
$80/97A2 AE 04 17    LDX $1704  [$80:1704]   A:0502 X:0575 Y:0006 P:envMxdizC
$80/97A5 86 02       STX $02    [$00:0002]   A:0502 X:171A Y:0006 P:envMxdizC
$80/97A7 AE 16 42    LDX $4216  [$80:4216]   A:0502 X:171A Y:0006 P:envMxdizC
$80/97AA BD 6B 95    LDA $956B,x[$80:956B]   A:0502 X:0000 Y:0006 P:envMxdiZC
$80/97AD 20 10 98    JSR $9810  [$80:9810]   A:0550 X:0000 Y:0006 P:envMxdizC
$80/97B0 F0 03       BEQ $03    [$97B5]      A:1700 X:0000 Y:0009 P:envMxdiZC
code is missing here
$80/97B5 A5 A2       LDA $A2    [$00:00A2]   A:1700 X:0000 Y:0009 P:envMxdiZC
$80/97B7 89 01       BIT #$01                A:1708 X:0000 Y:0009 P:envMxdizC
$80/97B9 D0 4C       BNE $4C       ; [$9807] Exit if Bit 0 is set
$80/97BB 89 08       BIT #$08                A:1708 X:0000 Y:0009 P:envMxdiZC
$80/97BD D0 08       BNE $08    [$97C7]      A:1708 X:0000 Y:0009 P:envMxdizC
$80/97BF AE FE 16    LDX $16FE  [$80:16FE]   A:1700 X:0000 Y:0009 P:envMxdiZC
$80/97C2 8E 00 17    STX $1700  [$80:1700]   A:1700 X:B040 Y:0009 P:eNvMxdizC
$80/97C5 80 40       BRA $40    [$9807]      A:1700 X:B040 Y:0009 P:eNvMxdizC
$80/97C7 A2 60 B0    LDX #$B060              A:1708 X:0000 Y:0009 P:envMxdizC
$80/97CA EC 00 17    CPX $1700  [$80:1700]   A:1708 X:B060 Y:0009 P:eNvMxdizC
$80/97CD D0 03       BNE $03    [$97D2]      A:1708 X:B060 Y:0009 P:eNvMxdizc
$80/97CF A2 80 B0    LDX #$B080              A:1708 X:B060 Y:0009 P:envMxdiZC
$80/97D2 8E 00 17    STX $1700  [$80:1700]   A:1708 X:B060 Y:0009 P:eNvMxdizc
$80/97D5 A9 DD       LDA #$DD                A:1708 X:B060 Y:0009 P:eNvMxdizc
$80/97D7 85 04       STA $04    [$00:0004]   A:17DD X:B060 Y:0009 P:eNvMxdizc
$80/97D9 64 01       STZ $01    [$00:0001]   A:17DD X:B060 Y:0009 P:eNvMxdizc
$80/97DB AE 00 17    LDX $1700     ; Setup 24-bit Address on Bank $7E in [$20]
$80/97DE 86 20       STX $20
$80/97E0 A9 7E       LDA #$7E
$80/97E2 85 22       STA $22
$80/97E4 A0 00 00    LDY #$0000              A:177E X:B060 Y:0009 P:envMxdizc
$80/97E7 A2 71 05    LDX #$0571    ; Load BG1 X-Scroll
$80/97EA 86 02       STX $02    [$00:0002]   A:177E X:0571 Y:0000 P:envMxdizc
$80/97EC AD EE 05    LDA $05EE     ; Load V Timer
$80/97EF 20 10 98    JSR $9810  [$80:9810]   A:17DB X:0571 Y:0000 P:eNvMxdizc
$80/97F2 F0 13       BEQ $13       ; [$9807] Exit if empty
$80/97F4 AE 04 17    LDX $1704  [$80:1704]   A:0502 X:0571 Y:0006 P:envMxdizC
$80/97F7 86 02       STX $02    [$00:0002]   A:0502 X:171A Y:0006 P:envMxdizC
$80/97F9 AE 16 42    LDX $4216  [$80:4216]   A:0502 X:171A Y:0006 P:envMxdizC
$80/97FC BD 6B 95    LDA $956B,x[$80:956B]   A:0502 X:0000 Y:0006 P:envMxdiZC
$80/97FF 20 10 98    JSR $9810  [$80:9810]   A:0550 X:0000 Y:0006 P:envMxdizC
$80/9802 F0 03       BEQ $03    [$9807]      A:1700 X:0000 Y:0009 P:envMxdiZC
code is missing here
$80/9807 60          RTS                     A:1700 X:0000 Y:0009 P:envMxdiZC

$80/9810 ?

$80/9810 DA          PHX                     A:00DB X:CE1F Y:0000 P:eNvMxdizC
$80/9811 C5 04       CMP $04       ; Compare A with $04
$80/9813 90 02       BCC $02       ; [$9817] Store the lower value of both in $05
$80/9815 A5 04       LDA $04
$80/9817 85 05       STA $05
$80/9819 64 00       STZ $00    [$00:0000]   A:00DB X:CE1F Y:0000 P:eNvMxdizc
$80/981B C9 71       CMP #$71                A:00DB X:CE1F Y:0000 P:eNvMxdizc
$80/981D 90 06       BCC $06       ; [$9825] Branch if A < #$71
$80/981F E9 70       SBC #$70                A:00DB X:CE1F Y:0000 P:envMxdizC
$80/9821 85 00       STA $00    [$00:0000]   A:006B X:CE1F Y:0000 P:enVMxdizC
$80/9823 A9 70       LDA #$70                A:006B X:CE1F Y:0000 P:enVMxdizC
$80/9825 AA          TAX                     A:0070 X:CE1F Y:0000 P:enVMxdizC
$80/9826 05 01       ORA $01    [$00:0001]   A:0070 X:0070 Y:0000 P:enVMxdizC
$80/9828 97 20       STA [$20],y[$7E:B000]   A:00F0 X:0070 Y:0000 P:eNVMxdizC
$80/982A C8          INY           ; Increment Store Index
$80/982B C2 20       REP #$20                A:00F0 X:0070 Y:0001 P:enVMxdizC
$80/982D A5 02       LDA $02    [$00:0002]   A:00F0 X:0070 Y:0001 P:enVmxdizC
$80/982F 97 20       STA [$20],y[$7E:B001]   A:CE1F X:0070 Y:0001 P:eNVmxdizC
$80/9831 E2 20       SEP #$20                A:CE1F X:0070 Y:0001 P:eNVmxdizC
$80/9833 C8          INY           ; Increment Store Index twice
$80/9834 C8          INY
$80/9835 A5 01       LDA $01    [$00:0001]   A:CE1F X:0070 Y:0003 P:enVMxdizC
$80/9837 10 0E       BPL $0E    [$9847]      A:CE80 X:0070 Y:0003 P:eNVMxdizC
$80/9839 C2 20       REP #$20                A:CE80 X:0070 Y:0003 P:eNVMxdizC
$80/983B 8A          TXA                     A:CE80 X:0070 Y:0003 P:eNVmxdizC
$80/983C 29 FF 00    AND #$00FF              A:0070 X:0070 Y:0003 P:enVmxdizC
$80/983F 0A          ASL A                   A:0070 X:0070 Y:0003 P:enVmxdizC
$80/9840 0A          ASL A                   A:00E0 X:0070 Y:0003 P:enVmxdizc
$80/9841 65 02       ADC $02    [$00:0002]   A:01C0 X:0070 Y:0003 P:enVmxdizc
$80/9843 85 02       STA $02    [$00:0002]   A:CFDF X:0070 Y:0003 P:eNvmxdizc
$80/9845 E2 20       SEP #$20                A:CFDF X:0070 Y:0003 P:eNvmxdizc
$80/9847 A5 00       LDA $00    [$00:0000]   A:CFDF X:0070 Y:0003 P:eNvMxdizc
$80/9849 D0 CE       BNE $CE    [$9819]      A:CF6B X:0070 Y:0003 P:envMxdizc
$80/984B 97 20       STA [$20],y[$7E:B006]   A:D100 X:CF6B Y:0006 P:envMxdiZc
$80/984D A5 01       LDA $01    [$00:0001]   A:D100 X:CF6B Y:0006 P:envMxdiZc
$80/984F 30 08       BMI $08    [$9859]      A:D180 X:CF6B Y:0006 P:eNvMxdizc
$80/9851 A6 02       LDX $02    [$00:0002]   A:0500 X:056B Y:0006 P:enVMxdiZc
$80/9853 E8          INX                     A:0500 X:0579 Y:0006 P:enVMxdizc
$80/9854 E8          INX                     A:0500 X:057A Y:0006 P:enVMxdizc
$80/9855 E8          INX                     A:0500 X:057B Y:0006 P:enVMxdizc
$80/9856 E8          INX                     A:0500 X:057C Y:0006 P:enVMxdizc
$80/9857 86 02       STX $02    [$00:0002]   A:0500 X:057D Y:0006 P:enVMxdizc
$80/9859 FA          PLX                     A:D180 X:CF6B Y:0006 P:eNvMxdizc
$80/985A A5 04       LDA $04    [$00:0004]   A:D180 X:CE1F Y:0006 P:eNvMxdizc
$80/985C 38          SEC                     A:D1DD X:CE1F Y:0006 P:eNvMxdizc
$80/985D E5 05       SBC $05    [$00:0005]   A:D1DD X:CE1F Y:0006 P:eNvMxdizC
$80/985F 85 04       STA $04    [$00:0004]   A:D102 X:CE1F Y:0006 P:envMxdizC
$80/9861 60          RTS                     A:D102 X:CE1F Y:0006 P:envMxdizC

$80/98F1 ?

$80/98F1 22 D8 84 86 JSL $8684D8[$86:84D8]   A:0476 X:0021 Y:0000 P:eNvMxdIzC
$80/98F5 C2 20       REP #$20                A:0000 X:007C Y:0000 P:eNvMxdIzc
$80/98F7 A9 E8 03    LDA #$03E8              A:0000 X:007C Y:0000 P:eNvmxdIzc
$80/98FA 8D A3 1E    STA $1EA3  [$80:1EA3]   A:03E8 X:007C Y:0000 P:envmxdIzc
$80/98FD A9 F4 01    LDA #$01F4              A:03E8 X:007C Y:0000 P:envmxdIzc
$80/9900 8F 4C BE 7E STA $7EBE4C[$7E:BE4C]   A:01F4 X:007C Y:0000 P:envmxdIzc
$80/9904 E2 20       SEP #$20                A:01F4 X:007C Y:0000 P:envmxdIzc
$80/9906 22 10 A9 9B JSL $9BA910[$9B:A910]   A:01F4 X:007C Y:0000 P:envMxdIzc
$80/990A 6B          RTL                     A:0017 X:00FF Y:0000 P:envMxdIzc

$80/999C ?

$80/999C 8B          PHB           ; Buffer Data Bank on Stack
$80/999D 4B          PHK           ; Set Data Bank to $80
$80/999E AB          PLB
$80/999F 20 A4 99    JSR $99A4  [$80:99A4]   A:0101 X:0006 Y:0006 P:eNvMxdizC
$80/99A2 AB          PLB           ; Restore Data Bank from Stack
$80/99A3 6B          RTL

$80/99A4 ?

$80/99A4 C2 20       REP #$20                A:0001 X:0002 Y:0002 P:envMxdizC
$80/99A6 AD CA 16    LDA $16CA  [$80:16CA]   A:0001 X:0002 Y:0002 P:envmxdizC
$80/99A9 0A          ASL A                   A:0014 X:0002 Y:0002 P:envmxdizC
$80/99AA 0A          ASL A                   A:0028 X:0002 Y:0002 P:envmxdizc
$80/99AB 0A          ASL A                   A:0050 X:0002 Y:0002 P:envmxdizc
$80/99AC 0A          ASL A                   A:00A0 X:0002 Y:0002 P:envmxdizc
$80/99AD 9D 43 07    STA $0743,x[$80:0745]   A:0140 X:0002 Y:0002 P:envmxdizc
$80/99B0 38          SEC                     A:0140 X:0002 Y:0002 P:envmxdizc
$80/99B1 BD 03 0A    LDA $0A03,x[$80:0A05]   A:0140 X:0002 Y:0002 P:envmxdizC
$80/99B4 FD 43 0A    SBC $0A43,x[$80:0A45]   A:0B80 X:0002 Y:0002 P:envmxdizC
$80/99B7 08          PHP                     A:0400 X:0002 Y:0002 P:envmxdizC
$80/99B8 B0 04       BCS $04    [$99BE]      A:0400 X:0002 Y:0002 P:envmxdizC
$80/99BA 49 FF FF    EOR #$FFFF              A:FFF8 X:000A Y:0004 P:eNvmxdizc
$80/99BD 1A          INC A                   A:0007 X:000A Y:0004 P:envmxdizc
$80/99BE 4A          LSR A                   A:0400 X:0002 Y:0002 P:envmxdizC
$80/99BF 4A          LSR A                   A:0200 X:0002 Y:0002 P:envmxdizc
$80/99C0 4A          LSR A                   A:0100 X:0002 Y:0002 P:envmxdizc
$80/99C1 1A          INC A                   A:0080 X:0002 Y:0002 P:envmxdizc
$80/99C2 4A          LSR A                   A:0081 X:0002 Y:0002 P:envmxdizc
$80/99C3 28          PLP                     A:0040 X:0002 Y:0002 P:envmxdizC
$80/99C4 B0 04       BCS $04    [$99CA]      A:0040 X:0002 Y:0002 P:envmxdizC
$80/99C6 49 FF FF    EOR #$FFFF              A:0001 X:000A Y:0004 P:eNvmxdizc
$80/99C9 1A          INC A                   A:FFFE X:000A Y:0004 P:eNvmxdizc
$80/99CA 18          CLC                     A:0040 X:0002 Y:0002 P:envmxdizC
$80/99CB 7D 43 07    ADC $0743,x[$80:0745]   A:0040 X:0002 Y:0002 P:envmxdizc
$80/99CE 9D 43 07    STA $0743,x[$80:0745]   A:0180 X:0002 Y:0002 P:envmxdizc
$80/99D1 AD CC 16    LDA $16CC  [$80:16CC]   A:0180 X:0002 Y:0002 P:envmxdizc
$80/99D4 0A          ASL A                   A:000C X:0002 Y:0002 P:envmxdizc
$80/99D5 0A          ASL A                   A:0018 X:0002 Y:0002 P:envmxdizc
$80/99D6 0A          ASL A                   A:0030 X:0002 Y:0002 P:envmxdizc
$80/99D7 69 07 00    ADC #$0007              A:0060 X:0002 Y:0002 P:envmxdizc
$80/99DA 9D 83 07    STA $0783,x[$80:0785]   A:0067 X:0002 Y:0002 P:envmxdizc
$80/99DD 18          CLC                     A:0067 X:0002 Y:0002 P:envmxdizc
$80/99DE BD 03 0A    LDA $0A03,x[$80:0A05]   A:0067 X:0002 Y:0002 P:envmxdizc
$80/99E1 7D 43 0A    ADC $0A43,x[$80:0A45]   A:0B80 X:0002 Y:0002 P:envmxdizc
$80/99E4 0A          ASL A                   A:1300 X:0002 Y:0002 P:envmxdizc
$80/99E5 38          SEC                     A:2600 X:0002 Y:0002 P:envmxdizc
$80/99E6 FD 83 0A    SBC $0A83,x[$80:0A85]   A:2600 X:0002 Y:0002 P:envmxdizC
$80/99E9 08          PHP                     A:2000 X:0002 Y:0002 P:envmxdizC
$80/99EA B0 04       BCS $04    [$99F0]      A:2000 X:0002 Y:0002 P:envmxdizC
code is missing here
$80/99F0 4A          LSR A                   A:2000 X:0002 Y:0002 P:envmxdizC
$80/99F1 4A          LSR A                   A:1000 X:0002 Y:0002 P:envmxdizc
$80/99F2 4A          LSR A                   A:0800 X:0002 Y:0002 P:envmxdizc
$80/99F3 4A          LSR A                   A:0400 X:0002 Y:0002 P:envmxdizc
$80/99F4 4A          LSR A                   A:0200 X:0002 Y:0002 P:envmxdizc
$80/99F5 1A          INC A                   A:0100 X:0002 Y:0002 P:envmxdizc
$80/99F6 4A          LSR A                   A:0101 X:0002 Y:0002 P:envmxdizc
$80/99F7 28          PLP                     A:0080 X:0002 Y:0002 P:envmxdizC
$80/99F8 B0 04       BCS $04    [$99FE]      A:0080 X:0002 Y:0002 P:envmxdizC
code is missing here
$80/99FE 18          CLC                     A:0080 X:0002 Y:0002 P:envmxdizC
$80/99FF 7D 83 07    ADC $0783,x[$80:0785]   A:0080 X:0002 Y:0002 P:envmxdizc
$80/9A02 9D 83 07    STA $0783,x[$80:0785]   A:00E7 X:0002 Y:0002 P:envmxdizc
$80/9A05 BD 03 0A    LDA $0A03,x[$80:0A05]   A:00E7 X:0002 Y:0002 P:envmxdizc
$80/9A08 18          CLC                     A:0B80 X:0002 Y:0002 P:envmxdizc
$80/9A09 69 01 00    ADC #$0001              A:0B80 X:0002 Y:0002 P:envmxdizc
$80/9A0C EB          XBA                     A:0B81 X:0002 Y:0002 P:envmxdizc
$80/9A0D E2 20       SEP #$20                A:810B X:0002 Y:0002 P:envmxdizc
$80/9A0F 9D 43 09    STA $0943,x[$80:0945]   A:810B X:0002 Y:0002 P:envMxdizc
$80/9A12 C2 21       REP #$21                A:810B X:0002 Y:0002 P:envMxdizc
$80/9A14 BD 43 0A    LDA $0A43,x[$80:0A45]   A:810B X:0002 Y:0002 P:envmxdizc
$80/9A17 69 01 00    ADC #$0001              A:0780 X:0002 Y:0002 P:envmxdizc
$80/9A1A EB          XBA                     A:0781 X:0002 Y:0002 P:envmxdizc
$80/9A1B E2 20       SEP #$20                A:8107 X:0002 Y:0002 P:envmxdizc
$80/9A1D 9D 44 09    STA $0944,x[$80:0946]   A:8107 X:0002 Y:0002 P:envMxdizc
$80/9A20 60          RTS                     A:8107 X:0002 Y:0002 P:envMxdizc

$80/9A21 Calculate the Global Cursor Position from it's Position on Map

Sorry, my language skills as well as my explanation skills are too limited to explain here how the calculation works, so you/we have to accept that it works.

What this subroutine does, is: It takes the coordinates of the cursor on the grid (you know, the Northeast-Southwest-Axis/Northwest-Southeast-coordinates) and turns it into an actual number of pixel offset.

$80/9A21 A2 3C 00    LDX #$003C    ; Write Index for the second last figure (Rhomb Marker) 
$80/9A24 A0 3E 00    LDY #$003E    ; Write Index for the last figure (Pointing Hand)
$80/9A27 C2 21       REP #$21
$80/9A29 AD CA 16    LDA $16CA     ; Load Width of the Map on the NE-SW-Axis(?)
$80/9A2C 6D 61 00    ADC $0061     ; Add Cursor Position - NW to SE Axis
$80/9A2F 38          SEC
$80/9A30 ED 63 00    SBC $0063     ; Subtract Cursor Position - NE to SW Axis
$80/9A33 0A          ASL A         ; Multiply by #$10 --- #$10 pixels per Rhomb
$80/9A34 0A          ASL A
$80/9A35 0A          ASL A
$80/9A36 0A          ASL A
$80/9A37 9D 43 07    STA $0743,x   ; Store for Rhomb Marker
$80/9A3A 99 43 07    STA $0743,y   ; Store for Pointing Hand
$80/9A3D 38          SEC           ; Set Carry (is a +1 for the next ADC-command)
$80/9A3E AD CC 16    LDA $16CC     ; Load Width of the Map on the NW-SE-Axis(?)
$80/9A41 6D 61 00    ADC $0061     ; Add Cursor Position - NW to SE Axis + 1
$80/9A44 6D 63 00    ADC $0063     ; Add Cursor Position - NE to SW Axis
$80/9A47 38          SEC
$80/9A48 ED 65 00    SBC $0065     ; Subtract the (geographical) Height of the Rhomb
$80/9A4B 0A          ASL A         ; Multiply by #$8 --- #$8 pixels per Rhomb
$80/9A4C 0A          ASL A
$80/9A4D 0A          ASL A
$80/9A4E 09 07 00    ORA #$0007    ; "Add" 7 pixels
$80/9A51 9D 83 07    STA $0783,x   ; Store as Y-Offset for the Rhomb Marker
$80/9A54 38          SEC           ; Subtract #$0018 pixels - the distance between Rhomb Marker and Pointing Hand
$80/9A55 E9 18 00    SBC #$0018
$80/9A58 99 83 07    STA $0783,y   ; Store as Y-Offset of the Pointing Hand
$80/9A5B E2 20       SEP #$20
$80/9A5D 60          RTS

$80/9A5E ?

$80/9A5E 8B          PHB           ; Buffer Data Bank on Stack
$80/9A5F 4B          PHK           ; Set Data Bank to $80
$80/9A60 AB          PLB
$80/9A61 20 66 9A    JSR $9A66  [$80:9A66]   A:3980 X:0002 Y:44C0 P:eNvMxdizc
$80/9A64 AB          PLB           ; Restore Data Bank
$80/9A65 6B          RTL

$80/9A66 ?

$80/9A66 A2 00 00    LDX #$0000              A:3980 X:0002 Y:44C0 P:eNvMxdizc
$80/9A69 9B          TXY                     A:3980 X:0000 Y:44C0 P:envMxdiZc
$80/9A6A BD 03 06    LDA $0603,x[$80:0603]   A:3980 X:0000 Y:0000 P:envMxdiZc
$80/9A6D F0 21       BEQ $21    [$9A90]      A:3901 X:0000 Y:0000 P:envMxdizc
$80/9A6F BD C3 09    LDA $09C3,x[$80:09C3]   A:3901 X:0000 Y:0000 P:envMxdizc
$80/9A72 89 C0       BIT #$C0                A:39FF X:0000 Y:0000 P:eNvMxdizc
$80/9A74 F0 1A       BEQ $1A    [$9A90]      A:39FF X:0000 Y:0000 P:eNvMxdizc
$80/9A76 C2 20       REP #$20                A:39FF X:0000 Y:0000 P:eNvMxdizc
$80/9A78 BD 83 0A    LDA $0A83,x[$80:0A83]   A:39FF X:0000 Y:0000 P:eNvmxdizc
$80/9A7B 4A          LSR A                   A:0600 X:0000 Y:0000 P:envmxdizc
$80/9A7C 4A          LSR A                   A:0300 X:0000 Y:0000 P:envmxdizc
$80/9A7D 4A          LSR A                   A:0180 X:0000 Y:0000 P:envmxdizc
$80/9A7E 18          CLC                     A:00C0 X:0000 Y:0000 P:envmxdizc
$80/9A7F 7D 43 0A    ADC $0A43,x[$80:0A43]   A:00C0 X:0000 Y:0000 P:envmxdizc
$80/9A82 7D 03 0A    ADC $0A03,x[$80:0A03]   A:0740 X:0000 Y:0000 P:envmxdizc
$80/9A85 9D 03 0C    STA $0C03,x[$80:0C03]   A:12C0 X:0000 Y:0000 P:envmxdizc
$80/9A88 8A          TXA                     A:12C0 X:0000 Y:0000 P:envmxdizc
$80/9A89 99 83 0E    STA $0E83,y[$80:0E83]   A:0000 X:0000 Y:0000 P:envmxdiZc
$80/9A8C E2 20       SEP #$20                A:0000 X:0000 Y:0000 P:envmxdiZc
$80/9A8E C8          INY                     A:0000 X:0000 Y:0000 P:envMxdiZc
$80/9A8F C8          INY                     A:0000 X:0000 Y:0001 P:envMxdizc
$80/9A90 E8          INX                     A:0000 X:0000 Y:0002 P:envMxdizc
$80/9A91 E8          INX                     A:0000 X:0001 Y:0002 P:envMxdizc
$80/9A92 E0 40 00    CPX #$0040              A:0000 X:0002 Y:0002 P:envMxdizc
$80/9A95 90 D3       BCC $D3    [$9A6A]      A:0000 X:0002 Y:0002 P:eNvMxdizc
$80/9A97 C2 20       REP #$20                A:0000 X:0040 Y:0008 P:envMxdiZC
$80/9A99 A9 FF FF    LDA #$FFFF              A:0000 X:0040 Y:0008 P:envmxdiZC
$80/9A9C 99 83 0E    STA $0E83,y[$80:0E8B]   A:FFFF X:0040 Y:0008 P:eNvmxdizC
$80/9A9F C0 04 00    CPY #$0004              A:FFFF X:0040 Y:0008 P:eNvmxdizC
$80/9AA2 90 0F       BCC $0F    [$9AB3]      A:FFFF X:0040 Y:0008 P:envmxdizC
$80/9AA4 A2 00 00    LDX #$0000              A:FFFF X:0040 Y:0008 P:envmxdizC
$80/9AA7 88          DEY                     A:FFFF X:0000 Y:0008 P:envmxdiZC
$80/9AA8 88          DEY                     A:FFFF X:0000 Y:0007 P:envmxdizC
$80/9AA9 8B          PHB           ; Buffer Data Bank on Stack
$80/9AAA F4 00 7E    PEA $7E00     ; Set Data Bank to $7E
$80/9AAD AB          PLB
$80/9AAE AB          PLB
$80/9AAF 20 DC 9B    JSR $9BDC  [$80:9BDC]   A:FFFF X:0000 Y:0006 P:envmxdizC
$80/9AB2 AB          PLB           ; Restore Data Bank
$80/9AB3 E2 20       SEP #$20      ; A = 8-bit
$80/9AB5 60          RTS

$80/9AB6 ?

$80/9AB6 8B          PHB           ; Buffer Data Bank on Stack
$80/9AB7 4B          PHK           ; Set Data Bank to $80
$80/9AB8 AB          PLB
$80/9AB9 20 BE 9A    JSR $9ABE  [$80:9ABE]   A:0000 X:0040 Y:0040 P:eNvMxdizC
$80/9ABC AB          PLB           ; Restore Data Bank from Stack
$80/9ABD 6B          RTL

$80/9ABE ?

$80/9ABE A0 00 00    LDY #$0000              A:00C9 X:0040 Y:0000 P:envMxdiZC
$80/9AC1 BE 83 0E    LDX $0E83,y[$80:0E83]   A:00C9 X:0040 Y:0000 P:envMxdiZC
$80/9AC4 30 3E       BMI $3E    [$9B04]      A:0E00 X:FFFF Y:0014 P:eNvMxdizc
$80/9AC6 BD 03 06    LDA $0603,x[$80:0605]   A:00C9 X:0002 Y:0000 P:envMxdizC
$80/9AC9 F0 24       BEQ $24    [$9AEF]      A:0001 X:0002 Y:0000 P:envMxdizC
$80/9ACB BD C3 09    LDA $09C3,x[$80:09C5]   A:0001 X:0002 Y:0000 P:envMxdizC
$80/9ACE 89 C0       BIT #$C0                A:00FF X:0002 Y:0000 P:eNvMxdizC
$80/9AD0 F0 1D       BEQ $1D    [$9AEF]      A:00FF X:0002 Y:0000 P:eNvMxdizC
$80/9AD2 C8          INY            ; Increment Load Index twice
$80/9AD3 C8          INY
$80/9AD4 BD 43 08    LDA $0843,x[$80:0845]   A:00FF X:0002 Y:0002 P:envMxdizC
$80/9AD7 F0 E8       BEQ $E8        ; [$9AC1] Do next entry if empty
$80/9AD9 C2 20       REP #$20                A:0001 X:003E Y:000C P:envMxdizC
$80/9ADB BD 83 0A    LDA $0A83,x[$80:0AC1]   A:0001 X:003E Y:000C P:envmxdizC
$80/9ADE 4A          LSR A          ; Divide by 8
$80/9ADF 4A          LSR A
$80/9AE0 4A          LSR A
$80/9AE1 18          CLC                     A:0180 X:003E Y:000C P:envmxdizc
$80/9AE2 7D 43 0A    ADC $0A43,x[$80:0A81]   A:0180 X:003E Y:000C P:envmxdizc
$80/9AE5 7D 03 0A    ADC $0A03,x[$80:0A41]   A:03FF X:003E Y:000C P:envmxdizc
$80/9AE8 9D 03 0C    STA $0C03,x[$80:0C41]   A:0F7E X:003E Y:000C P:envmxdizc
$80/9AEB E2 20       SEP #$20                A:0F7E X:003E Y:000C P:envmxdizc
$80/9AED 80 D2       BRA $D2       ; [$9AC1] Loop
$80/9AEF 5A          PHY                     A:0000 X:0006 Y:0004 P:envMxdiZC
$80/9AF0 C2 20       REP #$20                A:0000 X:0006 Y:0004 P:envMxdiZC
$80/9AF2 B9 85 0E    LDA $0E85,y[$80:0E89]   A:0000 X:0006 Y:0004 P:envmxdiZC
$80/9AF5 99 83 0E    STA $0E83,y[$80:0E87]   A:0008 X:0006 Y:0004 P:envmxdizC
$80/9AF8 C8          INY                     A:0008 X:0006 Y:0004 P:envmxdizC
$80/9AF9 C8          INY                     A:0008 X:0006 Y:0005 P:envmxdizC
$80/9AFA C9 FF FF    CMP #$FFFF              A:0008 X:0006 Y:0006 P:envmxdizC
$80/9AFD D0 F3       BNE $F3    [$9AF2]      A:0008 X:0006 Y:0006 P:envmxdizc
$80/9AFF E2 20       SEP #$20                A:FFFF X:0006 Y:000A P:envmxdiZC
$80/9B01 7A          PLY                     A:FFFF X:0006 Y:000A P:envMxdiZC
$80/9B02 80 BD       BRA $BD    [$9AC1]      A:FFFF X:0006 Y:0004 P:envMxdizC
$80/9B04 A0 00 00    LDY #$0000              A:0E00 X:FFFF Y:0014 P:eNvMxdizc
$80/9B07 BE 83 0E    LDX $0E83,y[$80:0E83]   A:0E00 X:FFFF Y:0000 P:envMxdiZc
$80/9B0A 10 03       BPL $03    [$9B0F]      A:0E00 X:0002 Y:0000 P:envMxdizc
$80/9B0C 4C 91 9B    JMP $9B91     ; Exit
$80/9B0F BD 43 08    LDA $0843,x[$80:0845]   A:0E00 X:0002 Y:0000 P:envMxdizc
$80/9B12 D0 03       BNE $03    [$9B17]      A:0E00 X:0002 Y:0000 P:envMxdiZc
$80/9B14 4C 8C 9B    JMP $9B8C      ; Increment Load Index twice and loop
$80/9B17 84 00       STY $00    [$00:0000]   A:0E01 X:003E Y:000A P:envMxdizc
$80/9B19 86 02       STX $02    [$00:0002]   A:0E01 X:003E Y:000A P:envMxdizc
$80/9B1B C2 20       REP #$20                A:0E01 X:003E Y:000A P:envMxdizc
$80/9B1D BD 03 0C    LDA $0C03,x[$80:0C41]   A:0E01 X:003E Y:000A P:envmxdizc
$80/9B20 C0 00 00    CPY #$0000              A:0F7E X:003E Y:000A P:envmxdizc
$80/9B23 F0 33       BEQ $33    [$9B58]      A:0F7E X:003E Y:000A P:envmxdizC
$80/9B25 BE 81 0E    LDX $0E81,y[$80:0E8B]   A:0F7E X:003E Y:000A P:envmxdizC
$80/9B28 DD 03 0C    CMP $0C03,x[$80:0C0F]   A:0F7E X:000C Y:000A P:envmxdizC
$80/9B2B 90 2B       BCC $2B    [$9B58]      A:0F7E X:000C Y:000A P:eNvmxdizc
$80/9B2D F0 29       BEQ $29    [$9B58]      A:0F40 X:0012 Y:000A P:envmxdiZC
$80/9B2F 88          DEY                     A:1208 X:0004 Y:0006 P:envmxdizC
$80/9B30 88          DEY                     A:1208 X:0004 Y:0005 P:envmxdizC
$80/9B31 F0 0A       BEQ $0A    [$9B3D]      A:1208 X:0004 Y:0004 P:envmxdizC
$80/9B33 BE 81 0E    LDX $0E81,y[$80:0E85]   A:1208 X:0004 Y:0004 P:envmxdizC
$80/9B36 DD 03 0C    CMP $0C03,x[$80:0C03]   A:1208 X:0000 Y:0004 P:envmxdiZC
$80/9B39 F0 02       BEQ $02    [$9B3D]      A:1208 X:0000 Y:0004 P:eNvmxdizc
$80/9B3B B0 F2       BCS $F2    [$9B2F]      A:1208 X:0000 Y:0004 P:eNvmxdizc
$80/9B3D C8          INY                     A:1208 X:0000 Y:0004 P:eNvmxdizc
$80/9B3E C8          INY                     A:1208 X:0000 Y:0005 P:envmxdizc
$80/9B3F 84 04       STY $04    [$00:0004]   A:1208 X:0000 Y:0006 P:envmxdizc
$80/9B41 A4 00       LDY $00    [$00:0000]   A:1208 X:0000 Y:0006 P:envmxdizc
$80/9B43 B9 81 0E    LDA $0E81,y[$80:0E87]   A:1208 X:0000 Y:0006 P:envmxdizc
$80/9B46 99 83 0E    STA $0E83,y[$80:0E89]   A:0004 X:0000 Y:0006 P:envmxdizc
$80/9B49 88          DEY                     A:0004 X:0000 Y:0006 P:envmxdizc
$80/9B4A 88          DEY                     A:0004 X:0000 Y:0005 P:envmxdizc
$80/9B4B C4 04       CPY $04    [$00:0004]   A:0004 X:0000 Y:0004 P:envmxdizc
$80/9B4D B0 F4       BCS $F4    [$9B43]      A:0004 X:0000 Y:0004 P:eNvmxdizc
$80/9B4F A5 02       LDA $02    [$00:0002]   A:0004 X:0000 Y:0004 P:eNvmxdizc
$80/9B51 99 83 0E    STA $0E83,y[$80:0E87]   A:0006 X:0000 Y:0004 P:envmxdizc
$80/9B54 A4 00       LDY $00    [$00:0000]   A:0006 X:0000 Y:0004 P:envmxdizc
$80/9B56 80 32       BRA $32    [$9B8A]      A:0006 X:0000 Y:0006 P:envmxdizc
$80/9B58 BE 85 0E    LDX $0E85,y[$80:0E8F]   A:0F7E X:000C Y:000A P:eNvmxdizc
$80/9B5B 30 2D       BMI $2D        ; [$9B8A] Increment Load Index twice and loop
$80/9B5D DD 03 0C    CMP $0C03,x[$80:0C0D]   A:0F7E X:000A Y:000A P:envmxdizc
$80/9B60 B0 28       BCS $28        ; [$9B8A] Increment Load Index twice and loop
$80/9B62 C8          INY                     A:0B68 X:000E Y:0008 P:eNvmxdizc
$80/9B63 C8          INY                     A:0B68 X:000E Y:0009 P:envmxdizc
$80/9B64 BE 85 0E    LDX $0E85,y[$80:0E8F]   A:0B68 X:000E Y:000A P:envmxdizc
$80/9B67 30 05       BMI $05    [$9B6E]      A:0B68 X:0010 Y:000A P:envmxdizc
$80/9B69 DD 03 0C    CMP $0C03,x[$80:0C13]   A:0B68 X:0010 Y:000A P:envmxdizc
$80/9B6C 90 F4       BCC $F4    [$9B62]      A:0B68 X:0010 Y:000A P:eNvmxdizc
$80/9B6E 84 04       STY $04    [$00:0004]   A:0B68 X:0006 Y:000C P:envmxdizC
$80/9B70 A4 00       LDY $00    [$00:0000]   A:0B68 X:0006 Y:000C P:envmxdizC
$80/9B72 B9 85 0E    LDA $0E85,y[$80:0E8D]   A:0B68 X:0006 Y:0008 P:envmxdizC
$80/9B75 99 83 0E    STA $0E83,y[$80:0E8B]   A:000E X:0006 Y:0008 P:envmxdizC
$80/9B78 C8          INY                     A:000E X:0006 Y:0008 P:envmxdizC
$80/9B79 C8          INY                     A:000E X:0006 Y:0009 P:envmxdizC
$80/9B7A C4 04       CPY $04    [$00:0004]   A:000E X:0006 Y:000A P:envmxdizC
$80/9B7C 90 F4       BCC $F4    [$9B72]      A:000E X:0006 Y:000A P:eNvmxdizc
$80/9B7E A5 02       LDA $02    [$00:0002]   A:0010 X:0006 Y:000C P:envmxdiZC
$80/9B80 99 83 0E    STA $0E83,y[$80:0E8F]   A:000C X:0006 Y:000C P:envmxdizC
$80/9B83 A4 00       LDY $00    [$00:0000]   A:000C X:0006 Y:000C P:envmxdizC
$80/9B85 E2 20       SEP #$20                A:000C X:0006 Y:0008 P:envmxdizC
$80/9B87 4C 07 9B    JMP $9B07  [$80:9B07]   A:000C X:0006 Y:0008 P:envMxdizC
$80/9B8A E2 20       SEP #$20                A:0F7E X:000A Y:000A P:envmxdizC
$80/9B8C C8          INY           ; Increment Load Index twice
$80/9B8D C8          INY           
$80/9B8E 4C 07 9B    JMP $9B07     ; Loop
$80/9B91 60          RTS

$80/9B9A ?

$80/9B9A C2 20       REP #$20                A:8107 X:0006 Y:0004 P:envMxdizc
$80/9B9C 7B          TDC                     A:8107 X:0006 Y:0004 P:envmxdizc
$80/9B9D A8          TAY                     A:0000 X:0006 Y:0004 P:envmxdiZc
$80/9B9E 3A          DEC A                   A:0000 X:0006 Y:0000 P:envmxdiZc
$80/9B9F D9 83 0E    CMP $0E83,y[$80:0E83]   A:FFFF X:0006 Y:0000 P:eNvmxdizc
$80/9BA2 F0 04       BEQ $04    [$9BA8]      A:FFFF X:0006 Y:0000 P:eNvmxdizC
$80/9BA4 C8          INY                     A:FFFF X:0006 Y:0000 P:eNvmxdizC
$80/9BA5 C8          INY                     A:FFFF X:0006 Y:0001 P:envmxdizC
$80/9BA6 80 F7       BRA $F7    [$9B9F]      A:FFFF X:0006 Y:0002 P:envmxdizC
$80/9BA8 8A          TXA                     A:FFFF X:0006 Y:0006 P:envmxdiZC
$80/9BA9 99 83 0E    STA $0E83,y[$80:0E89]   A:0006 X:0006 Y:0006 P:envmxdizC
$80/9BAC A9 FF FF    LDA #$FFFF              A:0006 X:0006 Y:0006 P:envmxdizC
$80/9BAF 99 85 0E    STA $0E85,y[$80:0E8B]   A:FFFF X:0006 Y:0006 P:eNvmxdizC
$80/9BB2 E2 20       SEP #$20                A:FFFF X:0006 Y:0006 P:eNvmxdizC
$80/9BB4 60          RTS                     A:FFFF X:0006 Y:0006 P:eNvMxdizC

$80/9BDC ?

$80/9BDC D4 00       PEI ($00)     ; Buffer $00-$05 on Stack
$80/9BDE D4 02       PEI ($02)
$80/9BE0 D4 04       PEI ($04)
$80/9BE2 86 00       STX $00    [$00:0000]   A:FFFF X:0000 Y:0006 P:envmxdizC
$80/9BE4 84 02       STY $02    [$00:0002]   A:FFFF X:0000 Y:0006 P:envmxdizC
$80/9BE6 98          TYA                     A:FFFF X:0000 Y:0006 P:envmxdizC
$80/9BE7 38          SEC                     A:0006 X:0000 Y:0006 P:envmxdizC
$80/9BE8 E5 00       SBC $00    [$00:0000]   A:0006 X:0000 Y:0006 P:envmxdizC
$80/9BEA C9 0A 00    CMP #$000A              A:0006 X:0000 Y:0006 P:envmxdizC
$80/9BED 90 20       BCC $20    [$9C0F]      A:0006 X:0000 Y:0006 P:eNvmxdizc
$80/9BEF A5 00       LDA $00    [$00:0000]   A:000A X:0000 Y:000A P:envmxdiZC
$80/9BF1 18          CLC                     A:0000 X:0000 Y:000A P:envmxdiZC
$80/9BF2 65 02       ADC $02    [$00:0002]   A:0000 X:0000 Y:000A P:envmxdiZc
$80/9BF4 4A          LSR A                   A:000A X:0000 Y:000A P:envmxdizc
$80/9BF5 29 FE FF    AND #$FFFE              A:0005 X:0000 Y:000A P:envmxdizc
$80/9BF8 85 04       STA $04    [$00:0004]   A:0004 X:0000 Y:000A P:envmxdizc
$80/9BFA A6 00       LDX $00    [$00:0000]   A:0004 X:0000 Y:000A P:envmxdizc
$80/9BFC A4 04       LDY $04    [$00:0004]   A:0004 X:0000 Y:000A P:envmxdiZc
$80/9BFE 20 DC 9B    JSR $9BDC  [$80:9BDC]   A:0004 X:0000 Y:0004 P:envmxdizc
$80/9C01 A6 04       LDX $04    [$00:0004]   A:12C0 X:0000 Y:0004 P:envmxdiZC
$80/9C03 E8          INX                     A:12C0 X:0004 Y:0004 P:envmxdizC
$80/9C04 E8          INX                     A:12C0 X:0005 Y:0004 P:envmxdizC
$80/9C05 A4 02       LDY $02    [$00:0002]   A:12C0 X:0006 Y:0004 P:envmxdizC
$80/9C07 20 DC 9B    JSR $9BDC  [$80:9BDC]   A:12C0 X:0006 Y:000A P:envmxdizC
$80/9C0A 20 20 9C    JSR $9C20  [$80:9C20]   A:0C00 X:0000 Y:000A P:envmxdiZC
$80/9C0D 80 07       BRA $07    [$9C16]      A:0004 X:3A17 Y:0006 P:envmxdiZC
$80/9C0F E4 02       CPX $02    [$00:0002]   A:0006 X:0000 Y:0006 P:eNvmxdizc
$80/9C11 F0 03       BEQ $03    [$9C16]      A:0006 X:0000 Y:0006 P:eNvmxdizc
$80/9C13 20 7B 9C    JSR $9C7B  [$80:9C7B]   A:0006 X:0000 Y:0006 P:eNvmxdizc
$80/9C16 FA          PLX           ; Restore $05-$00 from Stack
$80/9C17 86 04       STX $04
$80/9C19 FA          PLX
$80/9C1A 86 02       STX $02
$80/9C1C FA          PLX
$80/9C1D 86 00       STX $00
$80/9C1F 60          RTS

$80/9C20 ?

$80/9C20 A6 5C       LDX $5C    [$00:005C]   A:0C00 X:0000 Y:000A P:envmxdiZC
$80/9C22 A4 00       LDY $00    [$00:0000]   A:0C00 X:3A11 Y:000A P:envmxdizC
$80/9C24 B9 83 0E    LDA $0E83,y[$7E:0E83]   A:0C00 X:3A11 Y:0000 P:envmxdiZC
$80/9C27 9D 00 00    STA $0000,x   ; Buffer values
$80/9C2A C8          INY           ; Increment Load Index twice
$80/9C2B C8          INY
$80/9C2C E8          INX           ; Increment Store Index twice
$80/9C2D E8          INX
$80/9C2E C4 04       CPY $04    [$00:0004]   A:0002 X:3A13 Y:0002 P:envmxdizC
$80/9C30 90 F2       BCC $F2       ; [$9C24] Loop if Y is less
$80/9C32 F0 F0       BEQ $F0       ; [$9C24] Loop if Y is the same
$80/9C34 86 04       STX $04    [$00:0004]   A:0004 X:3A17 Y:0006 P:envmxdizC
$80/9C36 A6 5C       LDX $5C    [$00:005C]   A:0004 X:3A17 Y:0006 P:envmxdizC
$80/9C38 DA          PHX                     A:0004 X:3A11 Y:0006 P:envmxdizC
$80/9C39 BD 00 00    LDA $0000,x[$7E:3A11]   A:0004 X:3A11 Y:0006 P:envmxdizC
$80/9C3C AA          TAX                     A:0002 X:3A11 Y:0006 P:envmxdizC
$80/9C3D BD 03 0C    LDA $0C03,x[$7E:0C05]   A:0002 X:0002 Y:0006 P:envmxdizC
$80/9C40 BE 83 0E    LDX $0E83,y[$7E:0E89]   A:13C0 X:0002 Y:0006 P:envmxdizC
$80/9C43 DD 03 0C    CMP $0C03,x[$7E:0C09]   A:13C0 X:0006 Y:0006 P:envmxdizC
$80/9C46 FA          PLX                     A:13C0 X:0006 Y:0006 P:envmxdizC
$80/9C47 90 07       BCC $07    [$9C50]      A:13C0 X:3A11 Y:0006 P:envmxdizC
$80/9C49 BD 00 00    LDA $0000,x[$7E:3A11]   A:13C0 X:3A11 Y:0006 P:envmxdizC
$80/9C4C E8          INX                     A:0002 X:3A11 Y:0006 P:envmxdizC
$80/9C4D E8          INX                     A:0002 X:3A12 Y:0006 P:envmxdizC
$80/9C4E 80 05       BRA $05    [$9C55]      A:0002 X:3A13 Y:0006 P:envmxdizC
code is missing here
$80/9C55 5A          PHY                     A:0002 X:3A13 Y:0006 P:envmxdizC
$80/9C56 A4 00       LDY $00    [$00:0000]   A:0002 X:3A13 Y:0006 P:envmxdizC
$80/9C58 99 83 0E    STA $0E83,y[$7E:0E83]   A:0002 X:3A13 Y:0000 P:envmxdiZC
$80/9C5B C8          INY                     A:0002 X:3A13 Y:0000 P:envmxdiZC
$80/9C5C C8          INY                     A:0002 X:3A13 Y:0001 P:envmxdizC
$80/9C5D 84 00       STY $00    [$00:0000]   A:0002 X:3A13 Y:0002 P:envmxdizC
$80/9C5F 7A          PLY                     A:0002 X:3A13 Y:0002 P:envmxdizC
$80/9C60 E4 04       CPX $04    [$00:0004]   A:0002 X:3A13 Y:0006 P:envmxdizC
$80/9C62 B0 16       BCS $16    [$9C7A]      A:0002 X:3A13 Y:0006 P:eNvmxdizc
$80/9C64 C4 02       CPY $02    [$00:0002]   A:0002 X:3A13 Y:0006 P:eNvmxdizc
$80/9C66 90 D0       BCC $D0    [$9C38]      A:0002 X:3A13 Y:0006 P:eNvmxdizc
code is missing here
$80/9C7A 60          RTS                     A:0004 X:3A17 Y:0006 P:envmxdiZC

$80/9C7B ?

$80/9C7B A4 00       LDY $00    [$00:0000]   A:0006 X:0000 Y:0006 P:eNvmxdizc
$80/9C7D 5A          PHY                     A:0006 X:0000 Y:0000 P:envmxdiZc
$80/9C7E BE 83 0E    LDX $0E83,y[$7E:0E83]   A:0006 X:0000 Y:0000 P:envmxdiZc
$80/9C81 BD 03 0C    LDA $0C03,x[$7E:0C03]   A:0006 X:0000 Y:0000 P:envmxdiZc
$80/9C84 84 04       STY $04    [$00:0004]   A:12C0 X:0000 Y:0000 P:envmxdizc
$80/9C86 C8          INY                     A:12C0 X:0000 Y:0000 P:envmxdizc
$80/9C87 C8          INY                     A:12C0 X:0000 Y:0001 P:envmxdizc
$80/9C88 BE 83 0E    LDX $0E83,y[$7E:0E85]   A:12C0 X:0000 Y:0002 P:envmxdizc
$80/9C8B DD 03 0C    CMP $0C03,x[$7E:0C05]   A:12C0 X:0002 Y:0002 P:envmxdizc
$80/9C8E B0 05       BCS $05    [$9C95]      A:12C0 X:0002 Y:0002 P:eNvmxdizc
$80/9C90 BD 03 0C    LDA $0C03,x[$7E:0C05]   A:12C0 X:0002 Y:0002 P:eNvmxdizc
$80/9C93 84 04       STY $04    [$00:0004]   A:13C0 X:0002 Y:0002 P:envmxdizc
$80/9C95 C8          INY                     A:13C0 X:0002 Y:0002 P:envmxdizc
$80/9C96 C8          INY                     A:13C0 X:0002 Y:0003 P:envmxdizc
$80/9C97 C4 02       CPY $02    [$00:0002]   A:13C0 X:0002 Y:0004 P:envmxdizc
$80/9C99 90 ED       BCC $ED    [$9C88]      A:13C0 X:0002 Y:0004 P:eNvmxdizc
$80/9C9B F0 EB       BEQ $EB    [$9C88]      A:13C0 X:0004 Y:0006 P:envmxdiZC
$80/9C9D 7A          PLY                     A:13C0 X:0006 Y:0008 P:envmxdizC
$80/9C9E C4 04       CPY $04    [$00:0004]   A:13C0 X:0006 Y:0000 P:envmxdiZC
$80/9CA0 F0 18       BEQ $18    [$9CBA]      A:13C0 X:0006 Y:0000 P:eNvmxdizc
$80/9CA2 A6 04       LDX $04    [$00:0004]   A:13C0 X:0006 Y:0000 P:eNvmxdizc
$80/9CA4 84 04       STY $04    [$00:0004]   A:13C0 X:0002 Y:0000 P:envmxdizc
$80/9CA6 BD 83 0E    LDA $0E83,x[$7E:0E85]   A:13C0 X:0002 Y:0000 P:envmxdizc
$80/9CA9 48          PHA                     A:0002 X:0002 Y:0000 P:envmxdizc
$80/9CAA CA          DEX                     A:0002 X:0002 Y:0000 P:envmxdizc
$80/9CAB CA          DEX                     A:0002 X:0001 Y:0000 P:envmxdizc
$80/9CAC BD 83 0E    LDA $0E83,x[$7E:0E83]   A:0002 X:0000 Y:0000 P:envmxdiZc
$80/9CAF 9D 85 0E    STA $0E85,x[$7E:0E85]   A:0000 X:0000 Y:0000 P:envmxdiZc
$80/9CB2 E4 04       CPX $04    [$00:0004]   A:0000 X:0000 Y:0000 P:envmxdiZc
$80/9CB4 D0 F4       BNE $F4    [$9CAA]      A:0000 X:0000 Y:0000 P:envmxdiZC
$80/9CB6 68          PLA                     A:0000 X:0000 Y:0000 P:envmxdiZC
$80/9CB7 9D 83 0E    STA $0E83,x[$7E:0E83]   A:0002 X:0000 Y:0000 P:envmxdizC
$80/9CBA C8          INY                     A:0002 X:0000 Y:0000 P:envmxdizC
$80/9CBB C8          INY                     A:0002 X:0000 Y:0001 P:envmxdizC
$80/9CBC C4 02       CPY $02    [$00:0002]   A:0002 X:0000 Y:0002 P:envmxdizC
$80/9CBE 90 BD       BCC $BD    [$9C7D]      A:0002 X:0000 Y:0002 P:eNvmxdizc
$80/9CC0 60          RTS                     A:12C0 X:0006 Y:0006 P:envmxdiZC

$80/9D32 DMA Subroutine

Destination has to be set before this Subroutine is called

$80/9D32 8D 04 43    STA $4304     ; A: Source Bank (8 bit)
$80/9D35 8E 02 43    STX $4302     ; X: Source Address (16 bit)
$80/9D38 8C 05 43    STY $4305     ; Y: Number of Bytes to transfer
$80/9D3B A9 00       LDA #$00      ; DMA options
$80/9D3D 8D 00 43    STA $4300
$80/9D40 A9 01       LDA #$01      ; Activate DMA
$80/9D42 8D 0B 42    STA $420B
$80/9D45 60          RTS

$80/9D81 Long Jump to VRAM Clear

A: Source Bank of the Clear Byte (8 bit)

X: Source Address of the Clear Byte (16 bit)

Y: Destination VRAM Address (16 bit)

$80/9D81 8B          PHB           ; Buffer Program Bank
$80/9D82 4B          PHK           ; Set $80 as Program Bank
$80/9D83 AB          PLB
$80/9D84 20 89 9D    JSR $9D89     ; VRAM Clear
$80/9D87 AB          PLB           ; Restore Program Bank
$80/9D88 6B          RTL

$80/9D89 VRAM Clear

$80/9D89 8D 04 43    STA $4304     ; A: Source Bank (8 bit)
$80/9D8C 8E 02 43    STX $4302     ; X: Source Address (16 bit)
$80/9D8F 8C 16 21    STY $2116     ; Y: Destination VRAM Address (16 bit)
$80/9D92 A9 80       LDA #$80      ; Increment after writing $2119
$80/9D94 8D 15 21    STA $2115
$80/9D97 A9 09       LDA #$09      ; FIXED TRANSFER, 16 bit Transfer
$80/9D99 8D 00 43    STA $4300
$80/9D9C A9 18       LDA #$18      ; DMA Destination: $2118, VRAM
$80/9D9E 8D 01 43    STA $4301
$80/9DA1 A9 01       LDA #$01      ; Activate DMA
$80/9DA3 8D 0B 42    STA $420B
$80/9DA6 60          RTS

$80/9DA7 Long Jump to the WRAM-Clear-DMA

$80/9DA7 20 AB 9D    JSR $9DAB     ; Setup of the rest of the DMA and activation
$80/9DAA 6B          RTL

$80/9DAB WRAM-Clear-DMA

This Subroutine is half a setup for a DMA and starts the DMA. The first half of the setup has to be done before this Subroutine gets called. A call can be found at $80/801B. This is a fixed Transfer, so it's used for Clear Up DMAs. Furthermore, due to it's construction it is fixed to WRAM addresses. Before this subroutine is called, there are additional values that are loaded into certain registers:

A: Source Bank (8 bit)

X: Source Address (16 bit)

Y: Destination WRAM Address (16 bit)

Carry Bit Set: WRAM Bank $7F / Carry Bit Clear: WRAM Bank $7E

$80/9DAB 8D 04 43    STA $4304     ; A: Source Bank (8 bit)
$80/9DAE 8E 02 43    STX $4302     ; X: Source Address (16 bit)
$80/9DB1 8C 81 21    STY $2181     ; Y: Destination WRAM Address (16 bit)
$80/9DB4 2A          ROL A         ; Roll Carry-Bit in A
$80/9DB5 8D 83 21    STA $2183     ; If carry bit was set: Bank $7F, if clear: $7E
$80/9DB8 A9 08       LDA #$08      ; FIXED TRANSFER
$80/9DBA 8D 00 43    STA $4300
$80/9DBD A9 80       LDA #$80      ; DMA to Register $2180 --> to the WRAM address previously set up
$80/9DBF 8D 01 43    STA $4301
$80/9DC2 A9 01       LDA #$01      ; Activate DMA
$80/9DC4 8D 0B 42    STA $420B
$80/9DC7 60          RTS

$80/9DC8 Long Jump to Write Empty Tilemap in WRAM

$80/9DC8 20 CC 9D    JSR $9DCC     ; Write Empty Tilemap in WRAM
$80/9DCB 6B          RTL

$80/9DCC Write Empty Tilemap in WRAM

This subroutine is used to write the same double-byte over and over into a bigger space. This is used to write empty tilemaps in WRAM.

X contains the number of bytes to do

Y contains the destination address (the destination bank has to be set as Data Bank before this subroutine is called)

A (16-bit) contains the 16-bit value that should be written

This subroutine has to ways of doing this: Either it simply works off $20 byte in one step, or it does less if it has to do less then $20 byte. So, whatever amount you give it, it clears the big bunch in $20 byte steps first and then does the rest in the second way of doing it. The first part of the program is about distinguishing which method is to use.

This subroutine is actually quite well done: At $80/9DE4, it uses the remaining number of bytes to do which is in X as an index for a jump table, the jump table then lets the program jump right into the middle of the whole Store commands that start at $9E0D - that's the reason why it starts at $001E,y and not at $0000,y!

$80/9DCC D4 00       PEI ($00)     ; Buffer $00 on stack
$80/9DCE E0 21 00    CPX #$0021    ; Check if the number of bytes-to-do is more than #$20
$80/9DD1 90 0F       BCC $0F       ; [$9DE2] Branch if not
$80/9DD3 48          PHA           ; Buffer the Write-Byte
$80/9DD4 A9 20 00    LDA #$0020    ; Set Number of Bytes to do in $00
$80/9DD7 85 00       STA $00
$80/9DD9 68          PLA           ; Restore the Write-Byte
$80/9DDA 20 0D 9E    JSR $9E0D  [$80:9E0D]   A:0000 X:0080 Y:BDC4 P:envmxdIZC

$80/9DDD E0 21 00    CPX #$0021    ; Repeat this procedure if there are still more than $20 bytes to do
$80/9DE0 B0 F8       BCS $F8       ; [$9DDA]

$80/9DE2 86 00       STX $00       ; Set the remaining Number of Bytes to do in $00
$80/9DE4 FC EB 9D    JSR ($9DEB,x) ; Jump to the Jump Table which redirects into the part at $9E0D

$80/9DE7 FA          PLX           ; Restore Original $00 and Exit
$80/9DE8 86 00       STX $00
$80/9DEA 60          RTS
Code is missing here
What is missing here is most likely a list of 2-byte-long Branch Commands where the first one branches to $9E3A, the second to $9E3C...
$80/9E0D 99 1E 00    STA $001E,y   ; Write the Write-Byte into it's destination
$80/9E10 99 1C 00    STA $001C,y
$80/9E13 99 1A 00    STA $001A,y
$80/9E16 99 18 00    STA $0018,y
$80/9E19 99 16 00    STA $0016,y
$80/9E1C 99 14 00    STA $0014,y
$80/9E1F 99 12 00    STA $0012,y
$80/9E22 99 10 00    STA $0010,y
$80/9E25 99 0E 00    STA $000E,y
$80/9E28 99 0C 00    STA $000C,y
$80/9E2B 99 0A 00    STA $000A,y
$80/9E2E 99 08 00    STA $0008,y
$80/9E31 99 06 00    STA $0006,y
$80/9E34 99 04 00    STA $0004,y
$80/9E37 99 02 00    STA $0002,y
$80/9E3A 99 00 00    STA $0000,y
$80/9E3D 48          PHA           ; Buffer the Write-Byte
$80/9E3E 8A          TXA           ; Decrease the number of Bytes-to-do according to the number of transfered bytes
$80/9E3F 38          SEC
$80/9E40 E5 00       SBC $00
$80/9E42 AA          TAX
$80/9E43 98          TYA           ; Increase the where-to-write-address according to the number of transfered bytes
$80/9E44 18          CLC
$80/9E45 65 00       ADC $00
$80/9E47 A8          TAY
$80/9E48 68          PLA           ; Restore the Write-Byte
$80/9E49 60          RTS

$80/9E7B Long Jump to Decompress Data and DMA to VRAM

A and X contain 24-bit-Address of the Compressed Data.

Y contains the VRAM Destination

$20-$22 contains a 24-bit-Address where to tempstore the decompressed Data.

$80/9E7B 8B          PHB           ; Preserve Data Bank
$80/9E7C 4B          PHK           ; Change Data Bank to this
$80/9E7D AB          PLB
$80/9E7E 20 83 9E    JSR $9E83     ; Decompress Data and DMA to VRAM
$80/9E81 AB          PLB           ; Restore Data Bank
$80/9E82 6B          RTL

$80/9E83 Decompress Data and DMA to VRAM

A and X contain 24-bit-Address of the Compressed Data.

Y contains the VRAM Destination

$20-$22 contains a 24-bit-Address where to tempstore the decompressed Data.

$80/9E83 5A          PHY           ; Push VRAM Destination on Stack
$80/9E84 22 E5 F9 81 JSL $81F9E5   ; Decompress Data
$80/9E88 A6 0E       LDX $0E       ; Load number of decompressed bytes
$80/9E8A 86 0C       STX $0C       ; Set it as number of bytes to transfer to VRAM
$80/9E8C A9 80       LDA #$80      ; VRAM transfer settings ($2115)
$80/9E8E 85 0E       STA $0E
$80/9E90 A6 20       LDX $20       ; DMA Source Address
$80/9E92 A5 22       LDA $22       ; DMA Source Bank
$80/9E94 7A          PLY           ; VRAM Destination
$80/9E95 4C 2C 9F    JMP $9F2C     ; VRAM DMA - it's JMP, not JSR, so here's no RTS

$80/9E98 ?

$80/9E98 8B          PHB           ; Buffer Data Bank on Stack
$80/9E99 4B          PHK           ; Set Data Bank to $80
$80/9E9A AB          PLB
$80/9E9B 20 A0 9E    JSR $9EA0  [$80:9EA0]   A:DCC8 X:DCC1 Y:2B00 P:eNvMxdizc
$80/9E9E AB          PLB           ; Restore Data Bank from Stack
$80/9E9F 6B          RTL

$80/9EA0 ?

$80/9EA0 5A          PHY           ; Push VRAM Destination on Stack
$80/9EA1 22 CC F7 81 JSL $81F7CC[$81:F7CC]   A:DCC8 X:DCC1 Y:2B00 P:eNvMxdizc
$80/9EA5 A6 0E       LDX $0E       ; Load number of decompressed bytes
$80/9EA7 86 0C       STX $0C       ; Set it as number of bytes to transfer to VRAM
$80/9EA9 A9 80       LDA #$80      ; VRAM transfer settings ($2115)
$80/9EAB 85 0E       STA $0E
$80/9EAD A6 20       LDX $20       ; DMA Source Address
$80/9EAF A5 22       LDA $22       ; DMA Source Bank
$80/9EB1 7A          PLY           ; VRAM Destination
$80/9EB2 4C 2C 9F    JMP $9F2C     ; VRAM DMA - it's JMP, not JSR, so here's no RTS

$80/9E85 Transfer color

This subroutine transfers a part (or all) of the CGRAM buffer to CGRAM.

A contains the CGRAM Destination

X's content doesn't matter, but gets changed during this subroutine

Y contains the number of bytes to transfer

$80/9EB5 8B          PHB           ; Preserve Data Bank
$80/9EB6 4B          PHK           ; Change Data Bank to this
$80/9EB7 AB          PLB
$80/9EB8 48          PHA           ; Buffer Original A value
$80/9EB9 AD 6A 05    LDA $056A     ; Load $2100 Buffer
$80/9EBC 0A          ASL A         ; Roll MSB (FBLANK Flag) in the Carry Bit
$80/9EBD 68          PLA           ; Restore Original A value
$80/9EBE 90 24       BCC $24       ; [$9EE4] Branch if FBLANK isn't active
$80/9EC0 9C 0C 42    STZ $420C     ; Deactivate HDMAs
$80/9EC3 8D 21 21    STA $2121     ; Original A = CGRAM Destination
$80/9EC6 C2 20       REP #$20      ; 16-bit A
$80/9EC8 29 FF 00    AND #$00FF    ; Remove if there was something in the hidden 8-bit
$80/9ECB 0A          ASL A         ; Multiply A by 2 (each color is 2 bytes in size)
$80/9ECC 69 4B 12    ADC #$124B    ; Add the Offset of the CGRAM buffer, so A contains now the WRAM address of the first color
$80/9ECF AA          TAX           ; Transfer to X for the upcoming DMA Setup Subroutine
$80/9ED0 E2 20       SEP #$20
$80/9ED2 A9 22       LDA #$22      ; DMA Destination: $(21)22 = CGRAM
$80/9ED4 8D 01 43    STA $4301
$80/9ED7 A9 00       LDA #$00      ; DMA Source Bank: $00
$80/9ED9 20 32 9D    JSR $9D32     ; Setup and Execute DMA to CGRAM
$80/9EDC AD 86 05    LDA $0586     ; Reactivate HDMAs
$80/9EDF 8D 0C 42    STA $420C
$80/9EE2 80 05       BRA $05       ; [$9EE9] Exit

Code is missing here

$80/9EE9 AB          PLB           ; Restore Data Bank
$80/9EEA 6B          RTL

$80/9EEB VRAM DMA with accompanying Data Bytes

Important: Whenever and from wherever this subroutine is called, the next few bytes AFTER the JSL $809EEB is Data for this subroutine. So, the first part of this subroutine is changing the Jump-Back-Address on stack so the program does not accidentally try to interpret these data bytes as code, but skip them.

The rest is the regular VRAM DMA subroutine at $80/9F2C

The Data following this Subroutine's called are structured as follows:

2 Bytes - DMA Source Address

1 Byte - DMA Source Bank

2 Bytes - VRAM Destination Address

2 Bytes - Number of Bytes

$80/9EEB 8B          PHB           ; Push Program Bank
$80/9EEC C2 21       REP #$21      ; 16 bit A, clear Carry
$80/9EEE A3 02       LDA $02,s     ; Load the address from stack, where to return when the program reaches a RTL
$80/9EF0 AA          TAX           ; Copy it into X
$80/9EF1 69 07 00    ADC #$0007    ; Add 7 to the return address - skip 7 bytes
$80/9EF4 83 02       STA $02,s     ; Store it back on stack
$80/9EF6 E2 20       SEP #$20      ; 8 bit A
$80/9EF8 A3 04       LDA $04,s     ; Load the Bank Byte from the Return address
$80/9EFA 48          PHA           ; Set it as Program Bank for now
$80/9EFB AB          PLB
$80/9EFC D4 0C	PEI ($0C)          ; Preserve current values in $0C-$0F on Stack
$80/9EFE D4 0E	PEI ($0E)
$80/9F00 A9 80       LDA #$80      ; VRAM settings (for $2115)
$80/9F02 85 0E       STA $0E
$80/9F04 BD 03 00    LDA $0003,x   ; DMA Source Bank
$80/9F07 48          PHA           ; Push it on stack, it gets pulled right before the Subroutine Jump
$80/9F08 C2 20       REP #$20
$80/9F0A BD 06 00    LDA $0006,x   ; Number of Bytes to transfer
$80/9F0D 85 0C       STA $0C
$80/9F0F BC 04 00    LDY $0004,x   ; VRAM Destination Address
$80/9F12 BD 01 00    LDA $0001,x   ; DMA Source Address
$80/9F15 AA          TAX
$80/9F16 E2 20       SEP #$20
$80/9F18 68          PLA           ; Pull Source Bank
$80/9F19 20 2C 9F    JSR $9F2C     ; VRAM DMA
$80/9F1C FA          PLX           ; Restore old values of $0C-$0F
$80/9F1D 86 0E       STX $0E
$80/9F1F FA          PLX
$80/9F20 86 0C       STX $0C
$80/9F22 AB          PLB           ; Pull Program Bank
$80/9F23 6B          RTL

$80/9F24 Long Jump to VRAM DMA

This jumps to the VRAM DMA subroutine, but stores the current program bank on stack and restores the old one afterwards.

$80/9F24 8B          PHB
$80/9F25 4B          PHK
$80/9F26 AB          PLB
$80/9F27 20 2C 9F    JSR $9F2C     ; VRAM DMA
$80/9F2A AB          PLB
$80/9F2B 6B          RTL

$80/9F2C VRAM DMA

This Subroutine executes an DMA to VRAM.

First it checks if currently FBLANK is active. Then it checks if a HDMA is active. If it is, it pauses the HDMA for the time the DMA gets prepared and executed. The following preparations have been made in order to make this subroutine work properly:

A contains the DMA Source Bank

X contains the DMA Source Address

Y contains the VRAM Destination Address

$0C/$0D contain the number of bytes to transfer

$0E contains the VRAM settings (for register $2115)

$80/9F2C 48          PHA           ; Preserve the Original A content on Stack
$80/9F2D AD 6A 05    LDA $056A     ; Is currently a FBLANK active?
$80/9F30 10 38       BPL $38       ; [$9F6A] branch if not - If not, don't execute the DMA NOW, but put it in Pipeline
$80/9F32 68          PLA           ; Restore Original A content...
$80/9F33 EB          XBA           ; ... and put it in the other half of the Accumulator
$80/9F34 AD 86 05    LDA $0586     ; Are any HDMAs active/planned?
$80/9F37 F0 0D       BEQ $0D       ; [$9F46] If not, skip the next part - immediate execution of the DMA
$80/9F39 9C 0C 42    STZ $420C     ; Remove HDMA activation flags
$80/9F3C 20 46 9F    JSR $9F46     ; Execute the stuff you were branched to before as a subroutine now
$80/9F3F AD 86 05    LDA $0586     ; ... afterwards, restore the HDMA-Flags again
$80/9F42 8D 0C 42    STA $420C
$80/9F45 60          RTS
$80/9F46 A9 01       LDA #$01      ; DMA Settings
$80/9F48 8D 00 43    STA $4300
$80/9F4B A9 18       LDA #$18      ; Destination: $2118 - VRAM
$80/9F4D 8D 01 43    STA $4301
$80/9F50 EB          XBA           ; Restore Original A value
$80/9F51 8C 16 21    STY $2116     ; Original Y Value: VRAM Address
$80/9F54 8E 02 43    STX $4302     ; Original X Value: Source Address
$80/9F57 8D 04 43    STA $4304     ; Original A Value: Source Bank
$80/9F5A A6 0C       LDX $0C       ; $0C contains the number of bytes to transfer
$80/9F5C 8E 05 43    STX $4305
$80/9F5F A5 0E       LDA $0E       ; $0E contains the VRAM transfer settings
$80/9F61 8D 15 21    STA $2115
$80/9F64 A9 01       LDA #$01      ; Activate DMA
$80/9F66 8D 0B 42    STA $420B
$80/9F69 60          RTS
$80/9F6A A3 01       LDA $01,s     ; Load the last byte on stack (Original A) without removing it from stack
$80/9F6C C9 7E       CMP #$7E      ; is the DMA source Bank $7E?
$80/9F6E D0 18       BNE $18       ; [$9F88] branch if not
$80/9F70 E4 5C       CPX $5C       ; ???
$80/9F72 90 14       BCC $14       ; [$9F88]
$80/9F74 E4 5E       CPX $5E       ; ???
$80/9F76 B0 10       BCS $10       ; [$9F88]
$80/9F78 C2 21       REP #$21      ; A = 16 bit, Carry cleared
$80/9F7A 8A          TXA           ; DMA Source Address is now in A
$80/9F7B 65 0C       ADC $0C       ; Add the number of Bytes transfered
$80/9F7D 3A          DEC A         ; Decrement it by one
$80/9F7E C5 5E       CMP $5E       ; ???
$80/9F80 90 03       BCC $03       ; [$9F85]

Code is missing here

$80/9F85 1A          INC A         ; ???
$80/9F86 85 5C       STA $5C       ; ???
$80/9F88 C2 21       REP #$21      ; A = 16 bit, Carry cleared
$80/9F8A AD C5 0E    LDA $0EC5     ; ???
$80/9F8D 65 0C       ADC $0C       ; ???
$80/9F8F 8D C5 0E    STA $0EC5     ; ???
$80/9F92 DA          PHX           ; Push DMA Source Address from Stack
$80/9F93 AD C7 0E    LDA $0EC7     ; Load Number of already occupied Pipeline Slots
$80/9F96 29 FF 00    AND #$00FF    ; This Number is 8 bit in size
$80/9F99 0A          ASL A         ; multiply by 2 - each pipeline entry is 2 bytes in size
$80/9F9A AA          TAX           ; Transfer in X as Index
$80/9F9B 98          TYA           ; Y still held the VRAM Destination
$80/9F9C 9D 49 10    STA $1049,x   ; Put in Pipeline - VRAM Destination ($2116)
$80/9F9F A5 0C       LDA $0C
$80/9FA1 9D C9 0E    STA $0EC9,x   ; Put in Pipeline - Data Size ($4305)
$80/9FA4 68          PLA           ; Get DMA Source Address (see $80/9F92)
$80/9FA5 9D 89 0F    STA $0F89,x   ; Put in Pipeline - Source Address ($4302)
$80/9FA8 E2 20       SEP #$20
$80/9FAA 68          PLA
$80/9FAB 9D 0A 11    STA $110A,x   ; Put in Pipeline - Source Bank ($4304)
$80/9FAE A5 0E       LDA $0E
$80/9FB0 9D 09 11    STA $1109,x   ; Put in Pipeline - VRAM Settings ($2115)
$80/9FB3 EE C7 0E    INC $0EC7     ; Increment Number of occupied Pipeline Slots
$80/9FB6 60          RTS

$80/9FB7 Animation VRAM DMA

This subroutine is for small DMAs to the VRAM; it is used for updating Sprite Tiles (for moving animations or animated Rhombs, for example).

It checks if FBLANK is active (or the brightness is turned completely down) or not. If it is, it does a direct DMA to VRAM. If not, it adds it to a special Pipeline for these DMAs.

Y: VRAM Destination $2116

X: Source Address

A: Source Bank

$0C: Number of bytes

$80/9FB7 8B          PHB           ; Buffer Program Bank
$80/9FB8 4B          PHK           ; Change Program Bank
$80/9FB9 AB          PLB
$80/9FBA 48          PHA           ; Buffer A (Source Bank)
$80/9FBB AD 6A 05    LDA $056A     ; $2100 Buffer - FBLANK / Screen Brightness
$80/9FBE 10 34       BPL $34       ; [$9FF4] Branch if there's no FBLANK active
$80/9FC0 68          PLA           ; Put A where the coming subroutine can use it as Source Bank
$80/9FC1 EB          XBA
$80/9FC2 9C 0C 42    STZ $420C     ; Deactivate HDMA for now
$80/9FC5 20 D0 9F    JSR $9FD0     ; VRAM DMA
$80/9FC8 AD 86 05    LDA $0586     ; Reactivate HDMA
$80/9FCB 8D 0C 42    STA $420C
$80/9FCE 80 54       BRA $54       ; [$A024] CLC, PLB, RTL

$80/9FD0 VRAM DMA

Y: VRAM Destination $2116

X: Source Address

B (hidden 8bit of A): Source Bank

$0C: Number of bytes

$80/9FD0 A9 01       LDA #$01      ; DMA Transfer style
$80/9FD2 8D 00 43    STA $4300
$80/9FD5 A9 18       LDA #$18      ; DMA Destination: $2118 VRAM
$80/9FD7 8D 01 43    STA $4301
$80/9FDA EB          XBA           ; Source Bank is in the hidden 8 bit part of Accumulator
$80/9FDB 8C 16 21    STY $2116     ; Y: VRAM Destination
$80/9FDE 8E 02 43    STX $4302     ; X: Source Address
$80/9FE1 8D 04 43    STA $4304     ; Source Bank
$80/9FE4 A6 0C       LDX $0C       ; Number of Bytes to transfer
$80/9FE6 8E 05 43    STX $4305
$80/9FE9 A9 80       LDA #$80      ; VRAM transfer settings
$80/9FEB 8D 15 21    STA $2115
$80/9FEE A9 01       LDA #$01      ; Activate DMA
$80/9FF0 8D 0B 42    STA $420B
$80/9FF3 60          RTS

$80/9FF4 Add Entry to Animation VRAM DMA Pipeline

X contains the DMA Source Address

Y contains the VRAM Destination

$0C contains the Number of Bytes to transfer

$80/9FF4 AD C9 11    LDA $11C9     ; Load Number of the next free Animation VRAM DMA slot
$80/9FF7 1A          INC A         ; Increment by one
$80/9FF8 29 1F       AND #$1F      ; Reset if it surpassed #$1F (circular buffer)
$80/9FFA CD CA 11    CMP $11CA     ; Is it the same as Number of the first used Animation VRAM DMA slot
$80/9FFD F0 28       BEQ $28       ; [$A027] Exit
$80/9FFF 7B          TDC           ; Clear 16-bit A
$80/A000 AD C9 11    LDA $11C9     ; Load Number of the next free Animation VRAM DMA slot
$80/A003 C2 21       REP #$21      ; 16-bit A, Clear Carry
$80/A005 DA          PHX           ; Push DMA Source Address on Stack
$80/A006 0A          ASL A         ; Multiply Number of Animation VRAM DMAs by 2
$80/A007 AA          TAX           ; Transfer in X to use it as a store Index
$80/A008 98          TYA           ; Transfer VRAM Destination in A
$80/A009 9D C9 10    STA $10C9,x   ; Store it in Animation VRAM DMA Pipieline
$80/A00C A5 0C       LDA $0C       ; Number of Bytes to transfer
$80/A00E 9D 49 0F    STA $0F49,x   ; Store it in Animation VRAM DMA Pipieline
$80/A011 68          PLA           ; Pull DMA Source Address from Stack
$80/A012 9D 09 10    STA $1009,x   ; Store it in Animation VRAM DMA Pipieline
$80/A015 E2 20       SEP #$20      ; 8-bit A
$80/A017 68          PLA           ; Pull Source Bank from Stack (Pushed at $80/9FBA)
$80/A018 9D 8A 11    STA $118A,x   ; Store it in Animation VRAM DMA Pipieline
$80/A01B AD C9 11    LDA $11C9     ; Load Number of the next free Animation VRAM DMA slot
$80/A01E 1A          INC A         ; Increment it
$80/A01F 29 1F       AND #$1F      ; #$1F = Limit of Animation VRAM DMAs in Pipeline
$80/A021 8D C9 11    STA $11C9     ; Store back Number of the next free Animation VRAM DMA slot
$80/A024 18          CLC
$80/A025 AB          PLB           ; Pull Original Data Bank Register
$80/A026 6B          RTL

$80/A0E4 Add Entry to the VRAM Read DMA Pipeline

This adds an entry to the VRAM Read DMA Pipeline.

X contains the Number of Bytes to transfer

Y contains the VRAM Address from where to load

$80/A0E4 8B          PHB           ; Buffer Data Bank Register on Stack
$80/A0E5 4B          PHK           ; Set Data Bank Register to $80
$80/A0E6 AB          PLB
$80/A0E7 DA          PHX           ; Push Number of Bytes to transfer on Stack
$80/A0E8 7B          TDC           ; Clear 16-bit A
$80/A0E9 AD CE 11    LDA $11CE     ; Load Number of outstanding VRAM Read DMAs
$80/A0EC C9 10       CMP #$10      ; Look if the maximum of outstanding DMAs is reached 
$80/A0EE B0 15       BCS $15       ; [$A105] Exit if it is 
$80/A0F0 0A          ASL A         ; Multiply by 2 and use it as Store Index (each entry is 2 bytes in size)
$80/A0F1 AA          TAX
$80/A0F2 C2 20       REP #$20      ; 16-bit A
$80/A0F4 98          TYA           ; Transfer the VRAM Address from where to load in A
$80/A0F5 9D D0 11    STA $11D0,x   ; Store VRAM Address from where to load in the Pipeline
$80/A0F8 68          PLA           ; Pull Number of Bytes to transfer from Stack
$80/A0F9 9D F0 11    STA $11F0,x   ; Store Number of Bytes to transfer in the Pipeline
$80/A0FC AA          TAX           ; Transfer Number of Bytes to transfer back in X
$80/A0FD E2 20       SEP #$20      ; Set A back to 8-bit
$80/A0FF EE CE 11    INC $11CE     ; Increment Number of Read DMAs to do
$80/A102 9C CB 11    STZ $11CB     ; Enable VRAM Read DMAs
$80/A105 AB          PLB           ; Pull Original Data Bank Register
$80/A106 6B          RTL

$80/A127 Long Jump to Activate NMI and Auto-Joypad Read

$80/A127 8B          PHB           ; Buffer Data Bank Register on Stack
$80/A128 4B          PHK           ; Set Bank Register as Data Bank Register
$80/A129 AB          PLB
$80/A12A 20 2F A1    JSR $A12F     ; Activate NMI and Auto-Joypad Read
$80/A12D AB          PLB           ; Pull Original Data Bank Register
$80/A12E 6B          RTL

$80/A12F Activate NMI and Auto-Joypad Read

$80/A12F AD 10 42    LDA $4210     ; Load (and thus, remove) the NMI Flag
$80/A132 A9 81       LDA #$81      ; Activate NMI and Auto-Joypad Read
$80/A134 8D 00 42    STA $4200
$80/A137 0C AF 05    TSB $05AF     ; Update Buffer accordingly
$80/A13A 60          RTS

$80/A14A Long Jump to Deactivate NMI, Auto-Joypad and HDMAs

$80/A14A 8B          PHB           ; Buffer Data Bank Register on Stack
$80/A14B 4B          PHK           ; Set Bank Register as Data Bank Register
$80/A14C AB          PLB
$80/A14D 20 52 A1    JSR $A152     ; Jump to Deactivation of NMI, Auto-Joypad & HDMAs
$80/A150 AB          PLB           ; Pull Original Data Bank Register
$80/A151 6B          RTL

$80/A152 Deactivate NMI, Auto-Joypad and HDMAs

$80/A152 9C 00 42    STZ $4200     ; Deactivate NMI / Auto-Joypad
$80/A155 9C AF 05    STZ $05AF     ; Backup for $4200?
$80/A158 9C 0C 42    STZ $420C     ; De-activate HDMAs
$80/A15B 9C B0 05    STZ $05B0     ; Backup for $420C?
$80/A15E 9C 86 05    STZ $0586     ; Backup for $420C?
$80/A161 60          RTS

$80/A162 Long Jump to Enable VBLANK IRQ

$80/A162 8B          PHB           ; Buffer Data Bank Register on Stack
$80/A163 4B          PHK           ; Set Bank Register as Data Bank Register
$80/A164 AB          PLB
$80/A165 20 6A A1    JSR $A16A     ; Enable VBLANK IRQ
$80/A168 AB          PLB           ; Pull Original Data Bank Register
$80/A169 6B          RTL

$80/A16A Enable VBLANK IRQ

$80/A16A A9 20       LDA #$20
$80/A16C 0C AF 05    TSB $05AF
$80/A16F 60          RTS

$80/A170 Long Jump to Disable IRQ

$80/A170 8B          PHB           ; Buffer Data Bank Register on Stack
$80/A171 4B          PHK           ; Set Bank Register as Data Bank Register
$80/A172 AB          PLB
$80/A173 20 78 A1    JSR $A178     ; Disable IRQ
$80/A176 AB          PLB           ; Pull Original Data Bank Register
$80/A177 6B          RTL

$80/A178 Disable IRQ

$80/A178 A9 30       LDA #$30      ; TRB removes the set bits in the Accumulator from...
$80/A17A 1C AF 05    TRB $05AF     ; ... the value in the memory address ($05AF = $4200 Buffer)
$80/A17D 60          RTS

$80/A18A Change Bank, wait for NMI and execute code built in WRAM

$80/A18A 8B          PHB           ; Buffer Data Bank Register on Stack
$80/A18B 4B          PHK           ; Set Data Bank to $80
$80/A18C AB          PLB
$80/A18D 20 92 A1    JSR $A192     ; Wait for NMI and execute code built in WRAM
$80/A190 AB          PLB           ; Restore Data Bank
$80/A191 6B          RTL

$80/A192 Wait for NMI and execute code built in WRAM

$80/A192 A9 80       LDA #$80      ; ??? (Sets bit 7 in $05BD)
$80/A194 1C BD 05    TRB $05BD
$80/A197 AD B9 05    LDA $05B9     ; ??? (Load Framecounter?)
$80/A19A CD B9 05    CMP $05B9     ; Wait for the next NMI
$80/A19D F0 FB       BEQ $FB       ; [$A19A] 

After this, the next subroutine gets executed, too.

$80/A19F Execute code built in WRAM

$80/A19F A9 80       LDA #$80      ; ??? (Sets bit 7 in $05BD)
$80/A1A1 0C BD 05    TSB $05BD
$80/A1A4 22 D9 05 00 JSL $0005D9   ; Jump and execute the code built in WRAM
$80/A1A8 60          RTS

$80/A1B6 Write Executable Code in WRAM

This Subroutine writes executable Code in WRAM, starting at $05D9.

It writes 22 E4 A1 80 ("JSL $80A1E4") five times one after another with a final $6B ("RTL").

$80/A1B6 8B          PHB           ; Buffer Data Bank Register on Stack
$80/A1B7 F4 00 00    PEA $0000     ; Set Data Bank Register to $00
$80/A1BA AB          PLB
$80/A1BB AB          PLB
$80/A1BC A2 D9 05    LDX #$05D9    ; Start writing at $0005D9
$80/A1BF A0 05 00    LDY #$0005    ; ??? (Sets up some counter)
$80/A1C2 A9 22       LDA #$22      ; #$22 = "JSL"
$80/A1C4 9D 00 00    STA $0000,x   ; Store in WRAM
$80/A1C7 C2 20       REP #$20
$80/A1C9 A9 E4 A1    LDA #$A1E4    ; Store the Address
$80/A1CC 9D 01 00    STA $0001,x   ; Store in WRAM
$80/A1CF E2 20       SEP #$20
$80/A1D1 A9 80       LDA #$80      ; Store the Bank-part of the Address
$80/A1D3 9D 03 00    STA $0003,x   ; Store in WRAM
$80/A1D6 E8          INX           ; Increment the Store Index
$80/A1D7 E8          INX
$80/A1D8 E8          INX
$80/A1D9 E8          INX
$80/A1DA 88          DEY           ; Decrement loop counter
$80/A1DB D0 E5       BNE $E5       ; [$A1C2]
$80/A1DD A9 6B       LDA #$6B      ; Store the final #$6B (RTL)
$80/A1DF 9D 00 00    STA $0000,x
$80/A1E2 AB          PLB           ; Pull Original Data Bank Register
$80/A1E3 6B          RTL

$80/A1E4 RTL

$80/A19F can jump here (via $0005D9). A standard "do nothing, just exit right away"

$80/A1E4 6B          RTL

$80/A405 Long Jump to the Tilemap Rectangle Writer

If this subroutine should be used while the program pointer is currently on a different bank

$80/A405 20 09 A4    JSR $A409     ; See below
$80/A408 6B          RTL


$80/A409 Tilemap Rectangle Writer

This subroutine transfers a line of tilemap entries into a rectangle inside the tilemap buffer.

$00 contains the rectangle's number of columns

$01 is used as counter for the current column

$02 contains the rectangle's number of rows

$03 is used as counter for the current row

X contains the Index to the Load Address (the Bank has to be adjusted before this subroutine is called)

Y Contains the Index where to write - the rest of the write address has to be set up in $20-$22


$80/A409 A5 02       LDA $02       ; Copy Row/Column number into counter registers that can be decremented
$80/A40B 85 03       STA $03
$80/A40D A5 00       LDA $00
$80/A40F 85 01       STA $01
$80/A411 5A          PHY           ; Push the write index on Stack (the starting point of a new line of the rectangle)
$80/A412 C2 20       REP #$20
$80/A414 BD 00 00    LDA $0000,x   ; Read Byte
$80/A417 C9 FF FF    CMP #$FFFF    ; If in the read data is a #$FFFF, it does not overwrite that tile
$80/A41A F0 02       BEQ $02       ; [$A41E] Leave out the write command if 
$80/A41C 97 20       STA [$20],y   ; Write into the Tilemap Buffer
$80/A41E E2 20       SEP #$20
$80/A420 E8          INX           ; Increment Read & Write Index
$80/A421 E8          INX
$80/A422 C8          INY
$80/A423 C8          INY
$80/A424 C6 01       DEC $01       ; Decrement column/(=tile) counter
$80/A426 D0 EA       BNE $EA       ; [$A412] Loop if not all tiles in that row are done yet
$80/A428 C2 21       REP #$21      ; 16-bit A + Clear Carry
$80/A42A 68          PLA           ; Pull the starting point of the rectangle's new line from stack
$80/A42B 69 40 00    ADC #$0040    ; Add #$40 - move one line down
$80/A42E A8          TAY           ; Transfer new starting point into Y (so it can be used + Pushed on stack again)
$80/A42F E2 20       SEP #$20
$80/A431 C6 03       DEC $03       ; Decrement Row Counter
$80/A433 D0 D8       BNE $D8       ; [$A40D] Loop if not all rows are done yet
$80/A435 60          RTS

$80/A460 ?

$80/A460 8B          PHB           ; Buffer Data Bank on Stack
$80/A461 4B          PHK           ; Set Data Bank to $80
$80/A462 AB          PLB
$80/A463 22 09 F6 82 JSL $82F609[$82:F609]   A:0002 X:3300 Y:FFFE P:eNvMxdizC
$80/A467 A0 00 07    LDY #$0700              A:1600 X:0800 Y:0000 P:envMxdiZc
$80/A46A 84 0C       STY $0C    [$00:000C]   A:1600 X:0800 Y:0700 P:envMxdizc
$80/A46C A0 00 54    LDY #$5400              A:1600 X:0800 Y:0700 P:envMxdizc
$80/A46F A2 00 E0    LDX #$E000              A:1600 X:0800 Y:5400 P:envMxdizc
$80/A472 A9 7F       LDA #$7F                A:1600 X:E000 Y:5400 P:eNvMxdizc
$80/A474 22 2A A0 80 JSL $80A02A[$80:A02A]   A:167F X:E000 Y:5400 P:envMxdizc
$80/A478 A9 54       LDA #$54                A:E080 X:E000 Y:5400 P:eNvMxdizc
$80/A47A 8D 8B 05    STA $058B  [$80:058B]   A:E054 X:E000 Y:5400 P:envMxdizc
$80/A47D A0 60 B0    LDY #$B060              A:E054 X:E000 Y:5400 P:envMxdizc
$80/A480 8C 00 17    STY $1700  [$80:1700]   A:E054 X:E000 Y:B060 P:eNvMxdizc
$80/A483 A9 08       LDA #$08                A:E054 X:E000 Y:B060 P:eNvMxdizc
$80/A485 04 A2       TSB $A2    [$00:00A2]   A:E008 X:E000 Y:B060 P:envMxdizc
$80/A487 A2 00 00    LDX #$0000              A:E008 X:E000 Y:B060 P:envMxdiZc
$80/A48A 8E 91 05    STX $0591  [$80:0591]   A:E008 X:0000 Y:B060 P:envMxdiZc
$80/A48D 8E 93 05    STX $0593  [$80:0593]   A:E008 X:0000 Y:B060 P:envMxdiZc
$80/A490 AB          PLB           ; Restore Data Bank from Stack
$80/A491 6B          RTL

$80/A492 ?

"This line could be removed?": I'm not sure if it is necessary to change the Data Bank here.

$80/A492 8B          PHB           ; This line could be removed?
$80/A493 4B          PHK           ; This line could be removed?
$80/A494 AB          PLB           ; This line could be removed?
$80/A495 A9 71       LDA #$71      ; BG1 Tilemap at $7000 in VRAM, V-Mirror
$80/A497 8D 8B 05    STA $058B
$80/A49A AE FE 16    LDX $16FE  [$80:16FE]   A:0071 X:3919 Y:0004 P:envMxdizc
$80/A49D 8E 00 17    STX $1700  [$80:1700]   A:0071 X:B020 Y:0004 P:eNvMxdizc
$80/A4A0 A9 08       LDA #$08                A:0071 X:B020 Y:0004 P:eNvMxdizc
$80/A4A2 14 A2       TRB $A2    [$00:00A2]   A:0008 X:B020 Y:0004 P:envMxdizc
$80/A4A4 AE 95 05    LDX $0595     ; Set BG2 X Scroll to BG1 X Scroll
$80/A4A7 8E 91 05    STX $0591
$80/A4AA AE 97 05    LDX $0597     ; Set BG2 Y Scroll to BG1 Y Scroll
$80/A4AD 8E 93 05    STX $0593
$80/A4B0 AB          PLB           ; This line could be removed?
$80/A4B1 6B          RTL

$80/A50F Divide X by A

$80/A50F C9 00 01    CMP #$0100    ; Check if Divisor is actually 8-bit
$80/A512 90 1E       BCC $1E       ; [$A532] Branch if it is
code is missing here
$80/A532 8E 04 42    STX $4204     ; Set X as Dividend
$80/A535 E2 20       SEP #$20      ; A = 8-bit
$80/A537 8D 06 42    STA $4206     ; Set A as Divisor / START CALCULATION
$80/A53A C2 20       REP #$20      ; A = 16-bit
$80/A53C 0B          PHD           ; Waste time till the result is there
$80/A53D 2B          PLD
$80/A53E EA          NOP
$80/A53F EA          NOP
$80/A540 AD 14 42    LDA $4214     ; Load the 16-bit result in A
$80/A543 60          RTS

$80/A544 LONG JUMP: Multiply $00/1 and $04/5

$80/A544 8B          PHB           ; Buffer Data Bank on Stack
$80/A545 4B          PHK           ; Set Data Bank to $80
$80/A546 AB          PLB
$80/A547 20 4C A5    JSR $A54C     ; Multiply $00/1 and $04/5
$80/A54A AB          PLB           ; Restore Data Bank from Stack
$80/A54B 6B          RTL

$80/A54C Multiply $00/1 and $04/5

This multiplies two 16-bit numbers in $00/1 and $04/5. This multiplication is separated in four 8bit by 8bit multiplications:

$00 * $04
$00 * $05
$01 * $04
$01 * $05

The result will be stored $00-3.

X/Y don't get changed, $04/5 don't get changed.

$80/A54C DA          PHX           ; Buffer X on Stack
$80/A54D A5 00       LDA $00       ; Load $00/1 in 16-bit A
$80/A54F E2 20       SEP #$20      ; 8-bit A
$80/A551 8D 02 42    STA $4202     ; Store in Multiplicand Register
$80/A554 A5 04       LDA $04       ; Store $04 in second Multiplicand Register
$80/A556 8D 03 42    STA $4203     ; FIRST MULTIPLICATION: $00 * $04
$80/A559 64 02       STZ $02       ; Clear Result High Bytes
$80/A55B 64 03       STZ $03
$80/A55D A5 05       LDA $05       ; Load $05 (for second Multiplication)
$80/A55F AE 16 42    LDX $4216     ; Load 1st Multiplication 16-bit Result
$80/A562 8D 03 42    STA $4203     ; SECOND MULTIPLICATION: $00 * $05
$80/A565 86 00       STX $00       ; Store first result in the Result Low Byte Registers
$80/A567 EB          XBA           ; Exchange A and B (A contains now the byte from Original $01)
$80/A568 EA          NOP
$80/A569 AE 16 42    LDX $4216     ; Load 2nd Multiplication 16-bit Result
$80/A56C 8D 02 42    STA $4202     ; Store Original $01 in Multiplicand Register
$80/A56F A5 04       LDA $04       ; Store $04 in second Multiplicand Register
$80/A571 8D 03 42    STA $4203     ; THIRD MULTIPLICATION: $01 * $04
$80/A574 C2 21       REP #$21      ; 16-bit A, Clear Carry
$80/A576 8A          TXA           ; Transfer 2nd Result in A
$80/A577 65 01       ADC $01       ; Add it to the 1st Result...
$80/A579 85 01       STA $01       ; ... and store it
$80/A57B E2 20       SEP #$20      ; 8-bit A
$80/A57D A5 05       LDA $05       ; Load $05 for fourth Multiplication
$80/A57F AE 16 42    LDX $4216     ; Load 3rd Multiplication 16-bit Result
$80/A582 8D 03 42    STA $4203     ; FOURTH MULTIPLICATION: $01 * $05
$80/A585 C2 21       REP #$21      ; 16-bit A, Clear Carry
$80/A587 8A          TXA           ; Transfer 3rd Result in A
$80/A588 65 01       ADC $01       ; Add it to the 1st & 2nd Result...
$80/A58A 85 01       STA $01       ; ... and store it
$80/A58C E2 20       SEP #$20      ; 8-bit A
$80/A58E 90 02       BCC $02       ; [$A592] Branch if there was no Carry from the last Addition
Code is missing here
$80/A592 C2 21       REP #$21      ; 16-bit A, Clear Carry
$80/A594 AD 16 42    LDA $4216     ; Load 4th Multiplication 16-bit Result
$80/A597 65 02       ADC $02       ; Add it to the other Results...
$80/A599 85 02       STA $02       ; ... and store it
$80/A59B FA          PLX           ; Restore X from Stack
$80/A59C 60          RTS

$80/A59D Multiply $04-7 and $00-3

This is executed with 16-bit A.

This subroutine multiplies two 32-bit numbers (in $00-$03 and $04-$07) and stores the result in $04-$0B.

It does so by using four times the subroutine that calculates 32-bit results from multiplications of two 16-bit values. These four multiplications of partial values are in this order:

$06/7 * $02/3
$04/5 * $02/3
$06/7 * $00/1
$04/5 * $00/1

It begins with the highest bytes, so it can replace the values in $04-$07.

$80/A59D 8B          PHB           ; Buffer Data Bank Register on Stack
$80/A59E 4B          PHK           ; Set Data Bank Register to $80
$80/A59F AB          PLB
$80/A5A0 DA          PHX           ; Buffer X and Y on Stack
$80/A5A1 5A          PHY
$80/A5A2 D4 00       PEI ($00)     ; Buffer $00/1 on Stack
$80/A5A4 A6 04       LDX $04    [$00:0004]   A:0000 X:000C Y:0001 P:eNvmxdizc
$80/A5A6 A4 06       LDY $06    [$00:0006]   A:0000 X:0003 Y:0001 P:envmxdizc
$80/A5A8 A5 02       LDA $02    [$00:0002]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5AA 85 04       STA $04    [$00:0004]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5AC 84 00       STY $00    [$00:0000]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5AE 20 4C A5    JSR $A54C     ; Multiply $00/1 and $04/5
$80/A5B1 A5 00       LDA $00    [$00:0000]   A:0000 X:0003 Y:0000 P:envmxdizc
$80/A5B3 85 08       STA $08    [$00:0008]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5B5 A5 02       LDA $02    [$00:0002]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5B7 85 0A       STA $0A    [$00:000A]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5B9 86 00       STX $00    [$00:0000]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5BB 20 4C A5    JSR $A54C     ; Multiply $00/1 and $04/5
$80/A5BE A5 00       LDA $00    [$00:0000]   A:0000 X:0003 Y:0000 P:envmxdizc
$80/A5C0 85 06       STA $06    [$00:0006]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5C2 A5 02       LDA $02    [$00:0002]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5C4 18          CLC                     A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5C5 65 08       ADC $08    [$00:0008]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5C7 85 08       STA $08    [$00:0008]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5C9 7B          TDC                     A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5CA 65 0A       ADC $0A    [$00:000A]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5CC 85 0A       STA $0A    [$00:000A]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5CE 68          PLA                     A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5CF 85 04       STA $04    [$00:0004]   A:0009 X:0003 Y:0000 P:envmxdizc
$80/A5D1 84 00       STY $00    [$00:0000]   A:0009 X:0003 Y:0000 P:envmxdizc
$80/A5D3 20 4C A5    JSR $A54C     ; Multiply $00/1 and $04/5
$80/A5D6 A5 00       LDA $00    [$00:0000]   A:0000 X:0003 Y:0000 P:envmxdizc
$80/A5D8 18          CLC                     A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5D9 65 06       ADC $06    [$00:0006]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5DB 85 06       STA $06    [$00:0006]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5DD A5 02       LDA $02    [$00:0002]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5DF 65 08       ADC $08    [$00:0008]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5E1 85 08       STA $08    [$00:0008]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5E3 7B          TDC                     A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5E4 65 0A       ADC $0A    [$00:000A]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5E6 85 0A       STA $0A    [$00:000A]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5E8 86 00       STX $00    [$00:0000]   A:0000 X:0003 Y:0000 P:envmxdiZc
$80/A5EA 20 4C A5    JSR $A54C     ; Multiply $00/1 and $04/5
$80/A5ED A5 00       LDA $00    [$00:0000]   A:0000 X:0000 Y:00B4 P:envmxdiZc
$80/A5EF 85 04       STA $04    [$00:0004]   A:0000 X:0000 Y:00B4 P:envmxdiZc
$80/A5F1 A5 02       LDA $02    [$00:0002]   A:0000 X:0000 Y:00B4 P:envmxdiZc
$80/A5F3 18          CLC                     A:0000 X:0000 Y:00B4 P:envmxdiZc
$80/A5F4 65 06       ADC $06    [$00:0006]   A:0000 X:0000 Y:00B4 P:envmxdiZc
$80/A5F6 85 06       STA $06    [$00:0006]   A:0654 X:0000 Y:00B4 P:envmxdizc
$80/A5F8 7B          TDC                     A:0654 X:0000 Y:00B4 P:envmxdizc
$80/A5F9 65 08       ADC $08    [$00:0008]   A:0000 X:0000 Y:00B4 P:envmxdiZc
$80/A5FB 85 08       STA $08    [$00:0008]   A:0000 X:0000 Y:00B4 P:envmxdiZc
$80/A5FD 7B          TDC                     A:0000 X:0000 Y:00B4 P:envmxdiZc
$80/A5FE 65 0A       ADC $0A    [$00:000A]   A:0000 X:0000 Y:00B4 P:envmxdiZc
$80/A600 85 0A       STA $0A    [$00:000A]   A:0000 X:0000 Y:00B4 P:envmxdiZc
$80/A602 7A          PLY           ; Restore Original X and Y from Stack
$80/A603 FA          PLX
$80/A604 AB          PLB           ; Restore Data Bank Register from Stack
$80/A605 60          RTS

$80/A606 ?

$80/A606 8B          PHB           ; Buffer Data Bank Register on Stack
$80/A607 4B          PHK           ; Set Data Bank Register to $80
$80/A608 AB          PLB
$80/A609 20 0E A6    JSR $A60E     ; ???
$80/A60C AB          PLB           ; Restore Data Bank Register from Stack
$80/A60D 6B          RTL

$80/A60E ?

NOTES:

A60E: "Case decider"
A61A: $00!=0 $02 =0 $08!=0 Setup and Jump to 39
A624: $00 =? $02!=0 $08!=0 Do this and then 39
A639: $00!=0 $02 =0 $08!=0 
A648: $00 =? $02 =? $08 =0 ?
A652: Exit


$80/A60E A5 08       LDA $08    [$00:0008]   A:00C0 X:000C Y:0001 P:envmxdizc
$80/A610 F0 36       BEQ $36    [$A648]      A:00C0 X:000C Y:0001 P:envmxdizc
$80/A612 A5 02       LDA $02    [$00:0002]   A:00C0 X:000C Y:0001 P:envmxdizc
$80/A614 D0 0E       BNE $0E    [$A624]      A:0060 X:000C Y:0001 P:envmxdizc
$80/A616 A5 00       LDA $00    [$00:0000]   A:0000 X:3300 Y:0014 P:envmxdiZC
$80/A618 F0 38       BEQ $38    [$A652]      A:3600 X:3300 Y:0014 P:envmxdizC

$80/A61A A9 01 00    LDA #$0001    ; Setup loop counters in $04/5 and $06/7
$80/A61D 85 04       STA $04       ; ($04/5 gets ROLed at $80/A642, so: 16 loops)
$80/A61F 64 06       STZ $06       ; ($06/7 gets ROLed at $80/A635, so: 16 loops)
$80/A621 7B          TDC           ; Clear 16-bit A
$80/A622 80 15       BRA $15    [$A639]      A:0000 X:3300 Y:0014 P:envmxdiZC

$80/A624 A9 01 00    LDA #$0001    ; Setup loop counters in $04/5 and $06/7
$80/A627 85 04       STA $04       ; ($04/5 gets ROLed at $80/A642, so: 16 loops)
$80/A629 85 06       STA $06       ; ($06/7 gets ROLed at $80/A635, so: 16 loops)
$80/A62B 7B          TDC           ; Clear 16-bit A
$80/A62C 06 02       ASL $02    [$00:0002]   A:0000 X:000C Y:0001 P:envmxdiZc
$80/A62E 2A          ROL A                   A:0000 X:000C Y:0001 P:envmxdizc
$80/A62F C5 08       CMP $08    [$00:0008]   A:0000 X:000C Y:0001 P:envmxdiZc
$80/A631 90 02       BCC $02    [$A635]      A:0000 X:000C Y:0001 P:eNvmxdizc
Code is missing here
$80/A635 26 06       ROL $06       ; ROL Loop counter
$80/A637 90 F3       BCC $F3    [$A62C]      A:0000 X:000C Y:0001 P:envmxdizc

$80/A639 06 00       ASL $00       ; Roll MSB out of $00 in Carry
$80/A63B 2A          ROL A         ; Put Carry in A
$80/A63C C5 08       CMP $08    [$00:0008]   A:00C0 X:000C Y:0001 P:envmxdizc
$80/A63E 90 02       BCC $02       ; [$A642]      A:00C0 X:000C Y:0001 P:envmxdiZC
$80/A640 E5 08       SBC $08    [$00:0008]   A:00C0 X:000C Y:0001 P:envmxdiZC
$80/A642 26 04       ROL $04       ; ROL Loop counter
$80/A644 90 F3       BCC $F3       ; [$A639] Loop if Exit-Flag was not ROLed out of $04/05
$80/A646 80 0F       BRA $0F       ; [$A657] Else, exit
Code is missing here
$80/A652 64 04       STZ $04       ; Clear Loop Counters
$80/A654 64 06       STZ $06
$80/A656 7B          TDC           ; Clear 16-bit A
$80/A657 60          RTS

$80/A65C ?

$80/A65C DA          PHX           ; Buffer X and Y on Stack
$80/A65D 5A          PHY
$80/A65E A9 01 00    LDA #$0001    ; Setup "Roll Counters" for sixteen loops
$80/A661 85 10       STA $10
$80/A663 85 12       STA $12
$80/A665 85 14       STA $14
$80/A667 85 16       STA $16
$80/A669 A0 00 00    LDY #$0000              A:0001 X:0000 Y:0000 P:envmxdizC
$80/A66C 06 06       ASL $06    [$00:0006]   A:0001 X:0000 Y:0000 P:envmxdiZC
$80/A66E 98          TYA                     A:0001 X:0000 Y:0000 P:envmxdiZc
$80/A66F 2A          ROL A                   A:0000 X:0000 Y:0000 P:envmxdiZc
$80/A670 A8          TAY                     A:0000 X:0000 Y:0000 P:envmxdiZc
$80/A671 38          SEC                     A:0000 X:0000 Y:0000 P:envmxdiZc
$80/A672 E5 08       SBC $08    [$00:0008]   A:0000 X:0000 Y:0000 P:envmxdiZC
$80/A674 AA          TAX                     A:0000 X:0000 Y:0000 P:envmxdiZC
$80/A675 7B          TDC                     A:0000 X:0000 Y:0000 P:envmxdiZC
$80/A676 E5 0A       SBC $0A    [$00:000A]   A:0000 X:0000 Y:0000 P:envmxdiZC
$80/A678 90 01       BCC $01    [$A67B]      A:FEC0 X:0000 Y:0000 P:eNvmxdizc
code is missing here
$80/A67B 26 16       ROL $16       ; "Increment" Counter
$80/A67D 90 ED       BCC $ED       ; [$A66C] Loop for sixteen times
$80/A67F 06 04       ASL $04    [$00:0004]   A:FEC0 X:0000 Y:0000 P:envmxdiZC
$80/A681 98          TYA                     A:FEC0 X:0000 Y:0000 P:envmxdizc
$80/A682 2A          ROL A                   A:0000 X:0000 Y:0000 P:envmxdiZc
$80/A683 A8          TAY                     A:0000 X:0000 Y:0000 P:envmxdiZc
$80/A684 26 06       ROL $06    [$00:0006]   A:0000 X:0000 Y:0000 P:envmxdiZc
$80/A686 38          SEC                     A:0000 X:0000 Y:0000 P:envmxdiZc
$80/A687 E5 08       SBC $08    [$00:0008]   A:0000 X:0000 Y:0000 P:envmxdiZC
$80/A689 AA          TAX                     A:0000 X:0000 Y:0000 P:envmxdiZC
$80/A68A A5 06       LDA $06    [$00:0006]   A:0000 X:0000 Y:0000 P:envmxdiZC
$80/A68C E5 0A       SBC $0A    [$00:000A]   A:0000 X:0000 Y:0000 P:envmxdiZC
$80/A68E 90 03       BCC $03    [$A693]      A:FEC0 X:0000 Y:0000 P:eNvmxdizc
code is missing here
$80/A693 26 14       ROL $14       ; "Increment" Counter
$80/A695 90 E8       BCC $E8       ; [$A67F] Loop for sixteen times
$80/A697 06 02       ASL $02    [$00:0002]   A:FEC0 X:0030 Y:0030 P:envmxdiZC
$80/A699 98          TYA                     A:FEC0 X:0030 Y:0030 P:envmxdiZc
$80/A69A 2A          ROL A                   A:0030 X:0030 Y:0030 P:envmxdizc
$80/A69B A8          TAY                     A:0060 X:0030 Y:0030 P:envmxdizc
$80/A69C 26 06       ROL $06    [$00:0006]   A:0060 X:0030 Y:0060 P:envmxdizc
$80/A69E 38          SEC                     A:0060 X:0030 Y:0060 P:envmxdiZc
$80/A69F E5 08       SBC $08    [$00:0008]   A:0060 X:0030 Y:0060 P:envmxdiZC
$80/A6A1 AA          TAX                     A:0060 X:0030 Y:0060 P:envmxdizC
$80/A6A2 A5 06       LDA $06    [$00:0006]   A:0060 X:0060 Y:0060 P:envmxdizC
$80/A6A4 E5 0A       SBC $0A    [$00:000A]   A:0000 X:0060 Y:0060 P:envmxdiZC
$80/A6A6 90 03       BCC $03    [$A6AB]      A:FEC0 X:0060 Y:0060 P:eNvmxdizc
$80/A6A8 85 06       STA $06    [$00:0006]   A:0180 X:0000 Y:0000 P:envmxdizC
$80/A6AA 9B          TXY                     A:0180 X:0000 Y:0000 P:envmxdizC
$80/A6AB 26 12       ROL $12       ; "Increment" Counter
$80/A6AD 90 E8       BCC $E8       ; [$A697] Loop for sixteen times
$80/A6AF 06 00       ASL $00    [$00:0000]   A:FEF0 X:0000 Y:0000 P:envmxdiZC
$80/A6B1 98          TYA                     A:FEF0 X:0000 Y:0000 P:envmxdiZc
$80/A6B2 2A          ROL A                   A:0000 X:0000 Y:0000 P:envmxdiZc
$80/A6B3 A8          TAY                     A:0000 X:0000 Y:0000 P:envmxdiZc
$80/A6B4 26 06       ROL $06    [$00:0006]   A:0000 X:0000 Y:0000 P:envmxdiZc
$80/A6B6 38          SEC                     A:0000 X:0000 Y:0000 P:envmxdizc
$80/A6B7 E5 08       SBC $08    [$00:0008]   A:0000 X:0000 Y:0000 P:envmxdizC
$80/A6B9 AA          TAX                     A:0000 X:0000 Y:0000 P:envmxdiZC
$80/A6BA A5 06       LDA $06    [$00:0006]   A:0000 X:0000 Y:0000 P:envmxdiZC
$80/A6BC E5 0A       SBC $0A    [$00:000A]   A:0060 X:0000 Y:0000 P:envmxdizC
$80/A6BE 90 03       BCC $03    [$A6C3]      A:FF20 X:0000 Y:0000 P:eNvmxdizc
$80/A6C0 85 06       STA $06    [$00:0006]   A:0040 X:0000 Y:0000 P:envmxdizC
$80/A6C2 9B          TXY                     A:0040 X:0000 Y:0000 P:envmxdizC
$80/A6C3 26 10       ROL $10       ; "Increment" Counter
$80/A6C5 90 E8       BCC $E8       ; [$A6AF] Loop for sixteen times
$80/A6C7 7A          PLY           ; Restore Y and X from stack
$80/A6C8 FA          PLX
$80/A6C9 60          RTS

$80/A787 ?

$80/A787 A0 00 00    LDY #$0000              A:0000 X:000C Y:0000 P:envmxdiZC
$80/A78A A5 02       LDA $02    [$00:0002]   A:0000 X:000C Y:0000 P:envmxdiZC
$80/A78C 10 0C       BPL $0C    [$A79A]      A:00C0 X:000C Y:0000 P:envmxdizC
$80/A78E 7B          TDC                     A:FFFF X:0004 Y:0000 P:eNvmxdizc
$80/A78F 38          SEC                     A:0000 X:0004 Y:0000 P:envmxdiZc
$80/A790 E5 00       SBC $00    [$00:0000]   A:0000 X:0004 Y:0000 P:envmxdiZC
$80/A792 85 00       STA $00    [$00:0000]   A:0012 X:0004 Y:0000 P:envmxdizc
$80/A794 7B          TDC                     A:0012 X:0004 Y:0000 P:envmxdizc
$80/A795 E5 02       SBC $02    [$00:0002]   A:0000 X:0004 Y:0000 P:envmxdiZc
$80/A797 85 02       STA $02    [$00:0002]   A:0000 X:0004 Y:0000 P:envmxdiZc
$80/A799 C8          INY                     A:0000 X:0004 Y:0000 P:envmxdiZc
$80/A79A A5 06       LDA $06    [$00:0006]   A:00C0 X:000C Y:0000 P:envmxdizC
$80/A79C 10 0C       BPL $0C    [$A7AA]      A:0000 X:000C Y:0000 P:envmxdiZC
$80/A79E 7B          TDC                     A:FFFF X:0008 Y:0000 P:eNvmxdizc
$80/A79F 38          SEC                     A:0000 X:0008 Y:0000 P:envmxdiZc
$80/A7A0 E5 04       SBC $04    [$00:0004]   A:0000 X:0008 Y:0000 P:envmxdiZC
$80/A7A2 85 04       STA $04    [$00:0004]   A:0009 X:0008 Y:0000 P:envmxdizc
$80/A7A4 7B          TDC                     A:0009 X:0008 Y:0000 P:envmxdizc
$80/A7A5 E5 06       SBC $06    [$00:0006]   A:0000 X:0008 Y:0000 P:envmxdiZc
$80/A7A7 85 06       STA $06    [$00:0006]   A:0000 X:0008 Y:0000 P:envmxdiZc
$80/A7A9 C8          INY                     A:0000 X:0008 Y:0000 P:envmxdiZc
$80/A7AA 20 9D A5    JSR $A59D  [$80:A59D]   A:0000 X:000C Y:0000 P:envmxdiZC
$80/A7AD 98          TYA                     A:0000 X:000C Y:0000 P:envmxdizc
$80/A7AE 4A          LSR A                   A:0000 X:000C Y:0000 P:envmxdiZc
$80/A7AF 90 14       BCC $14    [$A7C5]      A:0000 X:000C Y:0000 P:envmxdiZc
$80/A7B1 7B          TDC                     A:0000 X:0008 Y:0001 P:envmxdiZC
$80/A7B2 E5 04       SBC $04    [$00:0004]   A:0000 X:0008 Y:0001 P:envmxdiZC
$80/A7B4 85 04       STA $04    [$00:0004]   A:0000 X:0008 Y:0001 P:envmxdiZC
$80/A7B6 7B          TDC                     A:0000 X:0008 Y:0001 P:envmxdiZC
$80/A7B7 E5 06       SBC $06    [$00:0006]   A:0000 X:0008 Y:0001 P:envmxdiZC
$80/A7B9 85 06       STA $06    [$00:0006]   A:FB80 X:0008 Y:0001 P:eNvmxdizc
$80/A7BB 7B          TDC                     A:FB80 X:0008 Y:0001 P:eNvmxdizc
$80/A7BC E5 08       SBC $08    [$00:0008]   A:0000 X:0008 Y:0001 P:envmxdiZc
$80/A7BE 85 08       STA $08    [$00:0008]   A:FFFF X:0008 Y:0001 P:eNvmxdizc
$80/A7C0 7B          TDC                     A:FFFF X:0008 Y:0001 P:eNvmxdizc
$80/A7C1 E5 0A       SBC $0A    [$00:000A]   A:0000 X:0008 Y:0001 P:envmxdiZc
$80/A7C3 85 0A       STA $0A    [$00:000A]   A:FFFF X:0008 Y:0001 P:eNvmxdizc
$80/A7C5 6B          RTL                     A:0000 X:000C Y:0000 P:envmxdiZc

$80/A7C6 ?

$80/A7C6 A0 00 00    LDY #$0000              A:0030 X:0000 Y:FFFE P:envmxdizC
$80/A7C9 A5 06       LDA $06    [$00:0006]   A:0030 X:0000 Y:0000 P:envmxdiZC
$80/A7CB 10 16       BPL $16    [$A7E3]      A:0000 X:0000 Y:0000 P:envmxdiZC
$80/A7CD 7B          TDC                     A:FFFF X:0008 Y:0000 P:eNvmxdizc
$80/A7CE 38          SEC                     A:0000 X:0008 Y:0000 P:envmxdiZc
$80/A7CF E5 00       SBC $00    [$00:0000]   A:0000 X:0008 Y:0000 P:envmxdiZC
$80/A7D1 85 00       STA $00    [$00:0000]   A:0000 X:0008 Y:0000 P:envmxdiZC
$80/A7D3 7B          TDC                     A:0000 X:0008 Y:0000 P:envmxdiZC
$80/A7D4 E5 02       SBC $02    [$00:0002]   A:0000 X:0008 Y:0000 P:envmxdiZC
$80/A7D6 85 02       STA $02    [$00:0002]   A:0000 X:0008 Y:0000 P:envmxdiZC
$80/A7D8 7B          TDC                     A:0000 X:0008 Y:0000 P:envmxdiZC
$80/A7D9 E5 04       SBC $04    [$00:0004]   A:0000 X:0008 Y:0000 P:envmxdiZC
$80/A7DB 85 04       STA $04    [$00:0004]   A:0030 X:0008 Y:0000 P:envmxdizc
$80/A7DD 7B          TDC                     A:0030 X:0008 Y:0000 P:envmxdizc
$80/A7DE E5 06       SBC $06    [$00:0006]   A:0000 X:0008 Y:0000 P:envmxdiZc
$80/A7E0 85 06       STA $06    [$00:0006]   A:0000 X:0008 Y:0000 P:envmxdiZc
$80/A7E2 C8          INY                     A:0000 X:0008 Y:0000 P:envmxdiZc
$80/A7E3 A5 0A       LDA $0A    [$00:000A]   A:0000 X:0000 Y:0000 P:envmxdiZC
$80/A7E5 10 0C       BPL $0C    [$A7F3]      A:0140 X:0000 Y:0000 P:envmxdizC
$80/A7F3 20 5C A6    JSR $A65C  [$80:A65C]   A:0140 X:0000 Y:0000 P:envmxdizC
$80/A7F6 98          TYA                     A:FF40 X:0000 Y:0000 P:envmxdiZC
$80/A7F7 4A          LSR A                   A:0000 X:0000 Y:0000 P:envmxdiZC
$80/A7F8 90 14       BCC $14    [$A80E]      A:0000 X:0000 Y:0000 P:envmxdiZc
$80/A7FA 7B          TDC                     A:0000 X:0008 Y:0001 P:envmxdiZC
$80/A7FB E5 10       SBC $10    [$00:0010]   A:0000 X:0008 Y:0001 P:envmxdiZC
$80/A7FD 85 10       STA $10    [$00:0010]   A:A000 X:0008 Y:0001 P:eNvmxdizc
$80/A7FF 7B          TDC                     A:A000 X:0008 Y:0001 P:eNvmxdizc
$80/A800 E5 12       SBC $12    [$00:0012]   A:0000 X:0008 Y:0001 P:envmxdiZc
$80/A802 85 12       STA $12    [$00:0012]   A:FFFF X:0008 Y:0001 P:eNvmxdizc
$80/A804 7B          TDC                     A:FFFF X:0008 Y:0001 P:eNvmxdizc
$80/A805 E5 14       SBC $14    [$00:0014]   A:0000 X:0008 Y:0001 P:envmxdiZc
$80/A807 85 14       STA $14    [$00:0014]   A:FFFF X:0008 Y:0001 P:eNvmxdizc
$80/A809 7B          TDC                     A:FFFF X:0008 Y:0001 P:eNvmxdizc
$80/A80A E5 16       SBC $16    [$00:0016]   A:0000 X:0008 Y:0001 P:envmxdiZc
$80/A80C 85 16       STA $16    [$00:0016]   A:FFFF X:0008 Y:0001 P:eNvmxdizc
$80/A80E 6B          RTL                     A:0000 X:0000 Y:0000 P:envmxdiZc

$80/A80F ?

$80/A80F 5A          PHY           ; Buffer Y on stack
$80/A810 A0 00 00    LDY #$0000              A:0140 X:0000 Y:0000 P:envmxdizC
$80/A813 A5 02       LDA $02    [$00:0002]   A:0140 X:0000 Y:0000 P:envmxdiZC
$80/A815 10 0C       BPL $0C    [$A823]      A:0030 X:0000 Y:0000 P:envmxdizC
code is missing here
$80/A823 A5 08       LDA $08    [$00:0008]   A:0030 X:0000 Y:0000 P:envmxdizC
$80/A825 10 07       BPL $07    [$A82E]      A:0140 X:0000 Y:0000 P:envmxdizC
code is missing here
$80/A82E 20 0E A6    JSR $A60E  [$80:A60E]   A:0140 X:0000 Y:0000 P:envmxdizC
$80/A831 98          TYA                     A:0080 X:0000 Y:0000 P:envmxdizC
$80/A832 4A          LSR A                   A:0000 X:0000 Y:0000 P:envmxdiZC
$80/A833 90 0A       BCC $0A    [$A83F]      A:0000 X:0000 Y:0000 P:envmxdiZc
code is missing here
$80/A83F 7A          PLY           ; Restore Y from stack
$80/A840 6B          RTL

$80/A86F ?

$80/A86F 8B          PHB           ; Buffer Data Bank Register on Stack
$80/A870 4B          PHK           ; Set Data Bank to $80
$80/A871 AB          PLB
$80/A872 DA          PHX           ; Buffer X on Stack
$80/A873 D4 00       PEI ($00)     ; Buffer $00-3 on Stack
$80/A875 D4 02       PEI ($02)
$80/A877 20 4C A5    JSR $A54C     ; Multiply $00/1 and $04/5
$80/A87A 20 0E A6    JSR $A60E  [$80:A60E]   A:0000 X:1758 Y:000A P:envmxdizc
$80/A87D FA          PLX           ; Restore Buffered Values of $00-3
$80/A87E 86 02       STX $02
$80/A880 FA          PLX
$80/A881 86 00       STX $00
$80/A883 FA          PLX           ; Restore Buffered Value of X
$80/A884 AB          PLB           ; Restore Data Bank
$80/A885 6B          RTL

$80/A886 ?

This is executed with 16-bit A.

First, this subroutine checks if the two multiplicants in $00-3 and $04-7 are positive. if not, this subroutine turns them into positive numbers.

$80/A886 A0 00 00    LDY #$0000              A:00C0 X:000C Y:000C P:envmxdizc
$80/A889 A5 02       LDA $02        ; $00-3 contain a number that gets multiplied
$80/A88B 10 0C       BPL $0C        ; [$A899] Branch if number is positive
$80/A88D 7B          TDC            ; Clear 16-bit A
$80/A88E 38          SEC            ; Set Carry for subtraction
$80/A88F E5 00       SBC $00        ; Turn number positive
$80/A891 85 00       STA $00
$80/A893 7B          TDC
$80/A894 E5 02       SBC $02
$80/A896 85 02       STA $02
$80/A898 C8          INY            ; Increment Y (counter for negative numbers)
$80/A899 A5 06       LDA $06        ; $04-7 contain a number that gets multiplied
$80/A89B 10 0C       BPL $0C        ; [$A8A9] Branch if number is positive
$80/A89D 7B          TDC            ; Clear 16-bit A
$80/A89E 38          SEC            ; Set Carry for subtraction
$80/A89F E5 04       SBC $04        ; Turn number positive
$80/A8A1 85 04       STA $04
$80/A8A3 7B          TDC
$80/A8A4 E5 06       SBC $06
$80/A8A6 85 06       STA $06
$80/A8A8 C8          INY            ; Increment Y (counter for negative numbers)
$80/A8A9 A5 0A       LDA $0A    [$00:000A]   A:00B8 X:000C Y:0000 P:envmxdizc
$80/A8AB 10 0C       BPL $0C    [$A8B9]      A:00C0 X:000C Y:0000 P:envmxdizc
Code is missing here
$80/A8B9 D4 08       PEI ($08)     ; Buffer $08-$0B
$80/A8BB D4 0A       PEI ($0A)
$80/A8BD 20 9D A5    JSR $A59D     ; Multiply $04-7 and $00-3
$80/A8C0 A5 04       LDA $04       ; Transfer the 64-bit Multiplication Result from $04-B to $00-7
$80/A8C2 85 00       STA $00
$80/A8C4 A5 06       LDA $06
$80/A8C6 85 02       STA $02
$80/A8C8 A5 08       LDA $08
$80/A8CA 85 04       STA $04
$80/A8CC A5 0A       LDA $0A
$80/A8CE 85 06       STA $06
$80/A8D0 68          PLA           ; Restore $08-$0B
$80/A8D1 85 0A       STA $0A
$80/A8D3 68          PLA
$80/A8D4 85 08       STA $08
$80/A8D6 20 5C A6    JSR $A65C  [$80:A65C]   A:0000 X:000C Y:0000 P:envmxdiZc
$80/A8D9 98          TYA           ; Transfer counter of negative numbers in A
$80/A8DA 4A          LSR A         ; Check if there was one multiplicant of both was negative
$80/A8DB 90 0A       BCC $0A       ; [$A8E7] Exit if not
$80/A8DD 7B          TDC                     A:0000 X:0004 Y:0001 P:envmxdiZC
$80/A8DE E5 10       SBC $10    [$00:0010]   A:0000 X:0004 Y:0001 P:envmxdiZC
$80/A8E0 85 10       STA $10    [$00:0010]   A:F430 X:0004 Y:0001 P:eNvmxdizc
$80/A8E2 7B          TDC                     A:F430 X:0004 Y:0001 P:eNvmxdizc
$80/A8E3 E5 12       SBC $12    [$00:0012]   A:0000 X:0004 Y:0001 P:envmxdiZc
$80/A8E5 85 12       STA $12    [$00:0012]   A:FFFF X:0004 Y:0001 P:eNvmxdizc
$80/A8E7 6B          RTL

$80/A8F0 Calculate the Square Number of A

The Result will be in A; A will contain a 16-bit result, but the Status Register Flags will be set for an 8-bit Accumulator.

$80/A8F0 8D 02 42    STA $4202     ; Store A as the first Multiplicand...
$80/A8F3 8D 03 42    STA $4203     ; ... and as the second one, too
$80/A8F6 EA          NOP           ; Wait for the multiplication result
$80/A8F7 EA          NOP
$80/A8F8 EA          NOP
$80/A8F9 C2 20       REP #$20      ; A = 16 bit
$80/A8FB AD 16 42    LDA $4216     ; Load the Result in A
$80/A8FE E2 20       SEP #$20      ; A = 8 bit again
$80/A900 60          RTS

$80/A901 Calculate the Square Number of 16-bit A

This subroutine calculates the Square Number of the 16-bit value in A. If A contains a really big value, the result could easily be outmax the 16-bit storage of A, so this subroutine does three calculations (Low Byte * Low Byte, High Byte * Low Byte * 2, High Byte * High Byte) and fits this all together to one big 32-bit number in registers $00-$03.

$80/A901 8B          PHB           ; Buffer Data Bank on Stack
$80/A902 4B          PHK           ; Set Data Bank to $80
$80/A903 AB          PLB
$80/A904 DA          PHX           ; Buffer X on Stack
$80/A905 E2 20       SEP #$20      ; 8-bit A
$80/A907 8D 02 42    STA $4202     ; Calculate the Square Number of A's Low Byte
$80/A90A 8D 03 42    STA $4203
$80/A90D 64 02       STZ $02       ; Clear $02/03
$80/A90F 64 03       STZ $03
$80/A911 EB          XBA           ; exchange the 8-bits in A
$80/A912 AE 16 42    LDX $4216     ; $00 = (A's Low Byte)²
$80/A915 86 00       STX $00
$80/A917 8D 03 42    STA $4203     ; Multiply the Original A High Byte with the Low byte
$80/A91A AA          TAX           ; X = A's High Byte
$80/A91B C2 20       REP #$20      ; 16-bit A
$80/A91D AD 16 42    LDA $4216     ; Load the Result of High Byte * Low Byte
$80/A920 0A          ASL A         ; Multiply it by two
$80/A921 08          PHP           ; Buffer Status Register (i. e. the possibly Set Carry of the ASL A)
$80/A922 18          CLC           ; Clear Carry for upcoming Addition
$80/A923 65 01       ADC $01       ; Add the High Byte of the Result of (A's Low Byte)²
$80/A925 85 01       STA $01       ; Store the result in $01/2
$80/A927 7B          TDC           ; Clear A
$80/A928 2A          ROL A         ; Clear Carry
$80/A929 28          PLP           ; Restore Status Register (and possibly set carry)
$80/A92A E2 20       SEP #$20      ; 8-bit A
$80/A92C 69 00       ADC #$00      ; Transfer the Carry in A, if it was set
$80/A92E 85 03       STA $03       ; Store it in $03
$80/A930 8A          TXA           ; A = Original High Byte
$80/A931 8D 02 42    STA $4202     ; (Original High Byte)²
$80/A934 8D 03 42    STA $4203
$80/A937 FA          PLX           ; Restore Original X
$80/A938 C2 21       REP #$21      ; 16-bit A, Clear Carry
$80/A93A A5 02       LDA $02       ; Load the Highest two Byte of the 32-bit Result
$80/A93C 6D 16 42    ADC $4216     ; Add the Multiplication Result = (Original High Byte)²
$80/A93F 85 02       STA $02       ; Store Result
$80/A941 AB          PLB           ; Restore Data Bank
$80/A942 6B          RTL

$80/ABA9 ?

$80/ABA9 8B          PHB           ; Buffer Data Bank on Stack
$80/ABAA 4B          PHK           ; Set Data Bank to $80
$80/ABAB AB          PLB
$80/ABAC DA          PHX           ; Buffer X and Y on Stack
$80/ABAD 5A          PHY
$80/ABAE D4 00       PEI ($00)     ; Buffer $00-7 on Stack
$80/ABB0 D4 02       PEI ($02)
$80/ABB2 D4 04       PEI ($04)
$80/ABB4 D4 06       PEI ($06)
$80/ABB6 C9 02 00    CMP #$0002              A:0024 X:003C Y:0000 P:eNvmxdizc
$80/ABB9 90 31       BCC $31       ; [$ABEC] Exit if less than #$0002
$80/ABBB 48          PHA                     A:0024 X:003C Y:0000 P:envmxdizC
$80/ABBC A0 FC FF    LDY #$FFFC              A:0024 X:003C Y:0000 P:envmxdizC
$80/ABBF 80 03       BRA $03    [$ABC4]      A:0024 X:003C Y:FFFC P:eNvmxdizC
$80/ABC1 4A          LSR A                   A:0392 X:3300 Y:FFFC P:envmxdizC
$80/ABC2 4A          LSR A                   A:01C9 X:3300 Y:FFFC P:envmxdizc
$80/ABC3 C8          INY                     A:00E4 X:3300 Y:FFFC P:envmxdizC
$80/ABC4 C9 00 01    CMP #$0100              A:0024 X:003C Y:FFFC P:eNvmxdizC
$80/ABC7 B0 F8       BCS $F8    [$ABC1]      A:0024 X:003C Y:FFFC P:eNvmxdizc
$80/ABC9 1A          INC A                   A:0024 X:003C Y:FFFC P:eNvmxdizc
$80/ABCA 0A          ASL A                   A:0025 X:003C Y:FFFC P:envmxdizc
$80/ABCB AA          TAX                     A:004A X:003C Y:FFFC P:envmxdizc
$80/ABCC BD A7 A9    LDA $A9A7,x[$80:A9F1]   A:004A X:004A Y:FFFC P:envmxdizc
$80/ABCF C0 00 00    CPY #$0000              A:6152 X:004A Y:FFFC P:envmxdizc
$80/ABD2 F0 04       BEQ $04    [$ABD8]      A:6152 X:004A Y:FFFC P:eNvmxdizC
$80/ABD4 4A          LSR A                   A:6152 X:004A Y:FFFC P:eNvmxdizC
$80/ABD5 C8          INY                     A:30A9 X:004A Y:FFFC P:envmxdizc
$80/ABD6 D0 FC       BNE $FC    [$ABD4]      A:30A9 X:004A Y:FFFD P:eNvmxdizc
$80/ABD8 EB          XBA                     A:0615 X:004A Y:0000 P:envmxdiZc
$80/ABD9 29 FF 00    AND #$00FF              A:1506 X:004A Y:0000 P:envmxdizc
$80/ABDC FA          PLX                     A:0006 X:004A Y:0000 P:envmxdizc
$80/ABDD 85 06       STA $06    [$00:0006]   A:0006 X:0024 Y:0000 P:envmxdizc
$80/ABDF 20 0F A5    JSR $A50F     ; Divide X by A, Result is in A
$80/ABE2 18          CLC                     A:0006 X:0024 Y:0000 P:envmxdizc
$80/ABE3 65 06       ADC $06    [$00:0006]   A:0006 X:0024 Y:0000 P:envmxdizc
$80/ABE5 4A          LSR A                   A:000C X:0024 Y:0000 P:envmxdizc
$80/ABE6 C5 06       CMP $06    [$00:0006]   A:0006 X:0024 Y:0000 P:envmxdizc
$80/ABE8 90 F3       BCC $F3    [$ABDD]      A:0006 X:0024 Y:0000 P:envmxdiZC
$80/ABEA A5 06       LDA $06    [$00:0006]   A:0006 X:0024 Y:0000 P:envmxdiZC
$80/ABEC 7A          PLY           ; Restore Buffered values of $00-7
$80/ABED 84 06       STY $06
$80/ABEF 7A          PLY
$80/ABF0 84 04       STY $04
$80/ABF2 7A          PLY
$80/ABF3 84 02       STY $02
$80/ABF5 7A          PLY
$80/ABF6 84 00       STY $00
$80/ABF8 7A          PLY           ; Restore Buffered Y
$80/ABF9 FA          PLX           ; Restore Buffered Y
$80/ABFA AB          PLB           ; Restore Data Bank
$80/ABFB 6B          RTL

$80/ABFC ?

$80/ABFC A5 02       LDA $02    [$00:0002]   A:0000 X:3300 Y:0002 P:envmxdiZC
$80/ABFE D0 05       BNE $05    [$AC05]      A:0000 X:3300 Y:0002 P:envmxdiZC
$80/AC00 A5 00       LDA $00    [$00:0000]   A:0000 X:3300 Y:0002 P:envmxdiZC
$80/AC02 4C A9 AB    JMP $ABA9  [$80:ABA9]   A:001A X:3300 Y:0002 P:envmxdizC
code is missing here

$80/AD39 RNG?

$80/AD39 DA          PHX                     A:0004 X:0004 Y:000A P:envMxdizc
$80/AD3A 5A          PHY                     A:0004 X:0004 Y:000A P:envMxdizc
$80/AD3B 08          PHP                     A:0004 X:0004 Y:000A P:envMxdizc
$80/AD3C E2 11       SEP #$11                A:0004 X:0004 Y:000A P:envMxdizc
$80/AD3E AE 11 12    LDX $1211  [$80:1211]   A:0004 X:0004 Y:000A P:envMXdizC
$80/AD41 AC 10 12    LDY $1210  [$80:1210]   A:0004 X:0018 Y:000A P:envMXdizC
$80/AD44 BD 12 12    LDA $1212,x[$80:122A]   A:0004 X:0018 Y:0030 P:envMXdizC
$80/AD47 F9 12 12    SBC $1212,y[$80:1242]   A:00A4 X:0018 Y:0030 P:eNvMXdizC
$80/AD4A 99 12 12    STA $1212,y[$80:1242]   A:0015 X:0018 Y:0030 P:envMXdizC
$80/AD4D E8          INX                     A:0015 X:0018 Y:0030 P:envMXdizC
$80/AD4E E0 37       CPX #$37                A:0015 X:0019 Y:0030 P:envMXdizC
$80/AD50 D0 02       BNE $02    [$AD54]      A:0015 X:0019 Y:0030 P:eNvMXdizc
$80/AD54 8E 11 12    STX $1211  [$80:1211]   A:0015 X:0019 Y:0030 P:eNvMXdizc
$80/AD57 C8          INY                     A:0015 X:0019 Y:0030 P:eNvMXdizc
$80/AD58 C0 37       CPY #$37                A:0015 X:0019 Y:0031 P:envMXdizc
$80/AD5A D0 02       BNE $02    [$AD5E]      A:0015 X:0019 Y:0031 P:eNvMXdizc
$80/AD5E 8C 10 12    STY $1210  [$80:1210]   A:0015 X:0019 Y:0031 P:eNvMXdizc
$80/AD61 28          PLP                     A:0015 X:0019 Y:0031 P:eNvMXdizc
$80/AD62 7A          PLY                     A:0015 X:0019 Y:0031 P:envMxdizc
$80/AD63 FA          PLX                     A:0015 X:0019 Y:000A P:envMxdizc
$80/AD64 60          RTS                     A:0015 X:0004 Y:000A P:envMxdizc

$80/ADCB Calculate Address in Tilemap

This seems to be about calculation of an Address in a Tilemap. You put the number of a tile's row number in A and the columns number in X, and it calculates the actual offset for it. The mathmatical formula is:

New A and New X = Old A * #$40 + Old X

$80/ADCB DA          PHX           ; Push the Column number on stack for now
$80/ADCC C2 20       REP #$20      ; Make Accumuleta great again
$80/ADCE 29 FF 00    AND #$00FF    ; Remove whatever was still in the hidden 8-bit of the Accumulator
$80/ADD1 EB          XBA           ; A * #$40 (sixty-four)
$80/ADD2 4A          LSR A
$80/ADD3 4A          LSR A
$80/ADD4 63 01       ADC $01,s     ; Add Column number (that is on stack)
$80/ADD6 FA          PLX           ; Remove Column number from stack (not needed any more)
$80/ADD7 AA          TAX           ; Replace it with the calculation's result
$80/ADD8 E2 20       SEP #$20
$80/ADDA 6B          RTL

$80/AEF2 Load Music?

Replacing the A5 59 ("LDA $59") at $AF03 with A9 10 ("LDA #$10"), this loaded a different song in the Title Demo and other scenes in the game.

$80/AEF2 8B          PHB                     A:000D X:905F Y:000D P:envMxdizc
$80/AEF3 4B          PHK                     A:000D X:905F Y:000D P:envMxdizc
$80/AEF4 AB          PLB                     A:000D X:905F Y:000D P:envMxdizc
$80/AEF5 85 59       STA $59    [$00:0059]   A:000D X:905F Y:000D P:eNvMxdizc
$80/AEF7 20 4C AF    JSR $AF4C  [$80:AF4C]   A:000D X:905F Y:000D P:eNvMxdizc
$80/AEFA 90 07       BCC $07    [$AF03]      A:000D X:905F Y:000D P:envMxdizc
code is missing here
$80/AF03 A5 59       LDA $59    [$00:0059]   A:000D X:905F Y:000D P:envMxdizc
$80/AF05 F0 0B       BEQ $0B    [$AF12]      A:000D X:905F Y:000D P:envMxdizc
$80/AF07 22 03 80 8F JSL $8F8003[$8F:8003]   A:000D X:905F Y:000D P:envMxdizc
$80/AF0B A9 01       LDA #$01                A:0002 X:33CC Y:D686 P:envMxdizc
$80/AF0D 85 F5       STA $F5    [$00:00F5]   A:0001 X:33CC Y:D686 P:envMxdizc
$80/AF0F 20 30 AF    JSR $AF30  [$80:AF30]   A:0001 X:33CC Y:D686 P:envMxdizc
$80/AF12 AB          PLB                     A:0000 X:33CC Y:D686 P:envMxdiZc
$80/AF13 6B          RTL                     A:0000 X:33CC Y:D686 P:envMxdizc

$80/AF14 Load Music?

$80/AF14 8B          PHB           ; Buffer Data Bank on Stack
$80/AF15 A9 FF       LDA #$FF                A:0000 X:05DD Y:0004 P:eNvMxdIzc
$80/AF17 85 F5       STA $F5    [$00:00F5]   A:00FF X:05DD Y:0004 P:eNvMxdIzc
$80/AF19 20 30 AF    JSR $AF30  [$80:AF30]   A:00FF X:05DD Y:0004 P:eNvMxdIzc
$80/AF1C A9 21       LDA #$21                A:0000 X:05DD Y:0004 P:envMxdIZc
$80/AF1E 22 03 80 8F JSL $8F8003[$8F:8003]   A:0021 X:05DD Y:0004 P:envMxdIzc
$80/AF22 A9 FF       LDA #$FF                A:0002 X:33CC Y:9E7A P:envMxdIzc
$80/AF24 85 59       STA $59    [$00:0059]   A:00FF X:33CC Y:9E7A P:eNvMxdIzc
$80/AF26 AB          PLB           ; Restore Data Bank from Stack
$80/AF27 6B          RTL

$80/AF28 Load Music?

$80/AF28 8B          PHB           ; Buffer Data Bank on Stack
$80/AF29 4B          PHK           ; Set Data Bank to $80
$80/AF2A AB          PLB
$80/AF2B 20 30 AF    JSR $AF30  [$80:AF30]   A:A1F8 X:05DD Y:0004 P:eNvMxdIzc
$80/AF2E AB          PLB           ; Restore Data Bank from Stack
$80/AF2F 6B          RTL

$80/AF30 Load Music?

$80/AF30 AD AF 05    LDA $05AF     ; (Is VBlank NMI enabled?)
$80/AF33 30 0A       BMI $0A       ; [$AF3F] Branch if it is
$80/AF35 22 0C 80 8F JSL $8F800C[$8F:800C]   A:A100 X:05DD Y:0004 P:envMxdIZc
$80/AF39 A5 F5       LDA $F5    [$00:00F5]   A:0000 X:05DD Y:0004 P:envMxdIZc
$80/AF3B D0 F8       BNE $F8    [$AF35]      A:00F8 X:05DD Y:0004 P:eNvMxdIzc
$80/AF3D 80 04       BRA $04       ; [$AF43] Exit
code is missing here
$80/AF43 60          RTS

$80/AF7E Actual NMI Handler

$80/AF7E C2 30       REP #$30      ; A/X/Y = 16 bit (to make sure everything is put on stack)
$80/AF80 48          PHA
$80/AF81 8B          PHB
$80/AF82 0B          PHD
$80/AF83 DA          PHX
$80/AF84 5A          PHY
$80/AF85 4B          PHK
$80/AF86 AB          PLB
$80/AF87 A9 00 00    LDA #$0000
$80/AF8A 5B          TCD
$80/AF8B E2 20       SEP #$20
$80/AF8D AD 10 42    LDA $4210     ; Remove NMI Flag
$80/AF90 A9 80       LDA #$80
$80/AF92 8D 00 21    STA $2100     ; FBLANK
$80/AF95 AD BD 05    LDA $05BD     ; ???
$80/AF98 10 03       BPL $03       ; ???
$80/AF9A 4C D2 B0    JMP $B0D2     ; ???
$80/AF9D 20 C2 B2    JSR $B2C2     ; ???

OAM Update

$80/AFA0 AD B0 05    LDA $05B0     ; Transfer HDMA Flags
$80/AFA3 8D 86 05    STA $0586
$80/AFA6 9C 0C 42    STZ $420C     ; Deactivate HDMAs
$80/AFA9 AD 40 05    LDA $0540     ; If $0540 is empty, don't update OAM?
$80/AFAC F0 29       BEQ $29       ; [$AFD7]
$80/AFAE A2 00 00    LDX #$0000    ; OAM Address
$80/AFB1 8E 02 21    STX $2102
$80/AFB4 9C 04 43    STZ $4304     ; Source Bank: $00
$80/AFB7 AE 45 05    LDX $0545
$80/AFBA 8E 02 43    STX $4302     ; Source Address: $0545
$80/AFBD A9 04       LDA #$04      ; DMA Destination: $2104 (OAM)
$80/AFBF 8D 01 43    STA $4301
$80/AFC2 A2 20 02    LDX #$0220    ; Transfer $220 Bytes - both OAM Tables
$80/AFC5 8E 05 43    STX $4305
$80/AFC8 A9 00       LDA #$00      ; DMA Transfer settings
$80/AFCA 8D 00 43    STA $4300
$80/AFCD A9 01       LDA #$01      ; Activate DMA
$80/AFCF 8D 0B 42    STA $420B
$80/AFD2 9C 40 05    STZ $0540     ; Clear OAM Update Flag
$80/AFD5 80 03       BRA $03       ; [$AFDA] --- ???
$80/AFD7 20 01 B1    JSR $B101     ; ???
$80/AFDA 20 35 B1    JSR $B135     ; ???
$80/AFDD 20 D8 B3    JSR $B3D8     ; CGRAM Update
$80/AFE0 20 2B B3    JSR $B32B     ; VRAM DMA Pipeline
$80/AFE3 20 7B B3    JSR $B37B     ; VRAM Read DMA
$80/AFE6 AD 86 05    LDA $0586     ; Reactivate HDMAs
$80/AFE9 8D 0C 42    STA $420C
$80/AFEC 20 6D B2    JSR $B26D     ; Update Graphic Setup Registers
$80/AFEF AD 6A 05    LDA $056A     ; Load the (old) Screen Settings
$80/AFF2 2C 12 42    BIT $4212     ; Wait for the next HBLANK to end
$80/AFF5 70 FB       BVS $FB       ; [$AFF2]
$80/AFF7 2C 12 42    BIT $4212
$80/AFFA 50 FB       BVC $FB       ; [$AFF7]
$80/AFFC 8D 00 21    STA $2100     ; Update Screen brightness
$80/AFFF 20 0B B4    JSR $B40B     ; Joypad Data Fetching
$80/B002 22 61 80 88 JSL $888061   ; ???
$80/B006 22 00 80 88 JSL $888000   ; ???
$80/B00A 22 18 81 88 JSL $888118   ; ???
$80/B00E AD BA 05    LDA $05BA
$80/B011 F0 04       BEQ $04       ; [$B017]
code is missing here
$80/B017 AE BB 05    LDX $05BB
$80/B01A F0 04       BEQ $04       ; [$B020]
code is missing here
$80/B020 20 40 B2    JSR $B240     ; ???
$80/B023 22 73 81 88 JSL $888173   ; ???
$80/B027 A6 32       LDX $32       ; ???
$80/B029 86 34       STX $34       ; ???
$80/B02B AE F0 05    LDX $05F0     ; Update V Timer - At which Scan Line an IRQ should come
$80/B02E 8E 09 42    STX $4209
$80/B031 AD 11 42    LDA $4211     ; Load (and remove) IRQ Flag
$80/B034 AD AF 05    LDA $05AF     ; Update NMI/IRQ/Auto-Joypad Flags
$80/B037 8D 00 42    STA $4200
$80/B03A EE B9 05    INC $05B9     ; ??? (Frame counter!? Flag register?)
$80/B03D AD BD 05    LDA $05BD     ; ??? (Check Flag register?)
$80/B040 89 C0       BIT #$C0      ; ??? (If bit 6 is set, CGRAM needs an update; bit 7 yet unknown)
$80/B042 D0 1C       BNE $1C       ; [$B060]
$80/B044 AD 38 00    LDA $0038     ; ???
$80/B047 F0 17       BEQ $17       ; [$B060]
code is missing here
$80/B060 A5 37       LDA $37    [$00:0037]   A:0000 X:00DB Y:0000 P:envMxdIZc
$80/B062 F0 62       BEQ $62    [$B0C6]      A:0003 X:00DB Y:0000 P:envMxdIzc
$80/B064 AD BD 05    LDA $05BD  [$80:05BD]   A:0003 X:00DB Y:0000 P:envMxdIzc
$80/B067 89 40       BIT #$40                A:0000 X:00DB Y:0000 P:envMxdIZc
$80/B069 D0 5B       BNE $5B    [$B0C6]      A:0000 X:00DB Y:0000 P:envMxdIZc
$80/B06B D4 00       PEI ($00)     ; Buffer $00-$0F and $20-$2B on stack
$80/B06D D4 02       PEI ($02)
$80/B06F D4 04       PEI ($04)
$80/B071 D4 06       PEI ($06)
$80/B073 D4 08       PEI ($08)
$80/B075 D4 0A       PEI ($0A)
$80/B077 D4 0C       PEI ($0C)
$80/B079 D4 0E       PEI ($0E)
$80/B07B D4 20       PEI ($20)
$80/B07D D4 22       PEI ($22)
$80/B07F D4 24       PEI ($24)
$80/B081 D4 26       PEI ($26)
$80/B083 D4 28       PEI ($28)
$80/B085 D4 2A       PEI ($2A)
$80/B087 58          CLI           ; Activate Interrupts
$80/B088 A5 37       LDA $37    [$00:0037]   A:0000 X:00DB Y:0000 P:envMxdiZc
$80/B08A 89 01       BIT #$01
$80/B08C F0 04       BEQ $04       ; [$B092] Don't do Figure Animation if Bit 0 is clear
$80/B08E 22 5F 80 84 JSL $84805F   ; Do the Tile/Figure Animation
$80/B092 A5 37       LDA $37    [$00:0037]   A:0007 X:0004 Y:001C P:eNvMxdizc
$80/B094 89 02       BIT #$02                A:0003 X:0004 Y:001C P:envMxdizc
$80/B096 F0 04       BEQ $04    [$B09C]      A:0003 X:0004 Y:001C P:envMxdizc
$80/B098 22 00 80 85 JSL $858000[$85:8000]   A:0003 X:0004 Y:001C P:envMxdizc
$80/B09C FA          PLX           ; Restore $00-$0F and $20-$2B from stack
$80/B09D 86 2A       STX $2A
$80/B09F FA          PLX
$80/B0A0 86 28       STX $28
$80/B0A2 FA          PLX
$80/B0A3 86 26       STX $26
$80/B0A5 FA          PLX
$80/B0A6 86 24       STX $24
$80/B0A8 FA          PLX
$80/B0A9 86 22       STX $22
$80/B0AB FA          PLX
$80/B0AC 86 20       STX $20
$80/B0AE FA          PLX
$80/B0AF 86 0E       STX $0E
$80/B0B1 FA          PLX
$80/B0B2 86 0C       STX $0C
$80/B0B4 FA          PLX
$80/B0B5 86 0A       STX $0A
$80/B0B7 FA          PLX
$80/B0B8 86 08       STX $08
$80/B0BA FA          PLX
$80/B0BB 86 06       STX $06
$80/B0BD FA          PLX
$80/B0BE 86 04       STX $04
$80/B0C0 FA          PLX
$80/B0C1 86 02       STX $02
$80/B0C3 FA          PLX
$80/B0C4 86 00       STX $00
$80/B0C6 22 0C 80 8F JSL $8F800C   ; ??? Sound related
$80/B0CA C2 30       REP #$30      ; Restore everything from Stack
$80/B0CC 7A          PLY
$80/B0CD FA          PLX
$80/B0CE 2B          PLD
$80/B0CF AB          PLB
$80/B0D0 68          PLA
$80/B0D1 40          RTI           ; End Interrupt Handler

$80/B0D2 ?

$80/B0D2 20 C2 B2    JSR $B2C2     : Do Animation VRAM DMAs
$80/B0D5 AD 86 05    LDA $0586     ; Activate HDMA
$80/B0D8 8D 0C 42    STA $420C
$80/B0DB 20 01 B1    JSR $B101  [$80:B101]   A:0006 X:E0A4 Y:BE79 P:envMxdIzC
$80/B0DE 20 6D B2    JSR $B26D     ; Update Graphic Setup Registers
$80/B0E1 AD 6A 05    LDA $056A     ; Load $2100 Buffer
$80/B0E4 2C 12 42    BIT $4212     ; Wait for HBLANK Period flag to be set
$80/B0E7 70 FB       BVS $FB       ; [$B0E4]
$80/B0E9 2C 12 42    BIT $4212     ; Wait for HBLANK Period flag to be cleared
$80/B0EC 50 FB       BVC $FB       ; [$B0E9]
$80/B0EE 8D 00 21    STA $2100     ; Turn the Screen on
$80/B0F1 A5 A1       LDA $A1    [$00:00A1]   A:000F X:0581 Y:0008 P:eNVMxdIzC
$80/B0F3 89 01       BIT #$01                A:0000 X:0581 Y:0008 P:enVMxdIZC
$80/B0F5 F0 07       BEQ $07    [$B0FE]      A:0000 X:0581 Y:0008 P:enVMxdIZC

Code is missing here

$80/B0FE 4C 27 B0    JMP $B027  [$80:B027]   A:0000 X:0581 Y:0008 P:enVMxdIZC

$80/B101 OAM Update

This only updates the first ten sprites!

$80/B101 A5 37       LDA $37       ; Load OAM Update Flag register
$80/B103 89 02       BIT #$02      ; Check Flag for regular OAM Updates
$80/B105 F0 2D       BEQ $2D       ; [$B134] Exit if not
$80/B107 A2 00 00    LDX #$0000    ; Set OAM Address to #$0000
$80/B10A 8E 02 21    STX $2102
$80/B10D 9C 04 43    STZ $4304     ; Source Bank: $00
$80/B110 AD B9 05    LDA $05B9     ; Check if value in the Frame Counter is odd or even
$80/B113 4A          LSR A
$80/B114 A2 00 01    LDX #$0100    ; Use OAM Buffer 1 if even
$80/B117 90 03       BCC $03       ; [$B11C]
$80/B119 A2 20 03    LDX #$0320    ; Use OAM Buffer 2 if odd
$80/B11C 8E 02 43    STX $4302
$80/B11F A9 04       LDA #$04      ; DMA Destination: OAM --- $(21)04
$80/B121 8D 01 43    STA $4301
$80/B124 A2 40 00    LDX #$0040    ; Transfer #$40 Byte
$80/B127 8E 05 43    STX $4305
$80/B12A A9 00       LDA #$00      ; DMA Settings
$80/B12C 8D 00 43    STA $4300
$80/B12F A9 01       LDA #$01      ; ACTIVATE DMA
$80/B131 8D 0B 42    STA $420B
$80/B134 60          RTS

$80/B135 Update Graphics Settings Buffer Registers

I'm not sure, but it looks like you can buffer values for the screen settings in buffer registers, so that they get transfered in the next frame to their destination. Because this seems to be the subroutine that makes these values step up in queue.

$80/B135 AE 91 05    LDX $0591     ; Update $210D Buffer
$80/B138 8E 71 05    STX $0571
$80/B13B AE 93 05    LDX $0593     ; Update $210E Buffer
$80/B13E 8E 73 05    STX $0573
$80/B141 AE 95 05    LDX $0595     ; Update $210F Buffer
$80/B144 8E 75 05    STX $0575
$80/B147 AE 97 05    LDX $0597     ; Update $2110 Buffer
$80/B14A 8E 77 05    STX $0577
$80/B14D AE 99 05    LDX $0599     ; Update $2111 Buffer
$80/B150 8E 79 05    STX $0579
$80/B153 AE 9B 05    LDX $059B     ; Update $2112 Buffer
$80/B156 8E 7B 05    STX $057B
$80/B159 AE 9D 05    LDX $059D     ; Update $2113 Buffer
$80/B15C 8E 7D 05    STX $057D
$80/B15F AE 9F 05    LDX $059F     ; Update $2114 Buffer
$80/B162 8E 7F 05    STX $057F
$80/B165 AE 8B 05    LDX $058B     ; Update $2107/8 Buffer
$80/B168 8E 6D 05    STX $056D
$80/B16B AE 8D 05    LDX $058D     ; Update $2109/A Buffer
$80/B16E 8E 6F 05    STX $056F
$80/B171 AD 87 05    LDA $0587     ; Update $2100 Buffer
$80/B174 8D 6A 05    STA $056A
$80/B177 AD 89 05    LDA $0589     ; Update $2105 Buffer
$80/B17A 8D 6B 05    STA $056B
$80/B17D AD 88 05    LDA $0588     ; Update $2101 Buffer
$80/B180 8D 6C 05    STA $056C
$80/B183 AE AC 05    LDX $05AC     ; Update $2132 Buffer - R?/G?
$80/B186 8E 83 05    STX $0583
$80/B189 AD AE 05    LDA $05AE     ; Update $2132 Buffer - V?
$80/B18C 8D 85 05    STA $0585
$80/B18F AD AA 05    LDA $05AA     ; Update $2130 Buffer
$80/B192 8D 81 05    STA $0581
$80/B195 AD AB 05    LDA $05AB     ; ???
$80/B198 8D 82 05    STA $0582     ; ???
$80/B19B AE EE 05    LDX $05EE     ; Update $4209/A Buffer
$80/B19E 8E F0 05    STX $05F0
$80/B1A1 AD 8A 05    LDA $058A     ; Update $2106
$80/B1A4 8D 06 21    STA $2106
$80/B1A7 AD 5F 17    LDA $175F     ; Is the flag for a HDMA Window Mask set?
$80/B1AA F0 43       BEQ $43       ; [$B1EF] Branch if not
$80/B1AC AD 60 17    LDA $1760     ; Set HDMA Parameters (Direction, Addr Mode, Step)
$80/B1AF 8D 40 43    STA $4340
$80/B1B2 A9 26       LDA #$26      ; I/O-Bus Address: $2126 Window 1 Position
$80/B1B4 8D 41 43    STA $4341
$80/B1B7 A9 7E       LDA #$7E
$80/B1B9 8D 44 43    STA $4344     ; HDMA Table Start Address on Bank $7E
$80/B1BC 8D 47 43    STA $4347     ; Indirect HDMA Address on Bank $7E
$80/B1BF AE 61 17    LDX $1761     ; HDMA Start Address
$80/B1C2 8E 42 43    STX $4342
$80/B1C5 AD A1 05    LDA $05A1     ; Window BG1/2 Mask Settings
$80/B1C8 8D 23 21    STA $2123
$80/B1CB AD A2 05    LDA $05A2     ; Window BG3/4 Mask Settings
$80/B1CE 8D 24 21    STA $2124
$80/B1D1 AD A3 05    LDA $05A3     ; Window OBJ/MATH Mask Settings
$80/B1D4 8D 25 21    STA $2125
$80/B1D7 AD A4 05    LDA $05A4     ; Window 1/2 Mask Logic for BG1-4
$80/B1DA 8D 2A 21    STA $212A
$80/B1DD AD A5 05    LDA $05A5     ; Window 1/2 Mask Logic for OBJ/MATH
$80/B1E0 8D 2B 21    STA $212B
$80/B1E3 AD A8 05    LDA $05A8     ; Window Area Main Screen Disable
$80/B1E6 8D 2E 21    STA $212E
$80/B1E9 AD A9 05    LDA $05A9     ; Window Area Sub Screen Disable
$80/B1EC 8D 2F 21    STA $212F
$80/B1EF AD FB 16    LDA $16FB  [$80:16FB]   A:0000 X:00DC Y:0000 P:envMxdIZC
$80/B1F2 F0 18       BEQ $18    [$B20C]      A:0055 X:00DC Y:0000 P:envMxdIzC
$80/B1F4 AE FC 16    LDX $16FC  [$80:16FC]   A:0055 X:00DC Y:0000 P:envMxdIzC
$80/B1F7 8E 72 43    STX $4372  [$80:4372]   A:0055 X:5555 Y:0000 P:envMxdIzC
$80/B1FA AE 02 17    LDX $1702  [$80:1702]   A:0055 X:5555 Y:0000 P:envMxdIzC
$80/B1FD 8E 12 43    STX $4312  [$80:4312]   A:0055 X:5555 Y:0000 P:envMxdIzC
$80/B200 AE FE 16    LDX $16FE  [$80:16FE]   A:0055 X:5555 Y:0000 P:envMxdIzC
$80/B203 8E 62 43    STX $4362  [$80:4362]   A:0055 X:5555 Y:0000 P:envMxdIzC
$80/B206 AE 00 17    LDX $1700  [$80:1700]   A:0055 X:5555 Y:0000 P:envMxdIzC
$80/B209 8E 52 43    STX $4352  [$80:4352]   A:0055 X:5555 Y:0000 P:envMxdIzC
$80/B20C AF 87 BE 7E LDA $7EBE87[$7E:BE87]   A:0055 X:5555 Y:0000 P:envMxdIzC
$80/B210 10 29       BPL $29    [$B23B]      A:0000 X:5555 Y:0000 P:envMxdIZC
$80/B212 29 7F       AND #$7F                A:0081 X:00DB Y:003A P:eNvMxdIzC
$80/B214 8F 87 BE 7E STA $7EBE87[$7E:BE87]   A:0001 X:00DB Y:003A P:envMxdIzC
$80/B218 C2 20       REP #$20                A:0001 X:00DB Y:003A P:envMxdIzC
$80/B21A AF 84 BE 7E LDA $7EBE84[$7E:BE84]   A:0001 X:00DB Y:003A P:envmxdIzC
$80/B21E C9 8A BE    CMP #$BE8A              A:BE8A X:00DB Y:003A P:eNvmxdIzC
$80/B221 F0 05       BEQ $05    [$B228]      A:BE8A X:00DB Y:003A P:envmxdIZC
$80/B228 A9 A4 BE    LDA #$BEA4              A:BE8A X:00DB Y:003A P:envmxdIZC
$80/B22B 8F 84 BE 7E STA $7EBE84[$7E:BE84]   A:BEA4 X:00DB Y:003A P:eNvmxdIzC
$80/B22F 8D 32 43    STA $4332  [$80:4332]   A:BEA4 X:00DB Y:003A P:eNvmxdIzC
$80/B232 18          CLC                     A:BEA4 X:00DB Y:003A P:eNvmxdIzC
$80/B233 69 0D 00    ADC #$000D              A:BEA4 X:00DB Y:003A P:eNvmxdIzc
$80/B236 8D 22 43    STA $4322  [$80:4322]   A:BEB1 X:00DB Y:003A P:eNvmxdIzc
$80/B239 E2 20       SEP #$20                A:BEB1 X:00DB Y:003A P:eNvmxdIzc
$80/B23B A5 36       LDA $36    [$00:0036]   A:0000 X:5555 Y:0000 P:envMxdIZC
$80/B23D 85 37       STA $37    [$00:0037]   A:0000 X:5555 Y:0000 P:envMxdIZC
$80/B23F 60          RTS

$80/B240 ? Change up HDMA Window Mask HDMA Table Address

I guess there are only two options here where this subroutine alternates between both, that is: HDMA Table Start Address at $7E/B100 and $7E/B120.

$80/B240 AD 5F 17    LDA $175F     ; Is the flag for a HDMA Window Mask set?
$80/B243 F0 11       BEQ $11       ; [$B256] Branch if not
$80/B245 9C 5F 17    STZ $175F     ; Clear HDMA Window Mask flag
$80/B248 A0 00 B1    LDY #$B100    ; Is the Window Mask - HDMA Table Start Address $(7E/)B100?
$80/B24B CC 61 17    CPY $1761
$80/B24E D0 03       BNE $03       ; [$B253] If not, branch and set it to $B100
$80/B250 A0 20 B1    LDY #$B120    ; If it was, set it to $B120
$80/B253 8C 61 17    STY $1761
$80/B256 AD FB 16    LDA $16FB  [$80:16FB]   A:0000 X:0000 Y:0000 P:enVMxdIZc
$80/B259 F0 11       BEQ $11       ; [$B26C] Exit if empty
$80/B25B 9C FB 16    STZ $16FB  [$80:16FB]   A:0002 X:0000 Y:0000 P:enVMxdIzc
$80/B25E A2 00 B0    LDX #$B000              A:0002 X:0000 Y:0000 P:enVMxdIzc
$80/B261 EC FC 16    CPX $16FC  [$80:16FC]   A:0002 X:B000 Y:0000 P:eNVMxdIzc
$80/B264 D0 03       BNE $03    [$B269]      A:0002 X:B000 Y:0000 P:enVMxdIZC
$80/B266 A2 10 B0    LDX #$B010              A:0002 X:B000 Y:0000 P:enVMxdIZC
$80/B269 8E FC 16    STX $16FC  [$80:16FC]   A:0002 X:B010 Y:0000 P:eNVMxdIzC
$80/B26C 60          RTS

$80/B26D Update Graphic Setup Registers

$80/B26D AD 6B 05    LDA $056B     ; BG Mode
$80/B270 8D 05 21    STA $2105
$80/B273 AD 6C 05    LDA $056C     ; Sprite sizes
$80/B276 8D 01 21    STA $2101
$80/B279 AE A6 05    LDX $05A6     ; Main Screen/Subscreen Destination (16 bit!)
$80/B27C 8E 2C 21    STX $212C
$80/B27F AE 8F 05    LDX $058F     ; BG1-4 Tileset Addresses (16 bit!)
$80/B282 8E 0B 21    STX $210B
$80/B285 AE 6D 05    LDX $056D     ; BG1/2 Tilemap Address
$80/B288 8E 07 21    STX $2107
$80/B28B AE 6F 05    LDX $056F     ; BG3/4 Tilemap Address
$80/B28E 8E 09 21    STX $2109
$80/B291 AE 81 05    LDX $0581     ; Color Addition Select
$80/B294 8E 30 21    STX $2130
$80/B297 AD 85 05    LDA $0585     ; Fixed Color Data
$80/B29A 8D 32 21    STA $2132
$80/B29D AD 84 05    LDA $0584     ; Fixed Color Data
$80/B2A0 8D 32 21    STA $2132
$80/B2A3 AD 83 05    LDA $0583     ; Fixed Color Data
$80/B2A6 8D 32 21    STA $2132
$80/B2A9 A0 00 00    LDY #$0000    ; Update the BG Scroll registers
$80/B2AC A2 71 05    LDX #$0571
$80/B2AF B5 00       LDA $00,x
$80/B2B1 99 0D 21    STA $210D,y
$80/B2B4 B5 01       LDA $01,x
$80/B2B6 99 0D 21    STA $210D,y
$80/B2B9 E8          INX
$80/B2BA E8          INX
$80/B2BB C8          INY
$80/B2BC C0 08 00    CPY #$0008
$80/B2BF D0 EE       BNE $EE       ; [$B2AF]
$80/B2C1 60          RTS

$80/B2C2 Do Animation VRAM DMAs

$11CA seems to be a counter and is an index for $0F49,y, $11C9 is a limit

$80/B2C2 AD CA 11    LDA $11CA     ; Load Number of the first Animation VRAM DMA
$80/B2C5 CD C9 11    CMP $11C9     ; Compare with Number of the last Animation VRAM DMA
$80/B2C8 F0 60       BEQ $60       ; [$B32A] Exit if equal
$80/B2CA AD BD 05    LDA $05BD  [$80:05BD]   A:0002 X:0000 Y:0006 P:eNvMxdIzc
$80/B2CD 30 14       BMI $14    [$B2E3]      A:0080 X:0000 Y:0006 P:eNvMxdIzc
$80/B2CF 7B          TDC           ; Clear 16-bit A
$80/B2D0 AD C7 0E    LDA $0EC7     ; (Load Number of Occupied VRAM DMA-Pipeline Entries?)
$80/B2D3 C2 20       REP #$20      ; 16-bit A
$80/B2D5 EB          XBA           ; $0EC7 * #$04 + $0EC5
$80/B2D6 4A          LSR A
$80/B2D7 4A          LSR A
$80/B2D8 6D C5 0E    ADC $0EC5
$80/B2DB C9 00 05    CMP #$0500    ; Compare if higher or same as #$500 (Sets carry if it is)
$80/B2DE E2 20       SEP #$20      ; 8-bit A
$80/B2E0 7B          TDC           ; Clear 16-bit A
$80/B2E1 B0 47       BCS $47       ; [$B32A] Exit if A was higher or same as #$500
$80/B2E3 A9 01       LDA #$01      ; DMA Transfer Settings
$80/B2E5 8D 00 43    STA $4300
$80/B2E8 A9 18       LDA #$18      ; DMA Destination $(21)18 - VRAM
$80/B2EA 8D 01 43    STA $4301
$80/B2ED A9 80       LDA #$80      ; VRAM Transfer Settings
$80/B2EF 8D 15 21    STA $2115
$80/B2F2 7B          TDC           ; Clear 16-bit A
$80/B2F3 AD CA 11    LDA $11CA     ; Load Number of the first Animation VRAM DMA
$80/B2F6 0A          ASL A         ; Multiply by 2 and use it as Load Index in Y
$80/B2F7 A8          TAY
$80/B2F8 BE 49 0F    LDX $0F49,y   ; Load Animation VRAM DMA Size
$80/B2FB E0 81 00    CPX #$0081
$80/B2FE 90 02       BCC $02       ; [$B302] Branch if smaller than #$0081
Code is missing here
$80/B302 8E 05 43    STX $4305     ; Set as DMA Size
$80/B305 BE 09 10    LDX $1009,y   ; Set Source Destination
$80/B308 8E 02 43    STX $4302
$80/B30B B9 8A 11    LDA $118A,y   ; Set Source Bank
$80/B30E 8D 04 43    STA $4304
$80/B311 BE C9 10    LDX $10C9,y   ; Set VRAM Destination
$80/B314 8E 16 21    STX $2116
$80/B317 A9 01       LDA #$01      ; Activate DMA
$80/B319 8D 0B 42    STA $420B
$80/B31C AD CA 11    LDA $11CA     ; Increment Number of the first Animation VRAM DMA
$80/B31F 1A          INC A
$80/B320 29 1F       AND #$1F      ; Reset to zero if it surpassed #1F (this is a circular buffer)
$80/B322 8D CA 11    STA $11CA
$80/B325 CD C9 11    CMP $11C9     ; Check if the Number of the last Animation VRAM DMA is reached
$80/B328 D0 CC       BNE $CC       ; [$B2F6] Do next Animation VRAM DMA if not
$80/B32A 60          RTS

$80/B32B VRAM DMA Pipeline

$80/B32B AD C7 0E    LDA $0EC7     ; Are there any VRAM DMAs in the pipeline?
$80/B32E F0 44       BEQ $44       ; [$B374] If not, exit
$80/B330 A9 01       LDA #$01      ; DMA Settings
$80/B332 8D 00 43    STA $4300
$80/B335 A9 18       LDA #$18      ; DMA Destination: $2118
$80/B337 8D 01 43    STA $4301
$80/B33A A0 00 00    LDY #$0000
$80/B33D BE C9 0E    LDX $0EC9,y   ; DMA Data Size
$80/B340 8E 05 43    STX $4305
$80/B343 BE 89 0F    LDX $0F89,y   ; DMA Adress
$80/B346 8E 02 43    STX $4302
$80/B349 B9 0A 11    LDA $110A,y   ; DMA Bank
$80/B34C 8D 04 43    STA $4304
$80/B34F B9 09 11    LDA $1109,y   ; VRAM Transfer Setting
$80/B352 8D 15 21    STA $2115
$80/B355 BE 49 10    LDX $1049,y   ; VRAM Destination
$80/B358 8E 16 21    STX $2116
$80/B35B A9 01       LDA #$01      ; Activate DMA
$80/B35D 8D 0B 42    STA $420B
$80/B360 C8          INY           ; Increment Index
$80/B361 C8          INY
$80/B362 CE C7 0E    DEC $0EC7     ; Decrement number of occupied Pipelines entries
$80/B365 D0 D6       BNE $D6       ; [$B33D] Loop until all are done
$80/B367 A2 00 00    LDX #$0000
$80/B36A 8E D6 16    STX $16D6     ; ???
$80/B36D 8E D8 16    STX $16D8     ; ???
$80/B370 A6 5A       LDX $5A       ; ???
$80/B372 86 5C       STX $5C       ; ???
$80/B374 A2 00 00    LDX #$0000    ; ???
$80/B377 8E C5 0E    STX $0EC5     ; ???
$80/B37A 60          RTS

$80/B37B VRAM Read DMA

$80/B37B AD CE 11    LDA $11CE     ; Load Number of VRAM Read DMAs to do
$80/B37E F0 57       BEQ $57       ; [$B3D7] Exit if empty
$80/B380 AD CB 11    LDA $11CB     ; ???
$80/B383 D0 52       BNE $52       ; [$B3D7] Exit if not empty
$80/B385 A9 81       LDA #$81      ; Transfer from Bus B / Write 2 registers write once
$80/B387 8D 00 43    STA $4300
$80/B38A A9 39       LDA #$39      ; Source Address: $(21)39 - VRAM Read Address
$80/B38C 8D 01 43    STA $4301
$80/B38F A9 80       LDA #$80      ; VRAM Transfer Settings: Increment when Reading from $213A
$80/B391 8D 15 21    STA $2115
$80/B394 A9 7F       LDA #$7F      ; Destination Bank: $7F
$80/B396 8D 04 43    STA $4304
$80/B399 A2 00 FC    LDX #$FC00    ; Destination Address: $(7F/)FC00
$80/B39C A0 00 00    LDY #$0000    ; Setup Loop Counter
$80/B39F AD CE 11    LDA $11CE     ; Load Number of VRAM Read DMAs to do
$80/B3A2 48          PHA           ; Push Number of VRAM Read DMAs to do on Stack
$80/B3A3 C2 20       REP #$20      ; 16-bit A
$80/B3A5 B9 F0 11    LDA $11F0,y   ; Set Number of Bytes to transfer
$80/B3A8 8D 05 43    STA $4305
$80/B3AB 8E 02 43    STX $4302     ; Destination Address: $(7F/)FC00
$80/B3AE B9 D0 11    LDA $11D0,y   ; Set VRAM Destination
$80/B3B1 8D 16 21    STA $2116
$80/B3B4 E2 20       SEP #$20      ; 8-bit A
$80/B3B6 F0 08       BEQ $08       ; [$B3C0] Leave out the 
$80/B3B8 AD 3A 21    LDA $213A     ; ???
$80/B3BB A9 01       LDA #$01      ; Activate DMA
$80/B3BD 8D 0B 42    STA $420B
$80/B3C0 68          PLA           ; Pull Number of VRAM Read DMAs to do from Stack
$80/B3C1 3A          DEC A         ; Decrement Number
$80/B3C2 F0 0E       BEQ $0E       ; [$B3D2] Exit if it has reached zero
$80/B3C4 48          PHA           ; If not, push Number of VRAM Read DMAs to do back on Stack
$80/B3C5 C2 21       REP #$21                A:5003 X:FC00 Y:0000 P:envMxdIzc
$80/B3C7 8A          TXA           ; Transfer Store Index in A
$80/B3C8 79 F0 11    ADC $11F0,y   ; Add the number of transfered bytes
$80/B3CB AA          TAX           ; Transfer back in X - Points now to the next empty byte
$80/B3CC E2 20       SEP #$20      ; 8-bit A
$80/B3CE C8          INY           ; Increment Load Index twice
$80/B3CF C8          INY
$80/B3D0 80 D1       BRA $D1       ; [$B3A3] Loop
$80/B3D2 A9 01       LDA #$01      ; ???
$80/B3D4 8D CB 11    STA $11CB     ; ??? Set flag to not do this again automatically
$80/B3D7 60          RTS

$80/B3D8 ?

$80/B3D8 AD BD 05    LDA $05BD     ; ???
$80/B3DB 89 40       BIT #$40      ; ??? If bit 6 in $05BD is set, this forces a CGRAM update
$80/B3DD D0 05       BNE $05       ; [$B3E4]
$80/B3DF AD 49 12    LDA $1249     ; Is "Update CGRAM" Flag set?
$80/B3E2 F0 26       BEQ $26       ; [$B40A] Exit if not
$80/B3E4 9C 21 21    STZ $2121     ; CGRAM Destination: $00
$80/B3E7 A9 22       LDA #$22      ; DMA Destination: $2122 (= CGRAM)
$80/B3E9 8D 01 43    STA $4301
$80/B3EC A2 00 02    LDX #$0200    ; Transfer #$200 Byte
$80/B3EF 8E 05 43    STX $4305
$80/B3F2 A2 4B 12    LDX #$124B    ; Source: $00124B (CGRAM Buffer)
$80/B3F5 8E 02 43    STX $4302
$80/B3F8 A9 00       LDA #$00
$80/B3FA 8D 04 43    STA $4304
$80/B3FD A9 00       LDA #$00      ; DMA Settings
$80/B3FF 8D 00 43    STA $4300
$80/B402 A9 01       LDA #$01      ; Activate DMA
$80/B404 8D 0B 42    STA $420B
$80/B407 9C 49 12    STZ $1249     ; Clear "Update CGRAM" Flag
$80/B40A 60          RTS

$80/B40B Joypad Data Fetching

$80/B40B AD 12 42    LDA $4212     ; Load PPU-Status
$80/B40E 4A          LSR A         ; Move Bit 0 (Auto-Joypad Status) into Carry
$80/B40F B0 FA       BCS $FA       ; [$B40B] Loop until Auto-Joypad Read is done
$80/B411 A0 00 00    LDY #$0000
$80/B414 A2 00 00    LDX #$0000
$80/B417 B9 18 42    LDA $4218,y
$80/B41A 29 0F       AND #$0F
$80/B41C D0 40       BNE $40       ; [$B45E] I think this is a security measure; if this isn't 0, something's wrong
$80/B41E BF 16 40 00 LDA $004016,x ; ???
$80/B422 29 01       AND #$01
$80/B424 F0 38       BEQ $38       ; [$B45E] Another security measure?
$80/B426 BD 47 05    LDA $0547,x   ; ???
$80/B429 F0 1B       BEQ $1B       ; [$B446]
$80/B42B C2 20       REP #$20
$80/B42D B9 49 05    LDA $0549,y   ; Load Joypad Data from the last frame, store it in $0551,y and push it on stack
$80/B430 99 51 05    STA $0551,y
$80/B433 48          PHA
$80/B434 B9 18 42    LDA $4218,y   ; Load Joypad-Input and store it in $0549-054C
$80/B437 99 49 05    STA $0549,y
$80/B43A 68          PLA
$80/B43B 39 49 05    AND $0549,y   ; Calculate, which buttons are held from the last frame, and store them in $054D,y
$80/B43E 59 49 05    EOR $0549,y
$80/B441 99 4D 05    STA $054D,y
$80/B444 80 26       BRA $26       ; [$B46C] Leave out the "other" Fetching method
$80/B446 A9 01       LDA #$01      ; ???
$80/B448 9D 47 05    STA $0547,x
$80/B44B C2 20       REP #$20
$80/B44D B9 18 42    LDA $4218,y   ; Load Joypad-Input and store it in $0549-054C
$80/B450 99 49 05    STA $0549,y
$80/B453 A9 00 00    LDA #$0000    ; 
$80/B456 99 4D 05    STA $054D,y   ; Clear held buttons
$80/B459 99 51 05    STA $0551,y   ; Clear last frame's Joypad input
$80/B45C 80 0E       BRA $0E       ; [$B46C]
$80/B46C E2 20       SEP #$20
$80/B46E A5 F9       LDA $F9       ; ???
$80/B470 30 12       BMI $12       ; [$B484] If $F9 is negative, no Soft Reset is accepted?
$80/B472 C2 20       REP #$20
$80/B474 B9 49 05    LDA $0549,y   ; Check newly fetched Joypad data
$80/B477 C9 30 30    CMP #$3030    ; Is Start, Select, L + R pressed?
$80/B47A D0 08       BNE $08       ; [$B484]

Code is missing here

$80/B484 E2 20       SEP #$20
$80/B486 C8          INY           ; Increment index registers
$80/B487 C8          INY
$80/B488 E8          INX
$80/B489 E0 02 00    CPX #$0002
$80/B48C 90 89       BCC $89       ; [$B417] Repeat this for the second controller
$80/B48E 60          RTS

$80/B4C8 An IRQ-Handler

This is an IRQ Handler. In Battle. With Battle Stats Menu on.

$80/B4C8 E2 20       SEP #$20
$80/B4CA 48          PHA           ; Buffer A value on stack
$80/B4CB AF 11 42 00 LDA $004211   ; Check if the IRQ flag is set
$80/B4CF 10 72       BPL $72       ; [$B543] If not, branch, pull A from Stack and exit
$80/B4D1 8B          PHB           ; Else, buffer the current Program bank and change  it
$80/B4D2 4B          PHK
$80/B4D3 AB          PLB
$80/B4D4 6C 34 00    JMP ($0034)   ; Jump to the IRQ Handler [$80:B4D7]

$80/B4D7 IRQ: Change Screen Settings during HBLANK

A possibility where the IRQ Handler at $80/B4C8 can jump to

$80/B4D7 AD F0 05    LDA $05F0     ; Load $4209 Buffer (V Timer Low Byte)
$80/B4DA C9 DA       CMP #$DA      ; #$DA = 218, so the third to last scan line visible(?)
$80/B4DC B0 4F       BCS $4F       ; [$B52D] Branch if the Timer is set offscreen
$80/B4DE C2 10       REP #$10      ; X/Y = 16-bit
$80/B4E0 DA          PHX           ; Buffer X, Y and Direct Bank on Stack
$80/B4E1 5A          PHY
$80/B4E2 0B          PHD
$80/B4E3 A2 00 21    LDX #$2100    ; This sets the direct bank to $2100, so every two-digit register is a $21xx register!
$80/B4E6 DA          PHX           ; I guess this is done so the HBLANKs are optimally used
$80/B4E7 2B          PLD
$80/B4E8 A9 09       LDA #$09      ; Prepare value so it can be stored right after the HBLANK
$80/B4EA 2C 12 42    BIT $4212     ; V/HBLANK-Flag register
$80/B4ED 70 FB       BVS $FB       ; [$B4EA] Loop until flag is set (HBLANK begins)
$80/B4EF 2C 12 42    BIT $4212
$80/B4F2 50 FB       BVC $FB       ; [$B4EF] Loop until flag is cleared, HBLANK has just ended
$80/B4F4 64 00       STZ $00       ; $2100 - turn down the Brightness
$80/B4F6 85 05       STA $05       ; $2105 - BG mode 1 with priority bit
$80/B4F8 64 31       STZ $31       ; $2131 - Deactivate color math
$80/B4FA A0 07 00    LDY #$0007    ; Load next bunch of values
$80/B4FD A2 38 38    LDX #$3838
$80/B500 A9 34       LDA #$34
$80/B502 2C 12 42    BIT $4212     ; Wait for the next passing of a HBLANK
$80/B505 70 FB       BVS $FB       ; [$B502]
$80/B507 2C 12 42    BIT $4212
$80/B50A 50 FB       BVC $FB       ; [$B507]
$80/B50C 84 2C       STY $2C       ; $212C - BG1/2/3 (No sprites!) on Main Screen, nothing on subscreen
$80/B50E 86 08       STX $08       ; BG2/3 Tilemap at $3800 in VRAM
$80/B510 85 07       STA $07       ; BG1 Tilemap at $3400
$80/B512 A9 02       LDA #$02      ; BG1 Tiles at $2000
$80/B514 85 0B       STA $0B
$80/B516 AD 6A 05    LDA $056A     ; Restore old brightness settings
$80/B519 85 00       STA $00
$80/B51B 2B          PLD           ; Restore old Direct Bank
$80/B51C A2 2D B5    LDX #$B52D    ; Setting up the Address of the IRQ Handler
$80/B51F 86 34       STX $34       ; For the last part, the IRQ Handler now jumps to $80/B52D
$80/B521 A2 DC 00    LDX #$00DC    ; V Timer on #$DC = (#220, the bottom line) - once executed is enough?
$80/B524 8E 09 42    STX $4209
$80/B527 7A          PLY           ; Restore Y, X and Data Bank
$80/B528 FA          PLX
$80/B529 AB          PLB
$80/B52A 4C 43 B5    JMP $B543     ; Pull A from Stack and RTI

$80/B52D 2C 12 42    BIT $4212     ; V/HBLANK-Flag register
$80/B530 70 FB       BVS $FB       ; [$B52D] Loop until flag is set (HBLANK begins)
$80/B532 2C 12 42    BIT $4212
$80/B535 50 FB       BVC $FB       ; [$B532] Loop until flag is cleared, HBLANK has just ended
$80/B537 9C 00 21    STZ $2100     ; No FBLANK, but screen brightness = 0
$80/B53A AD AF 05    LDA $05AF     ; Deactivate(?) HBLANK
$80/B53D 29 CF       AND #$CF
$80/B53F 8D 00 42    STA $4200
$80/B542 AB          PLB           ; Restore Program Bank and A
$80/B543 68          PLA
$80/B544 40          RTI

$80/B545 Long Jump to Clear Graphic Setup Registers

$80/B545 8B          PHB           ; Buffer Program Bank
$80/B546 4B          PHK           ; Set Program Bank to $80
$80/B547 AB          PLB
$80/B548 20 4D B5    JSR $B54D     ; Clear Graphic Setup Registers
$80/B54B AB          PLB           ; Restore Program Bank
$80/B54C 6B          RTL

$80/B54D Clear Graphic Setup Registers

$80/B54D 9C 33 21    STZ $2133
$80/B550 A9 02       LDA #$02      ; 8x8 and 32x32 sprites
$80/B552 8D 01 21    STA $2101
$80/B555 8D 88 05    STA $0588
$80/B558 A9 09       LDA #$09      ; Mode 1, Priority Bit
$80/B55A 8D 05 21    STA $2105
$80/B55D 8D 89 05    STA $0589
$80/B560 A9 71       LDA #$71      ; BG1 Tilemap at $7000 in VRAM, h mirroring
$80/B562 8D 07 21    STA $2107
$80/B565 8D 8B 05    STA $058B
$80/B568 A9 79       LDA #$79      ; BG2 Tilemap at $7000 in VRAM, h/v mirroring
$80/B56A 8D 08 21    STA $2108
$80/B56D 8D 8C 05    STA $058C
$80/B570 A9 3C       LDA #$3C      ; BG3 Tilemap at $3C00 in VRAM
$80/B572 8D 09 21    STA $2109
$80/B575 8D 8D 05    STA $058D
$80/B578 A9 3C       LDA #$3C      ; BG3 Tilemap at $3C00 in VRAM
$80/B57A 8D 0A 21    STA $210A
$80/B57D 8D 8E 05    STA $058E
$80/B580 A9 00       LDA #$00      ; BG1/2 Tiles at $0000 in VRAM
$80/B582 8D 0B 21    STA $210B
$80/B585 8D 8F 05    STA $058F
$80/B588 A9 55       LDA #$55      ; BG3/4 Tiles at $5000 in VRAM
$80/B58A 8D 0C 21    STA $210C
$80/B58D 8D 90 05    STA $0590
$80/B590 A9 17       LDA #$17      ; BG1-3 and Sprites for Main Screen
$80/B592 8D 2C 21    STA $212C
$80/B595 8D A6 05    STA $05A6
$80/B598 A9 04       LDA #$04      ; BG4 for Subscreen
$80/B59A 8D 2D 21    STA $212D
$80/B59D 8D A7 05    STA $05A7
$80/B5A0 9C A8 05    STZ $05A8     ; Window Mask Registers
$80/B5A3 9C 2E 21    STZ $212E
$80/B5A6 9C A9 05    STZ $05A9
$80/B5A9 9C 2F 21    STZ $212F
$80/B5AC A9 02       LDA #$02
$80/B5AE 8D AA 05    STA $05AA     ; $2130 Buffer - Add subscreen
$80/B5B1 A9 23       LDA #$23
$80/B5B3 8D AB 05    STA $05AB     ; ???
$80/B5B6 A9 E0       LDA #$E0
$80/B5B8 8D AC 05    STA $05AC     ; $2132 Buffer?
$80/B5BB 8D AD 05    STA $05AD     ; $2132 Buffer?
$80/B5BE 8D AE 05    STA $05AE     ; $2132 Buffer?
$80/B5C1 9C 8A 05    STZ $058A     ; Clear $2106 (Mosaic Register)
$80/B5C4 60          RTS

$80/B5C5 ?

$80/B5C5 8B          PHB           ; Buffer Program Bank
$80/B5C6 4B          PHK           ; Set Program Bank to $80
$80/B5C7 AB          PLB
$80/B5C8 20 CD B5    JSR $B5CD  [$80:B5CD]   A:0000 X:0000 Y:0000 P:eNvMxdizc

$80/B5CD ?

This is executed when loading a new map. Some reset of settings, as it seems.

$80/B5CD 64 36       STZ $36    [$00:0036]   A:0000 X:0000 Y:0000 P:eNvMxdizc
$80/B5CF 64 37       STZ $37    [$00:0037]   A:0000 X:0000 Y:0000 P:eNvMxdizc
$80/B5D1 64 59       STZ $59    [$00:0059]   A:0000 X:0000 Y:0000 P:eNvMxdizc
$80/B5D3 64 A2       STZ $A2    [$00:00A2]   A:0000 X:0000 Y:0000 P:eNvMxdizc
$80/B5D5 64 A1       STZ $A1    [$00:00A1]   A:0000 X:0000 Y:0000 P:eNvMxdizc
$80/B5D7 64 ED       STZ $ED    [$00:00ED]   A:0000 X:0000 Y:0000 P:eNvMxdizc
$80/B5D9 64 8E       STZ $8E    [$00:008E]   A:0000 X:0000 Y:0000 P:eNvMxdizc
$80/B5DB A2 FF FF    LDX #$FFFF              A:0000 X:0000 Y:0000 P:eNvMxdizc
$80/B5DE 86 8F       STX $8F    [$00:008F]   A:0000 X:FFFF Y:0000 P:eNvMxdizc
$80/B5E0 A2 DC 00    LDX #$00DC    ; Set V-Count Timer to #220 (off screen)
$80/B5E3 8E EE 05    STX $05EE     ; Set ($4209/A Buffer for next frame?)
$80/B5E6 8E F0 05    STX $05F0     ; Set $4209/A Buffer
$80/B5E9 9C B9 05    STZ $05B9     ; Clear (Frame Counter?)
$80/B5EC 9C BA 05    STZ $05BA  [$80:05BA]   A:0000 X:00DC Y:0000 P:envMxdizc
$80/B5EF 9C BE 05    STZ $05BE  [$80:05BE]   A:0000 X:00DC Y:0000 P:envMxdizc
$80/B5F2 9C BF 05    STZ $05BF     ; Clear Main Jump Table Index
$80/B5F5 9C C0 05    STZ $05C0     ; Clear (another Jump Table Index
$80/B5F8 9C C1 05    STZ $05C1  [$80:05C1]   A:0000 X:00DC Y:0000 P:envMxdizc
$80/B5FB 9C 49 12    STZ $1249     ; Remove Flag for CGRAM Update
$80/B5FE A9 00       LDA #$00                A:0000 X:00DC Y:0000 P:envMxdizc
$80/B600 8F 87 BE 7E STA $7EBE87[$7E:BE87]   A:0000 X:00DC Y:0000 P:envMxdiZc
$80/B604 A9 08       LDA #$08                A:0000 X:00DC Y:0000 P:envMxdiZc
$80/B606 85 67       STA $67    [$00:0067]   A:0008 X:00DC Y:0000 P:envMxdizc
$80/B608 22 36 E8 81 JSL $81E836[$81:E836]   A:0008 X:00DC Y:0000 P:envMxdizc
$80/B60C 22 49 E8 81 JSL $81E849[$81:E849]   A:0008 X:FFFF Y:0000 P:eNvMxdizc
$80/B610 22 C8 8A 81 JSL $818AC8[$81:8AC8]   A:0010 X:00FF Y:00FF P:envMxdiZc
$80/B614 9C CB 11    STZ $11CB  [$80:11CB]   A:00B8 X:0001 Y:00FF P:eNvMxdiZc
$80/B617 9C 69 05    STZ $0569  [$80:0569]   A:00B8 X:0001 Y:00FF P:eNvMxdiZc
$80/B61A C2 20       REP #$20                A:00B8 X:0001 Y:00FF P:eNvMxdiZc
$80/B61C 9C CE 11    STZ $11CE     ; Set number of VRAM Read DMAs to zero
$80/B61F 9C 47 05    STZ $0547  [$80:0547]   A:00B8 X:0001 Y:00FF P:eNvmxdiZc
$80/B622 9C 5B 05    STZ $055B  [$80:055B]   A:00B8 X:0001 Y:00FF P:eNvmxdiZc
$80/B625 A9 00 02    LDA #$0200              A:00B8 X:0001 Y:00FF P:eNvmxdiZc
$80/B628 8D 5D 05    STA $055D  [$80:055D]   A:0200 X:0001 Y:00FF P:envmxdizc
$80/B62B 9C C7 0E    STZ $0EC7     ; Clear VRAM DMA Pipeline Entries
$80/B62E 9C C9 11    STZ $11C9     ; Clear Number of the next free Animation VRAM DMA slot
$80/B631 9C C5 0E    STZ $0EC5  [$80:0EC5]   A:0200 X:0001 Y:00FF P:envmxdizc
$80/B634 9C BB 05    STZ $05BB  [$80:05BB]   A:0200 X:0001 Y:00FF P:envmxdizc
$80/B637 9C C3 05    STZ $05C3  [$80:05C3]   A:0200 X:0001 Y:00FF P:envmxdizc
$80/B63A 9C D6 16    STZ $16D6  [$80:16D6]   A:0200 X:0001 Y:00FF P:envmxdizc
$80/B63D 9C D8 16    STZ $16D8  [$80:16D8]   A:0200 X:0001 Y:00FF P:envmxdizc
$80/B640 A9 00 20    LDA #$2000              A:0200 X:0001 Y:00FF P:envmxdizc
$80/B643 85 5A       STA $5A    [$00:005A]   A:2000 X:0001 Y:00FF P:envmxdizc
$80/B645 85 5C       STA $5C    [$00:005C]   A:2000 X:0001 Y:00FF P:envmxdizc
$80/B647 A9 00 A8    LDA #$A800              A:2000 X:0001 Y:00FF P:envmxdizc
$80/B64A 85 5E       STA $5E    [$00:005E]   A:A800 X:0001 Y:00FF P:eNvmxdizc
$80/B64C A2 00 00    LDX #$0000    ; Setup Loop Counter
$80/B64F 9E 91 05    STZ $0591,x   ; Clear all the BG Scroll Register Buffers
$80/B652 E8          INX
$80/B653 E8          INX
$80/B654 E0 10 00    CPX #$0010
$80/B657 D0 F6       BNE $F6       ; [$B64F]
$80/B659 A2 00 00    LDX #$0000    ; Setup Loop Counter
$80/B65C 9E 71 05    STZ $0571,x   ; Clear all the other BG Scroll Register Buffers
$80/B65F E8          INX
$80/B660 E8          INX
$80/B661 E0 10 00    CPX #$0010
$80/B664 D0 F6       BNE $F6       ; [$B65C]
$80/B666 E2 20       SEP #$20
$80/B668 4C FA B6    JMP $B6FA     ; Clear OAM Buffers

$80/B66B Long Jump to Clear Registers, clear WRAM Bank $7F

$80/B66B 8B          PHB           ; Buffer Program Bank
$80/B66C 4B          PHK           ; Set Program Bank to $80
$80/B66D AB          PLB
$80/B66E 20 73 B6    JSR $B673     ; Clear Registers, clear WRAM Bank $7F
$80/B671 AB          PLB           ; Restore Program Bank
$80/B672 6B          RTL

$80/B673 Clear Registers, clear WRAM Bank $7F

$80/B673 A2 02 42    LDX #$4202    ; Clear $4202 to $420C
$80/B676 A9 0B       LDA #$0B
$80/B678 74 00       STZ $00,x
$80/B67A E8          INX
$80/B67B 3A          DEC A
$80/B67C D0 FA       BNE $FA    [$B678]
$80/B67E A9 FF       LDA #$FF      ; "Programmable I/O Port"
$80/B680 8D 01 42    STA $4201
$80/B683 A2 06 21    LDX #$2106    ; Clear $2106 to $2114
$80/B686 A9 0F       LDA #$0F
$80/B688 74 00       STZ $00,x
$80/B68A 74 00       STZ $00,x
$80/B68C E8          INX
$80/B68D 3A          DEC A
$80/B68E D0 F8       BNE $F8
$80/B690 A9 80       LDA #$80
$80/B692 95 00       STA $00,x  [$00:2115]
$80/B694 A9 01       LDA #$01
$80/B696 A2 1A 21    LDX #$211A    ; Mode 7 Settings
$80/B699 74 00       STZ $00,x     ; Clear a lot of Mode 7 Registers
$80/B69B 74 01       STZ $01,x
$80/B69D 95 01       STA $01,x
$80/B69F 74 02       STZ $02,x
$80/B6A1 74 02       STZ $02,x
$80/B6A3 74 03       STZ $03,x
$80/B6A5 74 03       STZ $03,x
$80/B6A7 74 04       STZ $04,x
$80/B6A9 95 04       STA $04,x
$80/B6AB 74 05       STZ $05,x
$80/B6AD 74 05       STZ $05,x
$80/B6AF 74 06       STZ $06,x
$80/B6B1 74 06       STZ $06,x
$80/B6B3 A2 23 21    LDX #$2123    ; Clear $2123 to $212E
$80/B6B6 A9 0C       LDA #$0C
$80/B6B8 74 00       STZ $00,x
$80/B6BA E8          INX
$80/B6BB 3A          DEC A
$80/B6BC D0 FA       BNE $FA    [$B6B8]
$80/B6BE A2 30 21    LDX #$2130
$80/B6C1 A9 30       LDA #$30
$80/B6C3 95 00       STA $00,x     ; $2130 - Color Addition
$80/B6C5 74 01       STZ $01,x     ; $2131 - Color Subtraction
$80/B6C7 A9 E0       LDA #$E0
$80/B6C9 95 02       STA $02,x     ; $2132 - Fixed Color Data
$80/B6CB 74 03       STZ $03,x     ; $2133 - Screen Mode/Video Select

And then proceeds on the next part

$80/B6CD Set up $7F Clear DMA

$80/B6CD A0 00 00    LDY #$0000    ; Transfer $10000 Byte
$80/B6D0 8C 05 43    STY $4305
$80/B6D3 A0 00 00    LDY #$0000    ; Destination: #$7F:0000
$80/B6D6 38          SEC
$80/B6D7 A2 F1 B6    LDX #$B6F1    ; Position of the Clear Byte: $80/B6F1
$80/B6DA A9 80       LDA #$80
$80/B6DC 20 AB 9D    JSR $9DAB     ; Fixed WRAM Clear DMA

$80/B6DF Set up VRAM Clear DMA

$80/B6DF A0 00 00    LDY #$0000    ; Transfer $10000 Byte
$80/B6E2 8C 05 43    STY $4305
$80/B6E5 A0 00 00    LDY #$0000    ; (VRAM-)Destination: #0000
$80/B6E8 A2 F1 B6    LDX #$B6F1    ; Position of the Clear Byte: $80/B6F1
$80/B6EB A9 80       LDA #$80
$80/B6ED 20 89 9D    JSR $9D89     ; Fixed VRAM Clear DMA
$80/B6F0 60          RTS

$80/B6FA Clear OAM Buffers

$80/B6FA C2 20       REP #$20
$80/B6FC A9 00 E8    LDA #$E800    ; Clear Value for OAM Low Table Buffer
$80/B6FF A2 00 01    LDX #$0100    ; Start Address of the Low Table of OAM Buffer 1
$80/B702 A0 80 00    LDY #$0080    ; Number of Sprites - All Sprites
$80/B705 95 00       STA $00,x     ; Clear OAM Buffer 1 Low Table
$80/B707 E8          INX
$80/B708 E8          INX
$80/B709 74 00       STZ $00,x
$80/B70B E8          INX
$80/B70C E8          INX
$80/B70D 88          DEY           ; Decrement Loop Counter
$80/B70E D0 F5       BNE $F5       ; [$B705] Loop
$80/B710 E2 20       SEP #$20
$80/B712 A2 00 03    LDX #$0300    ; Start Address of the High Table of OAM Buffer 1
$80/B715 A0 20 00    LDY #$0020    ; Number of Bytes to do / High Table Size
$80/B718 74 00       STZ $00,x     ; Clear OAM Buffer 1 High Table
$80/B71A E8          INX
$80/B71B 88          DEY
$80/B71C D0 FA       BNE $FA       ; [$B718]
$80/B71E C2 20       REP #$20
$80/B720 A9 00 E8    LDA #$E800    ; Clear Value for OAM Low Table Buffer
$80/B723 A2 20 03    LDX #$0320    ; Start Address of the Low Table of OAM Buffer 2
$80/B726 A0 80 00    LDY #$0080
$80/B729 95 00       STA $00,x     ; Clear OAM Buffer 2 Low Table
$80/B72B E8          INX
$80/B72C E8          INX
$80/B72D 74 00       STZ $00,x
$80/B72F E8          INX
$80/B730 E8          INX
$80/B731 88          DEY
$80/B732 D0 F5       BNE $F5       ; [$B729]
$80/B734 E2 20       SEP #$20
$80/B736 A2 20 05    LDX #$0520    ; Start Address of the High Table of OAM Buffer 2
$80/B739 A0 20 00    LDY #$0020
$80/B73C 74 00       STZ $00,x     ; Clear OAM Buffer 2 High Table
$80/B73E E8          INX
$80/B73F 88          DEY
$80/B740 D0 FA       BNE $FA       ; [$B73C]
$80/B742 A9 01       LDA #$01      ; Set Flag for an OAM Update
$80/B744 8D 40 05    STA $0540
$80/B747 A9 80       LDA #$80      ; Number of Free sprites in $320(?)
$80/B749 8D 41 05    STA $0541
$80/B74C A2 20 00    LDX #$0020    ; ??? Number of used Sprites in $0100 = $20, $0320 = $00???
$80/B74F 8E 43 05    STX $0543
$80/B752 A2 20 03    LDX #$0320    ; Set the OAM buffer to $0320
$80/B755 8E 45 05    STX $0545
$80/B758 60          RTS

$80/B7D6 ?

$80/B7D6 8B          PHB           ; Buffer Data Bank on Stack
$80/B7D7 4B          PHK           ; Set Data Bank to $80
$80/B7D8 AB          PLB
$80/B7D9 20 DE B7    JSR $B7DE  [$80:B7DE]   A:000B X:0006 Y:87F0 P:eNvMxdizc
$80/B7DC AB          PLB           ; Restore Data Bank from Stack
$80/B7DD 6B          RTL

$80/B7DE ?

$80/B7DE A4 39       LDY $39       ; (Load a Figure number)
$80/B7E0 B9 AE 17    LDA $17AE,y   ; Load Character Sprite
$80/B7E3 C9 F0       CMP #$F0
$80/B7E5 B0 0E       BCS $0E       ; [$B7F5] Branch if Sprite number is higher than #$EF
$80/B7E7 C9 DC       CMP #$DC                A:003B X:0006 Y:0006 P:envMxdizc
$80/B7E9 A9 0C       LDA #$0C                A:003B X:0006 Y:0006 P:envMxdizc
$80/B7EB 90 08       BCC $08    [$B7F5]      A:000C X:0006 Y:0006 P:envMxdizc
code is missing here
$80/B7F5 A6 3B       LDX $3B    [$00:003B]   A:000C X:0006 Y:0006 P:envMxdizc
$80/B7F7 20 7C B8    JSR $B87C  [$80:B87C]   A:000C X:0000 Y:0006 P:envMxdiZc
$80/B7FA 86 3B       STX $3B    [$00:003B]   A:0000 X:0006 Y:0006 P:envMxdiZc
$80/B7FC C2 20       REP #$20                A:0000 X:0006 Y:0006 P:envMxdiZc
$80/B7FE 8A          TXA                     A:0000 X:0006 Y:0006 P:envmxdiZc
$80/B7FF 99 3E 1E    STA $1E3E,y   ; (Value related to figure animation)
$80/B802 E2 20       SEP #$20                A:0006 X:0006 Y:0006 P:envmxdizc
$80/B804 98          TYA                     A:0006 X:0006 Y:0006 P:envMxdizc
$80/B805 9D C4 0B    STA $0BC4,x[$80:0BCA]   A:0006 X:0006 Y:0006 P:envMxdizc
$80/B808 C2 20       REP #$20                A:0006 X:0006 Y:0006 P:envMxdizc
$80/B80A B9 D6 1C    LDA $1CD6,y[$80:1CDC]   A:0006 X:0006 Y:0006 P:envmxdizc
$80/B80D 85 00       STA $00    [$00:0000]   A:0204 X:0006 Y:0006 P:envmxdizc
$80/B80F E2 20       SEP #$20                A:0204 X:0006 Y:0006 P:envmxdizc
$80/B811 B9 C6 1D    LDA $1DC6,y[$80:1DCC]   A:0204 X:0006 Y:0006 P:envMxdizc
$80/B814 0A          ASL A                   A:020B X:0006 Y:0006 P:envMxdizc
$80/B815 85 02       STA $02    [$00:0002]   A:0216 X:0006 Y:0006 P:envMxdizc
$80/B817 BB          TYX                     A:0216 X:0006 Y:0006 P:envMxdizc
$80/B818 22 8C B8 80 JSL $80B88C[$80:B88C]   A:0216 X:0006 Y:0006 P:envMxdizc
$80/B81C 08          PHP                     A:0001 X:0006 Y:0006 P:eNvMxdizc
$80/B81D A0 00 00    LDY #$0000              A:0001 X:0006 Y:0006 P:eNvMxdizc
$80/B820 A6 3B       LDX $3B    [$00:003B]   A:0001 X:0006 Y:0000 P:envMxdiZc
$80/B822 22 C6 81 8B JSL $8B81C6[$8B:81C6]   A:0001 X:0006 Y:0000 P:envMxdizc
$80/B826 A4 39       LDY $39    [$00:0039]   A:0204 X:0006 Y:0000 P:eNvMxdizc
$80/B828 22 F4 B8 80 JSL $80B8F4[$80:B8F4]   A:0204 X:0006 Y:0006 P:envMxdizc
$80/B82C 9D 03 07    STA $0703,x[$80:0709]   A:0006 X:0006 Y:0006 P:eNvMxdizC
$80/B82F 28          PLP                     A:0006 X:0006 Y:0006 P:eNvMxdizC
$80/B830 B0 21       BCS $21    [$B853]      A:0006 X:0006 Y:0006 P:eNvMxdizc
$80/B832 7B          TDC                     A:0006 X:0006 Y:0006 P:eNvMxdizc
$80/B833 B9 6E 1B    LDA $1B6E,y[$80:1B74]   A:0000 X:0006 Y:0006 P:envMxdiZc
$80/B836 A8          TAY                     A:0001 X:0006 Y:0006 P:envMxdizc
$80/B837 B9 6D B8    LDA $B86D,y[$80:B86E]   A:0001 X:0006 Y:0001 P:envMxdizc
$80/B83A 1D 03 07    ORA $0703,x[$80:0709]   A:0040 X:0006 Y:0001 P:envMxdizc
$80/B83D 9D 03 07    STA $0703,x[$80:0709]   A:0046 X:0006 Y:0001 P:envMxdizc
$80/B840 A4 39       LDY $39    [$00:0039]   A:0046 X:0006 Y:0001 P:envMxdizc
$80/B842 B9 AE 17    LDA $17AE,y   ; Load Figure's Character Sprite number
$80/B845 22 DF A3 88 JSL $88A3DF   ; Load Big Sprite Flag for this Character
$80/B849 90 08       BCC $08       ; [$B853] Branch if Figure has no Big Sprite
code is missing here
$80/B853 A5 06       LDA $06    [$00:0006]   A:003B X:0006 Y:0006 P:envMxdizc
$80/B855 E6 06       INC $06    [$00:0006]   A:000B X:0006 Y:0006 P:envMxdizc
$80/B857 9D C3 06    STA $06C3,x[$80:06C9]   A:000B X:0006 Y:0006 P:envMxdizc
$80/B85A BD 03 07    LDA $0703,x[$80:0709]   A:000B X:0006 Y:0006 P:envMxdizc
$80/B85D 29 06       AND #$06                A:0046 X:0006 Y:0006 P:envMxdizc
$80/B85F 9D 43 0C    STA $0C43,x[$80:0C49]   A:0006 X:0006 Y:0006 P:envMxdizc
$80/B862 A9 FF       LDA #$FF                A:0006 X:0006 Y:0006 P:envMxdizc
$80/B864 9D C4 08    STA $08C4,x[$80:08CA]   A:00FF X:0006 Y:0006 P:eNvMxdizc
$80/B867 20 A4 99    JSR $99A4  [$80:99A4]   A:00FF X:0006 Y:0006 P:eNvMxdizc
$80/B86A A6 39       LDX $39    [$00:0039]   A:8102 X:0006 Y:0006 P:envMxdizc
$80/B86C 60          RTS                     A:8102 X:0006 Y:0006 P:envMxdizc

$80/B87C ?

$80/B87C BD 03 06    LDA $0603,x[$80:0607]   A:0006 X:0004 Y:0004 P:envMxdizC
$80/B87F F0 09       BEQ $09       ; [$B88A] Exit if empty
$80/B881 E8          INX                     A:0001 X:0004 Y:0004 P:envMxdizC
$80/B882 E8          INX                     A:0001 X:0005 Y:0004 P:envMxdizC
$80/B883 E0 40 00    CPX #$0040              A:0001 X:0006 Y:0004 P:envMxdizC
$80/B886 90 F4       BCC $F4    [$B87C]      A:0001 X:0006 Y:0004 P:eNvMxdizc
code is missing here
$80/B88A 18          CLC                     A:0000 X:0006 Y:0004 P:envMxdiZc
$80/B88B 60          RTS                     A:0000 X:0006 Y:0004 P:envMxdiZc

$80/B88C ?

$80/B88C 8B          PHB           ; Buffer Data Bank on Stack
$80/B88D 4B          PHK           ; Set Data Bank to $80
$80/B88E AB          PLB
$80/B88F 5A          PHY           ; Buffer Y on Stack
$80/B890 9B          TXY                     A:0003 X:0002 Y:070B P:eNvMxdizc
$80/B891 B9 AE 17    LDA $17AE,y[$80:17B0]   A:0003 X:0002 Y:0002 P:envMxdizc
$80/B894 C9 F0       CMP #$F0                A:0035 X:0002 Y:0002 P:envMxdizc
$80/B896 B0 52       BCS $52    [$B8EA]      A:0035 X:0002 Y:0002 P:envMxdizc
$80/B898 C9 DC       CMP #$DC                A:0035 X:0002 Y:0002 P:envMxdizc
$80/B89A B0 4A       BCS $4A    [$B8E6]      A:0035 X:0002 Y:0002 P:envMxdizc
$80/B89C 7B          TDC                     A:0035 X:0002 Y:0002 P:envMxdizc
$80/B89D B9 D7 1C    LDA $1CD7,y[$80:1CD9]   A:0000 X:0002 Y:0002 P:envMxdiZc
$80/B8A0 C2 20       REP #$20                A:0007 X:0002 Y:0002 P:envMxdizc
$80/B8A2 EB          XBA                     A:0007 X:0002 Y:0002 P:envmxdizc
$80/B8A3 4A          LSR A                   A:0700 X:0002 Y:0002 P:envmxdiZc
$80/B8A4 4A          LSR A                   A:0380 X:0002 Y:0002 P:envmxdizc
$80/B8A5 4A          LSR A                   A:01C0 X:0002 Y:0002 P:envmxdizc
$80/B8A6 E2 20       SEP #$20                A:00E0 X:0002 Y:0002 P:envmxdizc
$80/B8A8 19 D6 1C    ORA $1CD6,y[$80:1CD8]   A:00E0 X:0002 Y:0002 P:envMxdizc
$80/B8AB AA          TAX                     A:00EB X:0002 Y:0002 P:eNvMxdizc
$80/B8AC B9 C7 1D    LDA $1DC7,y[$80:1DC9]   A:00EB X:00EB Y:0002 P:envMxdizc
$80/B8AF 20 7E C2    JSR $C27E  [$80:C27E]   A:0000 X:00EB Y:0002 P:envMxdiZc
$80/B8B2 08          PHP                     A:0003 X:00EB Y:0002 P:envMxdizc
$80/B8B3 B9 AE 17    LDA $17AE,y[$80:17B0]   A:0003 X:00EB Y:0002 P:envMxdizc
$80/B8B6 22 DF A3 88 JSL $88A3DF   ; Load Big Sprite Flag for this Character
$80/B8BA B0 15       BCS $15    [$B8D1]      A:0035 X:00EB Y:0002 P:envMxdizc
$80/B8BC B9 DE 19    LDA $19DE,y[$80:19E0]   A:0035 X:00EB Y:0002 P:envMxdizc
$80/B8BF 89 01       BIT #$01                A:0000 X:00EB Y:0002 P:envMxdiZc
$80/B8C1 F0 05       BEQ $05    [$B8C8]      A:0000 X:00EB Y:0002 P:envMxdiZc
$80/B8C8 28          PLP                     A:0000 X:00EB Y:0002 P:envMxdiZc
$80/B8C9 A9 01       LDA #$01                A:0000 X:00EB Y:0002 P:envMxdizc
$80/B8CB 90 22       BCC $22    [$B8EF]      A:0001 X:00EB Y:0002 P:envMxdizc
code is missing here
$80/B8EF 18          CLC                     A:0001 X:00EB Y:0002 P:envMxdizc
$80/B8F0 BB          TYX                     A:0001 X:00EB Y:0002 P:envMxdizc
$80/B8F1 7A          PLY           ; Restore Y from Stack
$80/B8F2 AB          PLB           ; Restore Data Bank from Stack
$80/B8F3 6B          RTL

$80/B8F4 ?

$80/B8F4 8B          PHB           ; Buffer Data Bank on Stack
$80/B8F5 4B          PHK           ; Set Data Bank to $80
$80/B8F6 AB          PLB
$80/B8F7 DA          PHX           ; Buffer X on Stack
$80/B8F8 BB          TYX                     A:0204 X:0006 Y:0006 P:eNvMxdizc
$80/B8F9 22 4C A5 88 JSL $88A54C[$88:A54C]   A:0204 X:0006 Y:0006 P:envMxdizc
$80/B8FD 90 04       BCC $04    [$B903]      A:0000 X:0006 Y:0006 P:eNvMxdizc
code is missing here
$80/B903 C9 00       CMP #$00                A:0000 X:0006 Y:0006 P:eNvMxdizc
$80/B905 F0 04       BEQ $04    [$B90B]      A:0000 X:0006 Y:0006 P:envMxdiZC
code is missing here
$80/B90B A9 06       LDA #$06                A:0000 X:0006 Y:0006 P:envMxdiZC
$80/B90D FA          PLX           ; Restore X and Data Bank from Stack
$80/B90E AB          PLB
$80/B90F 6B          RTL

$80/B910 ?

$80/B910 8B          PHB           ; Buffer Data Bank on Stack
$80/B911 A9 7E       LDA #$7E      ; Set Data Bank to $7E
$80/B913 48          PHA
$80/B914 AB          PLB
$80/B915 DA          PHX           ; Buffer X and Y on Stack
$80/B916 5A          PHY
$80/B917 A6 5C       LDX $5C    [$00:005C]   A:887E X:0006 Y:87F0 P:envMxdizc
$80/B919 A0 0C 00    LDY #$000C              A:887E X:3911 Y:87F0 P:envMxdizc
$80/B91C C2 20       REP #$20                A:887E X:3911 Y:000C P:envMxdizc
$80/B91E 9E 00 00    STZ $0000,x[$7E:3911]   A:887E X:3911 Y:000C P:envmxdizc
$80/B921 E8          INX                     A:887E X:3911 Y:000C P:envmxdizc
$80/B922 E8          INX                     A:887E X:3912 Y:000C P:envmxdizc
$80/B923 88          DEY                     A:887E X:3913 Y:000C P:envmxdizc
$80/B924 D0 F8       BNE $F8    [$B91E]      A:887E X:3913 Y:000B P:envmxdizc
$80/B926 E2 20       SEP #$20                A:887E X:3929 Y:0000 P:envmxdiZc
$80/B928 A0 00 00    LDY #$0000              A:887E X:3929 Y:0000 P:envMxdiZc
$80/B92B B9 03 06    LDA $0603,y[$7E:0603]   A:887E X:3929 Y:0000 P:envMxdiZc
$80/B92E F0 31       BEQ $31    [$B961]      A:8801 X:3929 Y:0000 P:envMxdizc
$80/B930 C9 61       CMP #$61                A:8801 X:3929 Y:0000 P:envMxdizc
$80/B932 B0 2D       BCS $2D    [$B961]      A:8801 X:3929 Y:0000 P:eNvMxdizc
$80/B934 7B          TDC                     A:8801 X:3929 Y:0000 P:eNvMxdizc
$80/B935 B9 C3 06    LDA $06C3,y[$7E:06C3]   A:0000 X:3929 Y:0000 P:envMxdiZc
$80/B938 C9 08       CMP #$08
$80/B93A 90 25       BCC $25       ; [$B961] Do next entry if value is lower than #$08
$80/B93C C9 20       CMP #$20
$80/B93E B0 21       BCS $21       ; [$B961] Do next entry if value is higher than #$1F
$80/B940 38          SEC                     A:0008 X:3929 Y:0000 P:eNvMxdizc
$80/B941 E9 08       SBC #$08                A:0008 X:3929 Y:0000 P:eNvMxdizC
$80/B943 C2 21       REP #$21                A:0000 X:3929 Y:0000 P:envMxdiZC
$80/B945 18          CLC                     A:0000 X:3929 Y:0000 P:envmxdiZc
$80/B946 65 5C       ADC $5C    [$00:005C]   A:0000 X:3929 Y:0000 P:envmxdiZc
$80/B948 AA          TAX                     A:3911 X:3929 Y:0000 P:envmxdizc
$80/B949 E2 20       SEP #$20                A:3911 X:3911 Y:0000 P:envmxdizc
$80/B94B FE 00 00    INC $0000,x[$7E:3911]   A:3911 X:3911 Y:0000 P:envMxdizc
$80/B94E DA          PHX                     A:3911 X:3911 Y:0000 P:envMxdizc
$80/B94F 7B          TDC           ; Clear 16-bit A
$80/B950 B9 C4 0B    LDA $0BC4,y[$7E:0BC4]   A:0000 X:3911 Y:0000 P:envMxdiZc
$80/B953 AA          TAX                     A:0000 X:3911 Y:0000 P:envMxdiZc
$80/B954 BD AF 17    LDA $17AF,x   ; Load Character Class number
$80/B957 22 DF A3 88 JSL $88A3DF   ; Load Big Sprite Flag for this Character
$80/B95B FA          PLX                     A:0001 X:0000 Y:0000 P:envMxdiZc
$80/B95C 90 03       BCC $03       ; [$B961] Do next entry if the Sprite isn't big
code is missing here
$80/B961 C8          INY           ; Increment Load Index twice
$80/B962 C8          INY
$80/B963 C0 40 00    CPY #$0040
$80/B966 90 C3       BCC $C3       ; [$B92B] Loop until every entry is worked off
$80/B968 7B          TDC                     A:0000 X:3913 Y:0040 P:envMxdiZC
$80/B969 A3 03       LDA $03,s  [$00:1FD2]   A:0000 X:3913 Y:0040 P:envMxdiZC
$80/B96B A8          TAY                     A:0006 X:3913 Y:0040 P:envMxdizC
$80/B96C B9 AF 17    LDA $17AF,y[$7E:17B5]   A:0006 X:3913 Y:0006 P:envMxdizC
$80/B96F 22 DF A3 88 JSL $88A3DF   ; Load Big Sprite Flag for this Character
$80/B973 B0 10       BCS $10    [$B985]      A:003B X:3913 Y:0006 P:envMxdizc
$80/B975 A6 5C       LDX $5C    [$00:005C]   A:003B X:3913 Y:0006 P:envMxdizc
$80/B977 A0 18 00    LDY #$0018              A:003B X:3911 Y:0006 P:envMxdizc
$80/B97A BD 00 00    LDA $0000,x[$7E:3911]   A:003B X:3911 Y:0018 P:envMxdizc
$80/B97D F0 23       BEQ $23    [$B9A2]      A:0001 X:3911 Y:0018 P:envMxdizc
$80/B97F E8          INX                     A:0001 X:3911 Y:0018 P:envMxdizc
$80/B980 88          DEY                     A:0001 X:3912 Y:0018 P:envMxdizc
$80/B981 D0 F7       BNE $F7    [$B97A]      A:0001 X:3912 Y:0017 P:envMxdizc
code is missing here
$80/B9A2 C2 20       REP #$20                A:0000 X:3914 Y:0015 P:envMxdiZc
$80/B9A4 38          SEC                     A:0000 X:3914 Y:0015 P:envmxdiZc
$80/B9A5 8A          TXA                     A:0000 X:3914 Y:0015 P:envmxdiZC
$80/B9A6 E5 5C       SBC $5C    [$00:005C]   A:3914 X:3914 Y:0015 P:envmxdizC
$80/B9A8 E2 20       SEP #$20                A:0003 X:3914 Y:0015 P:envmxdizC
$80/B9AA 18          CLC                     A:0003 X:3914 Y:0015 P:envMxdizC
$80/B9AB 69 08       ADC #$08                A:0003 X:3914 Y:0015 P:envMxdizc
$80/B9AD 18          CLC                     A:000B X:3914 Y:0015 P:envMxdizc
$80/B9AE 7A          PLY           ; Restore Y, X and Data Bank from Stack
$80/B9AF FA          PLX
$80/B9B0 AB          PLB
$80/B9B1 6B          RTL

$80/B9B2 ?

$80/B9B2 8B          PHB           ; Buffer Data Bank on Stack
$80/B9B3 4B          PHK           ; Set Data Bank to $80
$80/B9B4 AB          PLB
$80/B9B5 20 BA B9    JSR $B9BA  [$80:B9BA]   A:0000 X:3300 Y:331A P:eNvMxdizc
$80/B9B8 AB          PLB           : Restore Data Bank
$80/B9B9 6B          RTL

$80/B9BA ?

This subroutine checks all values from $0603 to $0642. If the value in these registers is something else than #$00 or #$C9, it uses that value as index for the Jump Table in the subroutine below this one.

$80/B9BA A2 00 00    LDX #$0000     ; Clear Load Index/Loop counter
$80/B9BD BD 03 06    LDA $0603,x[$80:0603]   A:E801 X:0000 Y:0320 P:envMxdiZC
$80/B9C0 F0 07       BEQ $07        ; [$B9C9] Leave out subroutine if value is #$00
$80/B9C2 C9 C9       CMP #$C9
$80/B9C4 F0 03       BEQ $03        ; [$B9C9] Leave out subroutine if value is #$C9
$80/B9C6 20 D1 B9    JSR $B9D1      ; [$80:B9D1] ? (Use Jump Table)
$80/B9C9 E8          INX            ; Increment Load Index/Loop counter twice
$80/B9CA E8          INX
$80/B9CB E0 40 00    CPX #$0040     ; Is the maximum value reached?
$80/B9CE 90 ED       BCC $ED        ; [$B9BD] Loop
$80/B9D0 60          RTS

$80/B9D1 Use Jump Table

$80/B9D1 86 3B       STX $3B       ; Buffer X value
$80/B9D3 7B          TDC                     A:A1CA X:000C Y:0002 P:envMxdizC
$80/B9D4 BD C3 08    LDA $08C3,x[$80:08CF]   A:0000 X:000C Y:0002 P:envMxdiZC
$80/B9D7 0A          ASL A                   A:0003 X:000C Y:0002 P:envMxdizC
$80/B9D8 A8          TAY                     A:0006 X:000C Y:0002 P:envMxdizc
$80/B9D9 BE E3 B9    LDX $B9E3,y[$80:B9E9]   A:0006 X:000C Y:0006 P:envMxdizc
$80/B9DC 86 00       STX $00    [$00:0000]   A:0006 X:BC4F Y:0006 P:eNvMxdizc
$80/B9DE A6 3B       LDX $3B       ; Restore X value
$80/B9E0 6C 00 00    JMP ($0000)[$80:BC4F]   A:0006 X:000C Y:0006 P:envMxdizc
$80/B9E3 75 BA --- Entry #$00 - $BA75
$80/B9E5 B2 BA --- Entry #$01 - $BAB2
$80/B9E7 DB BA --- Entry #$02 - $BADB
$80/B9E9 4F BC --- Entry #$03 - $BC4F
$80/B9EB 81 BA --- Entry #$04 - $BA81
$80/B9ED 51 BD --- Entry #$05 - $BD51
$80/B9EF 5C BD --- Entry #$06 - $BD5C
$80/B9F1 63 BD --- Entry #$07 - $BD63
$80/B9F3 67 BD --- Entry #$08 - $BD67
$80/B9F5 6E BD --- Entry #$09 - $BD6E
$80/B9F7 78 BD --- Entry #$0A - $BD78
$80/B9F9 87 BD --- Entry #$0B - $BD87
$80/B9FB E0 BC --- Entry #$0C - $BCE0
$80/B9FD 21 BD --- Entry #$0D - $BD21
$80/B9FF 94 BD --- Entry #$0E - $BD94
$80/BA01 89 BA --- Entry #$0F - $BA89
$80/BA03 BE BD --- Entry #$10 - $BDBE
$80/BA05 FF BD --- Entry #$11 - $BDFF
$80/BA07 1D BE --- Entry #$12 - $BE1D
$80/BA09 89 BA --- Entry #$13 - $BA89
$80/BA0B 89 BA --- Entry #$14 - $BA89
$80/BA0D 50 BE --- Entry #$15 - $BE50
$80/BA0F 63 BE --- Entry #$16 - $BE63
$80/BA11 6D BE --- Entry #$17 - $BE6D
$80/BA13 76 BE --- Entry #$18 - $BE76
$80/BA15 8E BA --- Entry #$19 - $BA8E
$80/BA17 A3 BE --- Entry #$1A - $BEA3
$80/BA19 AB BE --- Entry #$1B - $BEAB
$80/BA1B 8E BE --- Entry #$1C - $BE8E
$80/BA1D 95 BE --- Entry #$1D - $BE95
$80/BA1F B9 BE --- Entry #$1E - $BEB9
$80/BA21 D5 BE --- Entry #$1F - $BED5
$80/BA23 08 BF --- Entry #$20 - $BF08
$80/BA25 1C BF --- Entry #$21 - $BF1C
$80/BA27 B9 BE --- Entry #$22 - $BEB9
$80/BA29 D5 BE --- Entry #$23 - $BED5
$80/BA2B 25 BF --- Entry #$24 - $BF25
$80/BA2D B9 BE --- Entry #$25 - $BEB9
$80/BA2F 39 BF --- Entry #$26 - $BF39
$80/BA31 71 BF --- Entry #$27 - $BF71
$80/BA33 B9 BE --- Entry #$28 - $BEB9
$80/BA35 D5 BE --- Entry #$29 - $BED5
$80/BA37 82 BF --- Entry #$2A - $BF82
$80/BA39 13 C0 --- Entry #$2B - $C013
$80/BA3B DD C0 --- Entry #$2C - $C0DD
$80/BA3D 0B C1 --- Entry #$2D - $C10B
$80/BA3F 89 BA --- Entry #$2E - $BA89
$80/BA41 97 BA --- Entry #$2F - $BA97
$80/BA43 9F BB --- Entry #$30 - $BB9F
$80/BA45 44 BB --- Entry #$31 - $BB44
$80/BA47 99 BB --- Entry #$32 - $BB99
$80/BA49 78 C0 --- Entry #$33 - $C078
$80/BA4B AC C0 --- Entry #$34 - $C0AC
$80/BA4D D4 C0 --- Entry #$35 - $C0D4
$80/BA4F 89 BA --- Entry #$36 - $BA89
$80/BA51 89 BA --- Entry #$37 - $BA89
$80/BA53 4B C1 --- Entry #$38 - $C14B
$80/BA55 51 C1 --- Entry #$39 - $C151
$80/BA57 57 C1 --- Entry #$3A - $C157
$80/BA59 5E C1 --- Entry #$3B - $C15E
$80/BA5B 64 C1 --- Entry #$3C - $C164
$80/BA5D 44 BD --- Entry #$3D - $BD44
$80/BA5F 22 C0 --- Entry #$3E - $C022
$80/BA61 39 C0 --- Entry #$3F - $C039
$80/BA63 6B C0 --- Entry #$40 - $C06B
$80/BA65 6F C0 --- Entry #$41 - $C06F
$80/BA67 89 BA --- Entry #$42 - $BA89
$80/BA69 89 BA --- Entry #$43 - $BA89
$80/BA6B 89 BA --- Entry #$44 - $BA89
$80/BA6D 89 BA --- Entry #$45 - $BA89
$80/BA6F EF BF --- Entry #$46 - $BFEF
$80/BA71 0A C0 --- Entry #$47 - $C00A
$80/BA73 B5 BE --- Entry #$48 - $BEB5

$80/BA75 ?

$80/BA75 BD 04 07    LDA $0704,x[$80:0704]   A:0000 X:0000 Y:0000 P:envMxdiZc
$80/BA78 29 FB       AND #$FB                A:0000 X:0000 Y:0000 P:envMxdiZc
$80/BA7A 9D 04 07    STA $0704,x[$80:0704]   A:0000 X:0000 Y:0000 P:envMxdiZc
$80/BA7D 9E 43 08    STZ $0843,x[$80:0843]   A:0000 X:0000 Y:0000 P:envMxdiZc
$80/BA80 60          RTS                     A:0000 X:0000 Y:0000 P:envMxdiZc

$80/BC4F ?

$80/BC4F 7B          TDC                     A:0006 X:0008 Y:0006 P:envMxdizc
$80/BC50 BD C4 08    LDA $08C4,x[$80:08CC]   A:0000 X:0008 Y:0006 P:envMxdiZc
$80/BC53 A8          TAY                     A:0006 X:0008 Y:0006 P:envMxdizc
$80/BC54 B9 03 06    LDA $0603,y[$80:0609]   A:0006 X:0008 Y:0006 P:envMxdizc
$80/BC57 D0 03       BNE $03    [$BC5C]      A:0001 X:0008 Y:0006 P:envMxdizc
$80/BC59 4C DC BC    JMP $BCDC  [$80:BCDC]   A:0000 X:0008 Y:0006 P:envMxdiZc
$80/BC5C 20 29 D9    JSR $D929  [$80:D929]   A:0001 X:0008 Y:0006 P:envMxdizc
$80/BC5F C2 20       REP #$20                A:0001 X:0008 Y:0006 P:envMxdizc
$80/BC61 B9 03 0A    LDA $0A03,y[$80:0A09]   A:0001 X:0008 Y:0006 P:envmxdizc
$80/BC64 9D 03 0A    STA $0A03,x[$80:0A0B]   A:0988 X:0008 Y:0006 P:envmxdizc
$80/BC67 B9 43 0A    LDA $0A43,y[$80:0A49]   A:0988 X:0008 Y:0006 P:envmxdizc
$80/BC6A 9D 43 0A    STA $0A43,x[$80:0A4B]   A:0780 X:0008 Y:0006 P:envmxdizc
$80/BC6D E2 20       SEP #$20                A:0780 X:0008 Y:0006 P:envmxdizc
$80/BC6F 9B          TXY                     A:0780 X:0008 Y:0006 P:envMxdizc
$80/BC70 20 90 DA    JSR $DA90  [$80:DA90]   A:0780 X:0008 Y:0008 P:envMxdizc
$80/BC73 0A          ASL A                   A:0004 X:0008 Y:0008 P:envMxdizC
$80/BC74 9D 84 0A    STA $0A84,x[$80:0A8C]   A:0008 X:0008 Y:0008 P:envMxdizc
$80/BC77 64 00       STZ $00    [$00:0000]   A:0008 X:0008 Y:0008 P:envMxdizc
$80/BC79 85 01       STA $01    [$00:0001]   A:0008 X:0008 Y:0008 P:envMxdizc
$80/BC7B 7B          TDC                     A:0008 X:0008 Y:0008 P:envMxdizc
$80/BC7C BD C4 08    LDA $08C4,x[$80:08CC]   A:0000 X:0008 Y:0008 P:envMxdiZc
$80/BC7F A8          TAY                     A:0006 X:0008 Y:0008 P:envMxdizc
$80/BC80 C2 20       REP #$20                A:0006 X:0008 Y:0006 P:envMxdizc
$80/BC82 B9 83 0A    LDA $0A83,y[$80:0A89]   A:0006 X:0008 Y:0006 P:envmxdizc
$80/BC85 C5 00       CMP $00    [$00:0000]   A:0800 X:0008 Y:0006 P:envmxdizc
$80/BC87 E2 20       SEP #$20                A:0800 X:0008 Y:0006 P:envmxdiZC
$80/BC89 B0 34       BCS $34    [$BCBF]      A:0800 X:0008 Y:0006 P:envMxdiZC
code is missing here
$80/BCBF BD 84 0A    LDA $0A84,x[$80:0A8C]   A:0800 X:0008 Y:0006 P:envMxdiZC
$80/BCC2 D0 04       BNE $04    [$BCC8]      A:0808 X:0008 Y:0006 P:envMxdizC
code is missing here
$80/BCC8 A9 00       LDA #$00                A:0808 X:0008 Y:0006 P:envMxdizC
$80/BCCA 9D 04 07    STA $0704,x[$80:070C]   A:0800 X:0008 Y:0006 P:envMxdiZC
$80/BCCD 9E C3 0C    STZ $0CC3,x[$80:0CCB]   A:0800 X:0008 Y:0006 P:envMxdiZC
$80/BCD0 20 50 D5    JSR $D550  [$80:D550]   A:0800 X:0008 Y:0006 P:envMxdiZC
$80/BCD3 20 A4 99    JSR $99A4  [$80:99A4]   A:08FF X:0008 Y:000A P:eNvMxdizC
$80/BCD6 A9 01       LDA #$01                A:8107 X:0008 Y:000A P:envMxdizc
$80/BCD8 9D 83 0C    STA $0C83,x[$80:0C8B]   A:8101 X:0008 Y:000A P:envMxdizc
$80/BCDB 60          RTS                     A:8101 X:0008 Y:000A P:envMxdizc

$80/BCDC ?

$80/BCDC 9E 03 06    STZ $0603,x[$80:060B]   A:0000 X:0008 Y:0006 P:envMxdiZc
$80/BCDF 60          RTS                     A:0000 X:0008 Y:0006 P:envMxdiZc

$80/BD51 ?

$80/BD51 86 3D       STX $3D    [$00:003D]   A:000A X:0006 Y:000A P:envMxdizc
$80/BD53 FE C3 08    INC $08C3,x[$80:08C9]   A:000A X:0006 Y:000A P:envMxdizc
$80/BD56 20 A7 D1    JSR $D1A7  [$80:D1A7]   A:000A X:0006 Y:000A P:envMxdizc
$80/BD59 20 24 D1    JSR $D124  [$80:D124]   A:00FF X:0006 Y:0002 P:envMxdizc
$80/BD5C 20 9E D0    JSR $D09E  [$80:D09E]   A:0010 X:0006 Y:001A P:envMxdizc
$80/BD5F 20 A4 99    JSR $99A4  [$80:99A4]   A:6201 X:0006 Y:0004 P:envMxdizc
$80/BD62 60          RTS                     A:8107 X:0006 Y:0004 P:envMxdizc

$80/BD63 ?

$80/BD63 20 58 D3    JSR $D358  [$80:D358]   A:000E X:0006 Y:000E P:envMxdizc
$80/BD66 60          RTS                     A:0000 X:0006 Y:0004 P:envMxdiZc

$80/C23F ?

$80/C23F DA          PHX           ; Buffer X and Y on stack
$80/C240 5A          PHY
$80/C241 7B          TDC           ; Clear 16-bit A
$80/C242 BD C4 0B    LDA $0BC4,x[$80:0BCA]   A:0000 X:0006 Y:0004 P:envMxdiZc
$80/C245 A8          TAY                     A:0004 X:0006 Y:0004 P:envMxdizc
$80/C246 BD 44 0A    LDA $0A44,x[$80:0A4A]   A:0004 X:0006 Y:0004 P:envMxdizc
$80/C249 EB          XBA           ; Multiply by #$20
$80/C24A C2 20       REP #$20
$80/C24C 4A          LSR A
$80/C24D 4A          LSR A
$80/C24E 4A          LSR A
$80/C24F E2 20       SEP #$20
$80/C251 1D 04 0A    ORA $0A04,x[$80:0A0A]   A:00E0 X:0006 Y:0004 P:envMxdizc
$80/C254 AA          TAX                     A:00E9 X:0006 Y:0004 P:eNvMxdizc
$80/C255 B9 C7 1D    LDA $1DC7,y[$80:1DCB]   A:00E9 X:00E9 Y:0004 P:envMxdizc
$80/C258 20 7E C2    JSR $C27E  [$80:C27E]   A:0001 X:00E9 Y:0004 P:envMxdizc
$80/C25B 7A          PLY           ; Restore Y and X from stack
$80/C25C FA          PLX
$80/C25D 60          RTS

$80/C276 ?

$80/C276 8B          PHB           ; Buffer Data Bank on Stack
$80/C277 4B          PHK           ; Set Data Bank to $80
$80/C278 AB          PLB
$80/C279 20 7E C2    JSR $C27E  [$80:C27E]   A:0000 X:00EB Y:00EB P:eNvMxdizc
$80/C27C AB          PLB           ; Restore Data Bank from Stack
$80/C27D 6B          RTL

$80/C27E ?

$80/C27E 4A          LSR A                   A:0000 X:00EB Y:070B P:envMxdiZc
$80/C27F 4A          LSR A                   A:0000 X:00EB Y:070B P:envMxdiZc
$80/C280 C9 02       CMP #$02                A:0000 X:00EB Y:070B P:envMxdiZc
$80/C282 D0 0E       BNE $0E    [$C292]      A:0000 X:00EB Y:070B P:eNvMxdizc
$80/C284 22 E1 AD 86 JSL $86ADE1[$86:ADE1]   A:0202 X:0210 Y:0002 P:envMxdiZC
$80/C288 90 08       BCC $08    [$C292]      A:0201 X:0210 Y:0002 P:eNvMxdizc
$80/C28A 7B          TDC           ; Clear 16-bit A
$80/C28B BF 00 C8 7F LDA $7FC800,x ; Load value from the Step Map
$80/C28F 3A          DEC A                   A:000A X:018C Y:000C P:envMxdizC
$80/C290 38          SEC                     A:0009 X:018C Y:000C P:envMxdizC
$80/C291 60          RTS
$80/C292 7B          TDC           ; Clear 16-bit A
$80/C293 BF 00 C8 7F LDA $7FC800,x ; Load value from the Step Map
$80/C297 18          CLC                     A:0003 X:00EB Y:070B P:envMxdizc
$80/C298 60          RTS

$80/C2E0 ?

$80/C2E0 8B          PHB           ; Buffer Data Bank on Stack
$80/C2E1 4B          PHK           ; Set Data Bank to $80
$80/C2E2 AB          PLB
$80/C2E3 20 E8 C2    JSR $C2E8  [$80:C2E8]   A:0007 X:0002 Y:0002 P:eNvMxdizc
$80/C2E6 AB          PLB           ; Restore Data Bank from Stack
$80/C2E7 6B          RTL

$80/C2E8 ?

$80/C2E8 DA          PHX           ; Buffer X and Y on Stack
$80/C2E9 5A          PHY
$80/C2EA D4 00       PEI ($00)     ; Buffer $00/$01 on Stack
$80/C2EC A6 39       LDX $39    [$00:0039]   A:0007 X:0002 Y:0002 P:eNvMxdizc
$80/C2EE BC D6 1C    LDY $1CD6,x[$80:1CD8]   A:0007 X:0002 Y:0002 P:envMxdizc
$80/C2F1 84 00       STY $00    [$00:0000]   A:0007 X:0002 Y:070B P:envMxdizc
$80/C2F3 22 B6 8A 82 JSL $828AB6[$82:8AB6]   A:0007 X:0002 Y:070B P:envMxdizc
$80/C2F7 A5 02       LDA $02    [$00:0002]   A:000B X:0002 Y:070B P:eNvMxdizc
$80/C2F9 9D D6 1C    STA $1CD6,x[$80:1CD8]   A:000B X:0002 Y:070B P:envMxdizc
$80/C2FC A5 03       LDA $03    [$00:0003]   A:000B X:0002 Y:070B P:envMxdizc
$80/C2FE 9D D7 1C    STA $1CD7,x[$80:1CD9]   A:0007 X:0002 Y:070B P:envMxdizc
$80/C301 BD C7 1D    LDA $1DC7,x[$80:1DC9]   A:0007 X:0002 Y:070B P:envMxdizc
$80/C304 48          PHA                     A:0000 X:0002 Y:070B P:envMxdiZc
$80/C305 7B          TDC                     A:0000 X:0002 Y:070B P:envMxdiZc
$80/C306 A5 03       LDA $03    [$00:0003]   A:0000 X:0002 Y:070B P:envMxdiZc
$80/C308 EB          XBA                     A:0007 X:0002 Y:070B P:envMxdizc
$80/C309 C2 20       REP #$20                A:0700 X:0002 Y:070B P:envMxdiZc
$80/C30B 4A          LSR A                   A:0700 X:0002 Y:070B P:envmxdiZc
$80/C30C 4A          LSR A                   A:0380 X:0002 Y:070B P:envmxdizc
$80/C30D 4A          LSR A                   A:01C0 X:0002 Y:070B P:envmxdizc
$80/C30E E2 20       SEP #$20                A:00E0 X:0002 Y:070B P:envmxdizc
$80/C310 05 02       ORA $02    [$00:0002]   A:00E0 X:0002 Y:070B P:envMxdizc
$80/C312 AA          TAX                     A:00EB X:0002 Y:070B P:eNvMxdizc
$80/C313 68          PLA                     A:00EB X:00EB Y:070B P:envMxdizc
$80/C314 20 7E C2    JSR $C27E  [$80:C27E]   A:0000 X:00EB Y:070B P:envMxdiZc
$80/C317 A6 39       LDX $39    [$00:0039]   A:0003 X:00EB Y:070B P:envMxdizc
$80/C319 9D C6 1D    STA $1DC6,x[$80:1DC8]   A:0003 X:0002 Y:070B P:envMxdizc
$80/C31C 22 8C B8 80 JSL $80B88C[$80:B88C]   A:0003 X:0002 Y:070B P:envMxdizc
$80/C320 BC 3E 1E    LDY $1E3E,x[$80:1E40]   A:0001 X:0002 Y:070B P:eNvMxdizc
$80/C323 99 03 06    STA $0603,y[$80:0605]   A:0001 X:0002 Y:0002 P:envMxdizc
$80/C326 BD D6 1C    LDA $1CD6,x[$80:1CD8]   A:0001 X:0002 Y:0002 P:envMxdizc
$80/C329 99 04 0A    STA $0A04,y[$80:0A06]   A:000B X:0002 Y:0002 P:envMxdizc
$80/C32C BD D7 1C    LDA $1CD7,x[$80:1CD9]   A:000B X:0002 Y:0002 P:envMxdizc
$80/C32F 99 44 0A    STA $0A44,y[$80:0A46]   A:0007 X:0002 Y:0002 P:envMxdizc
$80/C332 BD C6 1D    LDA $1DC6,x[$80:1DC8]   A:0007 X:0002 Y:0002 P:envMxdizc
$80/C335 0A          ASL A                   A:0003 X:0002 Y:0002 P:envMxdizc
$80/C336 99 84 0A    STA $0A84,y[$80:0A86]   A:0006 X:0002 Y:0002 P:envMxdizc
$80/C339 B9 03 07    LDA $0703,y[$80:0705]   A:0006 X:0002 Y:0002 P:envMxdizc
$80/C33C 29 BF       AND #$BF                A:0004 X:0002 Y:0002 P:envMxdizc
$80/C33E 85 00       STA $00    [$00:0000]   A:0004 X:0002 Y:0002 P:envMxdizc
$80/C340 BD 6E 1B    LDA $1B6E,x[$80:1B70]   A:0004 X:0002 Y:0002 P:envMxdizc
$80/C343 4A          LSR A                   A:0001 X:0002 Y:0002 P:envMxdizc
$80/C344 90 04       BCC $04    [$C34A]      A:0000 X:0002 Y:0002 P:envMxdiZC
$80/C346 A9 40       LDA #$40                A:0000 X:0002 Y:0002 P:envMxdiZC
$80/C348 04 00       TSB $00    [$00:0000]   A:0040 X:0002 Y:0002 P:envMxdizC
$80/C34A A5 00       LDA $00    [$00:0000]   A:0040 X:0002 Y:0002 P:envMxdiZC
$80/C34C 99 03 07    STA $0703,y[$80:0705]   A:0044 X:0002 Y:0002 P:envMxdizC
$80/C34F A9 01       LDA #$01                A:0044 X:0002 Y:0002 P:envMxdizC
$80/C351 99 43 08    STA $0843,y[$80:0845]   A:0001 X:0002 Y:0002 P:envMxdizC
$80/C354 BB          TYX                     A:0001 X:0002 Y:0002 P:envMxdizC
$80/C355 20 A4 99    JSR $99A4  [$80:99A4]   A:0001 X:0002 Y:0002 P:envMxdizC
$80/C358 A6 39       LDX $39    [$00:0039]   A:8107 X:0002 Y:0002 P:envMxdizc
$80/C35A 20 75 88    JSR $8875  [$80:8875]   A:8107 X:0002 Y:0002 P:envMxdizc
$80/C35D 7A          PLY           ; Restore $00/$01 from Stack
$80/C35E 84 00       STY $00
$80/C360 7A          PLY           ; Restore Y and X from Stack
$80/C361 FA          PLX
$80/C362 60          RTS

$80/C363 ?

$80/C363 7B          TDC                     A:0007 X:0006 Y:001A P:envMxdizc
$80/C364 BD 83 08    LDA $0883,x[$80:0889]   A:0000 X:0006 Y:001A P:envMxdiZc
$80/C367 0A          ASL A                   A:0000 X:0006 Y:001A P:envMxdiZc
$80/C368 AA          TAX                     A:0000 X:0006 Y:001A P:envMxdiZc
$80/C369 FC 6D C3    JSR ($C36D,x)[$80:C375] A:0000 X:0000 Y:001A P:envMxdiZc
$80/C36C 60          RTS                     A:0988 X:0006 Y:001A P:envMxdizc

$80/C36D ? Jump Table for the subroutine above

$80/C36D 75 C3 --- Entry #00, $80/C375
$80/C36F A3 C3 --- Entry #01, $80/C3A3
$80/C371 8B C3 --- Entry #02, $80/C38B
$80/C373 B9 C3 --- Entry #03, $80/C3B9

$80/C375 ?

$80/C375 A6 3B       LDX $3B    [$00:003B]   A:0000 X:0000 Y:001A P:envMxdiZc
$80/C377 C2 20       REP #$20      ; A = 16-bit
$80/C379 BD 03 0A    LDA $0A03,x[$80:0A09]   A:0000 X:0006 Y:001A P:envmxdizc
$80/C37C C9 80 20    CMP #$2080              A:0980 X:0006 Y:001A P:envmxdizc
$80/C37F B0 07       BCS $07       ; [$C388] Exit
$80/C381 18          CLC                     A:0980 X:0006 Y:001A P:eNvmxdizc
$80/C382 7D C3 0A    ADC $0AC3,x[$80:0AC9]   A:0980 X:0006 Y:001A P:eNvmxdizc
$80/C385 9D 03 0A    STA $0A03,x[$80:0A09]   A:0988 X:0006 Y:001A P:envmxdizc
$80/C388 E2 20       SEP #$20      ; A = 8-bit
$80/C38A 60          RTS

$80/C38B ?

$80/C38B A6 3B       LDX $3B    [$00:003B]   A:0004 X:0004 Y:000C P:envMxdizc
$80/C38D C2 20       REP #$20      ; A = 16-bit
$80/C38F BD 03 0A    LDA $0A03,x[$80:0A0D]   A:0004 X:000A Y:000C P:envmxdizc
$80/C392 C9 80 01    CMP #$0180              A:0580 X:000A Y:000C P:envmxdizc
$80/C395 90 09       BCC $09       ; [$C3A0] Exit
$80/C397 F0 07       BEQ $07       ; [$C3A0] Exit if equal
$80/C399 38          SEC                     A:0580 X:000A Y:000C P:envmxdizC
$80/C39A FD C3 0A    SBC $0AC3,x[$80:0ACD]   A:0580 X:000A Y:000C P:envmxdizC
$80/C39D 9D 03 0A    STA $0A03,x[$80:0A0D]   A:0578 X:000A Y:000C P:envmxdizC
$80/C3A0 E2 20       SEP #$20      ; A = 8-bit
$80/C3A2 60          RTS

$80/C3A3 ?

$80/C3A3 A6 3B       LDX $3B    [$00:003B]   A:0002 X:0002 Y:001A P:envMxdizc
$80/C3A5 C2 20       REP #$20      ; A = 16-bit
$80/C3A7 BD 43 0A    LDA $0A43,x[$80:0A4D]   A:0002 X:000A Y:001A P:envmxdizc
$80/C3AA C9 80 20    CMP #$2080              A:0280 X:000A Y:001A P:envmxdizc
$80/C3AD B0 07       BCS $07       ; [$C3B6] Exit
$80/C3AF 18          CLC                     A:0280 X:000A Y:001A P:eNvmxdizc
$80/C3B0 7D 03 0B    ADC $0B03,x[$80:0B0D]   A:0280 X:000A Y:001A P:eNvmxdizc
$80/C3B3 9D 43 0A    STA $0A43,x[$80:0A4D]   A:0288 X:000A Y:001A P:envmxdizc
$80/C3B6 E2 20       SEP #$20      ; A = 8-bit
$80/C3B8 60          RTS

$80/C3B9 ?

$80/C3B9 A6 3B       LDX $3B    [$00:003B]   A:0006 X:0006 Y:000C P:envMxdizc
$80/C3BB C2 20       REP #$20      ; A = 16-bit
$80/C3BD BD 43 0A    LDA $0A43,x[$80:0A51]   A:0006 X:000E Y:000C P:envmxdizc
$80/C3C0 C9 80 01    CMP #$0180              A:0680 X:000E Y:000C P:envmxdizc
$80/C3C3 90 09       BCC $09       ; [$C3CE] Exit
$80/C3C5 F0 07       BEQ $07       ; [$C3CE] Exit if equal
$80/C3C7 38          SEC                     A:0680 X:000E Y:000C P:envmxdizC
$80/C3C8 FD 03 0B    SBC $0B03,x[$80:0B11]   A:0680 X:000E Y:000C P:envmxdizC
$80/C3CB 9D 43 0A    STA $0A43,x[$80:0A51]   A:0678 X:000E Y:000C P:envmxdizC
$80/C3CE E2 20       SEP #$20      ; A = 8-bit
$80/C3D0 60          RTS

$80/C3D1 ?

$80/C3D1 BD 43 0B    LDA $0B43,x[$80:0B49]   A:0006 X:0006 Y:0000 P:envMxdizC
$80/C3D4 18          CLC                     A:00FF X:0006 Y:0000 P:eNvMxdizC
$80/C3D5 7D C3 0B    ADC $0BC3,x[$80:0BC9]   A:00FF X:0006 Y:0000 P:eNvMxdizc
$80/C3D8 9D C3 0B    STA $0BC3,x[$80:0BC9]   A:00FF X:0006 Y:0000 P:eNvMxdizc
$80/C3DB 7B          TDC                     A:00FF X:0006 Y:0000 P:eNvMxdizc
$80/C3DC BD 44 0B    LDA $0B44,x[$80:0B4A]   A:0000 X:0006 Y:0000 P:envMxdiZc
$80/C3DF 10 03       BPL $03    [$C3E4]      A:00FF X:0006 Y:0000 P:eNvMxdizc
$80/C3E1 EB          XBA                     A:00FF X:0006 Y:0000 P:eNvMxdizc
$80/C3E2 3A          DEC A                   A:FF00 X:0006 Y:0000 P:envMxdiZc
$80/C3E3 EB          XBA                     A:FFFF X:0006 Y:0000 P:eNvMxdizc
$80/C3E4 C2 20       REP #$20                A:FFFF X:0006 Y:0000 P:eNvMxdizc
$80/C3E6 0A          ASL A                   A:FFFF X:0006 Y:0000 P:eNvmxdizc
$80/C3E7 0A          ASL A                   A:FFFE X:0006 Y:0000 P:eNvmxdizC
$80/C3E8 18          CLC                     A:FFFC X:0006 Y:0000 P:eNvmxdizC
$80/C3E9 7D 83 0A    ADC $0A83,x[$80:0A89]   A:FFFC X:0006 Y:0000 P:eNvmxdizc
$80/C3EC 9D 83 0A    STA $0A83,x[$80:0A89]   A:07FC X:0006 Y:0000 P:envmxdizC
$80/C3EF BD 43 0B    LDA $0B43,x[$80:0B49]   A:07FC X:0006 Y:0000 P:envmxdizC
$80/C3F2 08          PHP                     A:FFFF X:0006 Y:0000 P:eNvmxdizC
$80/C3F3 38          SEC                     A:FFFF X:0006 Y:0000 P:eNvmxdizC
$80/C3F4 E9 00 08    SBC #$0800              A:FFFF X:0006 Y:0000 P:eNvmxdizC
$80/C3F7 30 05       BMI $05    [$C3FE]      A:F7FF X:0006 Y:0000 P:eNvmxdizC
code is missing here
$80/C3FE 28          PLP                     A:F7FF X:0006 Y:0000 P:eNvmxdizC
$80/C3FF 9D 43 0B    STA $0B43,x[$80:0B49]   A:F7FF X:0006 Y:0000 P:eNvmxdizC
$80/C402 E2 20       SEP #$20                A:F7FF X:0006 Y:0000 P:eNvmxdizC
$80/C404 60          RTS                     A:F7FF X:0006 Y:0000 P:eNvMxdizC

$80/CE21 ?

$80/CE21 9B          TXY                     A:FFFF X:0006 Y:0006 P:eNvMxdizC
$80/CE22 20 7C B8    JSR $B87C  [$80:B87C]   A:FFFF X:0006 Y:0006 P:envMxdizC
$80/CE25 90 03       BCC $03    [$CE2A]      A:FF00 X:0008 Y:0006 P:envMxdiZc
code is missing here
$80/CE2A 86 3B       STX $3B    [$00:003B]   A:FF00 X:0008 Y:0006 P:envMxdiZc
$80/CE2C B9 04 0A    LDA $0A04,y[$80:0A0A]   A:FF00 X:0008 Y:0006 P:envMxdiZc
$80/CE2F 85 00       STA $00    [$00:0000]   A:FF09 X:0008 Y:0006 P:envMxdizc
$80/CE31 B9 44 0A    LDA $0A44,y[$80:0A4A]   A:FF09 X:0008 Y:0006 P:envMxdizc
$80/CE34 85 01       STA $01    [$00:0001]   A:FF07 X:0008 Y:0006 P:envMxdizc
$80/CE36 B9 84 0A    LDA $0A84,y[$80:0A8A]   A:FF07 X:0008 Y:0006 P:envMxdizc
$80/CE39 85 02       STA $02    [$00:0002]   A:FF08 X:0008 Y:0006 P:envMxdizc
$80/CE3B 5A          PHY                     A:FF08 X:0008 Y:0006 P:envMxdizc
$80/CE3C A0 03 00    LDY #$0003              A:FF08 X:0008 Y:0006 P:envMxdizc
$80/CE3F A9 CA       LDA #$CA                A:FF08 X:0008 Y:0003 P:envMxdizc
$80/CE41 22 C6 81 8B JSL $8B81C6[$8B:81C6]   A:FFCA X:0008 Y:0003 P:eNvMxdizc
$80/CE45 7A          PLY                     A:0709 X:0008 Y:0003 P:eNvMxdizc
$80/CE46 98          TYA                     A:0709 X:0008 Y:0006 P:envMxdizc
$80/CE47 9D C4 08    STA $08C4,x[$80:08CC]   A:0706 X:0008 Y:0006 P:envMxdizc
$80/CE4A A5 09       LDA $09    [$00:0009]   A:0706 X:0008 Y:0006 P:envMxdizc
$80/CE4C 29 38       AND #$38                A:0706 X:0008 Y:0006 P:envMxdizc
$80/CE4E 09 06       ORA #$06                A:0700 X:0008 Y:0006 P:envMxdiZc
$80/CE50 9D 03 07    STA $0703,x[$80:070B]   A:0706 X:0008 Y:0006 P:envMxdizc
$80/CE53 B9 C4 0B    LDA $0BC4,y[$80:0BCA]   A:0706 X:0008 Y:0006 P:envMxdizc
$80/CE56 9D C4 0B    STA $0BC4,x[$80:0BCC]   A:0704 X:0008 Y:0006 P:envMxdizc
$80/CE59 9E 83 0C    STZ $0C83,x[$80:0C8B]   A:0704 X:0008 Y:0006 P:envMxdizc
$80/CE5C 9E C3 0C    STZ $0CC3,x[$80:0CCB]   A:0704 X:0008 Y:0006 P:envMxdizc
$80/CE5F 20 A4 99    JSR $99A4  [$80:99A4]   A:0704 X:0008 Y:0006 P:envMxdizc
$80/CE62 20 9A 9B    JSR $9B9A  [$80:9B9A]   A:8107 X:0008 Y:0006 P:envMxdizc
$80/CE65 60          RTS                     A:FFFF X:0008 Y:0008 P:eNvMxdizC

$80/CE66 ?

$80/CE66 8B          PHB           ; Buffer Program Bank on stack
$80/CE67 4B          PHK           ; Set Program Bank to $80
$80/CE68 AB          PLB
$80/CE69 48          PHA           ; Buffer 16-bit A on stack
$80/CE6A EB          XBA
$80/CE6B 48          PHA
$80/CE6C A6 91       LDX $91    [$00:0091]   A:0000 X:0004 Y:339D P:envMxdiZC
$80/CE6E BD DF 19    LDA $19DF,x[$80:19E3]   A:0000 X:0004 Y:339D P:envMxdizC
$80/CE71 89 40       BIT #$40                A:0040 X:0004 Y:339D P:envMxdizC
$80/CE73 D0 08       BNE $08    [$CE7D]      A:0040 X:0004 Y:339D P:envMxdizC
code is missing here
$80/CE7D BC 3E 1E    LDY $1E3E,x[$80:1E42]   A:0040 X:0004 Y:339D P:envMxdizC
$80/CE80 B9 04 07    LDA $0704,y[$80:0708]   A:0040 X:0004 Y:0004 P:envMxdizC
$80/CE83 09 01       ORA #$01                A:0000 X:0004 Y:0004 P:envMxdiZC
$80/CE85 99 04 07    STA $0704,y[$80:0708]   A:0001 X:0004 Y:0004 P:envMxdizC
$80/CE88 B9 03 07    LDA $0703,y[$80:0707]   A:0001 X:0004 Y:0004 P:envMxdizC
$80/CE8B 85 09       STA $09    [$00:0009]   A:0006 X:0004 Y:0004 P:envMxdizC
$80/CE8D BB          TYX                     A:0006 X:0004 Y:0004 P:envMxdizC
$80/CE8E 20 7C B8    JSR $B87C  [$80:B87C]   A:0006 X:0004 Y:0004 P:envMxdizC
$80/CE91 90 03       BCC $03    [$CE96]      A:0000 X:0006 Y:0004 P:envMxdiZc
code is missing here
$80/CE96 8A          TXA                     A:0000 X:0006 Y:0004 P:envMxdiZc
$80/CE97 99 C4 08    STA $08C4,y[$80:08C8]   A:0006 X:0006 Y:0004 P:envMxdizc
$80/CE9A B9 04 0A    LDA $0A04,y[$80:0A08]   A:0006 X:0006 Y:0004 P:envMxdizc
$80/CE9D 85 00       STA $00    [$00:0000]   A:0009 X:0006 Y:0004 P:envMxdizc
$80/CE9F B9 44 0A    LDA $0A44,y[$80:0A48]   A:0009 X:0006 Y:0004 P:envMxdizc
$80/CEA2 85 01       STA $01    [$00:0001]   A:0007 X:0006 Y:0004 P:envMxdizc
$80/CEA4 B9 84 0A    LDA $0A84,y[$80:0A88]   A:0007 X:0006 Y:0004 P:envMxdizc
$80/CEA7 85 02       STA $02    [$00:0002]   A:0008 X:0006 Y:0004 P:envMxdizc
$80/CEA9 7B          TDC                     A:0008 X:0006 Y:0004 P:envMxdizc
$80/CEAA B9 C4 0B    LDA $0BC4,y[$80:0BC8]   A:0000 X:0006 Y:0004 P:envMxdiZc
$80/CEAD 48          PHA                     A:0004 X:0006 Y:0004 P:envMxdizc
$80/CEAE DA          PHX                     A:0004 X:0006 Y:0004 P:envMxdizc
$80/CEAF AA          TAX                     A:0004 X:0006 Y:0004 P:envMxdizc
$80/CEB0 22 D9 A5 88 JSL $88A5D9[$88:A5D9]   A:0004 X:0004 Y:0004 P:envMxdizc
$80/CEB4 C9 14       CMP #$14                A:0001 X:0004 Y:0004 P:envMxdizc
$80/CEB6 D0 02       BNE $02    [$CEBA]      A:0001 X:0004 Y:0004 P:eNvMxdizc
code is missing here
$80/CEBA FA          PLX                     A:0001 X:0004 Y:0004 P:eNvMxdizc
$80/CEBB A0 01 00    LDY #$0001              A:0001 X:0006 Y:0004 P:envMxdizc
$80/CEBE 22 C6 81 8B JSL $8B81C6[$8B:81C6]   A:0001 X:0006 Y:0001 P:envMxdizc
$80/CEC2 68          PLA                     A:0709 X:0006 Y:0001 P:eNvMxdizc
$80/CEC3 9D C4 0B    STA $0BC4,x[$80:0BCA]   A:0704 X:0006 Y:0001 P:envMxdizc
$80/CEC6 68          PLA                     A:0704 X:0006 Y:0001 P:envMxdizc
$80/CEC7 9D 04 0E    STA $0E04,x[$80:0E0A]   A:0700 X:0006 Y:0001 P:envMxdiZc
$80/CECA 68          PLA                     A:0700 X:0006 Y:0001 P:envMxdiZc
$80/CECB 9D 03 0E    STA $0E03,x[$80:0E09]   A:0700 X:0006 Y:0001 P:envMxdiZc
$80/CECE A5 09       LDA $09    [$00:0009]   A:0700 X:0006 Y:0001 P:envMxdiZc
$80/CED0 9D 03 07    STA $0703,x[$80:0709]   A:0706 X:0006 Y:0001 P:envMxdizc
$80/CED3 A9 05       LDA #$05                A:0706 X:0006 Y:0001 P:envMxdizc
$80/CED5 9D C3 08    STA $08C3,x[$80:08C9]   A:0705 X:0006 Y:0001 P:envMxdizc
$80/CED8 A9 00       LDA #$00                A:0705 X:0006 Y:0001 P:envMxdizc
$80/CEDA 9D 44 06    STA $0644,x[$80:064A]   A:0700 X:0006 Y:0001 P:envMxdiZc
$80/CEDD AD EC 1E    LDA $1EEC  [$80:1EEC]   A:0700 X:0006 Y:0001 P:envMxdiZc
$80/CEE0 9D C3 06    STA $06C3,x[$80:06C9]   A:0720 X:0006 Y:0001 P:envMxdizc
$80/CEE3 A9 01       LDA #$01                A:0720 X:0006 Y:0001 P:envMxdizc
$80/CEE5 9D 04 09    STA $0904,x[$80:090A]   A:0701 X:0006 Y:0001 P:envMxdizc
$80/CEE8 A9 10       LDA #$10                A:0701 X:0006 Y:0001 P:envMxdizc
$80/CEEA 9D 84 08    STA $0884,x[$80:088A]   A:0710 X:0006 Y:0001 P:envMxdizc
$80/CEED A4 91       LDY $91    [$00:0091]   A:0710 X:0006 Y:0001 P:envMxdizc
$80/CEEF B9 C7 1D    LDA $1DC7,y[$80:1DCB]   A:0710 X:0006 Y:0004 P:envMxdizc
$80/CEF2 4A          LSR A                   A:0701 X:0006 Y:0004 P:envMxdizc
$80/CEF3 4A          LSR A                   A:0700 X:0006 Y:0004 P:envMxdiZC
$80/CEF4 C9 03       CMP #$03                A:0700 X:0006 Y:0004 P:envMxdiZc
$80/CEF6 D0 12       BNE $12    [$CF0A]      A:0700 X:0006 Y:0004 P:eNvMxdizc
code is missing here
$80/CF0A B9 C7 1D    LDA $1DC7,y[$80:1DCB]   A:0700 X:0006 Y:0004 P:eNvMxdizc
$80/CF0D 29 03       AND #$03                A:0701 X:0006 Y:0004 P:envMxdizc
$80/CF0F C9 02       CMP #$02                A:0701 X:0006 Y:0004 P:envMxdizc
$80/CF11 D0 0A       BNE $0A    [$CF1D]      A:0701 X:0006 Y:0004 P:eNvMxdizc
code is missing here
$80/CF1D BD 04 0E    LDA $0E04,x[$80:0E0A]   A:0701 X:0006 Y:0004 P:eNvMxdizc
$80/CF20 9D C3 0C    STA $0CC3,x[$80:0CC9]   A:0700 X:0006 Y:0004 P:envMxdiZc
$80/CF23 A5 61       LDA $61    [$00:0061]   A:0700 X:0006 Y:0004 P:envMxdiZc
$80/CF25 9D 43 0E    STA $0E43,x[$80:0E49]   A:070A X:0006 Y:0004 P:envMxdizc
$80/CF28 A5 63       LDA $63    [$00:0063]   A:070A X:0006 Y:0004 P:envMxdizc
$80/CF2A 9D 44 0E    STA $0E44,x[$80:0E4A]   A:0707 X:0006 Y:0004 P:envMxdizc
$80/CF2D A5 08       LDA $08    [$00:0008]   A:0707 X:0006 Y:0004 P:envMxdizc
$80/CF2F F0 3D       BEQ $3D    [$CF6E]      A:0700 X:0006 Y:0004 P:envMxdiZc
code is missing here
$80/CF6E 20 A4 99    JSR $99A4  [$80:99A4]   A:0700 X:0006 Y:0004 P:envMxdiZc
$80/CF71 20 9A 9B    JSR $9B9A  [$80:9B9A]   A:8107 X:0006 Y:0004 P:envMxdizc
$80/CF74 DA          PHX                     A:FFFF X:0006 Y:0006 P:eNvMxdizC
$80/CF75 20 21 CE    JSR $CE21  [$80:CE21]   A:FFFF X:0006 Y:0006 P:eNvMxdizC
$80/CF78 FA          PLX           ; Restore Original 16-bit A in X from stack
$80/CF79 AB          PLB           ; Restore Program Bank from stack
$80/CF7A 6B          RTL

$80/CF7B ?

$80/CF7B 7B          TDC                     A:00FF X:0006 Y:0002 P:envMxdiZC
$80/CF7C BD C4 0B    LDA $0BC4,x[$80:0BCA]   A:0000 X:0006 Y:0002 P:envMxdiZC
$80/CF7F A8          TAY                     A:0004 X:0006 Y:0002 P:envMxdizC
$80/CF80 84 39       STY $39    [$00:0039]   A:0004 X:0006 Y:0004 P:envMxdizC
$80/CF82 7B          TDC                     A:0004 X:0006 Y:0004 P:envMxdizC
$80/CF83 BD 04 0E    LDA $0E04,x[$80:0E0A]   A:0000 X:0006 Y:0004 P:envMxdiZC
$80/CF86 AA          TAX                     A:0002 X:0006 Y:0004 P:envMxdizC
$80/CF87 BF DF D2 7E LDA $7ED2DF,x[$7E:D2E1] A:0002 X:0002 Y:0004 P:envMxdizC
$80/CF8B C9 FF       CMP #$FF                A:00FF X:0002 Y:0004 P:eNvMxdizC
$80/CF8D F0 04       BEQ $04    [$CF93]      A:00FF X:0002 Y:0004 P:envMxdiZC
code is missing here
$80/CF93 CA          DEX                     A:00FF X:0002 Y:0004 P:envMxdiZC
$80/CF94 BF DF D2 7E LDA $7ED2DF,x[$7E:D2E0] A:00FF X:0001 Y:0004 P:envMxdizC
$80/CF98 99 6E 1B    STA $1B6E,y[$80:1B72]   A:0000 X:0001 Y:0004 P:envMxdiZC
$80/CF9B A6 3B       LDX $3B    [$00:003B]   A:0000 X:0001 Y:0004 P:envMxdiZC
$80/CF9D BD 43 0E    LDA $0E43,x[$80:0E49]   A:0000 X:0006 Y:0004 P:envMxdizC
$80/CFA0 85 02       STA $02    [$00:0002]   A:000A X:0006 Y:0004 P:envMxdizC
$80/CFA2 BD 44 0E    LDA $0E44,x[$80:0E4A]   A:000A X:0006 Y:0004 P:envMxdizC
$80/CFA5 85 03       STA $03    [$00:0003]   A:0007 X:0006 Y:0004 P:envMxdizC
$80/CFA7 20 E8 C2    JSR $C2E8  [$80:C2E8]   A:0007 X:0006 Y:0004 P:envMxdizC
$80/CFAA A6 3B       LDX $3B    [$00:003B]   A:8134 X:0006 Y:0004 P:envMxdizc
$80/CFAC 20 78 DA    JSR $DA78  [$80:DA78]   A:8134 X:0006 Y:0004 P:envMxdizc
$80/CFAF 60          RTS                     A:0001 X:0006 Y:0004 P:envMxdizc

$80/CFB0 ?

$80/CFB0 7B          TDC                     A:0010 X:0016 Y:0010 P:envMxdizc
$80/CFB1 BD C4 08    LDA $08C4,x[$80:08DA]   A:0000 X:0016 Y:0010 P:envMxdiZc
$80/CFB4 A8          TAY                     A:0012 X:0016 Y:0010 P:envMxdizc
$80/CFB5 B9 03 06    LDA $0603,y[$80:0615]   A:0012 X:0016 Y:0012 P:envMxdizc
$80/CFB8 D0 03       BNE $03    [$CFBD]      A:0006 X:0016 Y:0012 P:envMxdizc
code is missing here
$80/CFBD C2 20       REP #$20                A:0006 X:0016 Y:0012 P:envMxdizc
$80/CFBF 38          SEC                     A:0006 X:0016 Y:0012 P:envmxdizc
$80/CFC0 B9 83 0A    LDA $0A83,y[$80:0A95]   A:0006 X:0016 Y:0012 P:envmxdizC
$80/CFC3 FD 83 0A    SBC $0A83,x[$80:0A99]   A:1C60 X:0016 Y:0012 P:envmxdizC
$80/CFC6 E2 20       SEP #$20                A:0660 X:0016 Y:0012 P:envmxdizC
$80/CFC8 90 08       BCC $08    [$CFD2]      A:0660 X:0016 Y:0012 P:envMxdizC
$80/CFCA EB          XBA                     A:0660 X:0016 Y:0012 P:envMxdizC
$80/CFCB C9 06       CMP #$06                A:6006 X:0016 Y:0012 P:envMxdizC
$80/CFCD 90 03       BCC $03    [$CFD2]      A:6006 X:0016 Y:0012 P:envMxdiZC
$80/CFCF 4C 6B D0    JMP $D06B  [$80:D06B]   A:6006 X:0016 Y:0012 P:envMxdiZC
code is missing here
$80/D06B BD 03 09    LDA $0903,x[$80:0919]   A:6006 X:0016 Y:0012 P:envMxdiZC
$80/D06E F0 0B       BEQ $0B    [$D07B]      A:6000 X:0016 Y:0012 P:envMxdiZC
code is missing here
$80/D07B 60          RTS                     A:6000 X:0016 Y:0012 P:envMxdiZC

$80/D09E ?

$80/D09E BD 03 09    LDA $0903,x[$80:0909]   A:0010 X:0006 Y:001A P:envMxdizc
$80/D0A1 D0 0C       BNE $0C    [$D0AF]      A:0008 X:0006 Y:001A P:envMxdizc
$80/D0A3 20 24 D1    JSR $D124  [$80:D124]   A:0000 X:0006 Y:000C P:envMxdiZc
$80/D0A6 90 07       BCC $07    [$D0AF]      A:0013 X:0006 Y:0020 P:envMxdizc
$80/D0A8 20 A7 D1    JSR $D1A7  [$80:D1A7]   A:00FF X:0006 Y:002C P:envMxdiZC
$80/D0AB 90 F6       BCC $F6    ; [$D0A3] Branch if no Error has occured
$80/D0AD 80 71       BRA $71    ; [$D120] Branch if Error has occured
$80/D0AF DE 03 09    DEC $0903,x[$80:0909]   A:0008 X:0006 Y:001A P:envMxdizc
$80/D0B2 BD 04 0A    LDA $0A04,x[$80:0A0A]   A:0008 X:0006 Y:001A P:envMxdizc
$80/D0B5 48          PHA                     A:0009 X:0006 Y:001A P:envMxdizc
$80/D0B6 BD 44 0A    LDA $0A44,x[$80:0A4A]   A:0009 X:0006 Y:001A P:envMxdizc
$80/D0B9 48          PHA                     A:0007 X:0006 Y:001A P:envMxdizc
$80/D0BA 20 63 C3    JSR $C363  [$80:C363]   A:0007 X:0006 Y:001A P:envMxdizc
$80/D0BD 68          PLA                     A:0988 X:0006 Y:001A P:envMxdizc
$80/D0BE EB          XBA                     A:0907 X:0006 Y:001A P:envMxdizc
$80/D0BF 68          PLA                     A:0709 X:0006 Y:001A P:envMxdizc
$80/D0C0 DD 04 0A    CMP $0A04,x[$80:0A0A]   A:0709 X:0006 Y:001A P:envMxdizc
$80/D0C3 D0 06       BNE $06    [$D0CB]      A:0709 X:0006 Y:001A P:envMxdiZC
$80/D0C5 EB          XBA                     A:0709 X:0006 Y:001A P:envMxdiZC
$80/D0C6 DD 44 0A    CMP $0A44,x[$80:0A4A]   A:0907 X:0006 Y:001A P:envMxdizC
$80/D0C9 F0 03       BEQ $03    [$D0CE]      A:0907 X:0006 Y:001A P:envMxdiZC
$80/D0CB FE C3 0C    INC $0CC3,x[$80:0CC9]   A:0709 X:0006 Y:000C P:eNvMxdizc
$80/D0CE BD 03 07    LDA $0703,x[$80:0709]   A:0907 X:0006 Y:001A P:envMxdiZC
$80/D0D1 29 BF       AND #$BF                A:0906 X:0006 Y:001A P:envMxdizC
$80/D0D3 9D 03 07    STA $0703,x[$80:0709]   A:0906 X:0006 Y:001A P:envMxdizC
$80/D0D6 7B          TDC                     A:0906 X:0006 Y:001A P:envMxdizC
$80/D0D7 BD 83 08    LDA $0883,x[$80:0889]   A:0000 X:0006 Y:001A P:envMxdiZC
$80/D0DA A8          TAY                     A:0000 X:0006 Y:001A P:envMxdiZC
$80/D0DB B9 6D B8    LDA $B86D,y[$80:B86D]   A:0000 X:0006 Y:0000 P:envMxdiZC
$80/D0DE 1D 03 07    ORA $0703,x[$80:0709]   A:0000 X:0006 Y:0000 P:envMxdiZC
$80/D0E1 9D 03 07    STA $0703,x[$80:0709]   A:0006 X:0006 Y:0000 P:envMxdizC
$80/D0E4 20 D1 C3    JSR $C3D1  [$80:C3D1]   A:0006 X:0006 Y:0000 P:envMxdizC
$80/D0E7 DA          PHX                     A:F7FF X:0006 Y:0000 P:eNvMxdizC
$80/D0E8 7B          TDC                     A:F7FF X:0006 Y:0000 P:eNvMxdizC
$80/D0E9 BD C3 0C    LDA $0CC3,x[$80:0CC9]   A:0000 X:0006 Y:0000 P:envMxdiZC
$80/D0EC AA          TAX                     A:0000 X:0006 Y:0000 P:envMxdiZC
$80/D0ED BF 00 F9 7F LDA $7FF900,x[$7F:F900] A:0000 X:0000 Y:0000 P:envMxdiZC
$80/D0F1 FA          PLX                     A:0004 X:0000 Y:0000 P:envMxdizC
$80/D0F2 0A          ASL A                   A:0004 X:0006 Y:0000 P:envMxdizC
$80/D0F3 85 01       STA $01    [$00:0001]   A:0008 X:0006 Y:0000 P:envMxdizc
$80/D0F5 64 00       STZ $00    [$00:0000]   A:0008 X:0006 Y:0000 P:envMxdizc
$80/D0F7 C2 20       REP #$20                A:0008 X:0006 Y:0000 P:envMxdizc
$80/D0F9 BD 83 0A    LDA $0A83,x[$80:0A89]   A:0008 X:0006 Y:0000 P:envmxdizc
$80/D0FC 38          SEC                     A:07FC X:0006 Y:0000 P:envmxdizc
$80/D0FD E5 00       SBC $00    [$00:0000]   A:07FC X:0006 Y:0000 P:envmxdizC
$80/D0FF E2 20       SEP #$20                A:FFFC X:0006 Y:0000 P:eNvmxdizc
$80/D101 7B          TDC                     A:FFFC X:0006 Y:0000 P:eNvMxdizc
$80/D102 B0 11       BCS $11    [$D115]      A:0000 X:0006 Y:0000 P:envMxdiZc
$80/D104 C2 20       REP #$20                A:0000 X:0006 Y:0000 P:envMxdiZc
$80/D106 A5 00       LDA $00    [$00:0000]   A:0000 X:0006 Y:0000 P:envmxdiZc
$80/D108 9D 83 0A    STA $0A83,x[$80:0A89]   A:0800 X:0006 Y:0000 P:envmxdizc
$80/D10B A9 FF FF    LDA #$FFFF              A:0800 X:0006 Y:0000 P:envmxdizc
$80/D10E 9D 43 0B    STA $0B43,x[$80:0B49]   A:FFFF X:0006 Y:0000 P:eNvmxdizc
$80/D111 E2 20       SEP #$20                A:FFFF X:0006 Y:0000 P:eNvmxdizc
$80/D113 A9 01       LDA #$01                A:FFFF X:0006 Y:0000 P:eNvMxdizc
$80/D115 9D 04 09    STA $0904,x[$80:090A]   A:FF01 X:0006 Y:0000 P:envMxdizc
$80/D118 20 B2 D3    JSR $D3B2  [$80:D3B2]   A:FF01 X:0006 Y:0000 P:envMxdizc
$80/D11B 20 50 D4    JSR $D450  [$80:D450]   A:0001 X:0006 Y:0004 P:envMxdiZC
$80/D11E 80 03       BRA $03    [$D123]      A:6201 X:0006 Y:0004 P:envMxdizc
$80/D120 20 7B CF    JSR $CF7B  [$80:CF7B]   A:00FF X:0006 Y:0002 P:envMxdiZC
$80/D123 60          RTS                     A:6201 X:0006 Y:0004 P:envMxdizc

$80/D124 ?

$80/D124 7B          TDC                     A:00FF X:0006 Y:0002 P:envMxdizc
$80/D125 BD C4 08    LDA $08C4,x[$80:08CA]   A:0000 X:0006 Y:0002 P:envMxdiZc
$80/D128 29 7F       AND #$7F                A:000D X:0006 Y:0002 P:envMxdizc
$80/D12A 0A          ASL A                   A:000D X:0006 Y:0002 P:envMxdizc
$80/D12B A8          TAY                     A:001A X:0006 Y:0002 P:envMxdizc
$80/D12C B9 66 D2    LDA $D266,y[$80:D280]   A:001A X:0006 Y:001A P:envMxdizc
$80/D12F 10 10       BPL $10    [$D141]      A:0000 X:0006 Y:001A P:envMxdiZc
$80/D131 C9 FF       CMP #$FF                A:0081 X:0006 Y:0026 P:eNvMxdizc
$80/D133 F0 70       BEQ $70    [$D1A5]      A:0081 X:0006 Y:0026 P:eNvMxdizc
$80/D135 BD 83 0C    LDA $0C83,x[$80:0C89]   A:0081 X:0006 Y:0026 P:eNvMxdizc
$80/D138 C9 80       CMP #$80                A:0000 X:0006 Y:0026 P:envMxdiZc
$80/D13A 49 80       EOR #$80                A:0000 X:0006 Y:0026 P:eNvMxdizc
$80/D13C 9D 83 0C    STA $0C83,x[$80:0C89]   A:0080 X:0006 Y:0026 P:eNvMxdizc
$80/D13F 80 04       BRA $04    [$D145]      A:0080 X:0006 Y:0026 P:eNvMxdizc
$80/D141 BD 83 0C    LDA $0C83,x[$80:0C89]   A:0000 X:0006 Y:001A P:envMxdiZc
$80/D144 0A          ASL A                   A:0000 X:0006 Y:001A P:envMxdiZc
$80/D145 B9 66 D2    LDA $D266,y[$80:D280]   A:0000 X:0006 Y:001A P:envMxdiZc
$80/D148 5A          PHY                     A:0000 X:0006 Y:001A P:envMxdiZc
$80/D149 2A          ROL A                   A:0000 X:0006 Y:001A P:envMxdiZc
$80/D14A A8          TAY                     A:0000 X:0006 Y:001A P:envMxdiZc
$80/D14B B9 4E D3    LDA $D34E,y[$80:D34E]   A:0000 X:0006 Y:0000 P:envMxdiZc
$80/D14E 9D 04 06    STA $0604,x[$80:060A]   A:0002 X:0006 Y:0000 P:envMxdizc
$80/D151 9D 44 0C    STA $0C44,x[$80:0C4A]   A:0002 X:0006 Y:0000 P:envMxdizc
$80/D154 7A          PLY                     A:0002 X:0006 Y:0000 P:envMxdizc
$80/D155 C2 20       REP #$20                A:0002 X:0006 Y:001A P:envMxdizc
$80/D157 B9 68 D2    LDA $D268,y[$80:D282]   A:0002 X:0006 Y:001A P:envmxdizc
$80/D15A C9 00 80    CMP #$8000              A:0040 X:0006 Y:001A P:envmxdizc
$80/D15D 29 FF 7F    AND #$7FFF              A:0040 X:0006 Y:001A P:eNvmxdizc
$80/D160 8D 04 42    STA $4204  [$80:4204]   A:0040 X:0006 Y:001A P:envmxdizc
$80/D163 E2 20       SEP #$20                A:0040 X:0006 Y:001A P:envmxdizc
$80/D165 7B          TDC                     A:0040 X:0006 Y:001A P:envMxdizc
$80/D166 BD 84 08    LDA $0884,x[$80:088A]   A:0000 X:0006 Y:001A P:envMxdiZc
$80/D169 8D 06 42    STA $4206  [$80:4206]   A:0008 X:0006 Y:001A P:envMxdizc
$80/D16C 90 02       BCC $02    [$D170]      A:0008 X:0006 Y:001A P:envMxdizc
code is missing here
$80/D170 C2 20       REP #$20                A:0008 X:0006 Y:001A P:envMxdizc
$80/D172 9D C3 0A    STA $0AC3,x[$80:0AC9]   A:0008 X:0006 Y:001A P:envmxdizc
$80/D175 9D 03 0B    STA $0B03,x[$80:0B09]   A:0008 X:0006 Y:001A P:envmxdizc
$80/D178 BD 04 09    LDA $0904,x[$80:090A]   A:0008 X:0006 Y:001A P:envmxdizc
$80/D17B 4A          LSR A                   A:0001 X:0006 Y:001A P:envmxdizc
$80/D17C 90 08       BCC $08    [$D186]      A:0000 X:0006 Y:001A P:envmxdiZC
$80/D17E B9 6A D2    LDA $D26A,y[$80:D284]   A:0000 X:0006 Y:001A P:envmxdiZC
$80/D181 F0 03       BEQ $03    [$D186]      A:FFFF X:0006 Y:001A P:eNvmxdizC
$80/D183 9D 43 0B    STA $0B43,x[$80:0B49]   A:FFFF X:0006 Y:001A P:eNvmxdizC
$80/D186 E2 20       SEP #$20                A:FFFF X:0006 Y:001A P:eNvmxdizC
$80/D188 AD 14 42    LDA $4214  [$80:4214]   A:FFFF X:0006 Y:001A P:eNvMxdizC
$80/D18B 9D 03 09    STA $0903,x[$80:0909]   A:FF08 X:0006 Y:001A P:envMxdizC
$80/D18E C2 20       REP #$20                A:FF08 X:0006 Y:001A P:envMxdizC
$80/D190 98          TYA                     A:FF08 X:0006 Y:001A P:envmxdizC
$80/D191 4A          LSR A                   A:001A X:0006 Y:001A P:envmxdizC
$80/D192 E2 20       SEP #$20                A:000D X:0006 Y:001A P:envmxdizc
$80/D194 18          CLC                     A:000D X:0006 Y:001A P:envMxdizc
$80/D195 69 03       ADC #$03                A:000D X:0006 Y:001A P:envMxdizc
$80/D197 48          PHA                     A:0010 X:0006 Y:001A P:envMxdizc
$80/D198 BD C4 08    LDA $08C4,x[$80:08CA]   A:0010 X:0006 Y:001A P:envMxdizc
$80/D19B 29 80       AND #$80                A:000D X:0006 Y:001A P:envMxdizc
$80/D19D 03 01       ORA $01,s  [$00:1FC9]   A:0000 X:0006 Y:001A P:envMxdiZc
$80/D19F 9D C4 08    STA $08C4,x[$80:08CA]   A:0010 X:0006 Y:001A P:envMxdizc
$80/D1A2 68          PLA                     A:0010 X:0006 Y:001A P:envMxdizc
$80/D1A3 18          CLC                     A:0010 X:0006 Y:001A P:envMxdizc
$80/D1A4 60          RTS                     A:0010 X:0006 Y:001A P:envMxdizc
$80/D1A5 38          SEC                     A:00FF X:0006 Y:002C P:envMxdiZC
$80/D1A6 60          RTS                     A:00FF X:0006 Y:002C P:envMxdiZC

$80/D1A7 ?

This subroutine uses the Carry as Error Flag

$80/D1A7 A0 DF D2    LDY #$D2DF    ; Setup 24-bit address $7E/D2DF in [$20]
$80/D1AA 84 20       STY $20
$80/D1AC A9 7E       LDA #$7E
$80/D1AE 85 22       STA $22
$80/D1B0 7B          TDC           ; Clear 16-bit A
$80/D1B1 BD 04 0E    LDA $0E04,x[$80:0E0A]   A:0000 X:0006 Y:D2DF P:envMxdiZc
$80/D1B4 A8          TAY                     A:0000 X:0006 Y:D2DF P:envMxdiZc
$80/D1B5 B7 20       LDA [$20],y[$7E:D2DF]   A:0000 X:0006 Y:0000 P:envMxdiZc
$80/D1B7 C9 FF       CMP #$FF      ; Error?
$80/D1B9 D0 03       BNE $03       ; [$D1BE] Branch if not
$80/D1BB 4C 5C D2    JMP $D25C     ; Error: Set Carry (Error Flag) and Exit
$80/D1BE 9D C4 08    STA $08C4,x[$80:08CA]   A:000D X:0006 Y:0000 P:envMxdizc
$80/D1C1 C8          INY                     A:000D X:0006 Y:0000 P:envMxdizc
$80/D1C2 B7 20       LDA [$20],y[$7E:D2E0]   A:000D X:0006 Y:0001 P:envMxdizc
$80/D1C4 9D 83 08    STA $0883,x[$80:0889]   A:0000 X:0006 Y:0001 P:envMxdiZc
$80/D1C7 85 00       STA $00    [$00:0000]   A:0000 X:0006 Y:0001 P:envMxdiZc
$80/D1C9 C8          INY                     A:0000 X:0006 Y:0001 P:envMxdiZc
$80/D1CA 98          TYA                     A:0000 X:0006 Y:0002 P:envMxdizc
$80/D1CB 9D 04 0E    STA $0E04,x[$80:0E0A]   A:0002 X:0006 Y:0002 P:envMxdizc
$80/D1CE B7 20       LDA [$20],y[$7E:D2E1]   A:0002 X:0006 Y:0002 P:envMxdizc
$80/D1D0 C9 FF       CMP #$FF      ; Exit Command?
$80/D1D2 D0 03       BNE $03       ; [$D1D7] Branch if not
$80/D1D4 4C 58 D2    JMP $D258     ; Else, clear Carry (Error Flag) and Exit
code is missing here
$80/D20F A8          TAY           ; Transfer Figure Number in Y as Load Index
$80/D210 B9 AE 17    LDA $17AE,y   ; Check Figure's Character Sprite
$80/D213 F0 43       BEQ $43       ; [$D258] If empty, clear Carry (Error Flag) and Exit
$80/D215 C9 F0       CMP #$F0                A:003B X:0044 Y:0006 P:envMxdizc
$80/D217 B0 16       BCS $16       ; [$D22F] Branch if equal or higher
$80/D219 B9 DE 19    LDA $19DE,y[$80:19E4]   A:003B X:0044 Y:0006 P:envMxdizc
$80/D21C 89 01       BIT #$01                A:0000 X:0044 Y:0006 P:envMxdiZc
$80/D21E D0 0F       BNE $0F    [$D22F]      A:0000 X:0044 Y:0006 P:envMxdiZc
$80/D220 B9 DF 19    LDA $19DF,y[$80:19E5]   A:0000 X:0044 Y:0006 P:envMxdiZc
$80/D223 89 20       BIT #$20                A:0040 X:0044 Y:0006 P:envMxdizc
$80/D225 D0 31       BNE $31       ; [$D258] clear Carry (Error Flag) and Exit
$80/D227 B9 2E 1A    LDA $1A2E,y[$80:1A34]   A:0040 X:0044 Y:0006 P:envMxdiZc
$80/D22A 4A          LSR A                   A:0000 X:0044 Y:0006 P:envMxdiZc
$80/D22B C5 02       CMP $02    [$00:0002]   A:0000 X:0044 Y:0006 P:envMxdiZc
$80/D22D D0 29       BNE $29       ; [$D258] clear Carry (Error Flag) and Exit
$80/D22F BE 3E 1E    LDX $1E3E,y[$80:1E44]   A:0000 X:0044 Y:0006 P:envMxdiZC
$80/D232 BD C4 08    LDA $08C4,x[$80:08CA]   A:0000 X:0006 Y:0006 P:envMxdizC
$80/D235 C9 FF       CMP #$FF                A:000A X:0006 Y:0006 P:envMxdizC
$80/D237 D0 1F       BNE $1F       ; [$D258] clear Carry (Error Flag) and Exit
code is missing here
$80/D258 A6 3B       LDX $3B    [$00:003B]   A:00FF X:0006 Y:0002 P:envMxdiZC
$80/D25A 18          CLC           ; Clear Carry (Error Flag)
$80/D25B 60          RTS
$80/D25C 38          SEC           ; Set Carry (Error Flag)
$80/D25D 60          RTS

$80/D358 ?

$80/D358 7B          TDC                     A:000E X:0006 Y:000E P:envMxdizc
$80/D359 BD 03 0E    LDA $0E03,x[$80:0E09]   A:0000 X:0006 Y:000E P:envMxdiZc
$80/D35C 1A          INC A                   A:0000 X:0006 Y:000E P:envMxdiZc
$80/D35D 1A          INC A                   A:0001 X:0006 Y:000E P:envMxdizc
$80/D35E 4A          LSR A                   A:0002 X:0006 Y:000E P:envMxdizc
$80/D35F 22 93 CA 84 JSL $84CA93[$84:CA93]   A:0001 X:0006 Y:000E P:envMxdizc
$80/D363 7B          TDC                     A:0001 X:0006 Y:000E P:eNvMxdizc
$80/D364 BD C4 0B    LDA $0BC4,x[$80:0BCA]   A:0000 X:0006 Y:000E P:envMxdiZc
$80/D367 A8          TAY                     A:0004 X:0006 Y:000E P:envMxdizc
$80/D368 B9 DF 19    LDA $19DF,y[$80:19E3]   A:0004 X:0006 Y:0004 P:envMxdizc
$80/D36B 89 40       BIT #$40                A:0040 X:0006 Y:0004 P:envMxdizc
$80/D36D F0 0F       BEQ $0F    [$D37E]      A:0040 X:0006 Y:0004 P:envMxdizc
$80/D36F 89 10       BIT #$10                A:0040 X:0006 Y:0004 P:envMxdizc
$80/D371 F0 05       BEQ $05    [$D378]      A:0040 X:0006 Y:0004 P:envMxdiZc
$80/D378 22 9F C1 84 JSL $84C19F[$84:C19F]   A:0040 X:0006 Y:0004 P:envMxdiZc
$80/D37C 80 06       BRA $06    [$D384]      A:4601 X:0006 Y:0004 P:eNvMxdizc
code is missing here
$80/D384 7B          TDC                     A:4601 X:0006 Y:0004 P:eNvMxdizc
$80/D385 B9 3E 1E    LDA $1E3E,y[$80:1E42]   A:0000 X:0006 Y:0004 P:envMxdiZc
$80/D388 A8          TAY                     A:0004 X:0006 Y:0004 P:envMxdizc
$80/D389 B9 04 07    LDA $0704,y[$80:0708]   A:0004 X:0006 Y:0004 P:envMxdizc
$80/D38C 29 FE       AND #$FE                A:0001 X:0006 Y:0004 P:envMxdizc
$80/D38E 99 04 07    STA $0704,y[$80:0708]   A:0000 X:0006 Y:0004 P:envMxdiZc
$80/D391 A9 01       LDA #$01                A:0000 X:0006 Y:0004 P:envMxdiZc
$80/D393 99 43 08    STA $0843,y[$80:0847]   A:0001 X:0006 Y:0004 P:envMxdizc
$80/D396 A9 FF       LDA #$FF                A:0001 X:0006 Y:0004 P:envMxdizc
$80/D398 99 C4 08    STA $08C4,y[$80:08C8]   A:00FF X:0006 Y:0004 P:eNvMxdizc
$80/D39B BD 03 07    LDA $0703,x[$80:0709]   A:00FF X:0006 Y:0004 P:eNvMxdizc
$80/D39E 29 40       AND #$40                A:0006 X:0006 Y:0004 P:envMxdizc
$80/D3A0 48          PHA                     A:0000 X:0006 Y:0004 P:envMxdiZc
$80/D3A1 B9 03 07    LDA $0703,y[$80:0707]   A:0000 X:0006 Y:0004 P:envMxdiZc
$80/D3A4 29 BF       AND #$BF                A:0006 X:0006 Y:0004 P:envMxdizc
$80/D3A6 03 01       ORA $01,s  [$00:1FCB]   A:0006 X:0006 Y:0004 P:envMxdizc
$80/D3A8 99 03 07    STA $0703,y[$80:0707]   A:0006 X:0006 Y:0004 P:envMxdizc
$80/D3AB 68          PLA                     A:0006 X:0006 Y:0004 P:envMxdizc
$80/D3AC 9E 03 06    STZ $0603,x[$80:0609]   A:0000 X:0006 Y:0004 P:envMxdiZc
$80/D3AF 84 3D       STY $3D    [$00:003D]   A:0000 X:0006 Y:0004 P:envMxdiZc
$80/D3B1 60          RTS                     A:0000 X:0006 Y:0004 P:envMxdiZc

$80/D3B2 ?

$80/D3B2 7B          TDC           ; Clear 16-bit A
$80/D3B3 BD C4 0B    LDA $0BC4,x[$80:0BCA]   A:0000 X:0006 Y:0000 P:envMxdiZc
$80/D3B6 A8          TAY           ; Transfer value (Character Class/Sprite) in Y as Load Index
$80/D3B7 B9 DE 19    LDA $19DE,y[$80:19E2]   A:0004 X:0006 Y:0004 P:envMxdizc
$80/D3BA 89 01       BIT #$01                A:0000 X:0006 Y:0004 P:envMxdiZc
$80/D3BC D0 73       BNE $73       ; [$D431] Exit if flag is set
$80/D3BE BD 03 06    LDA $0603,x[$80:0609]   A:0000 X:0006 Y:0004 P:envMxdiZc
$80/D3C1 C9 30       CMP #$30                A:0001 X:0006 Y:0004 P:envMxdizc
$80/D3C3 90 04       BCC $04    [$D3C9]      A:0001 X:0006 Y:0004 P:eNvMxdizc
code is missing here
$80/D3C9 B9 AE 17    LDA $17AE,y[$80:17B2]   A:0001 X:0006 Y:0004 P:eNvMxdizc
$80/D3CC 22 DF A3 88 JSL $88A3DF   ; Load Big Sprite Flag for this Character
$80/D3D0 90 2F       BCC $2F       ; [$D401] Branch if Sprite isn't big
code is missing here
$80/D401 20 22 D5    JSR $D522  [$80:D522]   A:0034 X:0006 Y:0004 P:envMxdizc
$80/D404 09 00       ORA #$00      ; Do this to set the Zero flag again
$80/D406 F0 0B       BEQ $0B       ; [$D413] Exit if A is zero
code is missing here
$80/D413 7B          TDC                     A:0000 X:0006 Y:0004 P:envMxdiZc
$80/D414 BD C4 0B    LDA $0BC4,x[$80:0BCA]   A:0000 X:0006 Y:0004 P:envMxdiZc
$80/D417 DA          PHX           ; Buffer X on Stack
$80/D418 AA          TAX                     A:0004 X:0006 Y:0004 P:envMxdizc
$80/D419 22 D9 A5 88 JSL $88A5D9[$88:A5D9]   A:0004 X:0004 Y:0004 P:envMxdizc
$80/D41D FA          PLX           ; Restore X from Stack
$80/D41E DD 03 06    CMP $0603,x[$80:0609]   A:0001 X:0006 Y:0004 P:envMxdizc
$80/D421 F0 0E       BEQ $0E       ; [$D431] Exit if equal
code is missing here
$80/D431 60          RTS

$80/D450 ?

$80/D450 7B          TDC                     A:0001 X:0006 Y:0004 P:envMxdiZC
$80/D451 BD C4 0B    LDA $0BC4,x[$80:0BCA]   A:0000 X:0006 Y:0004 P:envMxdiZC
$80/D454 A8          TAY                     A:0004 X:0006 Y:0004 P:envMxdizC
$80/D455 B9 DE 19    LDA $19DE,y[$80:19E2]   A:0004 X:0006 Y:0004 P:envMxdizC
$80/D458 89 01       BIT #$01                A:0000 X:0006 Y:0004 P:envMxdiZC
$80/D45A D0 5A       BNE $5A    [$D4B6]      A:0000 X:0006 Y:0004 P:envMxdiZC
$80/D45C 89 02       BIT #$02                A:0000 X:0006 Y:0004 P:envMxdiZC
$80/D45E F0 1E       BEQ $1E    [$D47E]      A:0000 X:0006 Y:0004 P:envMxdiZC
code is missing here
$80/D47E BD 04 06    LDA $0604,x[$80:060A]   A:0000 X:0006 Y:0004 P:envMxdiZC
$80/D481 C9 32       CMP #$32                A:0002 X:0006 Y:0004 P:envMxdizC
$80/D483 B0 04       BCS $04    [$D489]      A:0002 X:0006 Y:0004 P:eNvMxdizc
$80/D485 C9 10       CMP #$10                A:0002 X:0006 Y:0004 P:eNvMxdizc
$80/D487 B0 2D       BCS $2D    [$D4B6]      A:0002 X:0006 Y:0004 P:eNvMxdizc
$80/D489 C9 02       CMP #$02                A:0002 X:0006 Y:0004 P:eNvMxdizc
$80/D48B 90 29       BCC $29    [$D4B6]      A:0002 X:0006 Y:0004 P:envMxdiZC
$80/D48D C9 08       CMP #$08                A:0002 X:0006 Y:0004 P:envMxdiZC
$80/D48F B0 0E       BCS $0E    [$D49F]      A:0002 X:0006 Y:0004 P:eNvMxdizc
$80/D491 BD 83 08    LDA $0883,x[$80:0889]   A:0002 X:0006 Y:0004 P:eNvMxdizc
$80/D494 C9 02       CMP #$02                A:0000 X:0006 Y:0004 P:envMxdiZc
$80/D496 7B          TDC                     A:0000 X:0006 Y:0004 P:eNvMxdizc
$80/D497 90 02       BCC $02    [$D49B]      A:0000 X:0006 Y:0004 P:envMxdiZc
$80/D49B 18          CLC                     A:0000 X:0006 Y:0004 P:envMxdiZc
$80/D49C 7D 04 06    ADC $0604,x[$80:060A]   A:0000 X:0006 Y:0004 P:envMxdiZc
$80/D49F DD C4 06