Difference between revisions of "Tactics Ogre:ROM map"

From Data Crystal
Jump to: navigation, search
($86/E3C5 ?)
($80/B101 ?)
 
(147 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,044: Line 4,065:
 
  $80/B7DE A4 39      LDY $39      ; (Load a Figure number)
 
  $80/B7DE A4 39      LDY $39      ; (Load a Figure number)
 
  $80/B7E0 B9 AE 17    LDA $17AE,y  ; Load Character Sprite
 
  $80/B7E0 B9 AE 17    LDA $17AE,y  ; Load Character Sprite
  $80/B7E3 C9 F0      CMP #$F0               A:003B X:0006 Y:0006 P:envMxdizc
+
  $80/B7E3 C9 F0      CMP #$F0
  $80/B7E5 B0 0E      BCS $0E   [$B7F5]     A:003B X:0006 Y:0006 P:envMxdizc
+
  $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/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/B7E9 A9 0C      LDA #$0C                A:003B X:0006 Y:0006 P:envMxdizc
Line 4,084: Line 4,105:
 
  $80/B83D 9D 03 07    STA $0703,x[$80:0709]  A:0046 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/B840 A4 39      LDY $39    [$00:0039]  A:0046 X:0006 Y:0001 P:envMxdizc
  $80/B842 B9 AE 17    LDA $17AE,y[$80:17B4]   A:0046 X:0006 Y:0006 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/B845 22 DF A3 88 JSL $88A3DF  ; Load Big Sprite Flag for this Character
  $80/B849 90 08      BCC $08   [$B853]     A:003B X:0006 Y:0006 P:envMxdizc
+
  $80/B849 90 08      BCC $08       ; [$B853] Branch if Figure has no Big Sprite
 
;code is missing here
 
;code is missing here
 
  $80/B853 A5 06      LDA $06    [$00:0006]  A:003B X:0006 Y:0006 P:envMxdizc
 
  $80/B853 A5 06      LDA $06    [$00:0006]  A:003B X:0006 Y:0006 P:envMxdizc
Line 4,195: Line 4,216:
 
  $80/B934 7B          TDC                    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/B935 B9 C3 06    LDA $06C3,y[$7E:06C3]  A:0000 X:3929 Y:0000 P:envMxdiZc
  $80/B938 C9 08      CMP #$08               A:0008 X:3929 Y:0000 P:envMxdizc
+
  $80/B938 C9 08      CMP #$08
  $80/B93A 90 25      BCC $25   [$B961]     A:0008 X:3929 Y:0000 P:envMxdiZC
+
  $80/B93A 90 25      BCC $25       ; [$B961] Do next entry if value is lower than #$08
  $80/B93C C9 20      CMP #$20               A:0008 X:3929 Y:0000 P:envMxdiZC
+
  $80/B93C C9 20      CMP #$20
  $80/B93E B0 21      BCS $21   [$B961]     A:0008 X:3929 Y:0000 P:eNvMxdizc
+
  $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/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/B941 E9 08      SBC #$08                A:0008 X:3929 Y:0000 P:eNvMxdizC
Line 4,208: Line 4,229:
 
  $80/B94B FE 00 00    INC $0000,x[$7E:3911]  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/B94E DA          PHX                    A:3911 X:3911 Y:0000 P:envMxdizc
  $80/B94F 7B          TDC                     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/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/B953 AA          TAX                    A:0000 X:3911 Y:0000 P:envMxdiZc
  $80/B954 BD AF 17    LDA $17AF,x[$7E:17AF]   A:0000 X:0000 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/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/B95B FA          PLX                    A:0001 X:0000 Y:0000 P:envMxdiZc
  $80/B95C 90 03      BCC $03   [$B961]     A:0001 X:3911 Y:0000 P:envMxdizc
+
  $80/B95C 90 03      BCC $03       ; [$B961] Do next entry if the Sprite isn't big
 
;code is missing here
 
;code is missing here
  $80/B961 C8          INY                     A:0001 X:3911 Y:0000 P:envMxdizc
+
  $80/B961 C8          INY           ; Increment Load Index twice
  $80/B962 C8          INY                     A:0001 X:3911 Y:0001 P:envMxdizc
+
  $80/B962 C8          INY
  $80/B963 C0 40 00    CPY #$0040             A:0001 X:3911 Y:0002 P:envMxdizc
+
  $80/B963 C0 40 00    CPY #$0040
  $80/B966 90 C3      BCC $C3   [$B92B]     A:0001 X:3911 Y:0002 P:eNvMxdizc
+
  $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/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/B969 A3 03      LDA $03,s  [$00:1FD2]  A:0000 X:3913 Y:0040 P:envMxdiZC
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 5,909: Line 5,933:
  
 
= Bank $81 =
 
= Bank $81 =
== $81/802A ? ==
+
== $81/802A ? Sets up Window Mask for Textboxes ==
 +
 
 +
For all the in-game dialog boxes, this subroutine is executed. The Window Mask that gets set up in the latter part of this subroutine is for hiding sprites behind the textbox, otherwise they would appear between BG3 (the text) and BG1 (the textbox background).
  
 
  $81/802A 8B          PHB          ; Buffer Data Bank on Stack
 
  $81/802A 8B          PHB          ; Buffer Data Bank on Stack
Line 5,937: Line 5,963:
 
  $81/8058 9D 01 00    STA $0001,x[$7E:3912]  A:3901 X:3911 Y:0002 P:envMxdizc
 
  $81/8058 9D 01 00    STA $0001,x[$7E:3912]  A:3901 X:3911 Y:0002 P:envMxdizc
 
  $81/805B E6 C1      INC $C1    [$00:00C1]  A:3901 X:3911 Y:0002 P:envMxdizc
 
  $81/805B E6 C1      INC $C1    [$00:00C1]  A:3901 X:3911 Y:0002 P:envMxdizc
  $81/805D A9 10      LDA #$10               A:3901 X:3911 Y:0002 P:envMxdizc
+
  $81/805D A9 10      LDA #$10     ; Disable Sprites outside the window
  $81/805F 8D A8 05    STA $05A8 [$7E:05A8]  A:3910 X:3911 Y:0002 P:envMxdizc
+
  $81/805F 8D A8 05    STA $05A8     ; Store in Buffer for $212E
  $81/8062 A9 22      LDA #$22               A:3910 X:3911 Y:0002 P:envMxdizc
+
  $81/8062 A9 22      LDA #$22     ; Activate Window 1 OBJ/MATH Mask Outside
  $81/8064 8D A3 05    STA $05A3 [$7E:05A3]  A:3922 X:3911 Y:0002 P:envMxdizc
+
  $81/8064 8D A3 05    STA $05A3     ; Store in Buffer for $2125
  $81/8067 A9 20      LDA #$20               A:3922 X:3911 Y:0002 P:envMxdizc
+
  $81/8067 A9 20      LDA #$20     ; Enable NotColorMath-Window
  $81/8069 0C AA 05    TSB $05AA [$7E:05AA]  A:3920 X:3911 Y:0002 P:envMxdizc
+
  $81/8069 0C AA 05    TSB $05AA     ; Add to Buffer value for $2130
  $81/806C EE 5F 17    INC $175F [$7E:175F]  A:3920 X:3911 Y:0002 P:envMxdiZc
+
  $81/806C EE 5F 17    INC $175F     ; Set Flag for HDMA Window Mask
 
  $81/806F FA          PLX          ; Restore X and Data Bank from Stack
 
  $81/806F FA          PLX          ; Restore X and Data Bank from Stack
 
  $81/8070 AB          PLB
 
  $81/8070 AB          PLB
Line 6,019: 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,051: 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,062: 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 7,356: Line 7,382:
 
  $81/96EB 60          RTS                    A:001A X:45D9 Y:0308 P:envMxdizc
 
  $81/96EB 60          RTS                    A:001A X:45D9 Y:0308 P:envMxdizc
  
== $81/96EC ? ==
+
== $81/96EC ? Transfer BG1 Tilemap Buffer Data into another address ==
  
 
  $81/96EC D4 02      PEI ($02)    ; Buffer $02-$05 on Stack
 
  $81/96EC D4 02      PEI ($02)    ; Buffer $02-$05 on Stack
 
  $81/96EE D4 04      PEI ($04)
 
  $81/96EE D4 04      PEI ($04)
 
  $81/96F0 A6 D8      LDX $D8    [$00:00D8]  A:0200 X:45D9 Y:01D4 P:envMxdizc
 
  $81/96F0 A6 D8      LDX $D8    [$00:00D8]  A:0200 X:45D9 Y:01D4 P:envMxdizc
  $81/96F2 C2 20      REP #$20               A:0200 X:45D9 Y:01D4 P:envMxdizc
+
  $81/96F2 C2 20      REP #$20     ; A = 16-bit
 
  $81/96F4 BD 49 00    LDA $0049,x[$7E:4622]  A:0200 X:45D9 Y:01D4 P:envmxdizc
 
  $81/96F4 BD 49 00    LDA $0049,x[$7E:4622]  A:0200 X:45D9 Y:01D4 P:envmxdizc
 
  $81/96F7 85 23      STA $23    [$00:0023]  A:4819 X:45D9 Y:01D4 P:envmxdizc
 
  $81/96F7 85 23      STA $23    [$00:0023]  A:4819 X:45D9 Y:01D4 P:envmxdizc
Line 7,373: Line 7,399:
 
  $81/9706 3A          DEC A                  A:0086 X:45D9 Y:01D4 P:envmxdizc
 
  $81/9706 3A          DEC A                  A:0086 X:45D9 Y:01D4 P:envmxdizc
 
  $81/9707 3A          DEC A                  A:0085 X:45D9 Y:01D4 P:envmxdizc
 
  $81/9707 3A          DEC A                  A:0085 X:45D9 Y:01D4 P:envmxdizc
  $81/9708 A8          TAY                     A:0084 X:45D9 Y:01D4 P:envmxdizc
+
  $81/9708 A8          TAY           ; Buffer Load Index in Y
  $81/9709 85 04      STA $04   [$00:0004]  A:0084 X:45D9 Y:0084 P:envmxdizc
+
  $81/9709 85 04      STA $04       ; Buffer Load Index Offset in $04
 
  $81/970B BD 59 00    LDA $0059,x[$7E:4632]  A:0084 X:45D9 Y:0084 P:envmxdizc
 
  $81/970B BD 59 00    LDA $0059,x[$7E:4632]  A:0084 X:45D9 Y:0084 P:envmxdizc
 
  $81/970E 1A          INC A                  A:0018 X:45D9 Y:0084 P:envmxdizc
 
  $81/970E 1A          INC A                  A:0018 X:45D9 Y:0084 P:envmxdizc
Line 7,383: Line 7,409:
 
  $81/9715 1A          INC A                  A:0007 X:45D9 Y:0084 P:envmxdizc
 
  $81/9715 1A          INC A                  A:0007 X:45D9 Y:0084 P:envmxdizc
 
  $81/9716 85 00      STA $00    [$00:0000]  A:0008 X:45D9 Y:0084 P:envmxdizc
 
  $81/9716 85 00      STA $00    [$00:0000]  A:0008 X:45D9 Y:0084 P:envmxdizc
  $81/9718 BB          TYX                     A:0008 X:45D9 Y:0084 P:envmxdizc
+
  $81/9718 BB          TYX           ; Transfer Load Index from Y to X
  $81/9719 A3 01      LDA $01,s [$00:1FBD]  A:0008 X:0084 Y:0084 P:envmxdizc
+
  $81/9719 A3 01      LDA $01,s     ; Load value from Stack, without removing it from there
  $81/971B 85 02      STA $02   [$00:0002]  A:001A X:0084 Y:0084 P:envmxdizc
+
  $81/971B 85 02      STA $02       ; Set it up as Inner Loop Counter
  $81/971D BF 00 E0 7F LDA $7FE000,x[$7F:E084] A:001A X:0084 Y:0084 P:envmxdizc
+
  $81/971D BF 00 E0 7F LDA $7FE000,x ; Load value from VRAM Buffer of Battle BG1 Tilemap
  $81/9721 92 23      STA ($23) [$7E:4819]  A:0280 X:0084 Y:0084 P:envmxdizc
+
  $81/9721 92 23      STA ($23)     ; Store on Bank $7E
  $81/9723 E8          INX                     A:0280 X:0084 Y:0084 P:envmxdizc
+
  $81/9723 E8          INX           ; Increment Load Index twice
  $81/9724 E8          INX                     A:0280 X:0085 Y:0084 P:envmxdizc
+
  $81/9724 E8          INX
  $81/9725 E6 23      INC $23   [$00:0023]  A:0280 X:0086 Y:0084 P:envmxdizc
+
  $81/9725 E6 23      INC $23       ; Increment Store Address twice
  $81/9727 E6 23      INC $23   [$00:0023]  A:0280 X:0086 Y:0084 P:envmxdizc
+
  $81/9727 E6 23      INC $23
  $81/9729 C6 02      DEC $02   [$00:0002]  A:0280 X:0086 Y:0084 P:envmxdizc
+
  $81/9729 C6 02      DEC $02       ; Decrement Inner Loop Counter
  $81/972B D0 F0      BNE $F0   [$971D]     A:0280 X:0086 Y:0084 P:envmxdizc
+
  $81/972B D0 F0      BNE $F0       ; [$971D] Loop until Inner Counter runs out
  $81/972D A5 04      LDA $04   [$00:0004]  A:30A9 X:00B8 Y:0084 P:envmxdiZc
+
  $81/972D A5 04      LDA $04       ; Add #$40 to Load Index offset
  $81/972F 18          CLC                     A:0084 X:00B8 Y:0084 P:envmxdizc
+
  $81/972F 18          CLC
  $81/9730 69 40 00    ADC #$0040             A:0084 X:00B8 Y:0084 P:envmxdizc
+
  $81/9730 69 40 00    ADC #$0040
 
  $81/9733 29 FF 07    AND #$07FF              A:00C4 X:00B8 Y:0084 P:envmxdizc
 
  $81/9733 29 FF 07    AND #$07FF              A:00C4 X:00B8 Y:0084 P:envmxdizc
 
  $81/9736 85 04      STA $04    [$00:0004]  A:00C4 X:00B8 Y:0084 P:envmxdizc
 
  $81/9736 85 04      STA $04    [$00:0004]  A:00C4 X:00B8 Y:0084 P:envmxdizc
  $81/9738 AA          TAX                     A:00C4 X:00B8 Y:0084 P:envmxdizc
+
  $81/9738 AA          TAX           ; Transfer in X as Load Index
  $81/9739 C6 00      DEC $00   [$00:0000]  A:00C4 X:00C4 Y:0084 P:envmxdizc
+
  $81/9739 C6 00      DEC $00       ; Decrement Outer Loop Counter
  $81/973B D0 DC      BNE $DC   [$9719]     A:00C4 X:00C4 Y:0084 P:envmxdizc
+
  $81/973B D0 DC      BNE $DC       ; [$9719] Loop until Outer Counter runs out
 
  $81/973D 68          PLA                    A:0284 X:0284 Y:0084 P:envmxdiZc
 
  $81/973D 68          PLA                    A:0284 X:0284 Y:0084 P:envmxdiZc
 
  $81/973E E2 20      SEP #$20                A:001A X:0284 Y:0084 P:envmxdizc
 
  $81/973E E2 20      SEP #$20                A:001A X:0284 Y:0084 P:envmxdizc
Line 7,906: Line 7,932:
 
  $81/9C07 3A          DEC A                  A:5813 X:3919 Y:3919 P:envMxdizC
 
  $81/9C07 3A          DEC A                  A:5813 X:3919 Y:3919 P:envMxdizC
 
  $81/9C08 85 04      STA $04    [$00:0004]  A:5812 X:3919 Y:3919 P:envMxdizC
 
  $81/9C08 85 04      STA $04    [$00:0004]  A:5812 X:3919 Y:3919 P:envMxdizC
  $81/9C0A AD 8D 05    LDA $058D [$7E:058D]  A:5812 X:3919 Y:3919 P:envMxdizC
+
  $81/9C0A AD 8D 05    LDA $058D     ; Load BG3 Tilemap Address and size
  $81/9C0D 85 09      STA $09   [$00:0009]  A:583C X:3919 Y:3919 P:envMxdizC
+
  $81/9C0D 85 09      STA $09       ; Set it up as 16-bit address in $08/09
  $81/9C0F 64 08      STZ $08   [$00:0008]  A:583C X:3919 Y:3919 P:envMxdizC
+
  $81/9C0F 64 08      STZ $08
 
  $81/9C11 A0 00 A8    LDY #$A800              A:583C X:3919 Y:3919 P:envMxdizC
 
  $81/9C11 A0 00 A8    LDY #$A800              A:583C X:3919 Y:3919 P:envMxdizC
 
  $81/9C14 84 0A      STY $0A    [$00:000A]  A:583C X:3919 Y:A800 P:eNvMxdizC
 
  $81/9C14 84 0A      STY $0A    [$00:000A]  A:583C X:3919 Y:A800 P:eNvMxdizC
 
  $81/9C16 A9 7E      LDA #$7E                A:583C X:3919 Y:A800 P:eNvMxdizC
 
  $81/9C16 A9 7E      LDA #$7E                A:583C X:3919 Y:A800 P:eNvMxdizC
 
  $81/9C18 85 0F      STA $0F    [$00:000F]  A:587E X:3919 Y:A800 P:envMxdizC
 
  $81/9C18 85 0F      STA $0F    [$00:000F]  A:587E X:3919 Y:A800 P:envMxdizC
  $81/9C1A AC 9B 05    LDY $059B [$7E:059B]  A:587E X:3919 Y:A800 P:envMxdizC
+
  $81/9C1A AC 9B 05    LDY $059B     ; Buffer BG3 Y-Scroll in $06
  $81/9C1D 84 06      STY $06   [$00:0006]  A:587E X:3919 Y:0000 P:envMxdiZC
+
  $81/9C1D 84 06      STY $06
 
  $81/9C1F 20 25 9C    JSR $9C25  [$81:9C25]  A:587E X:3919 Y:0000 P:envMxdiZC
 
  $81/9C1F 20 25 9C    JSR $9C25  [$81:9C25]  A:587E X:3919 Y:0000 P:envMxdiZC
 
  $81/9C22 A6 D8      LDX $D8    [$00:00D8]  A:AC7E X:A800 Y:3C00 P:eNvMxdizc
 
  $81/9C22 A6 D8      LDX $D8    [$00:00D8]  A:AC7E X:A800 Y:3C00 P:eNvMxdizc
Line 7,920: Line 7,946:
  
 
== $81/9C25 ? ==
 
== $81/9C25 ? ==
 +
 +
When coming from $81/9BD8, $06 contains the buffered BG3 Y-scroll value.
  
 
  $81/9C25 A9 80      LDA #$80                A:587E X:3919 Y:0000 P:envMxdiZC
 
  $81/9C25 A9 80      LDA #$80                A:587E X:3919 Y:0000 P:envMxdiZC
Line 7,938: Line 7,966:
 
  $81/9C48 85 10      STA $10    [$00:0010]  A:0488 X:3919 Y:0000 P:envmxdizc
 
  $81/9C48 85 10      STA $10    [$00:0010]  A:0488 X:3919 Y:0000 P:envmxdizc
 
  $81/9C4A 48          PHA                    A:0488 X:3919 Y:0000 P:envmxdizc
 
  $81/9C4A 48          PHA                    A:0488 X:3919 Y:0000 P:envmxdizc
  $81/9C4B A5 06      LDA $06   [$00:0006]  A:0488 X:3919 Y:0000 P:envmxdizc
+
  $81/9C4B A5 06      LDA $06       ; Load BG3 Y-scroll
  $81/9C4D 0A          ASL A                   A:0000 X:3919 Y:0000 P:envmxdiZc
+
  $81/9C4D 0A          ASL A         ; Multiply by eight
  $81/9C4E 0A          ASL A                   A:0000 X:3919 Y:0000 P:envmxdiZc
+
  $81/9C4E 0A          ASL A
  $81/9C4F 0A          ASL A                   A:0000 X:3919 Y:0000 P:envmxdiZc
+
  $81/9C4F 0A          ASL A
  $81/9C50 63 01      ADC $01,s [$00:1FC1]  A:0000 X:3919 Y:0000 P:envmxdiZc
+
  $81/9C50 63 01      ADC $01,s     ; (Add value that was just pushed on stack)
 
  $81/9C52 29 FF 07    AND #$07FF              A:0488 X:3919 Y:0000 P:envmxdizc
 
  $81/9C52 29 FF 07    AND #$07FF              A:0488 X:3919 Y:0000 P:envmxdizc
 
  $81/9C55 85 12      STA $12    [$00:0012]  A:0488 X:3919 Y:0000 P:envmxdizc
 
  $81/9C55 85 12      STA $12    [$00:0012]  A:0488 X:3919 Y:0000 P:envmxdizc
Line 7,981: Line 8,009:
 
  $81/9CB1 6B          RTL                    A:AC7E X:A800 Y:3C00 P:eNvMxdizc
 
  $81/9CB1 6B          RTL                    A:AC7E X:A800 Y:3C00 P:eNvMxdizc
  
== $81/9CB2 ? ==
+
== $81/9CB2 ? Some VRAM DMA ==
 +
 
 +
'''I logged this. This only seems to be executed in the Attraction Mode when the stats bars appear'''
 +
 
 +
This sets up a VRAM DMA.
 +
 
 +
If $0C is empty,  the whole VRAM DMA gets skipped.
 +
 
 +
A contains the DMA Source Bank
 +
 
 +
X contains the DMA Source Address
 +
 
 +
Y contains the VRAM Destination Address
 +
 
 +
$10 is an offset that gets added to X (DMA Source Address)
 +
 
 +
$12 is an offset that gets added to Y (VRAM Destination Address)
  
 
  $81/9CB2 DA          PHX          ; Buffer X, Y and A on Stack
 
  $81/9CB2 DA          PHX          ; Buffer X, Y and A on Stack
Line 7,993: Line 8,037:
 
  $81/9CBE AA          TAX                    A:AC88 X:A800 Y:3C00 P:eNvmxdizc
 
  $81/9CBE AA          TAX                    A:AC88 X:A800 Y:3C00 P:eNvmxdizc
 
  $81/9CBF A5 12      LDA $12    [$00:0012]  A:AC88 X:AC88 Y:3C00 P:eNvmxdizc
 
  $81/9CBF A5 12      LDA $12    [$00:0012]  A:AC88 X:AC88 Y:3C00 P:eNvmxdizc
  $81/9CC1 4A          LSR A                   A:0488 X:AC88 Y:3C00 P:envmxdizc
+
  $81/9CC1 4A          LSR A         ; Divide by two
  $81/9CC2 48          PHA                     A:0244 X:AC88 Y:3C00 P:envmxdizc
+
  $81/9CC2 48          PHA           ; Add value in A to Y
  $81/9CC3 98          TYA                     A:0244 X:AC88 Y:3C00 P:envmxdizc
+
  $81/9CC3 98          TYA           ; This is done by pushing A on stack...
  $81/9CC4 63 01      ADC $01,s [$00:1FB7]  A:3C00 X:AC88 Y:3C00 P:envmxdizc
+
  $81/9CC4 63 01      ADC $01,s     ; ... transfering Y in A, adding that stack value...
  $81/9CC6 A8          TAY                     A:3E44 X:AC88 Y:3C00 P:envmxdizc
+
  $81/9CC6 A8          TAY           ; ... and cleaning up again.
  $81/9CC7 68          PLA                     A:3E44 X:AC88 Y:3E44 P:envmxdizc
+
  $81/9CC7 68          PLA
  $81/9CC8 E2 20      SEP #$20               A:0244 X:AC88 Y:3E44 P:envmxdizc
+
  $81/9CC8 E2 20      SEP #$20     ; A = 8-bit
  $81/9CCA A3 01      LDA $01,s [$00:1FB9]  A:0244 X:AC88 Y:3E44 P:envMxdizc
+
  $81/9CCA A3 01      LDA $01,s     ; Restore Original A value (while keeping it on stack)
  $81/9CCC 22 24 9F 80 JSL $809F24[$80:9F24]   A:027E X:AC88 Y:3E44 P:envMxdizc
+
  $81/9CCC 22 24 9F 80 JSL $809F24  ; VRAM DMA
  $81/9CD0 E2 20      SEP #$20               A:AC80 X:0000 Y:3E44 P:envMxdizc
+
  $81/9CD0 E2 20      SEP #$20     ; A = 8-bit
 
  $81/9CD2 68          PLA          ; Restore A, Y and X from Stack
 
  $81/9CD2 68          PLA          ; Restore A, Y and X from Stack
 
  $81/9CD3 7A          PLY
 
  $81/9CD3 7A          PLY
Line 8,699: 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,711: 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,753: 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,247: Line 9,292:
 
  $81/BCB3 20 99 AB    JSR $AB99  [$81:AB99]  A:4C00 X:45D9 Y:45D9 P:envMxdiZc
 
  $81/BCB3 20 99 AB    JSR $AB99  [$81:AB99]  A:4C00 X:45D9 Y:45D9 P:envMxdiZc
 
  $81/BCB6 90 07      BCC $07    [$BCBF]      A:0003 X:45D9 Y:45D9 P:envMxdiZC
 
  $81/BCB6 90 07      BCC $07    [$BCBF]      A:0003 X:45D9 Y:45D9 P:envMxdiZC
  $81/BCB8 AD 65 05    LDA $0565 [$7E:0565]  A:0003 X:45D9 Y:45D9 P:envMxdiZC
+
  $81/BCB8 AD 65 05    LDA $0565     ; Load Copy Value of Held Joypad Buttons
 
  $81/BCBB 89 80      BIT #$80                A:0000 X:45D9 Y:45D9 P:envMxdiZC
 
  $81/BCBB 89 80      BIT #$80                A:0000 X:45D9 Y:45D9 P:envMxdiZC
  $81/BCBD D0 02      BNE $02   [$BCC1]     A:0000 X:45D9 Y:45D9 P:envMxdiZC
+
  $81/BCBD D0 02      BNE $02       ; [$BCC1] Branch if Button is held
  $81/BCBF 18          CLC                     A:0000 X:45D9 Y:45D9 P:envMxdiZC
+
  $81/BCBF 18          CLC           ; Else, Clear Carry (Flag) and exit
  $81/BCC0 60          RTS                     A:0000 X:45D9 Y:45D9 P:envMxdiZc
+
  $81/BCC0 60          RTS
 
  $81/BCC1 A9 01      LDA #$01                A:0080 X:45D9 Y:45D9 P:eNvMxdizC
 
  $81/BCC1 A9 01      LDA #$01                A:0080 X:45D9 Y:45D9 P:eNvMxdizC
 
  $81/BCC3 9D 2E 02    STA $022E,x[$7E:4807]  A:0001 X:45D9 Y:45D9 P:envMxdizC
 
  $81/BCC3 9D 2E 02    STA $022E,x[$7E:4807]  A:0001 X:45D9 Y:45D9 P:envMxdizC
Line 9,428: 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,439: 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,447: 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,457: 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,260: Line 10,305:
 
Executed every time a textbox pops up.
 
Executed every time a textbox pops up.
  
  $81/E9D7 C2 20      REP #$20               A:0032 X:5299 Y:2B00 P:envMxdizc
+
  $81/E9D7 C2 20      REP #$20     ; A = 16-bit
  $81/E9D9 29 FF 00    AND #$00FF             A:0032 X:5299 Y:2B00 P:envmxdizc
+
  $81/E9D9 29 FF 00    AND #$00FF   ; Clear High Byte of A
  $81/E9DC 0A          ASL A                   A:0032 X:5299 Y:2B00 P:envmxdizc
+
  $81/E9DC 0A          ASL A         ; Multiply A by 8
  $81/E9DD 0A          ASL A                   A:0064 X:5299 Y:2B00 P:envmxdizc
+
  $81/E9DD 0A          ASL A
  $81/E9DE 0A          ASL A                   A:00C8 X:5299 Y:2B00 P:envmxdizc
+
  $81/E9DE 0A          ASL A
  $81/E9DF 48          PHA                     A:0190 X:5299 Y:2B00 P:envmxdizc
+
  $81/E9DF 48          PHA           ; Buffer A on stack
  $81/E9E0 E2 20      SEP #$20               A:0190 X:5299 Y:2B00 P:envmxdizc
+
  $81/E9E0 E2 20      SEP #$20     ; A = 8-bit
 
  $81/E9E2 A5 B0      LDA $B0    [$00:00B0]  A:0190 X:5299 Y:2B00 P:envMxdizc
 
  $81/E9E2 A5 B0      LDA $B0    [$00:00B0]  A:0190 X:5299 Y:2B00 P:envMxdizc
 
  $81/E9E4 22 B7 A5 88 JSL $88A5B7[$88:A5B7]  A:0108 X:5299 Y:2B00 P:envMxdizc
 
  $81/E9E4 22 B7 A5 88 JSL $88A5B7[$88:A5B7]  A:0108 X:5299 Y:2B00 P:envMxdizc
  $81/E9E8 C2 20      REP #$20               A:0004 X:5299 Y:2B00 P:envMxdizc
+
  $81/E9E8 C2 20      REP #$20     ; A = 16-bit
  $81/E9EA 03 01      ORA $01,s [$00:1FA2]  A:0004 X:5299 Y:2B00 P:envmxdizc
+
  $81/E9EA 03 01      ORA $01,s     ; Add the buffered value from stack to A
  $81/E9EC AA          TAX                     A:0194 X:5299 Y:2B00 P:envmxdizc
+
  $81/E9EC AA          TAX           ; Transfer A in X as Load Index
  $81/E9ED 68          PLA                     A:0194 X:0194 Y:2B00 P:envmxdizc
+
  $81/E9ED 68          PLA           ; Remove buffered A value from stack
 
  $81/E9EE BF 2F DF C4 LDA $C4DF2F,x[$C4:E0C3] A:0190 X:0194 Y:2B00 P:envmxdizc
 
  $81/E9EE BF 2F DF C4 LDA $C4DF2F,x[$C4:E0C3] A:0190 X:0194 Y:2B00 P:envmxdizc
  $81/E9F2 29 FF 00    AND #$00FF             A:4343 X:0194 Y:2B00 P:envmxdizc
+
  $81/E9F2 29 FF 00    AND #$00FF   ; Remove accidentally loaded second byte
  $81/E9F5 0A          ASL A                   A:0043 X:0194 Y:2B00 P:envmxdizc
+
  $81/E9F5 0A          ASL A         ; Multiply by 2 and use it as Load Index
  $81/E9F6 AA          TAX                     A:0086 X:0194 Y:2B00 P:envmxdizc
+
  $81/E9F6 AA          TAX
 
  $81/E9F7 BF 01 80 C3 LDA $C38001,x[$C3:8087] A:0086 X:0086 Y:2B00 P:envmxdizc
 
  $81/E9F7 BF 01 80 C3 LDA $C38001,x[$C3:8087] A:0086 X:0086 Y:2B00 P:envmxdizc
 
  $81/E9FB AA          TAX                    A:8320 X:0086 Y:2B00 P:eNvmxdizc
 
  $81/E9FB AA          TAX                    A:8320 X:0086 Y:2B00 P:eNvmxdizc
Line 10,286: Line 10,331:
 
  $81/EA07 A9 C3      LDA #$C3                A:FBC9 X:8320 Y:2B00 P:eNvMxdizc
 
  $81/EA07 A9 C3      LDA #$C3                A:FBC9 X:8320 Y:2B00 P:eNvMxdizc
 
  $81/EA09 22 CC F7 81 JSL $81F7CC[$81:F7CC]  A:FBC3 X:8320 Y:2B00 P:eNvMxdizc
 
  $81/EA09 22 CC F7 81 JSL $81F7CC[$81:F7CC]  A:FBC3 X:8320 Y:2B00 P:eNvMxdizc
  $81/EA0D 6B          RTL                     A:FFFF X:8326 Y:52B7 P:envMxdizC
+
  $81/EA0D 6B          RTL
  
 
== $81/EA40 ? ==
 
== $81/EA40 ? ==
Line 10,356: Line 10,401:
 
  $81/EAA1 A9 7E      LDA #$7E                A:527E X:5299 Y:52B7 P:envMxdizc
 
  $81/EAA1 A9 7E      LDA #$7E                A:527E X:5299 Y:52B7 P:envMxdizc
 
  $81/EAA3 85 22      STA $22    [$00:0022]  A:527E X:5299 Y:52B7 P:envMxdizc
 
  $81/EAA3 85 22      STA $22    [$00:0022]  A:527E X:5299 Y:52B7 P:envMxdizc
  $81/EAA5 7B          TDC                     A:527E X:5299 Y:52B7 P:envMxdizc
+
  $81/EAA5 7B          TDC           ; Clear 16-bit A
 
  $81/EAA6 A5 0E      LDA $0E    [$00:000E]  A:0000 X:5299 Y:52B7 P:envMxdiZc
 
  $81/EAA6 A5 0E      LDA $0E    [$00:000E]  A:0000 X:5299 Y:52B7 P:envMxdiZc
  $81/EAA8 C2 20      REP #$20               A:0001 X:5299 Y:52B7 P:envMxdizc
+
  $81/EAA8 C2 20      REP #$20     ; A = 16-bit
  $81/EAAA 0A          ASL A                   A:0001 X:5299 Y:52B7 P:envmxdizc
+
  $81/EAAA 0A          ASL A         ; Multiply A by #$10
  $81/EAAB 0A          ASL A                   A:0002 X:5299 Y:52B7 P:envmxdizc
+
  $81/EAAB 0A          ASL A         ; This line could be removed? - just use XBA?
  $81/EAAC 0A          ASL A                   A:0004 X:5299 Y:52B7 P:envmxdizc
+
  $81/EAAC 0A          ASL A
  $81/EAAD 0A          ASL A                   A:0008 X:5299 Y:52B7 P:envmxdizc
+
  $81/EAAD 0A          ASL A
 
  $81/EAAE 1A          INC A                  A:0010 X:5299 Y:52B7 P:envmxdizc
 
  $81/EAAE 1A          INC A                  A:0010 X:5299 Y:52B7 P:envmxdizc
 
  $81/EAAF 85 0E      STA $0E    [$00:000E]  A:0011 X:5299 Y:52B7 P:envmxdizc
 
  $81/EAAF 85 0E      STA $0E    [$00:000E]  A:0011 X:5299 Y:52B7 P:envmxdizc
Line 10,397: Line 10,442:
 
== $81/EB38 ? ==
 
== $81/EB38 ? ==
  
  $81/EB38 DA          PHX                     A:0032 X:0001 Y:2B00 P:envMxdizC
+
  $81/EB38 DA          PHX           ; Buffer X and Y on stack
  $81/EB39 5A          PHY                     A:0032 X:0001 Y:2B00 P:envMxdizC
+
  $81/EB39 5A          PHY
  $81/EB3A 64 0E      STZ $0E   [$00:000E]  A:0032 X:0001 Y:2B00 P:envMxdizC
+
  $81/EB3A 64 0E      STZ $0E       ; Clear $0E
  $81/EB3C D4 0E      PEI ($0E)       [$0000]      A:0032 X:0001 Y:2B00 P:envMxdizC
+
  $81/EB3C D4 0E      PEI ($0E)     ; Push an empty byte on stack
  $81/EB3E 48          PHA                     A:0032 X:0001 Y:2B00 P:envMxdizC
+
  $81/EB3E 48          PHA           ; Buffer A on stack
 
  $81/EB3F A6 5C      LDX $5C    [$00:005C]  A:0032 X:0001 Y:2B00 P:envMxdizC
 
  $81/EB3F A6 5C      LDX $5C    [$00:005C]  A:0032 X:0001 Y:2B00 P:envMxdizC
 
  $81/EB41 86 20      STX $20    [$00:0020]  A:0032 X:5299 Y:2B00 P:envMxdizC
 
  $81/EB41 86 20      STX $20    [$00:0020]  A:0032 X:5299 Y:2B00 P:envMxdizC
 
  $81/EB43 A9 7E      LDA #$7E                A:0032 X:5299 Y:2B00 P:envMxdizC
 
  $81/EB43 A9 7E      LDA #$7E                A:0032 X:5299 Y:2B00 P:envMxdizC
 
  $81/EB45 85 22      STA $22    [$00:0022]  A:007E X:5299 Y:2B00 P:envMxdizC
 
  $81/EB45 85 22      STA $22    [$00:0022]  A:007E X:5299 Y:2B00 P:envMxdizC
  $81/EB47 A2 41 C3    LDX #$C341             A:007E X:5299 Y:2B00 P:envMxdizC
+
  $81/EB47 A2 41 C3    LDX #$C341   ; Setup address $C0/C341 in [$23]
  $81/EB4A A9 C0      LDA #$C0               A:007E X:C341 Y:2B00 P:eNvMxdizC
+
  $81/EB4A A9 C0      LDA #$C0
  $81/EB4C 86 23      STX $23   [$00:0023]  A:00C0 X:C341 Y:2B00 P:eNvMxdizC
+
  $81/EB4C 86 23      STX $23
  $81/EB4E 85 25      STA $25   [$00:0025]  A:00C0 X:C341 Y:2B00 P:eNvMxdizC
+
  $81/EB4E 85 25      STA $25
  $81/EB50 7B          TDC                     A:00C0 X:C341 Y:2B00 P:eNvMxdizC
+
  $81/EB50 7B          TDC           ; Clear 16-bit A
  $81/EB51 68          PLA                     A:0000 X:C341 Y:2B00 P:envMxdiZC
+
  $81/EB51 68          PLA           ; Restore A from stack
  $81/EB52 C2 20      REP #$20               A:0032 X:C341 Y:2B00 P:envMxdizC
+
  $81/EB52 C2 20      REP #$20     ; A = 16-bit
  $81/EB54 0A          ASL A                   A:0032 X:C341 Y:2B00 P:envmxdizC
+
  $81/EB54 0A          ASL A         ; Multiply by 4
  $81/EB55 0A          ASL A                   A:0064 X:C341 Y:2B00 P:envmxdizc
+
  $81/EB55 0A          ASL A
  $81/EB56 AA          TAX                     A:00C8 X:C341 Y:2B00 P:envmxdizc
+
  $81/EB56 AA          TAX           ; Transfer A in X as Load Index
 
  $81/EB57 BF AF EC 81 LDA $81ECAF,x[$81:ED77] A:00C8 X:00C8 Y:2B00 P:envmxdizc
 
  $81/EB57 BF AF EC 81 LDA $81ECAF,x[$81:ED77] A:00C8 X:00C8 Y:2B00 P:envmxdizc
 
  $81/EB5B 0A          ASL A                  A:0032 X:00C8 Y:2B00 P:envmxdizc
 
  $81/EB5B 0A          ASL A                  A:0032 X:00C8 Y:2B00 P:envmxdizc
Line 10,439: Line 10,484:
 
  $81/EB80 85 0E      STA $0E    [$00:000E]  A:02AF X:0000 Y:2B00 P:envmxdizC
 
  $81/EB80 85 0E      STA $0E    [$00:000E]  A:02AF X:0000 Y:2B00 P:envmxdizC
 
  $81/EB82 68          PLA                    A:02AF X:0000 Y:2B00 P:envmxdizC
 
  $81/EB82 68          PLA                    A:02AF X:0000 Y:2B00 P:envmxdizC
  $81/EB83 E2 20      SEP #$20               A:0001 X:0000 Y:2B00 P:envmxdizC
+
  $81/EB83 E2 20      SEP #$20     ; A = 8-bit
  $81/EB85 60          RTS                     A:0001 X:0000 Y:2B00 P:envMxdizC
+
  $81/EB85 60          RTS
  
 
== $81/EB86 ? Use A as Load Index from a Table ==
 
== $81/EB86 ? Use A as Load Index from a Table ==
Line 10,464: 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,492: 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 11,360: Line 11,414:
 
  $82/990F BD B7 19    LDA $19B7,x  ; ???
 
  $82/990F BD B7 19    LDA $19B7,x  ; ???
 
  $82/9912 8D 9D 1E    STA $1E9D
 
  $82/9912 8D 9D 1E    STA $1E9D
  $82/9915 BD 26 1D    LDA $1D26,x  ; ???
+
  $82/9915 BD 26 1D    LDA $1D26,x  ; Type (Manual/Guest)
 
  $82/9918 8D 9E 1E    STA $1E9E
 
  $82/9918 8D 9E 1E    STA $1E9E
 
  $82/991B C2 20      REP #$20      ; 16 bit values ahead
 
  $82/991B C2 20      REP #$20      ; 16 bit values ahead
Line 11,383: Line 11,437:
 
  $82/9953 BD 8E 19    LDA $198E,x  ; MEN
 
  $82/9953 BD 8E 19    LDA $198E,x  ; MEN
 
  $82/9956 8D 7C 1E    STA $1E7C
 
  $82/9956 8D 7C 1E    STA $1E7C
  $82/9959 BD 7E 1A    LDA $1A7E,x  ; ???
+
  $82/9959 BD 7E 1A    LDA $1A7E,x  ; Equipment UL/UR Corner
 
  $82/995C 8D 83 1E    STA $1E83
 
  $82/995C 8D 83 1E    STA $1E83
  $82/995F BD A6 1A    LDA $1AA6,x  ; ???
+
  $82/995F BD A6 1A    LDA $1AA6,x  ; Equipment LL/LR Corner
 
  $82/9962 8D 85 1E    STA $1E85
 
  $82/9962 8D 85 1E    STA $1E85
  $82/9965 BD CE 1A    LDA $1ACE,x  ; ???
+
  $82/9965 BD CE 1A    LDA $1ACE,x  ; Second Screen Item 1/2
 
  $82/9968 8D 87 1E    STA $1E87
 
  $82/9968 8D 87 1E    STA $1E87
  $82/996B BD F6 1A    LDA $1AF6,x  ; ???
+
  $82/996B BD F6 1A    LDA $1AF6,x  ; Second Screen Item 3/4
 
  $82/996E 8D 89 1E    STA $1E89
 
  $82/996E 8D 89 1E    STA $1E89
  $82/9971 BD 1E 1B    LDA $1B1E,x  ; ???
+
  $82/9971 BD 1E 1B    LDA $1B1E,x  ; Bonus/Malus on Equipment UL/UR Corner
 
  $82/9974 8D 8B 1E    STA $1E8B
 
  $82/9974 8D 8B 1E    STA $1E8B
  $82/9977 BD 46 1B    LDA $1B46,x  ; ???
+
  $82/9977 BD 46 1B    LDA $1B46,x  ; Bonus/Malus on Equipment LL/LR Corner
 
  $82/997A 8D 8D 1E    STA $1E8D
 
  $82/997A 8D 8D 1E    STA $1E8D
  $82/997D BD 96 1B    LDA $1B96,x  ; ???
+
  $82/997D BD 96 1B    LDA $1B96,x  ; Current WT
 
  $82/9980 8D 92 1E    STA $1E92
 
  $82/9980 8D 92 1E    STA $1E92
 
  $82/9983 BD 9E 1D    LDA $1D9E,x  ; 16-bit Address (on WRAM bank $7E) of the Character's name, class etc.
 
  $82/9983 BD 9E 1D    LDA $1D9E,x  ; 16-bit Address (on WRAM bank $7E) of the Character's name, class etc.
Line 11,665: Line 11,719:
 
  $82/DF2A E2 20      SEP #$20      ; This line could be removed?
 
  $82/DF2A E2 20      SEP #$20      ; This line could be removed?
 
  $82/DF2C C2 21      REP #$21      ; Clear Carry
 
  $82/DF2C C2 21      REP #$21      ; Clear Carry
  $82/DF2E AD C6 16    LDA $16C6 [$82:16C6]  A:2384 X:2000 Y:0003 P:envmxdizc
+
  $82/DF2E AD C6 16    LDA $16C6     ; Load Index/Offset for the Terrain Type Dataset
  $82/DF31 69 5D 87    ADC #$875D             A:0080 X:2000 Y:0003 P:envmxdizc
+
  $82/DF31 69 5D 87    ADC #$875D   ; Add Offset of the Data Table ($8B/875D) to the Index
  $82/DF34 85 26      STA $26   [$00:0026]   A:87DD X:2000 Y:0003 P:eNvmxdizc
+
  $82/DF34 85 26      STA $26       ; Set it up as 24-bit Load Address in [$26]
  $82/DF36 E2 20      SEP #$20               A:87DD X:2000 Y:0003 P:eNvmxdizc
+
  $82/DF36 E2 20      SEP #$20
  $82/DF38 A9 8B      LDA #$8B               A:87DD X:2000 Y:0003 P:eNvMxdizc
+
  $82/DF38 A9 8B      LDA #$8B
  $82/DF3A 85 28      STA $28   [$00:0028]  A:878B X:2000 Y:0003 P:eNvMxdizc
+
  $82/DF3A 85 28      STA $28
 
  $82/DF3C AD CA 16    LDA $16CA    ; Setup Outer Loop Counter:
 
  $82/DF3C AD CA 16    LDA $16CA    ; Setup Outer Loop Counter:
 
  $82/DF3F 85 00      STA $00      ; Width of the Map of the Map on the NE-SW-Axis
 
  $82/DF3F 85 00      STA $00      ; Width of the Map of the Map on the NE-SW-Axis
Line 11,865: Line 11,919:
  
 
$00 contains the Original X value - Low Byte
 
$00 contains the Original X value - Low Byte
 +
 
$01 contains the Original X value - High Byte
 
$01 contains the Original X value - High Byte
  
 
$09 entry of the $7F/C800 table
 
$09 entry of the $7F/C800 table
 +
 
$0A contains the Original X value
 
$0A contains the Original X value
 +
 
$0B contains the Original Y value
 
$0B contains the Original Y value
  
 
$0E contains the Offset of the Rhomb that this subroutine is aimed at (X/Y Original Contents)
 
$0E contains the Offset of the Rhomb that this subroutine is aimed at (X/Y Original Contents)
 +
 +
$10 contains some kinda case decider, see $82/E120
  
 
  $82/E0F6 86 00      STX $00      ; Buffer brought-in X in $00/1
 
  $82/E0F6 86 00      STX $00      ; Buffer brought-in X in $00/1
Line 11,883: Line 11,942:
 
  $82/E106 8D 03 42    STA $4203
 
  $82/E106 8D 03 42    STA $4203
 
  $82/E109 8A          TXA
 
  $82/E109 8A          TXA
  $82/E10A 85 0A      STA $0A      ; Buffer Original X in $0C
+
  $82/E10A 85 0A      STA $0A      ; Buffer Original X in $0A
 
  $82/E10C C2 21      REP #$21      ; 16 bit A, Clear Carry
 
  $82/E10C C2 21      REP #$21      ; 16 bit A, Clear Carry
 
  $82/E10E 8A          TXA          ; A = Orig. X + Orig. Y * #$20
 
  $82/E10E 8A          TXA          ; A = Orig. X + Orig. Y * #$20
Line 11,892: Line 11,951:
 
  $82/E117 BF 00 C8 7F LDA $7FC800,x ; Load Step Number(?) of the Rhomb
 
  $82/E117 BF 00 C8 7F LDA $7FC800,x ; Load Step Number(?) of the Rhomb
 
  $82/E11B 85 09      STA $09      ; Store Value in $09
 
  $82/E11B 85 09      STA $09      ; Store Value in $09
  $82/E11D 20 50 E3    JSR $E350 [$82:E350]  A:001F X:0021 Y:0001 P:envMxdizc
+
  $82/E11D 20 50 E3    JSR $E350     ; ??? (Calculates a value in Y)
 
  $82/E120 A5 10      LDA $10    [$00:0010]  A:009E X:0021 Y:009E P:envMxdizc
 
  $82/E120 A5 10      LDA $10    [$00:0010]  A:009E X:0021 Y:009E P:envMxdizc
 
  $82/E122 F0 01      BEQ $01    [$E125]      A:0000 X:0021 Y:009E P:envMxdiZc
 
  $82/E122 F0 01      BEQ $01    [$E125]      A:0000 X:0021 Y:009E P:envMxdiZc
Line 11,904: Line 11,963:
 
  $82/E131 A5 10      LDA $10    [$00:0010]  A:00FF X:0021 Y:009E P:eNvMxdizc
 
  $82/E131 A5 10      LDA $10    [$00:0010]  A:00FF X:0021 Y:009E P:eNvMxdizc
 
  $82/E133 D0 0C      BNE $0C    [$E141]      A:0000 X:0021 Y:009E P:envMxdiZc
 
  $82/E133 D0 0C      BNE $0C    [$E141]      A:0000 X:0021 Y:009E P:envMxdiZc
  $82/E135 BF 20 C8 7F LDA $7FC820,x[$7F:C841] A:0000 X:0021 Y:009E P:envMxdiZc
+
  $82/E135 BF 20 C8 7F LDA $7FC820,x ; Load Step Map value from next row's Rhomb
  $82/E139 85 0D      STA $0D   [$00:000D]  A:001F X:0021 Y:009E P:envMxdizc
+
  $82/E139 85 0D      STA $0D       ; Buffer in $0D
  $82/E13B BF 20 D0 7F LDA $7FD020,x[$7F:D041] A:001F X:0021 Y:009E P:envMxdizc
+
  $82/E13B BF 20 D0 7F LDA $7FD020,x ; Load ??? Map value from next row's Rhomb
 
  $82/E13F 80 0A      BRA $0A    [$E14B]      A:0011 X:0021 Y:009E P:envMxdizc
 
  $82/E13F 80 0A      BRA $0A    [$E14B]      A:0011 X:0021 Y:009E P:envMxdizc
 
; Code is missing here
 
; Code is missing here
  $82/E14B 4A          LSR A                   A:0011 X:0021 Y:009E P:envMxdizc
+
  $82/E14B 4A          LSR A         ; divide by #$20
  $82/E14C 4A          LSR A                   A:0008 X:0021 Y:009E P:envMxdizC
+
  $82/E14C 4A          LSR A
  $82/E14D 4A          LSR A                   A:0004 X:0021 Y:009E P:envMxdizc
+
  $82/E14D 4A          LSR A
  $82/E14E 4A          LSR A                   A:0002 X:0021 Y:009E P:envMxdizc
+
  $82/E14E 4A          LSR A
  $82/E14F 4A          LSR A                   A:0001 X:0021 Y:009E P:envMxdizc
+
  $82/E14F 4A          LSR A
 
  $82/E150 85 05      STA $05    [$00:0005]  A:0000 X:0021 Y:009E P:envMxdiZC
 
  $82/E150 85 05      STA $05    [$00:0005]  A:0000 X:0021 Y:009E P:envMxdiZC
 
  $82/E152 64 04      STZ $04    [$00:0004]  A:0000 X:0021 Y:009E P:envMxdiZC
 
  $82/E152 64 04      STZ $04    [$00:0004]  A:0000 X:0021 Y:009E P:envMxdiZC
Line 11,930: Line 11,989:
 
  $82/E16D E6 0A      INC $0A    [$00:000A]  A:0100 X:01BC Y:007E P:envMxdiZc
 
  $82/E16D E6 0A      INC $0A    [$00:000A]  A:0100 X:01BC Y:007E P:envMxdiZc
 
  $82/E16F A5 0A      LDA $0A    [$00:000A]  A:0100 X:01BC Y:007E P:envMxdizc
 
  $82/E16F A5 0A      LDA $0A    [$00:000A]  A:0100 X:01BC Y:007E P:envMxdizc
  $82/E171 CD C8 16    CMP $16C8 [$82:16C8]  A:0102 X:01BC Y:007E P:envMxdizc
+
  $82/E171 CD C8 16    CMP $16C8     ; Compare with Width of the Map on the NW-SE-Axis
  $82/E174 90 03      BCC $03   [$E179]     A:0102 X:01BC Y:007E P:eNvMxdizc
+
  $82/E174 90 03      BCC $03       ; [$E179] Branch if $0A hasn't exceeded it
 +
; code is missing here
 
  $82/E179 A6 0E      LDX $0E    [$00:000E]  A:0102 X:01BC Y:007E P:eNvMxdizc
 
  $82/E179 A6 0E      LDX $0E    [$00:000E]  A:0102 X:01BC Y:007E P:eNvMxdizc
 
  $82/E17B E8          INX                    A:0102 X:0041 Y:007E P:envMxdizc
 
  $82/E17B E8          INX                    A:0102 X:0041 Y:007E P:envMxdizc
 
  $82/E17C 86 0E      STX $0E    [$00:000E]  A:0102 X:0042 Y:007E P:envMxdizc
 
  $82/E17C 86 0E      STX $0E    [$00:000E]  A:0102 X:0042 Y:007E P:envMxdizc
  $82/E17E BF FF D7 7F LDA $7FD7FF,x[$7F:D841] A:0102 X:0042 Y:007E P:envMxdizc
+
  $82/E17E BF FF D7 7F LDA $7FD7FF,x ; Load Height Map value from previous Rhomb
 
  $82/E182 C5 12      CMP $12    [$00:0012]  A:011F X:0042 Y:007E P:envMxdizc
 
  $82/E182 C5 12      CMP $12    [$00:0012]  A:011F X:0042 Y:007E P:envMxdizc
 
  $82/E184 B0 26      BCS $26    [$E1AC]      A:011F X:0042 Y:007E P:eNvMxdizc
 
  $82/E184 B0 26      BCS $26    [$E1AC]      A:011F X:0042 Y:007E P:eNvMxdizc
Line 11,941: Line 12,001:
 
  $82/E188 80 22      BRA $22    [$E1AC]      A:011F X:0042 Y:007E P:eNvMxdizc
 
  $82/E188 80 22      BRA $22    [$E1AC]      A:011F X:0042 Y:007E P:eNvMxdizc
 
  $82/E18A E6 0B      INC $0B    [$00:000B]  A:0001 X:013C Y:0024 P:envMxdizc
 
  $82/E18A E6 0B      INC $0B    [$00:000B]  A:0001 X:013C Y:0024 P:envMxdizc
  $82/E18C A5 0B      LDA $0B   [$00:000B]  A:0001 X:013C Y:0024 P:envMxdizc
+
  $82/E18C A5 0B      LDA $0B       ;
  $82/E18E CD CA 16    CMP $16CA [$82:16CA]  A:0002 X:013C Y:0024 P:envMxdizc
+
  $82/E18E CD CA 16    CMP $16CA     ; Compare with Width of the Map on the NE-SW-Axis
  $82/E191 90 03      BCC $03   [$E196]     A:0002 X:013C Y:0024 P:eNvMxdizc
+
  $82/E191 90 03      BCC $03       ; [$E196] Branch if $0B hasn't exceeded it
  $82/E196 C2 21      REP #$21               A:0002 X:013C Y:0024 P:eNvMxdizc
+
;code is missing here
  $82/E198 A5 0E      LDA $0E   [$00:000E]  A:0002 X:013C Y:0024 P:eNvmxdizc
+
  $82/E196 C2 21      REP #$21     ; Clear Carry and add #$20 to $0E
  $82/E19A 69 20 00    ADC #$0020             A:0021 X:013C Y:0024 P:envmxdizc
+
  $82/E198 A5 0E      LDA $0E
  $82/E19D 85 0E      STA $0E   [$00:000E]  A:0041 X:013C Y:0024 P:envmxdizc
+
  $82/E19A 69 20 00    ADC #$0020
  $82/E19F E2 20      SEP #$20               A:0041 X:013C Y:0024 P:envmxdizc
+
  $82/E19D 85 0E      STA $0E
  $82/E1A1 AA          TAX                     A:0041 X:013C Y:0024 P:envMxdizc
+
  $82/E19F E2 20      SEP #$20
  $82/E1A2 BF E0 D7 7F LDA $7FD7E0,x[$7F:D821] A:0041 X:0041 Y:0024 P:envMxdizc
+
  $82/E1A1 AA          TAX           ; Transfer new value in $0E in X as Load Index
 +
  $82/E1A2 BF E0 D7 7F LDA $7FD7E0,x ; Load Height Map value from previous row's Rhomb
 
  $82/E1A6 C5 12      CMP $12    [$00:0012]  A:001F X:0041 Y:0024 P:envMxdizc
 
  $82/E1A6 C5 12      CMP $12    [$00:0012]  A:001F X:0041 Y:0024 P:envMxdizc
 
  $82/E1A8 B0 02      BCS $02    [$E1AC]      A:001F X:0041 Y:0024 P:eNvMxdizc
 
  $82/E1A8 B0 02      BCS $02    [$E1AC]      A:001F X:0041 Y:0024 P:eNvMxdizc
Line 12,034: Line 12,095:
 
  $82/E2A8 D0 1D      BNE $1D      ; [$E2C7] ???
 
  $82/E2A8 D0 1D      BNE $1D      ; [$E2C7] ???
 
  $82/E2AA E6 03      INC $03    [$00:0003]  A:0300 X:0183 Y:0395 P:envMxdiZc
 
  $82/E2AA E6 03      INC $03    [$00:0003]  A:0300 X:0183 Y:0395 P:envMxdiZc
  $82/E2AC BF 00 D8 7F LDA $7FD800,x[$7F:D983] A:0300 X:0183 Y:0395 P:envMxdizc
+
  $82/E2AC BF 00 D8 7F LDA $7FD800,x ; Load corresponding rhomb's value from Height Map
  $82/E2B0 85 00      STA $00   [$00:0000]  A:031C X:0183 Y:0395 P:envMxdizc
+
  $82/E2B0 85 00      STA $00       ; Buffer in $00
  $82/E2B2 C2 21      REP #$21               A:1600 X:03DE Y:165E P:envMxdiZc
+
  $82/E2B2 C2 21      REP #$21     ; Clear Carry and add #$20 to X (jump to the next row)
  $82/E2B4 8A          TXA                     A:1600 X:03DE Y:165E P:envmxdiZc
+
  $82/E2B4 8A          TXA
  $82/E2B5 69 20 00    ADC #$0020             A:03DE X:03DE Y:165E P:envmxdizc
+
  $82/E2B5 69 20 00    ADC #$0020
  $82/E2B8 AA          TAX                     A:03FE X:03DE Y:165E P:envmxdizc
+
  $82/E2B8 AA          TAX
  $82/E2B9 E2 20      SEP #$20               A:03FE X:03FE Y:165E P:envmxdizc
+
  $82/E2B9 E2 20      SEP #$20
  $82/E2BB BF 00 C8 7F LDA $7FC800,x[$7F:CBFE] A:03FE X:03FE Y:165E P:envMxdizc
+
  $82/E2BB BF 00 C8 7F LDA $7FC800,x ; Load (next row) value from Step Map
  $82/E2BF 30 29      BMI $29   [$E2EA]     A:03FF X:03FE Y:165E P:eNvMxdizc
+
  $82/E2BF 30 29      BMI $29       ; [$E2EA] Branch if Step Map value is negative ( =#$FF = invalid?)
  $82/E2C1 D0 04      BNE $04   [$E2C7]     A:0000 X:0061 Y:00DD P:envMxdiZc
+
  $82/E2C1 D0 04      BNE $04       ; [$E2C7] Branch if Step Map value is positive and not zero
 
  $82/E2C3 E6 03      INC $03    [$00:0003]  A:0000 X:0061 Y:00DD P:envMxdiZc
 
  $82/E2C3 E6 03      INC $03    [$00:0003]  A:0000 X:0061 Y:00DD P:envMxdiZc
 
  $82/E2C5 80 D4      BRA $D4    [$E29B]      A:0000 X:0061 Y:00DD P:envMxdizc
 
  $82/E2C5 80 D4      BRA $D4    [$E29B]      A:0000 X:0061 Y:00DD P:envMxdizc
  $82/E2C7 C5 00      CMP $00   [$00:0000]  A:001C X:0062 Y:00DD P:envMxdizc
+
  $82/E2C7 C5 00      CMP $00       ; Compare Step Map value with Height Map value
 
  $82/E2C9 B0 02      BCS $02    [$E2CD]      A:001C X:0062 Y:00DD P:envMxdiZC
 
  $82/E2C9 B0 02      BCS $02    [$E2CD]      A:001C X:0062 Y:00DD P:envMxdiZC
 
; Code is missing here
 
; Code is missing here
Line 12,055: Line 12,116:
 
  $82/E2D4 A5 09      LDA $09    [$00:0009]  A:0021 X:0062 Y:00DD P:envMxdizc
 
  $82/E2D4 A5 09      LDA $09    [$00:0009]  A:0021 X:0062 Y:00DD P:envMxdizc
 
  $82/E2D6 38          SEC                    A:001F X:0062 Y:00DD P:envMxdizc
 
  $82/E2D6 38          SEC                    A:001F X:0062 Y:00DD P:envMxdizc
  $82/E2D7 E5 00      SBC $00   [$00:0000]  A:001F X:0062 Y:00DD P:envMxdizC
+
  $82/E2D7 E5 00      SBC $00       ; Subtract Height Map value
 
  $82/E2D9 18          CLC                    A:0003 X:0062 Y:00DD P:envMxdizC
 
  $82/E2D9 18          CLC                    A:0003 X:0062 Y:00DD P:envMxdizC
 
  $82/E2DA 65 03      ADC $03    [$00:0003]  A:0003 X:0062 Y:00DD P:envMxdizc
 
  $82/E2DA 65 03      ADC $03    [$00:0003]  A:0003 X:0062 Y:00DD P:envMxdizc
Line 12,100: Line 12,161:
 
== $82/E350 ? ==
 
== $82/E350 ? ==
  
$09 entry of the $7F/C800 table
+
Mathematically spoken, the use of this subroutine is
 +
 
 +
Y = Width of the Map on the NE-SW-Axis + Original X - Original Y + (#$40 * (Original X + Original Y + 1 + $16CC - Step Value per Rhomb))
 +
 
 +
$09 entry of the $7F/C800 table - Step Value per Rhomb
 +
 
 
$0A contains the Original X value
 
$0A contains the Original X value
 +
 
$0B contains the Original Y value
 
$0B contains the Original Y value
  
  $82/E350 A9 40      LDA #$40               A:001F X:0021 Y:0001 P:envMxdizc
+
  $82/E350 A9 40      LDA #$40     ; Multiply by #$40
  $82/E352 8D 02 42    STA $4202 [$82:4202]  A:0040 X:0021 Y:0001 P:envMxdizc
+
  $82/E352 8D 02 42    STA $4202
 
  $82/E355 A5 0A      LDA $0A    [$00:000A]  A:0040 X:0021 Y:0001 P:envMxdizc
 
  $82/E355 A5 0A      LDA $0A    [$00:000A]  A:0040 X:0021 Y:0001 P:envMxdizc
 
  $82/E357 38          SEC                    A:0001 X:0021 Y:0001 P:envMxdizc
 
  $82/E357 38          SEC                    A:0001 X:0021 Y:0001 P:envMxdizc
Line 12,113: Line 12,180:
 
  $82/E35E E5 09      SBC $09    [$00:0009]  A:0021 X:0021 Y:0001 P:envMxdizC
 
  $82/E35E E5 09      SBC $09    [$00:0009]  A:0021 X:0021 Y:0001 P:envMxdizC
 
  $82/E360 8D 03 42    STA $4203  [$82:4203]  A:0002 X:0021 Y:0001 P:envMxdizC
 
  $82/E360 8D 03 42    STA $4203  [$82:4203]  A:0002 X:0021 Y:0001 P:envMxdizC
  $82/E363 18          CLC                     A:0002 X:0021 Y:0001 P:envMxdizC
+
  $82/E363 18          CLC           ; Clear Carry
  $82/E364 7B          TDC                     A:0002 X:0021 Y:0001 P:envMxdizc
+
  $82/E364 7B          TDC           ; Clear 16-bit A
 
  $82/E365 AD CA 16    LDA $16CA  [$82:16CA]  A:0000 X:0021 Y:0001 P:envMxdiZc
 
  $82/E365 AD CA 16    LDA $16CA  [$82:16CA]  A:0000 X:0021 Y:0001 P:envMxdiZc
 
  $82/E368 65 0A      ADC $0A    [$00:000A]  A:001F X:0021 Y:0001 P:envMxdizc
 
  $82/E368 65 0A      ADC $0A    [$00:000A]  A:001F X:0021 Y:0001 P:envMxdizc
 
  $82/E36A E5 0B      SBC $0B    [$00:000B]  A:0020 X:0021 Y:0001 P:envMxdizc
 
  $82/E36A E5 0B      SBC $0B    [$00:000B]  A:0020 X:0021 Y:0001 P:envMxdizc
  $82/E36C C2 21      REP #$21               A:001E X:0021 Y:0001 P:envMxdizC
+
  $82/E36C C2 21      REP #$21     ; 16-bit A, Clear Carry
 
  $82/E36E 6D 16 42    ADC $4216  [$82:4216]  A:001E X:0021 Y:0001 P:envmxdizc
 
  $82/E36E 6D 16 42    ADC $4216  [$82:4216]  A:001E X:0021 Y:0001 P:envmxdizc
 
  $82/E371 A8          TAY                    A:009E X:0021 Y:0001 P:envmxdizc
 
  $82/E371 A8          TAY                    A:009E X:0021 Y:0001 P:envmxdizc
  $82/E372 E2 20      SEP #$20               A:009E X:0021 Y:009E P:envmxdizc
+
  $82/E372 E2 20      SEP #$20     ; 8-bit A
  $82/E374 60          RTS                     A:009E X:0021 Y:009E P:envMxdizc
+
  $82/E374 60          RTS
  
 
== $82/E375 ? ==
 
== $82/E375 ? ==
Line 12,417: 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,426: 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,447: 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 12,665: Line 12,732:
  
 
$00 and $02 contain 8-bit values that seem to be rhomb related(?). A contains an additional value of unknown sort.
 
$00 and $02 contain 8-bit values that seem to be rhomb related(?). A contains an additional value of unknown sort.
 +
 +
*** Just a quick note, because I'm not sure about this, so I can't explain that whole stuff correctly, wholely and completely convinced: that "subtract #$20" stuff seems to be related to "do more than one row". If that value is higher than #$20, its more than one row, and so it has to subtract that #$20 and make a mark somewhere that it has more to do. Or something
 +
  
 
  $82/F2AD 64 01      STZ $01    [$00:0001]  A:0003 X:00DF Y:0060 P:envMxdizc
 
  $82/F2AD 64 01      STZ $01    [$00:0001]  A:0003 X:00DF Y:0060 P:envMxdizc
Line 12,695: Line 12,765:
 
  $82/F2D7 C9 21      CMP #$21      ; Check if the value is less than #$21
 
  $82/F2D7 C9 21      CMP #$21      ; Check if the value is less than #$21
 
  $82/F2D9 90 0C      BCC $0C      ; [$F2E7] Branch if it is
 
  $82/F2D9 90 0C      BCC $0C      ; [$F2E7] Branch if it is
  $82/F2DB E9 20      SBC #$20               A:0628 X:00DF Y:0060 P:envMxdizC
+
  $82/F2DB E9 20      SBC #$20     ; *** See note above ***
 
  $82/F2DD 85 09      STA $09    [$00:0009]  A:0608 X:00DF Y:0060 P:envMxdizC
 
  $82/F2DD 85 09      STA $09    [$00:0009]  A:0608 X:00DF Y:0060 P:envMxdizC
 
  $82/F2DF A5 02      LDA $02    [$00:0002]  A:0608 X:00DF Y:0060 P:envMxdizC
 
  $82/F2DF A5 02      LDA $02    [$00:0002]  A:0608 X:00DF Y:0060 P:envMxdizC
Line 12,723: Line 12,793:
 
  $82/F31E 05 04      ORA $04      ; Put the transformed H/VScroll-values together
 
  $82/F31E 05 04      ORA $04      ; Put the transformed H/VScroll-values together
 
  $82/F320 A8          TAY                    A:061B X:0000 Y:0060 P:envmxdizc
 
  $82/F320 A8          TAY                    A:061B X:0000 Y:0060 P:envmxdizc
  $82/F321 A5 08      LDA $08   [$00:0008]  A:061B X:0000 Y:061B P:envmxdizc
+
  $82/F321 A5 08      LDA $08       ; Load Number of Double-Bytes to transfer
 
  $82/F323 20 5D F7    JSR $F75D    ; Update BG1 Tilemap Buffer (from Scrolling?)
 
  $82/F323 20 5D F7    JSR $F75D    ; Update BG1 Tilemap Buffer (from Scrolling?)
 
  $82/F326 80 09      BRA $09    [$F331]      A:101A X:0028 Y:101A P:envmxdiZc
 
  $82/F326 80 09      BRA $09    [$F331]      A:101A X:0028 Y:101A P:envmxdiZc
Line 12,738: Line 12,808:
 
  $82/F346 05 04      ORA $04    [$00:0004]  A:1000 X:0028 Y:101A P:eNvmxdizc
 
  $82/F346 05 04      ORA $04    [$00:0004]  A:1000 X:0028 Y:101A P:eNvmxdizc
 
  $82/F348 A8          TAY                    A:101B X:0028 Y:101A P:envmxdizc
 
  $82/F348 A8          TAY                    A:101B X:0028 Y:101A P:envmxdizc
  $82/F349 A5 09      LDA $09   [$00:0009]  A:101B X:0028 Y:101B P:envmxdizc
+
  $82/F349 A5 09      LDA $09       ; Load Number of Double-Bytes to transfer
 
  $82/F34B 20 5D F7    JSR $F75D    ; Update BG1 Tilemap Buffer (from Scrolling?)
 
  $82/F34B 20 5D F7    JSR $F75D    ; Update BG1 Tilemap Buffer (from Scrolling?)
 
  $82/F34E 80 09      BRA $09    [$F359]      A:141A X:0038 Y:141A P:envmxdiZc
 
  $82/F34E 80 09      BRA $09    [$F359]      A:141A X:0038 Y:141A P:envmxdiZc
Line 12,754: Line 12,824:
 
  $82/F371 29 E0 03    AND #$03E0              A:0180 X:0000 Y:141A P:envmxdizc
 
  $82/F371 29 E0 03    AND #$03E0              A:0180 X:0000 Y:141A P:envmxdizc
 
  $82/F374 04 0A      TSB $0A    [$00:000A]  A:0180 X:0000 Y:141A P:envmxdizc
 
  $82/F374 04 0A      TSB $0A    [$00:000A]  A:0180 X:0000 Y:141A P:envmxdizc
  $82/F376 A5 08      LDA $08   [$00:0008]  A:0180 X:0000 Y:141A P:envmxdiZc
+
  $82/F376 A5 08      LDA $08     ; Load Number of Tilemap Double-Bytes to transfer
 
  $82/F378 20 C5 F7    JSR $F7C5    ; Transfer Buffered BG1 Tilemap into VRAM
 
  $82/F378 20 C5 F7    JSR $F7C5    ; Transfer Buffered BG1 Tilemap into VRAM
 
  $82/F37B A5 0A      LDA $0A    [$00:000A]  A:0028 X:0000 Y:719B P:envmxdizc
 
  $82/F37B A5 0A      LDA $0A    [$00:000A]  A:0028 X:0000 Y:719B P:envmxdizc
Line 12,837: Line 12,907:
 
  $82/F60C 6B          RTL                    A:1600 X:0800 Y:0000 P:envMxdiZc
 
  $82/F60C 6B          RTL                    A:1600 X:0800 Y:0000 P:envMxdiZc
  
== $82/F60D ? ==
+
== $82/F60D ? Tilemap updating-related (after scrolling?) ==
 +
 
 +
This subroutine is prepares a lot of values for a tilemap update. I think this is used if the tilemap has to be updated when the map is scrolled.
 +
 
 +
Set in this subroutine:
 +
 
 +
$02/$03 Number of Tilemap Entries to do (= #$20)
 +
 
 +
$06/$07 BG1 Y scroll, without bits 0-2, multiplied by #$10, gets #$80 added every loop iteration, max. #$3000
 +
 
 +
$08/$09 Number of Tilemap Entries to do (= #$20)
  
 
  $82/F60D 22 60 81 99 JSL $998160[$99:8160]  A:0002 X:3300 Y:FFFE P:eNvMxdizC
 
  $82/F60D 22 60 81 99 JSL $998160[$99:8160]  A:0002 X:3300 Y:FFFE P:eNvMxdizC
 
  $82/F611 B0 05      BCS $05    [$F618]      A:0002 X:3300 Y:FFFE P:envMxdizC
 
  $82/F611 B0 05      BCS $05    [$F618]      A:0002 X:3300 Y:FFFE P:envMxdizC
 
;code is missing here
 
;code is missing here
  $82/F618 C2 20      REP #$20               A:0002 X:3300 Y:FFFE P:envMxdizC
+
  $82/F618 C2 20      REP #$20     ; A = 16-bit
  $82/F61A A9 20 00    LDA #$0020             A:0002 X:3300 Y:FFFE P:envmxdizC
+
  $82/F61A A9 20 00    LDA #$0020   ; Number of Tilemap entries to do / number of Tilemap lines to do
  $82/F61D 85 08      STA $08   [$00:0008]  A:0020 X:3300 Y:FFFE P:envmxdizC
+
  $82/F61D 85 08      STA $08
  $82/F61F AD 93 05    LDA $0593 [$80:0593]  A:0020 X:3300 Y:FFFE P:envmxdizC
+
  $82/F61F AD 93 05    LDA $0593     ; Load BG1 Y scroll value
  $82/F622 29 F8 FF    AND #$FFF8             A:0060 X:3300 Y:FFFE P:envmxdizC
+
  $82/F622 29 F8 FF    AND #$FFF8   ; Remove bits 0-2
  $82/F625 0A          ASL A                   A:0060 X:3300 Y:FFFE P:envmxdizC
+
  $82/F625 0A          ASL A         ; Multiply by sixteen / #$10
  $82/F626 0A          ASL A                   A:00C0 X:3300 Y:FFFE P:envmxdizc
+
  $82/F626 0A          ASL A
  $82/F627 0A          ASL A                   A:0180 X:3300 Y:FFFE P:envmxdizc
+
  $82/F627 0A          ASL A
  $82/F628 0A          ASL A                   A:0300 X:3300 Y:FFFE P:envmxdizc
+
  $82/F628 0A          ASL A
  $82/F629 85 06      STA $06   [$00:0006]  A:0600 X:3300 Y:FFFE P:envmxdizc
+
  $82/F629 85 06      STA $06       ; Store in $06
 
  $82/F62B 64 00      STZ $00    [$00:0000]  A:0600 X:3300 Y:FFFE P:envmxdizc
 
  $82/F62B 64 00      STZ $00    [$00:0000]  A:0600 X:3300 Y:FFFE P:envmxdizc
  $82/F62D A5 08      LDA $08   [$00:0008]  A:0600 X:3300 Y:FFFE P:envmxdizc
+
  $82/F62D A5 08      LDA $08       ; $08 = Number of Tilemap lines to do
  $82/F62F 85 02      STA $02   [$00:0002]  A:0020 X:3300 Y:FFFE P:envmxdizc
+
  $82/F62F 85 02      STA $02       ; $02 = Number of Tilemap entries to do
 
  $82/F631 64 04      STZ $04    [$00:0004]  A:0020 X:3300 Y:FFFE P:envmxdizc
 
  $82/F631 64 04      STZ $04    [$00:0004]  A:0020 X:3300 Y:FFFE P:envmxdizc
 
  $82/F633 64 0C      STZ $0C    [$00:000C]  A:0020 X:3300 Y:FFFE P:envmxdizc
 
  $82/F633 64 0C      STZ $0C    [$00:000C]  A:0020 X:3300 Y:FFFE P:envmxdizc
  $82/F635 AD 91 05    LDA $0591 [$80:0591]  A:0020 X:3300 Y:FFFE P:envmxdizc
+
  $82/F635 AD 91 05    LDA $0591     ; Load BG1 X scroll value
  $82/F638 10 12      BPL $12   [$F64C]     A:00F0 X:3300 Y:FFFE P:envmxdizc
+
  $82/F638 10 12      BPL $12       ; [$F64C] Branch if positive
 
;code is missing here
 
;code is missing here
  $82/F64C 4A          LSR A                   A:00F0 X:3300 Y:FFFE P:envmxdizc
+
  $82/F64C 4A          LSR A         ; divide by eight
  $82/F64D 4A          LSR A                   A:0078 X:3300 Y:FFFE P:envmxdizc
+
  $82/F64D 4A          LSR A
  $82/F64E 4A          LSR A                   A:003C X:3300 Y:FFFE P:envmxdizc
+
  $82/F64E 4A          LSR A
  $82/F64F 85 0C      STA $0C   [$00:000C]  A:001E X:3300 Y:FFFE P:envmxdizc
+
  $82/F64F 85 0C      STA $0C       ; Store in $0C/$0D
 
  $82/F651 18          CLC                    A:001E X:3300 Y:FFFE P:envmxdizc
 
  $82/F651 18          CLC                    A:001E X:3300 Y:FFFE P:envmxdizc
 
  $82/F652 65 08      ADC $08    [$00:0008]  A:001E X:3300 Y:FFFE P:envmxdizc
 
  $82/F652 65 08      ADC $08    [$00:0008]  A:001E X:3300 Y:FFFE P:envmxdizc
Line 12,869: Line 12,949:
 
  $82/F657 90 08      BCC $08    [$F661]      A:FFBE X:3300 Y:FFFE P:eNvmxdizc
 
  $82/F657 90 08      BCC $08    [$F661]      A:FFBE X:3300 Y:FFFE P:eNvmxdizc
 
;code is missing here
 
;code is missing here
  $82/F661 E2 20      SEP #$20               A:FFBE X:3300 Y:FFFE P:eNvmxdizc
+
  $82/F661 E2 20      SEP #$20     ; A = 8-bit
  $82/F663 A9 7F      LDA #$7F               A:FFBE X:3300 Y:FFFE P:eNvMxdizc
+
  $82/F663 A9 7F      LDA #$7F     ; Setup address $7F/2000 in [$20] - Address of the whole Tilemap
  $82/F665 85 22      STA $22   [$00:0022]  A:FF7F X:3300 Y:FFFE P:envMxdizc
+
  $82/F665 85 22      STA $22
  $82/F667 A2 00 20    LDX #$2000             A:FF7F X:3300 Y:FFFE P:envMxdizc
+
  $82/F667 A2 00 20    LDX #$2000
  $82/F66A 86 20      STX $20   [$00:0020]  A:FF7F X:2000 Y:FFFE P:envMxdizc
+
  $82/F66A 86 20      STX $20
  $82/F66C C2 20      REP #$20               A:FF7F X:2000 Y:FFFE P:envMxdizc
+
  $82/F66C C2 20      REP #$20     ; A = 16-bit
  $82/F66E A2 00 00    LDX #$0000             A:FF7F X:2000 Y:FFFE P:envmxdizc
+
  $82/F66E A2 00 00    LDX #$0000   ; Clear X (Store Index for BG1 Tilemap Buffer)
  $82/F671 A5 06      LDA $06   [$00:0006]  A:FF7F X:0000 Y:FFFE P:envmxdiZc
+
  $82/F671 A5 06      LDA $06       ; Load edited BG1 Y scroll value
  $82/F673 C9 00 30    CMP #$3000             A:0600 X:0000 Y:FFFE P:envmxdizc
+
  $82/F673 C9 00 30    CMP #$3000   ; Branch if lower than #$3000 (Tilemap size maximum)
  $82/F676 90 08      BCC $08   [$F680]     A:0600 X:0000 Y:FFFE P:eNvmxdizc
+
  $82/F676 90 08      BCC $08       ; [$F680]
 
;code is missing here
 
;code is missing here
 
  $82/F680 A4 00      LDY $00    [$00:0000]  A:0600 X:0000 Y:FFFE P:eNvmxdizc
 
  $82/F680 A4 00      LDY $00    [$00:0000]  A:0600 X:0000 Y:FFFE P:eNvmxdizc
 
  $82/F682 F0 03      BEQ $03    [$F687]      A:0600 X:0000 Y:0000 P:envmxdiZc
 
  $82/F682 F0 03      BEQ $03    [$F687]      A:0600 X:0000 Y:0000 P:envmxdiZc
 
;code is missing here
 
;code is missing here
  $82/F687 A5 0C      LDA $0C   [$00:000C]  A:0600 X:0000 Y:0000 P:envmxdiZc
+
  $82/F687 A5 0C      LDA $0C       ; Load edited BG1 X scroll value
  $82/F689 05 06      ORA $06   [$00:0006]  A:001E X:0000 Y:0000 P:envmxdizc
+
  $82/F689 05 06      ORA $06       ; ORA edited BG1 Y scroll value
  $82/F68B A8          TAY                     A:061E X:0000 Y:0000 P:envmxdizc
+
  $82/F68B A8          TAY           ; Transfer in Y as Load Index for the whole Tilemap
  $82/F68C A5 02      LDA $02   [$00:0002]  A:061E X:0000 Y:061E P:envmxdizc
+
  $82/F68C A5 02      LDA $02       ; Load number of Tilemap Entries to do in A
  $82/F68E 20 CB F6    JSR $F6CB [$82:F6CB]  A:0020 X:0000 Y:061E P:envmxdizc
+
  $82/F68E 20 CB F6    JSR $F6CB     ; Build BG1 Tilemap in Buffer
 
  $82/F691 A4 04      LDY $04    [$00:0004]  A:0281 X:0040 Y:063E P:envmxdiZc
 
  $82/F691 A4 04      LDY $04    [$00:0004]  A:0281 X:0040 Y:063E P:envmxdiZc
 
  $82/F693 F0 03      BEQ $03    [$F698]      A:0281 X:0040 Y:0000 P:envmxdiZc
 
  $82/F693 F0 03      BEQ $03    [$F698]      A:0281 X:0040 Y:0000 P:envmxdiZc
 
;code is missing here
 
;code is missing here
  $82/F698 A5 06      LDA $06   [$00:0006]  A:0281 X:0040 Y:0000 P:envmxdiZc
+
  $82/F698 A5 06      LDA $06       ; Add #$80 to edited Y-scroll value in $06
  $82/F69A 18          CLC                     A:0600 X:0040 Y:0000 P:envmxdizc
+
  $82/F69A 18          CLC
  $82/F69B 69 80 00    ADC #$0080             A:0600 X:0040 Y:0000 P:envmxdizc
+
  $82/F69B 69 80 00    ADC #$0080
  $82/F69E 85 06      STA $06   [$00:0006]  A:0680 X:0040 Y:0000 P:envmxdizc
+
  $82/F69E 85 06      STA $06
  $82/F6A0 C6 08      DEC $08   [$00:0008]  A:0680 X:0040 Y:0000 P:envmxdizc
+
  $82/F6A0 C6 08      DEC $08       ; Decrement Loop counter (originally set to #$20)
  $82/F6A2 D0 CD      BNE $CD   [$F671]     A:0680 X:0040 Y:0000 P:envmxdizc
+
  $82/F6A2 D0 CD      BNE $CD       ; [$F671] Loop until counter runs out
  $82/F6A4 E2 20      SEP #$20               A:1600 X:0800 Y:0000 P:envmxdiZc
+
  $82/F6A4 E2 20      SEP #$20     ; A = 8-bit
  $82/F6A6 60          RTS                     A:1600 X:0800 Y:0000 P:envMxdiZc
+
  $82/F6A6 60          RTS
  
 
== $82/F6CB Build BG1 Tilemap in Buffer ==
 
== $82/F6CB Build BG1 Tilemap in Buffer ==
Line 13,179: 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,199: 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,205: 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,301: Line 13,381:
 
  $82/FD66 F0 0C      BEQ $0C    [$FD74]      A:0203 X:003E Y:0387 P:envMxdiZC
 
  $82/FD66 F0 0C      BEQ $0C    [$FD74]      A:0203 X:003E Y:0387 P:envMxdiZC
 
;code is missing here
 
;code is missing here
  $82/FD74 A9 01      LDA #$01               A:0203 X:003E Y:0387 P:envMxdiZC
+
  $82/FD74 A9 01      LDA #$01     ; Setup $01 as Row Counter
  $82/FD76 85 01      STA $01   [$00:0001]  A:0201 X:003E Y:0387 P:envMxdizC
+
  $82/FD76 85 01      STA $01
  $82/FD78 A9 01      LDA #$01               A:0201 X:003E Y:0387 P:envMxdizC
+
  $82/FD78 A9 01      LDA #$01     ; Setup $00 as Tile per Row Counter
  $82/FD7A 85 00      STA $00   [$00:0000]  A:0201 X:003E Y:0387 P:envMxdizC
+
  $82/FD7A 85 00      STA $00
  $82/FD7C 7B          TDC                     A:0201 X:003E Y:0387 P:envMxdizC
+
  $82/FD7C 7B          TDC           ; Clear 16-bit A
  $82/FD7D A5 01      LDA $01   [$00:0001]  A:0000 X:003E Y:0387 P:envMxdiZC
+
  $82/FD7D A5 01      LDA $01       ; Load Row Counter value
 
  $82/FD7F C2 20      REP #$20      ; A = 16-bit
 
  $82/FD7F C2 20      REP #$20      ; A = 16-bit
  $82/FD81 EB          XBA          ; A * #$20
+
  $82/FD81 EB          XBA          ; Row Counter value * #$20
 
  $82/FD82 4A          LSR A
 
  $82/FD82 4A          LSR A
 
  $82/FD83 4A          LSR A
 
  $82/FD83 4A          LSR A
 
  $82/FD84 4A          LSR A
 
  $82/FD84 4A          LSR A
 
  $82/FD85 E2 20      SEP #$20      ; A = 8-bit
 
  $82/FD85 E2 20      SEP #$20      ; A = 8-bit
  $82/FD87 05 00      ORA $00   [$00:0000]  A:0020 X:003E Y:0387 P:envMxdizc
+
  $82/FD87 05 00      ORA $00       ; Add Tile per Row Counter
  $82/FD89 AA          TAX                     A:0021 X:003E Y:0387 P:envMxdizc
+
  $82/FD89 AA          TAX           ; Transfer in X as Store Index
 
  $82/FD8A 20 C0 FD    JSR $FDC0  [$82:FDC0]  A:0021 X:0021 Y:0387 P:envMxdizc
 
  $82/FD8A 20 C0 FD    JSR $FDC0  [$82:FDC0]  A:0021 X:0021 Y:0387 P:envMxdizc
  $82/FD8D E8          INX                     A:0003 X:0021 Y:0387 P:eNvMxdizc
+
  $82/FD8D E8          INX           ; Increment Store Index
  $82/FD8E E6 00      INC $00   [$00:0000]  A:0003 X:0022 Y:0387 P:envMxdizc
+
  $82/FD8E E6 00      INC $00       ; Increment Tile per Row Counter
  $82/FD90 A5 00      LDA $00   [$00:0000]  A:0003 X:0022 Y:0387 P:envMxdizc
+
  $82/FD90 A5 00      LDA $00       ; Check if Tile per Row Counter has exceeded...
  $82/FD92 CD C8 16    CMP $16C8    ; Compare with Map Width/NW-SE-Axis
+
  $82/FD92 CD C8 16    CMP $16C8    ; the Map Width on the NW-SE-Axis
  $82/FD95 90 F3      BCC $F3   [$FD8A]     A:0002 X:0022 Y:0387 P:eNvMxdizc
+
  $82/FD95 90 F3      BCC $F3       ; [$FD8A] Loop if not
  $82/FD97 E6 01      INC $01   [$00:0001]  A:001F X:003F Y:0387 P:envMxdiZC
+
  $82/FD97 E6 01      INC $01       ; Else, increment the Row Counter
  $82/FD99 A5 01      LDA $01   [$00:0001]  A:001F X:003F Y:0387 P:envMxdizC
+
  $82/FD99 A5 01      LDA $01       ; Check if it has exceeded the Map Width/NE-SW-Axis
  $82/FD9B CD CA 16    CMP $16CA     ; Compare with Map Width/NE-SW-Axis
+
  $82/FD9B CD CA 16    CMP $16CA
  $82/FD9E 90 D8      BCC $D8   [$FD78]     A:0002 X:003F Y:0387 P:eNvMxdizc
+
  $82/FD9E 90 D8      BCC $D8       ; [$FD78] If not, Loop, else exit
 
  $82/FDA0 60          RTS
 
  $82/FDA0 60          RTS
  
Line 13,344: Line 13,424:
 
  $82/FDDD 29 1F      AND #$1F                A:003E X:01C6 Y:0387 P:envMxdizC
 
  $82/FDDD 29 1F      AND #$1F                A:003E X:01C6 Y:0387 P:envMxdizC
 
  $82/FDDF 9F 00 D4 7F STA $7FD400,x  ; Store in "Object" Type Map
 
  $82/FDDF 9F 00 D4 7F STA $7FD400,x  ; Store in "Object" Type Map
  $82/FDE3 5A          PHY                     A:001E X:01C6 Y:0387 P:envMxdizC
+
  $82/FDE3 5A          PHY             ; Buffer Y on stack
  $82/FDE4 A8          TAY                     A:001E X:01C6 Y:0387 P:envMxdizC
+
  $82/FDE4 A8          TAY             ; Transfer "Object" Type Map value in Y as Load Index
  $82/FDE5 B7 26      LDA [$26],y[$8B:87FB]  A:001E X:01C6 Y:001E P:envMxdizC
+
  $82/FDE5 B7 26      LDA [$26],y     ; Load value from Data Table
  $82/FDE7 7A          PLY                     A:008A X:01C6 Y:001E P:eNvMxdizC
+
  $82/FDE7 7A          PLY             ; Restore Y from stack
  $82/FDE8 9F 00 CC 7F STA $7FCC00,x[$7F:CDC6] A:008A X:01C6 Y:0387 P:envMxdizC
+
  $82/FDE8 9F 00 CC 7F STA $7FCC00,x   ; Set A as value for the Terrain Type Map
 
  $82/FDEC BF 00 C8 7F LDA $7FC800,x  ; Lower Step Map value by 2
 
  $82/FDEC BF 00 C8 7F LDA $7FC800,x  ; Lower Step Map value by 2
 
  $82/FDF0 3A          DEC A
 
  $82/FDF0 3A          DEC A
 
  $82/FDF1 3A          DEC A
 
  $82/FDF1 3A          DEC A
 
  $82/FDF2 9F 00 C8 7F STA $7FC800,x
 
  $82/FDF2 9F 00 C8 7F STA $7FC800,x
  $82/FDF6 9F 00 D8 7F STA $7FD800,x[$7F:D9C6] A:000D X:01C6 Y:0387 P:envMxdizC
+
  $82/FDF6 9F 00 D8 7F STA $7FD800,x   ; Set lowered value as Height Map value
  $82/FDFA 60          RTS                     A:0003 X:0021 Y:0387 P:eNvMxdizc
+
  $82/FDFA 60          RTS
  
 
= Bank $83 =
 
= Bank $83 =
Line 13,360: 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,712: 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,740: 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,016: 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,108: 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,135: 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,241: Line 14,338:
 
  $84/9D66 60          RTS                    A:5080 X:000E Y:5080 P:envMxdizc
 
  $84/9D66 60          RTS                    A:5080 X:000E Y:5080 P:envMxdizc
  
== $84/9E13 ? ==
+
== $84/9E13 BATTLE: Calculate VRAM Destination for Animation ==
 +
 
 +
This is entered with a value from $06C3,x in A, the High Byte is always cleared.
 +
 
 +
This subroutine is entered and left with A = 16 bit. The result in A is used as a VRAM destination for a DMA. When this is subroutine is left, A contains:
 +
 
 +
A = #%xbbb.aaxc.xxxx.xxxx (Big Endian)
 +
a = $2101 bits 4 and 3, Name Base bits, Gap between Sprite #$0FF and #$100
 +
b = $2101 bits 2 to 0, Object Size bits
  
 
  $84/9E13 85 02      STA $02    [$00:0002]  A:000F X:0016 Y:89B4 P:envmxdizc
 
  $84/9E13 85 02      STA $02    [$00:0002]  A:000F X:0016 Y:89B4 P:envmxdizc
  $84/9E15 29 3C 00    AND #$003C             A:000F X:0016 Y:89B4 P:envmxdizc
+
  $84/9E15 29 3C 00    AND #$003C   ; #%0000.0000.0011.1100
 
  $84/9E18 18          CLC                    A:000C X:0016 Y:89B4 P:envmxdizc
 
  $84/9E18 18          CLC                    A:000C X:0016 Y:89B4 P:envmxdizc
 
  $84/9E19 65 02      ADC $02    [$00:0002]  A:000C X:0016 Y:89B4 P:envmxdizc
 
  $84/9E19 65 02      ADC $02    [$00:0002]  A:000C X:0016 Y:89B4 P:envmxdizc
Line 14,251: Line 14,356:
 
  $84/9E1D 4A          LSR A                  A:0D80 X:0016 Y:89B4 P:envmxdizc
 
  $84/9E1D 4A          LSR A                  A:0D80 X:0016 Y:89B4 P:envmxdizc
 
  $84/9E1E C9 00 10    CMP #$1000              A:06C0 X:0016 Y:89B4 P:envmxdizc
 
  $84/9E1E C9 00 10    CMP #$1000              A:06C0 X:0016 Y:89B4 P:envmxdizc
  $84/9E21 90 0C      BCC $0C   [$9E2F]     A:06C0 X:0016 Y:89B4 P:eNvmxdizc
+
  $84/9E21 90 0C      BCC $0C       ; [$9E2F] Leave out the Name Base stuff because it isn't relevant to this sprite(?)
 
  $84/9E23 85 02      STA $02    [$00:0002]  A:1000 X:0006 Y:0000 P:envmxdiZC
 
  $84/9E23 85 02      STA $02    [$00:0002]  A:1000 X:0006 Y:0000 P:envmxdiZC
  $84/9E25 AD 88 05    LDA $0588 [$84:0588]  A:1000 X:0006 Y:0000 P:envmxdiZC
+
  $84/9E25 AD 88 05    LDA $0588     ; Load $2101 Buffer
  $84/9E28 29 18 00    AND #$0018             A:0902 X:0006 Y:0000 P:envmxdizC
+
  $84/9E28 29 18 00    AND #$0018   ; Exempt Name Base bits
 
  $84/9E2B EB          XBA                    A:0000 X:0006 Y:0000 P:envmxdiZC
 
  $84/9E2B EB          XBA                    A:0000 X:0006 Y:0000 P:envmxdiZC
 
  $84/9E2C 0A          ASL A                  A:0000 X:0006 Y:0000 P:envmxdiZC
 
  $84/9E2C 0A          ASL A                  A:0000 X:0006 Y:0000 P:envmxdiZC
Line 14,260: Line 14,365:
 
  $84/9E2F 85 02      STA $02    [$00:0002]  A:06C0 X:0016 Y:89B4 P:eNvmxdizc
 
  $84/9E2F 85 02      STA $02    [$00:0002]  A:06C0 X:0016 Y:89B4 P:eNvmxdizc
 
  $84/9E31 AD 88 05    LDA $0588    ; Load $2101 Buffer
 
  $84/9E31 AD 88 05    LDA $0588    ; Load $2101 Buffer
  $84/9E34 29 07 00    AND #$0007    ; Exempt the Object Size
+
  $84/9E34 29 07 00    AND #$0007    ; Exempt the Sprite Graphics Base Offset in VRAM
  $84/9E37 4A          LSR A                   A:0002 X:0016 Y:89B4 P:envmxdizc
+
  $84/9E37 4A          LSR A         ; Move Sprite Graphics Base Offset to bits 15 to 12
  $84/9E38 6A          ROR A                   A:0001 X:0016 Y:89B4 P:envmxdizc
+
  $84/9E38 6A          ROR A
  $84/9E39 6A          ROR A                   A:0000 X:0016 Y:89B4 P:envmxdiZC
+
  $84/9E39 6A          ROR A
  $84/9E3A 6A          ROR A                   A:8000 X:0016 Y:89B4 P:eNvmxdizc
+
  $84/9E3A 6A          ROR A
 
  $84/9E3B 65 02      ADC $02    [$00:0002]  A:4000 X:0016 Y:89B4 P:envmxdizc
 
  $84/9E3B 65 02      ADC $02    [$00:0002]  A:4000 X:0016 Y:89B4 P:envmxdizc
  $84/9E3D 60          RTS                     A:46C0 X:0016 Y:89B4 P:envmxdizc
+
  $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,278: 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/9F62 ? ==
+
== $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) ==
 +
 
 +
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,359: 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,397: 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,447: 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,476: 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,484: 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,555: 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,580: 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,587: 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,630: 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,647: 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,661: 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,668: 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 ? ==
  
  $84/A4EB EB          XBA                     A:8086 X:00D0 Y:AB6E P:envMxdizC
+
  $84/A4EB EB          XBA             ; Clear Hidden High Byte of A
  $84/A4EC A9 00      LDA #$00               A:8680 X:00D0 Y:AB6E P:eNvMxdizC
+
  $84/A4EC A9 00      LDA #$00
  $84/A4EE EB          XBA                     A:8600 X:00D0 Y:AB6E P:envMxdiZC
+
  $84/A4EE EB          XBA
  $84/A4EF 0A          ASL A                   A:0086 X:00D0 Y:AB6E P:eNvMxdizC
+
  $84/A4EF 0A          ASL A           ; Multiply A by 2 to use it as a Jump Table Index
  $84/A4F0 AA          TAX                     A:000C X:00D0 Y:AB6E P:envMxdizC
+
  $84/A4F0 AA          TAX
  $84/A4F1 7C F4 A4    JMP ($A4F4,x)[$84:A56D] A:000C X:000C Y:AB6E P:envMxdizC
+
  $84/A4F1 7C F4 A4    JMP ($A4F4,x)   ; Jump (see address table below)
 
   
 
   
 
  $84/A4F4 06 A5 - Entry #$00 - $A506
 
  $84/A4F4 06 A5 - Entry #$00 - $A506
Line 14,695: 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,712: 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,748: 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 14,795: Line 15,044:
 
== $84/B915 ? ==
 
== $84/B915 ? ==
  
  $84/B915 8B          PHB                     A:0220 X:0006 Y:0004 P:envMxdizc
+
  $84/B915 8B          PHB           ; Buffer Data Bank on Stack
  $84/B916 4B          PHK                     A:0220 X:0006 Y:0004 P:envMxdizc
+
  $84/B916 4B          PHK           ; Set Data Bank to $84
  $84/B917 AB          PLB                     A:0220 X:0006 Y:0004 P:envMxdizc
+
  $84/B917 AB          PLB
 
  $84/B918 A8          TAY                    A:0220 X:0006 Y:0004 P:eNvMxdizc
 
  $84/B918 A8          TAY                    A:0220 X:0006 Y:0004 P:eNvMxdizc
 
  $84/B919 84 00      STY $00    [$00:0000]  A:0220 X:0006 Y:0220 P:envMxdizc
 
  $84/B919 84 00      STY $00    [$00:0000]  A:0220 X:0006 Y:0220 P:envMxdizc
Line 14,807: Line 15,056:
 
  $84/B928 98          TYA                    A:0200 X:0006 Y:0000 P:envmxdiZc
 
  $84/B928 98          TYA                    A:0200 X:0006 Y:0000 P:envmxdiZc
 
  $84/B929 69 00 60    ADC #$6000              A:0000 X:0006 Y:0000 P:envmxdiZc
 
  $84/B929 69 00 60    ADC #$6000              A:0000 X:0006 Y:0000 P:envmxdiZc
  $84/B92C 85 20      STA $20   [$00:0020]   A:6000 X:0006 Y:0000 P:envmxdizc
+
  $84/B92C 85 20      STA $20       ; Setup address in [$20]: Either $7E/6000 or $7E/7000
  $84/B92E E2 20      SEP #$20               A:6000 X:0006 Y:0000 P:envmxdizc
+
  $84/B92E E2 20      SEP #$20     ; A = 8-bit
  $84/B930 A9 7E      LDA #$7E               A:6000 X:0006 Y:0000 P:envMxdizc
+
  $84/B930 A9 7E      LDA #$7E
  $84/B932 85 22      STA $22   [$00:0022]  A:607E X:0006 Y:0000 P:envMxdizc
+
  $84/B932 85 22      STA $22
  $84/B934 7B          TDC                     A:607E X:0006 Y:0000 P:envMxdizc
+
  $84/B934 7B          TDC           ; Clear 16-bit A
 
  $84/B935 A5 00      LDA $00    [$00:0000]  A:0000 X:0006 Y:0000 P:envMxdiZc
 
  $84/B935 A5 00      LDA $00    [$00:0000]  A:0000 X:0006 Y:0000 P:envMxdiZc
 
  $84/B937 C2 20      REP #$20                A:0020 X:0006 Y:0000 P:envMxdizc
 
  $84/B937 C2 20      REP #$20                A:0020 X:0006 Y:0000 P:envMxdizc
Line 14,831: Line 15,080:
 
  $84/B95C 09 80      ORA #$80                A:0000 X:0002 Y:5000 P:envMxdiZc
 
  $84/B95C 09 80      ORA #$80                A:0000 X:0002 Y:5000 P:envMxdiZc
 
  $84/B95E 22 8A B9 84 JSL $84B98A[$84:B98A]  A:0080 X:0002 Y:5000 P:eNvMxdizc
 
  $84/B95E 22 8A B9 84 JSL $84B98A[$84:B98A]  A:0080 X:0002 Y:5000 P:eNvMxdizc
  $84/B962 80 24      BRA $24   [$B988]     A:6200 X:0220 Y:0004 P:eNvMxdizc
+
  $84/B962 80 24      BRA $24       ; [$B988] Exit
 
;code is missing here
 
;code is missing here
  $84/B988 AB          PLB                     A:6200 X:0220 Y:0004 P:eNvMxdizc
+
  $84/B988 AB          PLB           ; Restore Data Bank from Stack
  $84/B989 6B          RTL                     A:6200 X:0220 Y:0004 P:eNvMxdizc
+
  $84/B989 6B          RTL
 
 
== $84/B98A Battle figure moving animation? ==
 
  
This is executed in the title screen demo, when the soldier jumps over the gap and beats the archeress(?)
+
== $84/B98A BATTLE: Figure Move Animation ==
  
This executes an VRAM DMA - I can imagine this is the graphics update for a marching game figure animation.
+
This subroutine updates the sprites for a figure
  
 
There are some values to this subroutine carried in before it is called:
 
There are some values to this subroutine carried in before it is called:
Line 14,850: Line 15,097:
 
$20 to $22 contains an offset for the DMA Source Address
 
$20 to $22 contains an offset for the DMA Source Address
  
  $84/B98A 8B          PHB          ; Preserve Data Bank on Stack
+
  $84/B98A 8B          PHB          ; Buffer Data Bank on Stack
  $84/B98B 4B          PHK          ; Change Data Bank to $84
+
  $84/B98B 4B          PHK          ; Set Data Bank to $84
 
  $84/B98C AB          PLB
 
  $84/B98C AB          PLB
  $84/B98D D4 00      PEI ($00)    ; Push current content of $00 on stack
+
  $84/B98D D4 00      PEI ($00)    ; Buffer $00-$03 on Stack
  $84/B98F D4 02      PEI ($02)     ; Push current content of $02 on stack
+
  $84/B98F D4 02      PEI ($02)
  $84/B991 D4 0C      PEI ($0C)    ; Push current content of $0C on stack
+
  $84/B991 D4 0C      PEI ($0C)    ; Buffer $0C-$0F on Stack
  $84/B993 D4 0E      PEI ($0E)     ; Push current content of $0E on stack
+
  $84/B993 D4 0E      PEI ($0E)
 
  $84/B995 09 00      ORA #$00      ; Set the "focus" of the flag register back on the Accumulator???
 
  $84/B995 09 00      ORA #$00      ; Set the "focus" of the flag register back on the Accumulator???
 
  $84/B997 10 0A      BPL $0A      ; [$B9A3] Branch if A value is between #$00 and #$7F
 
  $84/B997 10 0A      BPL $0A      ; [$B9A3] Branch if A value is between #$00 and #$7F
  $84/B999 29 7F      AND #$7F      ; If not, remove the MSB anyways
+
  $84/B999 29 7F      AND #$7F      ; This line could be removed? - MSB wasn't set anyways
 
  $84/B99B 85 00      STA $00      ; Store Original A minus MSB in $00
 
  $84/B99B 85 00      STA $00      ; Store Original A minus MSB in $00
 
  $84/B99D A9 02      LDA #$02      ; Set up a counter for left/right side of the  graphic
 
  $84/B99D A9 02      LDA #$02      ; Set up a counter for left/right side of the  graphic
 
  $84/B99F 85 01      STA $01      ; Yeah, I wouldn't understand that comment, too
 
  $84/B99F 85 01      STA $01      ; Yeah, I wouldn't understand that comment, too
 
  $84/B9A1 80 04      BRA $04      ; [$B9A7]
 
  $84/B9A1 80 04      BRA $04      ; [$B9A7]
Code is missing here  
+
;code is missing here  
 
  $84/B9A7 84 02      STY $02      ; Buffer VRAM destination in $02
 
  $84/B9A7 84 02      STY $02      ; Buffer VRAM destination in $02
 
  $84/B9A9 A2 40 00    LDX #$0040    ; Number of Bytes to transfer
 
  $84/B9A9 A2 40 00    LDX #$0040    ; Number of Bytes to transfer
Line 14,908: Line 15,155:
 
  $84/B9F1 E2 20      SEP #$20
 
  $84/B9F1 E2 20      SEP #$20
 
  $84/B9F3 80 C3      BRA $C3      ; [$B9B8] ... and loop
 
  $84/B9F3 80 C3      BRA $C3      ; [$B9B8] ... and loop
  $84/B9F5 FA          PLX          ; Restore the old values of $0E, $0C, $02 and $00
+
  $84/B9F5 FA          PLX          ; Restore the $0C-$0F from Stack
 
  $84/B9F6 86 0E      STX $0E
 
  $84/B9F6 86 0E      STX $0E
 
  $84/B9F8 FA          PLX
 
  $84/B9F8 FA          PLX
 
  $84/B9F9 86 0C      STX $0C
 
  $84/B9F9 86 0C      STX $0C
  $84/B9FB FA          PLX
+
  $84/B9FB FA          PLX           ; Restore the $00-$03 from Stack
 
  $84/B9FC 86 02      STX $02
 
  $84/B9FC 86 02      STX $02
 
  $84/B9FE FA          PLX
 
  $84/B9FE FA          PLX
 
  $84/B9FF 86 00      STX $00
 
  $84/B9FF 86 00      STX $00
  $84/BA01 AB          PLB          ; Restore old bank
+
  $84/BA01 AB          PLB          ; Restore Data Bank from Stack
 
  $84/BA02 6B          RTL
 
  $84/BA02 6B          RTL
 +
 +
$84/BA03 08 00 18 10
 +
$84/BA07 0A 02 1A 12
 +
$84/BA0B 0C 04 1C 14
 +
$84/BA0F 0E 06 1E 16
 +
$84/BA13 44 40 54 50
 +
$84/BA17 46 42 56 52
 +
$84/BA1B 28 20 38 30
 +
$84/BA1F 2A 22 3A 32
 +
$84/BA23 2C 24 3C 34
 +
$84/BA27 2E 26 3E 36
 +
$84/BA2B 4C 48 5C 58
 +
$84/BA2F 4E 4A 5E 5A
 +
$84/BA33 60 00 FF 10
 +
$84/BA37 62 02 FF 12
 +
$84/BA3B 64 04 FF 14
 +
$84/BA3F 66 06 FF 16
 +
$84/BA43 70 40 FF 50
 +
$84/BA47 72 42 FF 52
 +
$84/BA4B 68 20 FF 30
 +
$84/BA4F 6A 22 FF 32
 +
$84/BA53 6C 24 FF 34
 +
$84/BA57 6E 26 FF 36
 +
$84/BA5B 74 48 FF 58
 +
$84/BA5F 76 4A FF 5A
 +
$84/BA63 46 42 56 52
 +
$84/BA67 FF FF FF FF
 +
$84/BA6B FF FF 00 FF
 +
$84/BA6F 00 FF 10 FF
 +
$84/BA73 10 FF 08 00
 +
$84/BA77 22 FF 32 FF
 +
$84/BA7B 32 FF 28 22
 +
$84/BA7F FF FF FF FF
 +
$84/BA83 08 00 FF 10
 +
$84/BA87 08 40 FF 50
 +
$84/BA8B 28 20 38 30
 +
$84/BA8F 2E 26 FF 36
 +
$84/BA93 FF FF 00 01
 +
$84/BA97 02 03 04 05
 +
$84/BA9B 18 FF 06 07
 +
$84/BA9F 08 09 0A 0B
  
 
== $84/BBC4 ? ==
 
== $84/BBC4 ? ==
Line 15,072: 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,305: Line 15,593:
 
  $84/BF93 60          RTS                    A:4C01 X:00D4 Y:89B6 P:eNvMxdizc
 
  $84/BF93 60          RTS                    A:4C01 X:00D4 Y:89B6 P:eNvMxdizc
  
== $84/C19F ? ==
+
== $84/C19F ? (Related to Moving/Move Animation?) ==
  
 
  $84/C19F 8B          PHB          ; Buffer Data Bank on Stack
 
  $84/C19F 8B          PHB          ; Buffer Data Bank on Stack
Line 15,315: Line 15,603:
 
  $84/C1A6 D4 3B      PEI ($3B)
 
  $84/C1A6 D4 3B      PEI ($3B)
 
  $84/C1A8 84 39      STY $39    [$00:0039]  A:0040 X:0006 Y:0004 P:eNvMxdizc
 
  $84/C1A8 84 39      STY $39    [$00:0039]  A:0040 X:0006 Y:0004 P:eNvMxdizc
  $84/C1AA BE 3E 1E    LDX $1E3E,y[$84:1E42]   A:0040 X:0006 Y:0004 P:eNvMxdizc
+
  $84/C1AA BE 3E 1E    LDX $1E3E,y  ; (1E3E: "? Related to the Animation Changing the value stops it")
 
  $84/C1AD 86 3B      STX $3B    [$00:003B]  A:0040 X:0004 Y:0004 P:envMxdizc
 
  $84/C1AD 86 3B      STX $3B    [$00:003B]  A:0040 X:0004 Y:0004 P:envMxdizc
 
  $84/C1AF BD 04 07    LDA $0704,x[$84:0708]  A:0040 X:0004 Y:0004 P:envMxdizc
 
  $84/C1AF BD 04 07    LDA $0704,x[$84:0708]  A:0040 X:0004 Y:0004 P:envMxdizc
  $84/C1B2 48          PHA                     A:0001 X:0004 Y:0004 P:envMxdizc
+
  $84/C1B2 48          PHA           ; Buffer value on Stack
  $84/C1B3 29 FE      AND #$FE               A:0001 X:0004 Y:0004 P:envMxdizc
+
  $84/C1B3 29 FE      AND #$FE     ; Remove LSB
  $84/C1B5 9D 04 07    STA $0704,x[$84:0708]   A:0000 X:0004 Y:0004 P:envMxdiZc
+
  $84/C1B5 9D 04 07    STA $0704,x  ; Store value sans LSB back (for now)
 
  $84/C1B8 B9 16 1E    LDA $1E16,y[$84:1E1A]  A:0000 X:0004 Y:0004 P:envMxdiZc
 
  $84/C1B8 B9 16 1E    LDA $1E16,y[$84:1E1A]  A:0000 X:0004 Y:0004 P:envMxdiZc
 
  $84/C1BB D0 04      BNE $04    [$C1C1]      A:0000 X:0004 Y:0004 P:envMxdiZc
 
  $84/C1BB D0 04      BNE $04    [$C1C1]      A:0000 X:0004 Y:0004 P:envMxdiZc
Line 15,326: Line 15,614:
 
  $84/C1BE 99 16 1E    STA $1E16,y[$84:1E1A]  A:0001 X:0004 Y:0004 P:envMxdizc
 
  $84/C1BE 99 16 1E    STA $1E16,y[$84:1E1A]  A:0001 X:0004 Y:0004 P:envMxdizc
 
  $84/C1C1 22 D3 C1 84 JSL $84C1D3[$84:C1D3]  A:0001 X:0004 Y:0004 P:envMxdizc
 
  $84/C1C1 22 D3 C1 84 JSL $84C1D3[$84:C1D3]  A:0001 X:0004 Y:0004 P:envMxdizc
  $84/C1C5 68          PLA                     A:4680 X:0004 Y:0004 P:eNvMxdizc
+
  $84/C1C5 68          PLA           ; Pull original value from $0704,x from Stack
  $84/C1C6 9D 04 07    STA $0704,x[$84:0708]   A:4601 X:0004 Y:0004 P:envMxdizc
+
  $84/C1C6 9D 04 07    STA $0704,x  ; Store it back
 
  $84/C1C9 FA          PLX          ; Restore $39-$3C from Stack
 
  $84/C1C9 FA          PLX          ; Restore $39-$3C from Stack
 
  $84/C1CA 86 3B      STX $3B
 
  $84/C1CA 86 3B      STX $3B
Line 15,346: Line 15,634:
 
  $84/C1D8 D4 00      PEI ($00)    ; Buffer $00-$03 on Stack
 
  $84/C1D8 D4 00      PEI ($00)    ; Buffer $00-$03 on Stack
 
  $84/C1DA D4 02      PEI ($02)
 
  $84/C1DA D4 02      PEI ($02)
  $84/C1DC A6 39      LDX $39   [$00:0039]  A:0001 X:0004 Y:0004 P:eNvMxdizc
+
  $84/C1DC A6 39      LDX $39       ; Load Figure number
  $84/C1DE A4 3B      LDY $3B   [$00:003B]  A:0001 X:0004 Y:0004 P:envMxdizc
+
  $84/C1DE A4 3B      LDY $3B       ; Load another Figure number
 
  $84/C1E0 B9 04 07    LDA $0704,y[$84:0708]  A:0001 X:0004 Y:0004 P:envMxdizc
 
  $84/C1E0 B9 04 07    LDA $0704,y[$84:0708]  A:0001 X:0004 Y:0004 P:envMxdizc
  $84/C1E3 4A          LSR A                   A:0000 X:0004 Y:0004 P:envMxdiZc
+
  $84/C1E3 4A          LSR A         ; Branch if the LSB is set
  $84/C1E4 B0 37      BCS $37   [$C21D]     A:0000 X:0004 Y:0004 P:envMxdiZc
+
  $84/C1E4 B0 37      BCS $37       ; [$C21D]
  $84/C1E6 7B          TDC                     A:0000 X:0004 Y:0004 P:envMxdiZc
+
  $84/C1E6 7B          TDC           ; Clear 16-bit A
 
  $84/C1E7 A5 ED      LDA $ED    [$00:00ED]  A:0000 X:0004 Y:0004 P:envMxdiZc
 
  $84/C1E7 A5 ED      LDA $ED    [$00:00ED]  A:0000 X:0004 Y:0004 P:envMxdiZc
 
  $84/C1E9 4A          LSR A                  A:0000 X:0004 Y:0004 P:envMxdiZc
 
  $84/C1E9 4A          LSR A                  A:0000 X:0004 Y:0004 P:envMxdiZc
 
  $84/C1EA BD EF 1D    LDA $1DEF,x[$84:1DF3]  A:0000 X:0004 Y:0004 P:envMxdiZc
 
  $84/C1EA BD EF 1D    LDA $1DEF,x[$84:1DF3]  A:0000 X:0004 Y:0004 P:envMxdiZc
 
  $84/C1ED B0 11      BCS $11    [$C200]      A:0000 X:0004 Y:0004 P:envMxdiZc
 
  $84/C1ED B0 11      BCS $11    [$C200]      A:0000 X:0004 Y:0004 P:envMxdiZc
  $84/C1EF BD AE 17    LDA $17AE,x[$84:17B2]   A:0000 X:0004 Y:0004 P:envMxdiZc
+
  $84/C1EF BD AE 17    LDA $17AE,x  ; Load Figure's Sprite number
 
  $84/C1F2 C9 F0      CMP #$F0                A:0034 X:0004 Y:0004 P:envMxdizc
 
  $84/C1F2 C9 F0      CMP #$F0                A:0034 X:0004 Y:0004 P:envMxdizc
 
  $84/C1F4 D0 04      BNE $04    [$C1FA]      A:0034 X:0004 Y:0004 P:envMxdizc
 
  $84/C1F4 D0 04      BNE $04    [$C1FA]      A:0034 X:0004 Y:0004 P:envMxdizc
 +
;code is missing here
 
  $84/C1FA 20 67 C2    JSR $C267  [$84:C267]  A:0034 X:0004 Y:0004 P:envMxdizc
 
  $84/C1FA 20 67 C2    JSR $C267  [$84:C267]  A:0034 X:0004 Y:0004 P:envMxdizc
 
  $84/C1FD 9D EF 1D    STA $1DEF,x[$84:1DF3]  A:0000 X:0004 Y:0004 P:envMxdizc
 
  $84/C1FD 9D EF 1D    STA $1DEF,x[$84:1DF3]  A:0000 X:0004 Y:0004 P:envMxdizc
Line 15,367: Line 15,656:
 
  $84/C208 3A          DEC A                  A:0001 X:0004 Y:0000 P:envMxdizc
 
  $84/C208 3A          DEC A                  A:0001 X:0004 Y:0000 P:envMxdizc
 
  $84/C209 AA          TAX                    A:0000 X:0004 Y:0000 P:envMxdiZc
 
  $84/C209 AA          TAX                    A:0000 X:0004 Y:0000 P:envMxdiZc
  $84/C20A 7B          TDC                     A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $84/C20A 7B          TDC           ; Clear 16-bit A
 
  $84/C20B BD C9 83    LDA $83C9,x[$84:83C9]  A:0000 X:0000 Y:0000 P:envMxdiZc
 
  $84/C20B BD C9 83    LDA $83C9,x[$84:83C9]  A:0000 X:0000 Y:0000 P:envMxdiZc
 
  $84/C20E A6 3B      LDX $3B    [$00:003B]  A:0001 X:0000 Y:0000 P:envMxdizc
 
  $84/C20E A6 3B      LDX $3B    [$00:003B]  A:0001 X:0000 Y:0000 P:envMxdizc
Line 15,375: Line 15,664:
 
  $84/C215 A4 39      LDY $39    [$00:0039]  A:0000 X:0000 Y:0000 P:envMxdiZc
 
  $84/C215 A4 39      LDY $39    [$00:0039]  A:0000 X:0000 Y:0000 P:envMxdiZc
 
  $84/C217 22 29 BD 84 JSL $84BD29[$84:BD29]  A:0000 X:0000 Y:0004 P:envMxdizc
 
  $84/C217 22 29 BD 84 JSL $84BD29[$84:BD29]  A:0000 X:0000 Y:0004 P:envMxdizc
  $84/C21B 80 40      BRA $40   [$C25D]     A:4680 X:0000 Y:0004 P:eNvMxdizc
+
  $84/C21B 80 40      BRA $40       ; [$C25D] Restore Registers and exit
 
;code is missing here
 
;code is missing here
 
  $84/C25D 7A          PLY          ; Restore $00-$03 from Stack
 
  $84/C25D 7A          PLY          ; Restore $00-$03 from Stack
Line 15,386: Line 15,675:
 
  $84/C266 6B          RTL
 
  $84/C266 6B          RTL
  
== $84/C267 Figure Animation related ==
+
== $84/C267 Figure Facing Direction related ==
  
 
X and Y contain the same Figure Number.
 
X and Y contain the same Figure Number.
 +
 +
I forced this subroutine to be left always with 01, and all the figures faced away from the camera. I forced 00, and whenever a character should've looked to the upper left, they looked to the lower right instead.
  
 
  $84/C267 5A          PHY          ; Buffer Figure Number on Stack
 
  $84/C267 5A          PHY          ; Buffer Figure Number on Stack
Line 15,439: 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,483: Line 15,774:
 
  $84/CA9E DA          PHX          ; Buffer X and Y on Stack
 
  $84/CA9E DA          PHX          ; Buffer X and Y on Stack
 
  $84/CA9F 5A          PHY
 
  $84/CA9F 5A          PHY
  $84/CAA0 A9 01      LDA #$01               A:0105 X:0004 Y:0001 P:eNvMxdizc
+
  $84/CAA0 A9 01      LDA #$01     ; Check if LSB in $1EE6 is set
  $84/CAA2 2C E6 1E    BIT $1EE6 [$84:1EE6]  A:0101 X:0004 Y:0001 P:envMxdizc
+
  $84/CAA2 2C E6 1E    BIT $1EE6
  $84/CAA5 F0 0D      BEQ $0D   [$CAB4]     A:0101 X:0004 Y:0001 P:envMxdiZc
+
  $84/CAA5 F0 0D      BEQ $0D       ; [$CAB4] Branch if not
 
  $84/CAA7 A0 00 10    LDY #$1000              A:0001 X:0008 Y:0001 P:envMxdizc
 
  $84/CAA7 A0 00 10    LDY #$1000              A:0001 X:0008 Y:0001 P:envMxdizc
  $84/CAAA A9 02      LDA #$02               A:0001 X:0008 Y:1000 P:envMxdizc
+
  $84/CAAA A9 02      LDA #$02     ; Check if Bit 1 in $1EE6 is set
  $84/CAAC 2C E6 1E    BIT $1EE6 [$84:1EE6]  A:0002 X:0008 Y:1000 P:envMxdizc
+
  $84/CAAC 2C E6 1E    BIT $1EE6
  $84/CAAF F0 20      BEQ $20   [$CAD1]     A:0002 X:0008 Y:1000 P:envMxdiZc
+
  $84/CAAF F0 20      BEQ $20       ; [$CAD1] Branch if not
 
;code is missing here
 
;code is missing here
  $84/CAB4 0C E6 1E    TSB $1EE6 [$84:1EE6]  A:0101 X:0004 Y:0001 P:envMxdiZc
+
  $84/CAB4 0C E6 1E    TSB $1EE6     ; Set LSB in $1EE6
  $84/CAB7 A9 00      LDA #$00               A:0101 X:0004 Y:0001 P:envMxdiZc
+
  $84/CAB7 A9 00      LDA #$00     ; ??? Reset (?)-Pointer in $1EE7
  $84/CAB9 8D E7 1E    STA $1EE7 [$84:1EE7]  A:0100 X:0004 Y:0001 P:envMxdiZc
+
  $84/CAB9 8D E7 1E    STA $1EE7
 
  $84/CABC A0 00 00    LDY #$0000              A:0100 X:0004 Y:0001 P:envMxdiZc
 
  $84/CABC A0 00 00    LDY #$0000              A:0100 X:0004 Y:0001 P:envMxdiZc
 
  $84/CABF 84 43      STY $43    [$00:0043]  A:0100 X:0004 Y:0000 P:envMxdiZc
 
  $84/CABF 84 43      STY $43    [$00:0043]  A:0100 X:0004 Y:0000 P:envMxdiZc
Line 15,510: Line 15,801:
 
  $84/CAE0 22 F9 CA 84 JSL $84CAF9[$84:CAF9]  A:0002 X:0008 Y:1040 P:envMxdizc
 
  $84/CAE0 22 F9 CA 84 JSL $84CAF9[$84:CAF9]  A:0002 X:0008 Y:1040 P:envMxdizc
 
  $84/CAE4 8D EC 1E    STA $1EEC  [$84:1EEC]  A:0021 X:0008 Y:1040 P:envMxdizc
 
  $84/CAE4 8D EC 1E    STA $1EEC  [$84:1EEC]  A:0021 X:0008 Y:1040 P:envMxdizc
  $84/CAE7 48          PHA                     A:0020 X:0004 Y:1000 P:envMxdizc
+
  $84/CAE7 48          PHA           ; Buffer A on stack
  $84/CAE8 7B          TDC                     A:0020 X:0004 Y:1000 P:envMxdizc
+
  $84/CAE8 7B          TDC           ; Clear 16-bit A
  $84/CAE9 AD E7 1E    LDA $1EE7 [$84:1EE7]  A:0000 X:0004 Y:1000 P:envMxdiZc
+
  $84/CAE9 AD E7 1E    LDA $1EE7     ; Set $1EE7 as Store Index for $1EE8,y
  $84/CAEC A8          TAY                     A:0000 X:0004 Y:1000 P:envMxdiZc
+
  $84/CAEC A8          TAY
  $84/CAED 68          PLA                     A:0000 X:0004 Y:0000 P:envMxdiZc
+
  $84/CAED 68          PLA           ; Load 8-bit value for storing from stack
  $84/CAEE 99 E8 1E    STA $1EE8,y[$84:1EE8]  A:0020 X:0004 Y:0000 P:envMxdizc
+
  $84/CAEE 99 E8 1E    STA $1EE8,y   ; Store in $1EE8/9,y
  $84/CAF1 99 E9 1E    STA $1EE9,y[$84:1EE9]  A:0020 X:0004 Y:0000 P:envMxdizc
+
  $84/CAF1 99 E9 1E    STA $1EE9,y
  $84/CAF4 18          CLC                     A:0020 X:0004 Y:0000 P:envMxdizc
+
  $84/CAF4 18          CLC           ; ??? "Job's done successfully"-Flag?
 
  $84/CAF5 7A          PLY          ; Restore Y and X from Stack
 
  $84/CAF5 7A          PLY          ; Restore Y and X from Stack
 
  $84/CAF6 FA          PLX
 
  $84/CAF6 FA          PLX
Line 15,524: Line 15,815:
  
 
== $84/CAF9 ? ==
 
== $84/CAF9 ? ==
 +
 +
This subroutine takes the 16-bit value in Y, pushes some bits around and puts them into 8-bit A. The transformation is as follows:
 +
 +
Y : XXXa.bcdX.efXX.XXXX
 +
A :          XXab.cdef
 +
 +
The Original Value for Y gets restored in Y before the subroutine is left. This value gets stored in $7E1EEC after this subroutine is left.
  
 
  $84/CAF9 5A          PHY          ; Buffer Y on Stack
 
  $84/CAF9 5A          PHY          ; Buffer Y on Stack
 
  $84/CAFA D4 00      PEI ($00)    ; Buffer $00/$01 on Stack
 
  $84/CAFA D4 00      PEI ($00)    ; Buffer $00/$01 on Stack
  $84/CAFC C2 20      REP #$20               A:0100 X:0004 Y:1000 P:envMxdizc
+
  $84/CAFC C2 20      REP #$20     ; A = 16-bit
  $84/CAFE 98          TYA                     A:0100 X:0004 Y:1000 P:envmxdizc
+
  $84/CAFE 98          TYA           ; Transfer Y in A
  $84/CAFF 29 00 1E    AND #$1E00             A:1000 X:0004 Y:1000 P:envmxdizc
+
  $84/CAFF 29 00 1E    AND #$1E00   ; Remove bits      #%000x.xxx0.0000.0000
  $84/CB02 4A          LSR A                  A:1000 X:0004 Y:1000 P:envmxdizc
+
  $84/CB02 4A          LSR A         ;                   #%0000.xxxx.0000.0000
  $84/CB03 85 00      STA $00   [$00:0000]  A:0800 X:0004 Y:1000 P:envmxdizc
+
  $84/CB03 85 00      STA $00       ; Buffer in $00/1
  $84/CB05 98          TYA                     A:0800 X:0004 Y:1000 P:envmxdizc
+
  $84/CB05 98          TYA           ; Transfer Y in A again
  $84/CB06 29 C0 00    AND #$00C0             A:1000 X:0004 Y:1000 P:envmxdizc
+
  $84/CB06 29 C0 00    AND #$00C0   ; Remove bits      #%0000.0000.yy00.0000
  $84/CB09 05 00      ORA $00   [$00:0000]  A:0000 X:0004 Y:1000 P:envmxdiZc
+
  $84/CB09 05 00      ORA $00       ; Add bits together #%0000.xxxx.yy00.0000
  $84/CB0B 0A          ASL A                   A:0800 X:0004 Y:1000 P:envmxdizc
+
  $84/CB0B 0A          ASL A         ; Push bits left twice so all are in High Byte
  $84/CB0C 0A          ASL A                   A:1000 X:0004 Y:1000 P:envmxdizc
+
  $84/CB0C 0A          ASL A
  $84/CB0D EB          XBA                     A:2000 X:0004 Y:1000 P:envmxdizc
+
  $84/CB0D EB          XBA           ; XBA so it's in Low Byte
  $84/CB0E E2 20      SEP #$20               A:0020 X:0004 Y:1000 P:envmxdizc
+
  $84/CB0E E2 20      SEP #$20     ; A = 8-bit
 
  $84/CB10 7A          PLY          ; Restore $00/$01 from Stack
 
  $84/CB10 7A          PLY          ; Restore $00/$01 from Stack
 
  $84/CB11 84 00      STY $00
 
  $84/CB11 84 00      STY $00
  $84/CB13 7A          PLY          ; Restore Y from Stack
+
  $84/CB13 7A          PLY          ; Restore Orignal Y value from Stack
 
  $84/CB14 6B          RTL
 
  $84/CB14 6B          RTL
  
Line 15,798: 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,386: Line 16,750:
 
  $86/9B2C 5A          PHY          ; Buffer Y on Stack
 
  $86/9B2C 5A          PHY          ; Buffer Y on Stack
 
  $86/9B2D D4 0E      PEI ($0E)    ; Buffer $0E/$0F on Stack
 
  $86/9B2D D4 0E      PEI ($0E)    ; Buffer $0E/$0F on Stack
  $86/9B2F 48          PHA                     A:0000 X:0004 Y:0002 P:eNvMxdizc
+
  $86/9B2F 48          PHA           ; Buffer A on Stack
  $86/9B30 BD D6 1C    LDA $1CD6,x[$86:1CDA]   A:0000 X:0004 Y:0002 P:eNvMxdizc
+
  $86/9B30 BD D6 1C    LDA $1CD6,x  ; Buffer Position from where the possible Movement is calculated - NW-SE-Axis on Stack
  $86/9B33 48          PHA                     A:0009 X:0004 Y:0002 P:envMxdizc
+
  $86/9B33 48          PHA
  $86/9B34 BD D7 1C    LDA $1CD7,x[$86:1CDB]   A:0009 X:0004 Y:0002 P:envMxdizc
+
  $86/9B34 BD D7 1C    LDA $1CD7,x  ; Buffer Position from where the possible Movement is calculated - NE-SW-Axis on Stack
  $86/9B37 48          PHA                     A:0007 X:0004 Y:0002 P:envMxdizc
+
  $86/9B37 48          PHA
  $86/9B38 5A          PHY                     A:0007 X:0004 Y:0002 P:envMxdizc
+
  $86/9B38 5A          PHY           ; Buffer Y on Stack (again)
 
  $86/9B39 86 91      STX $91    [$00:0091]  A:0007 X:0004 Y:0002 P:envMxdizc
 
  $86/9B39 86 91      STX $91    [$00:0091]  A:0007 X:0004 Y:0002 P:envMxdizc
  $86/9B3B A6 20      LDX $20   [$00:0020]   A:0007 X:0004 Y:0002 P:envMxdizc
+
  $86/9B3B A6 20      LDX $20       ; Setup the address from [$20] in [$29]
  $86/9B3D A5 22      LDA $22   [$00:0022]  A:0007 X:339B Y:0002 P:envMxdizc
+
  $86/9B3D A5 22      LDA $22
  $86/9B3F 86 29      STX $29   [$00:0029]  A:007E X:339B Y:0002 P:envMxdizc
+
  $86/9B3F 86 29      STX $29
  $86/9B41 85 2B      STA $2B   [$00:002B]  A:007E X:339B Y:0002 P:envMxdizc
+
  $86/9B41 85 2B      STA $2B
  $86/9B43 A0 00 00    LDY #$0000             A:007E X:339B Y:0002 P:envMxdizc
+
  $86/9B43 A0 00 00    LDY #$0000   ; Setup a Load Index in Y
 
  $86/9B46 B7 29      LDA [$29],y[$7E:339B]  A:007E X:339B Y:0000 P:envMxdiZc
 
  $86/9B46 B7 29      LDA [$29],y[$7E:339B]  A:007E X:339B Y:0000 P:envMxdiZc
 
  $86/9B48 85 61      STA $61    [$00:0061]  A:000A X:339B Y:0000 P:envMxdizc
 
  $86/9B48 85 61      STA $61    [$00:0061]  A:000A X:339B Y:0000 P:envMxdizc
Line 16,408: Line 16,772:
 
  $86/9B55 A9 FF      LDA #$FF                A:0005 X:0004 Y:0001 P:envMxdizc
 
  $86/9B55 A9 FF      LDA #$FF                A:0005 X:0004 Y:0001 P:envMxdizc
 
  $86/9B57 9D EE 1D    STA $1DEE,x[$86:1DF2]  A:00FF X:0004 Y:0001 P:eNvMxdizc
 
  $86/9B57 9D EE 1D    STA $1DEE,x[$86:1DF2]  A:00FF X:0004 Y:0001 P:eNvMxdizc
  $86/9B5A D4 0E      PEI ($0E)       [$0010]      A:00FF X:0004 Y:0001 P:eNvMxdizc
+
  $86/9B5A D4 0E      PEI ($0E) [$0010]      A:00FF X:0004 Y:0001 P:eNvMxdizc
 
  $86/9B5C 22 50 9C 86 JSL $869C50[$86:9C50]  A:00FF X:0004 Y:0001 P:eNvMxdizc
 
  $86/9B5C 22 50 9C 86 JSL $869C50[$86:9C50]  A:00FF X:0004 Y:0001 P:eNvMxdizc
 
  $86/9B60 FA          PLX                    A:01D4 X:0004 Y:0001 P:eNvMxdizc
 
  $86/9B60 FA          PLX                    A:01D4 X:0004 Y:0001 P:eNvMxdizc
Line 16,419: 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,441: Line 16,805:
 
  $86/9B9B A9 FF      LDA #$FF                A:1005 X:0004 Y:339D P:envMxdizc
 
  $86/9B9B A9 FF      LDA #$FF                A:1005 X:0004 Y:339D P:envMxdizc
 
  $86/9B9D 9D EE 1D    STA $1DEE,x[$86:1DF2]  A:10FF X:0004 Y:339D P:eNvMxdizc
 
  $86/9B9D 9D EE 1D    STA $1DEE,x[$86:1DF2]  A:10FF X:0004 Y:339D P:eNvMxdizc
  $86/9BA0 D4 0E      PEI ($0E)       [$0000]      A:10FF X:0004 Y:339D P:eNvMxdizc
+
  $86/9BA0 D4 0E      PEI ($0E) [$0000]      A:10FF X:0004 Y:339D P:eNvMxdizc
 
  $86/9BA2 22 50 9C 86 JSL $869C50[$86:9C50]  A:10FF X:0004 Y:339D P:eNvMxdizc
 
  $86/9BA2 22 50 9C 86 JSL $869C50[$86:9C50]  A:10FF X:0004 Y:339D P:eNvMxdizc
 
  $86/9BA6 FA          PLX                    A:01D4 X:0004 Y:339D P:eNvMxdizc
 
  $86/9BA6 FA          PLX                    A:01D4 X:0004 Y:339D P:eNvMxdizc
Line 16,469: Line 16,833:
 
  $86/9BEA 18          CLC                    A:FF08 X:0006 Y:0001 P:envMxdizC
 
  $86/9BEA 18          CLC                    A:FF08 X:0006 Y:0001 P:envMxdizC
 
  $86/9BEB A6 91      LDX $91    [$00:0091]  A:FF08 X:0006 Y:0001 P:envMxdizc
 
  $86/9BEB A6 91      LDX $91    [$00:0091]  A:FF08 X:0006 Y:0001 P:envMxdizc
  $86/9BED 68          PLA                     A:FF08 X:0004 Y:0001 P:envMxdizc
+
  $86/9BED 68          PLA           ; Restore Position from where the possible Movement is calculated - NE-SW-Axis from Stack
  $86/9BEE 9D D7 1C    STA $1CD7,x[$86:1CDB]  A:FF07 X:0004 Y:0001 P:envMxdizc
+
  $86/9BEE 9D D7 1C    STA $1CD7,x
  $86/9BF1 68          PLA                     A:FF07 X:0004 Y:0001 P:envMxdizc
+
  $86/9BF1 68          PLA           ; Restore Position from where the possible Movement is calculated - NW-SE-Axis from Stack
  $86/9BF2 9D D6 1C    STA $1CD6,x[$86:1CDA]  A:FF09 X:0004 Y:0001 P:envMxdizc
+
  $86/9BF2 9D D6 1C    STA $1CD6,x
  $86/9BF5 68          PLA                     A:FF09 X:0004 Y:0001 P:envMxdizc
+
  $86/9BF5 68          PLA           ; Restore A from Stack
 
  $86/9BF6 7A          PLY          ; Restore $0E/$0F from Stack
 
  $86/9BF6 7A          PLY          ; Restore $0E/$0F from Stack
 
  $86/9BF7 84 0E      STY $0E
 
  $86/9BF7 84 0E      STY $0E
Line 16,497: 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 16,864: Line 17,228:
 
  $86/A296 4A          LSR A                  A:01D6 X:00EA Y:FFFF P:envmxdizc
 
  $86/A296 4A          LSR A                  A:01D6 X:00EA Y:FFFF P:envmxdizc
 
  $86/A297 AA          TAX                    A:00EB X:00EA Y:FFFF P:envmxdizc
 
  $86/A297 AA          TAX                    A:00EB X:00EA Y:FFFF P:envmxdizc
  $86/A298 E2 20      SEP #$20               A:00EB X:00EB Y:FFFF P:envmxdizc
+
  $86/A298 E2 20      SEP #$20     ; A = 8-bit
  $86/A29A BF 00 C8 7F LDA $7FC800,x[$7F:C8EB] A:00EB X:00EB Y:FFFF P:envMxdizc
+
  $86/A29A BF 00 C8 7F LDA $7FC800,x ; Load value from Step Map
  $86/A29E F0 10      BEQ $10   [$A2B0]     A:0003 X:00EB Y:FFFF P:envMxdizc
+
  $86/A29E F0 10      BEQ $10       ; [$A2B0] If empty, set Carry and exit
  $86/A2A0 C9 FF      CMP #$FF               A:0003 X:00EB Y:FFFF P:envMxdizc
+
  $86/A2A0 C9 FF      CMP #$FF
  $86/A2A2 F0 0C      BEQ $0C   [$A2B0]     A:0003 X:00EB Y:FFFF P:envMxdizc
+
  $86/A2A2 F0 0C      BEQ $0C       ; [$A2B0] If #$FF, set Carry and exit
 
  $86/A2A4 3A          DEC A                  A:0003 X:00EB Y:FFFF P:envMxdizc
 
  $86/A2A4 3A          DEC A                  A:0003 X:00EB Y:FFFF P:envMxdizc
 
  $86/A2A5 C5 0A      CMP $0A    [$00:000A]  A:0002 X:00EB Y:FFFF P:envMxdizc
 
  $86/A2A5 C5 0A      CMP $0A    [$00:000A]  A:0002 X:00EB Y:FFFF P:envMxdizc
 
  $86/A2A7 B0 07      BCS $07    [$A2B0]      A:0002 X:00EB Y:FFFF P:eNvMxdizc
 
  $86/A2A7 B0 07      BCS $07    [$A2B0]      A:0002 X:00EB Y:FFFF P:eNvMxdizc
  $86/A2A9 C2 20      REP #$20               A:0002 X:00EB Y:FFFF P:eNvMxdizc
+
  $86/A2A9 C2 20      REP #$20     ; A = 16-bit
 
  $86/A2AB 8A          TXA                    A:0002 X:00EB Y:FFFF P:eNvmxdizc
 
  $86/A2AB 8A          TXA                    A:0002 X:00EB Y:FFFF P:eNvmxdizc
 
  $86/A2AC 0A          ASL A                  A:00EB X:00EB Y:FFFF P:envmxdizc
 
  $86/A2AC 0A          ASL A                  A:00EB X:00EB Y:FFFF P:envmxdizc
 
  $86/A2AD 4C BD A0    JMP $A0BD  [$86:A0BD]  A:01D6 X:00EB Y:FFFF P:envmxdizc
 
  $86/A2AD 4C BD A0    JMP $A0BD  [$86:A0BD]  A:01D6 X:00EB Y:FFFF P:envmxdizc
;code is missing here
+
$86/A2B0 C2 20      REP #$20      ; A = 16-bit
 +
$86/A2B2 38          SEC          ; Set Carry (Error Flag?)
 +
$86/A2B3 60          RTS
  
 
== $86/A815 ? ==
 
== $86/A815 ? ==
Line 17,861: Line 18,227:
 
  $86/E3A7 20 96 A2    JSR $A296  [$86:A296]  A:01D6 X:00EA Y:FFFF P:envmxdizc
 
  $86/E3A7 20 96 A2    JSR $A296  [$86:A296]  A:01D6 X:00EA Y:FFFF P:envmxdizc
 
  $86/E3AA FA          PLX                    A:0001 X:00EB Y:0001 P:envmxdizc
 
  $86/E3AA FA          PLX                    A:0001 X:00EB Y:0001 P:envmxdizc
  $86/E3AB B0 17      BCS $17   [$E3C4]     A:0001 X:01D6 Y:0001 P:envmxdizc
+
  $86/E3AB B0 17      BCS $17       ; [$E3C4] Exit if Error Flag was set by $A296
 
  $86/E3AD 1A          INC A                  A:0001 X:01D6 Y:0001 P:envmxdizc
 
  $86/E3AD 1A          INC A                  A:0001 X:01D6 Y:0001 P:envmxdizc
 
  $86/E3AE A8          TAY                    A:0002 X:01D6 Y:0001 P:envmxdizc
 
  $86/E3AE A8          TAY                    A:0002 X:01D6 Y:0001 P:envmxdizc
Line 17,946: Line 18,312:
 
  $88/8060 6B          RTL
 
  $88/8060 6B          RTL
  
== $88/8061 ? ==
+
== $88/8061 ? Joypad related ==
 
 
Joypad related
 
  
 
  $88/8061 A5 A1      LDA $A1    [$00:00A1]  A:0000 X:0002 Y:0004 P:enVMxdIZC
 
  $88/8061 A5 A1      LDA $A1    [$00:00A1]  A:0000 X:0002 Y:0004 P:enVMxdIZC
  $88/8063 89 81      BIT #$81               A:0080 X:0002 Y:0004 P:eNVMxdIzC
+
  $88/8063 89 81      BIT #$81
  $88/8065 D0 03      BNE $03   [$806A]     A:0080 X:0002 Y:0004 P:eNVMxdIzC
+
  $88/8065 D0 03      BNE $03       ; [$806A] Go on if on of those bits are set
 
  $88/8067 4C F7 80    JMP $80F7    ; Exit
 
  $88/8067 4C F7 80    JMP $80F7    ; Exit
 
  $88/806A AD 47 05    LDA $0547  [$80:0547]  A:0080 X:0002 Y:0004 P:eNVMxdIzC
 
  $88/806A AD 47 05    LDA $0547  [$80:0547]  A:0080 X:0002 Y:0004 P:eNVMxdIzC
Line 18,120: 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,135: Line 18,501:
 
  $88/A146 AA          TAX          ; Transfer it in X as Load Index
 
  $88/A146 AA          TAX          ; Transfer it in X as Load Index
 
  $88/A147 BF 02 A7 88 LDA $88A702,x[$88:A734] A:0032 X:0032 Y:8A14 P:envMxdizC
 
  $88/A147 BF 02 A7 88 LDA $88A702,x[$88:A734] A:0032 X:0032 Y:8A14 P:envMxdizC
  $88/A14B C9 FF      CMP #$FF               A:001F X:0032 Y:8A14 P:envMxdizC
+
  $88/A14B C9 FF      CMP #$FF
  $88/A14D D0 04      BNE $04   [$A153]     A:001F X:0032 Y:8A14 P:envMxdizc
+
  $88/A14D D0 04      BNE $04       ; [$A153] If not #$FF, keep Class number
  $88/A14F A3 01      LDA $01,s [$00:1FE4]  A:00FF X:001E Y:0006 P:envMxdiZC
+
  $88/A14F A3 01      LDA $01,s     ; Replace buffered Class number with Graphic Set number
  $88/A151 83 02      STA $02,s [$00:1FE5]  A:001E X:001E Y:0006 P:envMxdizC
+
  $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,218: Line 18,584:
 
== $88/A54C ? ==
 
== $88/A54C ? ==
  
  $88/A54C 7B          TDC                     A:0204 X:0006 Y:0006 P:envMxdizc
+
  $88/A54C 7B          TDC           ; Clear 16-bit A
  $88/A54D BD AE 17    LDA $17AE,x[$80:17B4]   A:0000 X:0006 Y:0006 P:envMxdiZc
+
  $88/A54D BD AE 17    LDA $17AE,x  ; Load Character Sprite number
  $88/A550 C9 F0      CMP #$F0               A:003B X:0006 Y:0006 P:envMxdizc
+
  $88/A550 C9 F0      CMP #$F0
  $88/A552 90 0F      BCC $0F   [$A563]     A:003B X:0006 Y:0006 P:envMxdizc
+
  $88/A552 90 0F      BCC $0F       ; [$A563] Branch if lower than #$F1 (normal)
 
;code is missing here
 
;code is missing here
  $88/A563 DA          PHX                     A:003B X:0006 Y:0006 P:envMxdizc
+
  $88/A563 DA          PHX           ; Buffer X on stack
  $88/A564 AA          TAX                     A:003B X:0006 Y:0006 P:envMxdizc
+
  $88/A564 AA          TAX           ; Transfer Sprite number in X as Load Index
 
  $88/A565 BF F2 A7 88 LDA $88A7F2,x[$88:A82D] A:003B X:003B Y:0006 P:envMxdizc
 
  $88/A565 BF F2 A7 88 LDA $88A7F2,x[$88:A82D] A:003B X:003B Y:0006 P:envMxdizc
  $88/A569 FA          PLX                     A:0003 X:003B Y:0006 P:envMxdizc
+
  $88/A569 FA          PLX           ; Restore X from Stack
 
  $88/A56A C9 FF      CMP #$FF                A:0003 X:0006 Y:0006 P:envMxdizc
 
  $88/A56A C9 FF      CMP #$FF                A:0003 X:0006 Y:0006 P:envMxdizc
 
  $88/A56C F0 19      BEQ $19    [$A587]      A:0003 X:0006 Y:0006 P:envMxdizc
 
  $88/A56C F0 19      BEQ $19    [$A587]      A:0003 X:0006 Y:0006 P:envMxdizc
Line 18,236: Line 18,602:
 
  $88/A59C C9 03      CMP #$03                A:0003 X:0006 Y:0006 P:envMxdizc
 
  $88/A59C C9 03      CMP #$03                A:0003 X:0006 Y:0006 P:envMxdizc
 
  $88/A59E F0 08      BEQ $08    [$A5A8]      A:0003 X:0006 Y:0006 P:envMxdiZC
 
  $88/A59E F0 08      BEQ $08    [$A5A8]      A:0003 X:0006 Y:0006 P:envMxdiZC
;code is missing here
+
$88/A5A0 C9 02      CMP #$02                A:0002 X:0002 Y:0006 P:eNvMxdizc
 +
$88/A5A2 D0 06      BNE $06    [$A5AA]      A:0002 X:0002 Y:0006 P:envMxdiZC
 +
$88/A5A4 A9 01      LDA #$01                A:0002 X:0002 Y:0006 P:envMxdiZC
 +
$88/A5A6 80 02      BRA $02    [$A5AA]      A:0001 X:0002 Y:0006 P:envMxdizC
 
  $88/A5A8 A9 00      LDA #$00                A:0003 X:0006 Y:0006 P:envMxdiZC
 
  $88/A5A8 A9 00      LDA #$00                A:0003 X:0006 Y:0006 P:envMxdiZC
 
  $88/A5AA C9 02      CMP #$02      ; This line could be removed? - Some check if this is stupid or super-clever
 
  $88/A5AA C9 02      CMP #$02      ; This line could be removed? - Some check if this is stupid or super-clever
Line 18,243: Line 18,612:
 
== $88/A5B7 ? ==
 
== $88/A5B7 ? ==
  
  $88/A5B7 DA          PHX                     A:0108 X:5299 Y:2B00 P:envMxdizc
+
  $88/A5B7 DA          PHX           ; Buffer X on stack
  $88/A5B8 EB          XBA                     A:0108 X:5299 Y:2B00 P:envMxdizc
+
  $88/A5B8 EB          XBA           ; Clear Hidden 8-bit A part
  $88/A5B9 A9 00      LDA #$00               A:0801 X:5299 Y:2B00 P:envMxdizc
+
  $88/A5B9 A9 00      LDA #$00
  $88/A5BB EB          XBA                     A:0800 X:5299 Y:2B00 P:envMxdiZc
+
  $88/A5BB EB          XBA
  $88/A5BC C9 10      CMP #$10               A:0008 X:5299 Y:2B00 P:envMxdizc
+
  $88/A5BC C9 10      CMP #$10
  $88/A5BE 90 02      BCC $02   [$A5C2]     A:0008 X:5299 Y:2B00 P:eNvMxdizc
+
  $88/A5BE 90 02      BCC $02       ; [$A5C2] Branch if value is lower than #$11
  $88/A5C2 AA          TAX                     A:0008 X:5299 Y:2B00 P:eNvMxdizc
+
;code is missing here
  $88/A5C3 BF C9 A5 88 LDA $88A5C9,x[$88:A5D1] A:0008 X:0008 Y:2B00 P:envMxdizc
+
  $88/A5C2 AA          TAX           ; Transfer A in X as Load Index
  $88/A5C7 FA          PLX                     A:0004 X:0008 Y:2B00 P:envMxdizc
+
  $88/A5C3 BF C9 A5 88 LDA $88A5C9,x ; Load value from the table below
  $88/A5C8 6B          RTL                     A:0004 X:5299 Y:2B00 P:envMxdizc
+
  $88/A5C7 FA          PLX           ; Restore X from stack
 +
  $88/A5C8 6B          RTL
  
 
  $88/A5C9 01
 
  $88/A5C9 01
Line 18,273: 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,299: 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,588: Line 18,976:
  
 
= Bank $89 =
 
= Bank $89 =
== $89/B62A ? ==
+
== $89/B62A NEW GAME: Symbol Cloud Pattern OAM entries ==
 +
 
 +
During the new game creation process, there are symbols that appear and rotate (thanks to window mask effects). These symbols are filled with a half-transparent cloud pattern. This pattern is a number of sprites that are moving constantly upwards.
 +
This subroutine creates the OAM entries for these sprites. Right behind this subroutines are some "green bodies" for those entries which are loaded and marginally altered.
 +
 
 +
$89/B3EA A6 DF      LDX $DF    [$00:00DF]  A:0000 X:38FB Y:02BE P:envMxdiZc
 +
$89/B3EC DE A5 00    DEC $00A5,x  ; Decrement scroll value - sprite move upwards
 +
$89/B3EF BD A5 00    LDA $00A5,x  ; Load Scroll value and buffer it in $00
 +
$89/B3F2 85 00      STA $00
 +
$89/B3F4 7B          TDC          ; Clear 16-bit A
 +
$89/B3F5 AA          TAX          ; Clear X (to use it as Load/Store Index)
 +
$89/B3F6 BF 36 B4 89 LDA $89B436,x ; Load X-value from green body
 +
$89/B3FA 9D 00 01    STA $0100,x  ; Set as X-value in OAM buffer
 +
$89/B3FD BF 37 B4 89 LDA $89B437,x ; Load Y-value from green body
 +
$89/B401 18          CLC          ; Add buffered scroll value
 +
$89/B402 65 00      ADC $00
 +
$89/B404 9D 01 01    STA $0101,x  ; Set as Y-value in OAM buffer
 +
$89/B407 BF 38 B4 89 LDA $89B438,x ; Load graphic number from green body
 +
$89/B40B 9D 02 01    STA $0102,x  ; Set as graphic number in OAM buffer
 +
$89/B40E BF 39 B4 89 LDA $89B439,x ; Load graphic settings from green body
 +
$89/B412 9D 03 01    STA $0103,x  ; Set as graphic settings in OAM buffer
 +
$89/B415 E8          INX          ; Increment Index four times so it points...
 +
$89/B416 E8          INX          ; ... to the next OAM entry
 +
$89/B417 E8          INX
 +
$89/B418 E8          INX
 +
$89/B419 E0 38 00    CPX #$0038    ; Repeat until every entry is done
 +
$89/B41C 90 D8      BCC $D8      ; [$B3F6]
 +
$89/B41E A9 AA      LDA #$AA                A:00B2 X:0038 Y:02BE P:envMxdiZC
 +
$89/B420 8D 00 03    STA $0300  [$7E:0300]  A:00AA X:0038 Y:02BE P:eNvMxdizC
 +
$89/B423 A9 AA      LDA #$AA                A:00AA X:0038 Y:02BE P:eNvMxdizC
 +
$89/B425 8D 01 03    STA $0301  [$7E:0301]  A:00AA X:0038 Y:02BE P:eNvMxdizC
 +
$89/B428 A9 AA      LDA #$AA                A:00AA X:0038 Y:02BE P:eNvMxdizC
 +
$89/B42A 8D 02 03    STA $0302  [$7E:0302]  A:00AA X:0038 Y:02BE P:eNvMxdizC
 +
$89/B42D A9 0A      LDA #$0A                A:00AA X:0038 Y:02BE P:eNvMxdizC
 +
$89/B42F 8D 03 03    STA $0303  [$7E:0303]  A:000A X:0038 Y:02BE P:envMxdizC
 +
$89/B432 EE 40 05    INC $0540  [$7E:0540]  A:000A X:0038 Y:02BE P:envMxdizC
 +
$89/B435 60          RTS                    A:000A X:0038 Y:02BE P:envMxdizC
 +
 
 +
$89/B436 00 00 00 B2 - SPRITE 0: X: 00 Y:00 Graphic: 00 V-Flip, Priority 3, Palette 1
 +
$89/B43A 40 00 00 B2 - SPRITE 1: X: 40 Y:00 Graphic: 00 V-Flip, Priority 3, Palette 1
 +
$89/B43E 80 00 00 B2 - SPRITE 2: X: 80 Y:00 Graphic: 00 V-Flip, Priority 3, Palette 1
 +
$89/B442 C0 00 00 B2 - SPRITE 3: X: C0 Y:00 Graphic: 00 V-Flip, Priority 3, Palette 1
 +
$89/B446 20 40 00 B2 - SPRITE 4: X: 20 Y:40 Graphic: 00 V-Flip, Priority 3, Palette 1
 +
$89/B44A 60 40 00 B2 - SPRITE 5: X: 60 Y:40 Graphic: 00 V-Flip, Priority 3, Palette 1
 +
$89/B44E A0 40 00 B2 - SPRITE 6: X: A0 Y:40 Graphic: 00 V-Flip, Priority 3, Palette 1
 +
$89/B452 00 80 00 B2 - SPRITE 7: X: 00 Y:80 Graphic: 00 V-Flip, Priority 3, Palette 1
 +
$89/B456 40 80 00 B2 - SPRITE 8: X: 40 Y:80 Graphic: 00 V-Flip, Priority 3, Palette 1
 +
$89/B45A 80 80 00 B2 - SPRITE 9: X: 80 Y:80 Graphic: 00 V-Flip, Priority 3, Palette 1
 +
$89/B45E C0 80 00 B2 - SPRITE A: X: C0 Y:80 Graphic: 00 V-Flip, Priority 3, Palette 1
 +
$89/B462 20 C0 00 B2 - SPRITE B: X: 20 Y:C0 Graphic: 00 V-Flip, Priority 3, Palette 1
 +
$89/B466 60 C0 00 B2 - SPRITE C: X: 50 Y:C0 Graphic: 00 V-Flip, Priority 3, Palette 1
 +
$89/B46A A0 C0 00 B2 - SPRITE D: X: A0 Y:C0 Graphic: 00 V-Flip, Priority 3, Palette 1
 +
 
 +
== $89/B62A NEW GAME: ? ==
  
 
During the new game creation process, this is executed when one of these artworks gets loaded
 
During the new game creation process, this is executed when one of these artworks gets loaded
Line 18,598: Line 19,039:
 
  $89/B635 60          RTS
 
  $89/B635 60          RTS
  
== $89/BE00 ? ==
+
== $89/BE00 NEW GAME: ? ==
  
 
During the new game creation process, this is executed when one of the Goddesses' artworks gets loaded
 
During the new game creation process, this is executed when one of the Goddesses' artworks gets loaded
Line 18,810: 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 18,914: 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 18,967: 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,105: 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,120: 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,161: 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,295: 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,333: 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,346: 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,363: 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,375: 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,388: 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,460: 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,478: 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,510: 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,763: 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 19,867: Line 20,317:
 
  $99/C6E0 60          RTS                    A:4680 X:0002 Y:4440 P:envMxdizc
 
  $99/C6E0 60          RTS                    A:4680 X:0002 Y:4440 P:envMxdizc
  
== $99/C6FD ? ==
+
== $99/C6FD (the same as $84/9E13) ==
  
  $99/C6FD 85 02      STA $02   [$00:0002]  A:0009 X:0002 Y:0002 P:envmxdizc
+
This subroutine is exactly the same as $84/9E13. Please look for a detailled description there. This subroutine was implemented twice into the program, because it is bound to a bank ($80 and, in this case, $99) by the RTS command. I guess they didn't change it to a long Jump/Return command (JSL/RTL) due to cycle management issues.
  $99/C6FF 29 3C 00    AND #$003C             A:0009 X:0002 Y:0002 P:envmxdizc
+
 
  $99/C702 18          CLC                     A:0008 X:0002 Y:0002 P:envmxdizc
+
  $99/C6FD 85 02      STA $02
  $99/C703 65 02      ADC $02   [$00:0002]  A:0008 X:0002 Y:0002 P:envmxdizc
+
  $99/C6FF 29 3C 00    AND #$003C
  $99/C705 EB          XBA                     A:0011 X:0002 Y:0002 P:envmxdizc
+
  $99/C702 18          CLC
  $99/C706 4A          LSR A                   A:1100 X:0002 Y:0002 P:envmxdiZc
+
  $99/C703 65 02      ADC $02
  $99/C707 4A          LSR A                   A:0880 X:0002 Y:0002 P:envmxdizc
+
  $99/C705 EB          XBA
  $99/C708 C9 00 10    CMP #$1000             A:0440 X:0002 Y:0002 P:envmxdizc
+
  $99/C706 4A          LSR A
  $99/C70B 90 0C      BCC $0C   [$C719]     A:0440 X:0002 Y:0002 P:eNvmxdizc
+
  $99/C707 4A          LSR A
 +
  $99/C708 C9 00 10    CMP #$1000
 +
  $99/C70B 90 0C      BCC $0C       ; [$C719]
 
;code is missing here
 
;code is missing here
  $99/C719 85 02      STA $02   [$00:0002]  A:0440 X:0002 Y:0002 P:eNvmxdizc
+
  $99/C719 85 02      STA $02
  $99/C71B AD 88 05    LDA $0588 [$7E:0588]  A:0440 X:0002 Y:0002 P:eNvmxdizc
+
  $99/C71B AD 88 05    LDA $0588
  $99/C71E 29 07 00    AND #$0007             A:0902 X:0002 Y:0002 P:envmxdizc
+
  $99/C71E 29 07 00    AND #$0007
  $99/C721 4A          LSR A                   A:0002 X:0002 Y:0002 P:envmxdizc
+
  $99/C721 4A          LSR A
  $99/C722 6A          ROR A                   A:0001 X:0002 Y:0002 P:envmxdizc
+
  $99/C722 6A          ROR A
  $99/C723 6A          ROR A                   A:0000 X:0002 Y:0002 P:envmxdiZC
+
  $99/C723 6A          ROR A
  $99/C724 6A          ROR A                   A:8000 X:0002 Y:0002 P:eNvmxdizc
+
  $99/C724 6A          ROR A
  $99/C725 65 02      ADC $02   [$00:0002]  A:4000 X:0002 Y:0002 P:envmxdizc
+
  $99/C725 65 02      ADC $02
  $99/C727 60          RTS                     A:4440 X:0002 Y:0002 P:envmxdizc
+
  $99/C727 60          RTS
  
 
== $99/C86F ? ==
 
== $99/C86F ? ==
Line 20,296: 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,332: 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 20,917: 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,344: Line 21,796:
 
  8C 93  $938C - Entry #$0E
 
  8C 93  $938C - Entry #$0E
  
== $9C/8BA7 Quest Logo? ==
+
== $9C/8BA7 ? Game Boot Intro ==
  
 
A lot of loading, some Mode 7 stuff
 
A lot of loading, some Mode 7 stuff
Line 21,390: Line 21,842:
 
  $9C/8C13 A0 57 9B    LDY #$9B57    ; Decompress all the Tiles and Tilemaps for the Title Intro
 
  $9C/8C13 A0 57 9B    LDY #$9B57    ; Decompress all the Tiles and Tilemaps for the Title Intro
 
  $9C/8C16 20 15 9B    JSR $9B15    ; Decompress Data and transfer it to VRAM in a Row
 
  $9C/8C16 20 15 9B    JSR $9B15    ; Decompress Data and transfer it to VRAM in a Row
  $9C/8C19 20 7B 9C    JSR $9C7B [$9C:9C7B]  A:FF80 X:FFFF Y:9BAF P:envMxdiZC
+
  $9C/8C19 20 7B 9C    JSR $9C7B     ; Calculate Shadow effect for the BG3 Vertical Japanese Text
 +
 
 +
After the Quest and Hermit logos, you see vertical Japanese text appear over the cloudy background. The following VRAM DMA transfers the graphic data for the shadows(!) of the vertical text to $0000 in VRAM. These shadows are designated to BG3.
 +
 
 
  $9C/8C1C A9 80      LDA #$80      ; VRAM settings ($2115)
 
  $9C/8C1C A9 80      LDA #$80      ; VRAM settings ($2115)
 
  $9C/8C1E 85 0E      STA $0E
 
  $9C/8C1E 85 0E      STA $0E
Line 21,399: Line 21,854:
 
  $9C/8C2B A9 7E      LDA #$7E
 
  $9C/8C2B A9 7E      LDA #$7E
 
  $9C/8C2D 22 24 9F 80 JSL $809F24  ; Long Jump to VRAM: $7E/2000 to $0000 VRAM
 
  $9C/8C2D 22 24 9F 80 JSL $809F24  ; Long Jump to VRAM: $7E/2000 to $0000 VRAM
 +
 
  $9C/8C31 C2 20      REP #$20
 
  $9C/8C31 C2 20      REP #$20
 
  $9C/8C33 7B          TDC          ; Clear 16-bit A
 
  $9C/8C33 7B          TDC          ; Clear 16-bit A
Line 21,588: 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,596: 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,606: 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,616: Line 22,072:
 
  $9C/8E48 60          RTS
 
  $9C/8E48 60          RTS
  
== $9C/8E49 ? ==
+
== $9C/8E49 GAME INTRO: Quest Logo ==
  
  $9C/8E49 EE 9C 17    INC $179C [$9C:179C]  A:0002 X:0002 Y:9E53 P:envMxdizc
+
This handles the fade-in and the fade-out of the Quest logo
  $9C/8E4C AD 9C 17    LDA $179C [$9C:179C]  A:0002 X:0002 Y:9E53 P:envMxdizc
+
 
  $9C/8E4F C9 9E      CMP #$9E               A:0001 X:0002 Y:9E53 P:envMxdizc
+
  $9C/8E49 EE 9C 17    INC $179C     ; Increment Timer (Frame Counter)
  $9C/8E51 B0 03      BCS $03   [$8E56]     A:0001 X:0002 Y:9E53 P:envMxdizc
+
  $9C/8E4C AD 9C 17    LDA $179C     ; Load Timer value
  $9C/8E53 4C 64 9C    JMP $9C64    ; ??? Screen fade in?
+
  $9C/8E4F C9 9E      CMP #$9E     ; Is the limit reached?
  $9C/8E56 4A          LSR A                   A:009E X:0002 Y:9E53 P:envMxdiZC
+
  $9C/8E51 B0 03      BCS $03       ; [$8E56] Leave out Screen fade-in if higher than #$9E
  $9C/8E57 90 10      BCC $10      ; [$8E69] ??? Exit
+
  $9C/8E53 4C 64 9C    JMP $9C64    ; Screen fade-in (and leave out the rest here)
 +
  $9C/8E56 4A          LSR A         ; Push LSB into Carry (Clear = Even number, Set = odd number)
 +
  $9C/8E57 90 10      BCC $10      ; [$8E69] Exit if $179C was even
 
  $9C/8E59 CE 87 05    DEC $0587    ; Decrement Screen Brightness (Buffer value)
 
  $9C/8E59 CE 87 05    DEC $0587    ; Decrement Screen Brightness (Buffer value)
 
  $9C/8E5C D0 0B      BNE $0B      ; [$8E69] Exit if Brightness hasn't reached zero
 
  $9C/8E5C D0 0B      BNE $0B      ; [$8E69] Exit if Brightness hasn't reached zero
  $9C/8E5E A9 0C      LDA #$0C               A:005D X:0002 Y:9E53 P:envMxdiZC
+
  $9C/8E5E A9 0C      LDA #$0C     ; Set BG2 Tilemap Address to #$0C00 in VRAM
  $9C/8E60 8D 8C 05    STA $058C [$9C:058C]  A:000C X:0002 Y:9E53 P:envMxdizC
+
  $9C/8E60 8D 8C 05    STA $058C
  $9C/8E63 9C 9C 17    STZ $179C [$9C:179C]  A:000C X:0002 Y:9E53 P:envMxdizC
+
  $9C/8E63 9C 9C 17    STZ $179C     ; Reset Timer
  $9C/8E66 EE C0 05    INC $05C0 [$9C:05C0]  A:000C X:0002 Y:9E53 P:envMxdizC
+
  $9C/8E66 EE C0 05    INC $05C0     ; Increment the overall pointer - do the next step in the Intro
 
  $9C/8E69 60          RTS
 
  $9C/8E69 60          RTS
  
== $9C/8E6A ? ==
+
== $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).
 +
 
 +
This subroutine
 +
* increments the Frame Counter ($9C/8E6A)
 +
* checks if #$96 was reached - at #$96, it starts the music ($9C/8E6D to $9C/8E79)
 +
* checks if #$9E was surpassed - if not, it jumps to the Screen fade-in ($9C/8E7A to $9C/8E7E)
 +
* if >#$9E: Decrement the Screen Brightness every two frames (every even frame number) ($9C/8E81 to $9C/8E87)
  
  $9C/8E6A EE 9C 17    INC $179C [$9C:179C]  A:0004 X:0004 Y:9E53 P:envMxdizc
+
  $9C/8E6A EE 9C 17    INC $179C     ; Increment Timer
  $9C/8E6D AD 9C 17    LDA $179C [$9C:179C]  A:0004 X:0004 Y:9E53 P:envMxdizc
+
  $9C/8E6D AD 9C 17    LDA $179C     ; Check Timer
  $9C/8E70 C9 96      CMP #$96               A:0001 X:0004 Y:9E53 P:envMxdizc
+
  $9C/8E70 C9 96      CMP #$96     ; Is the Timer value reached to start the music?
  $9C/8E72 D0 06      BNE $06   [$8E7A]     A:0001 X:0004 Y:9E53 P:envMxdizc
+
  $9C/8E72 D0 06      BNE $06       ; [$8E7A] Branch if not
  $9C/8E74 48          PHA                     A:0096 X:0004 Y:9E53 P:envMxdiZC
+
  $9C/8E74 48          PHA           ; Else, buffer Timer value on Stack
  $9C/8E75 A9 01      LDA #$01               A:0096 X:0004 Y:9E53 P:envMxdiZC
+
  $9C/8E75 A9 01      LDA #$01     ; Store #$01 in $F5 to start music
  $9C/8E77 85 F5      STA $F5   [$00:00F5]  A:0001 X:0004 Y:9E53 P:envMxdizC
+
  $9C/8E77 85 F5      STA $F5
  $9C/8E79 68          PLA                     A:0001 X:0004 Y:9E53 P:envMxdizC
+
  $9C/8E79 68          PLA           ; Restore Timer value from Stack
  $9C/8E7A C9 9E      CMP #$9E               A:0001 X:0004 Y:9E53 P:envMxdizc
+
  $9C/8E7A C9 9E      CMP #$9E     ; Is the Timer (Frame Counter) higher than #$9E?
  $9C/8E7C B0 03      BCS $03   [$8E81]     A:0001 X:0004 Y:9E53 P:envMxdizc
+
  $9C/8E7C B0 03      BCS $03       ; [$8E81] Branch if it IS
  $9C/8E7E 4C 64 9C    JMP $9C64    ; ??? Screen fade in?
+
  $9C/8E7E 4C 64 9C    JMP $9C64    ; Jump to Screen fade-in (leave this subroutine)
  $9C/8E81 4A          LSR A                   A:009E X:0004 Y:9E53 P:envMxdiZC
+
  $9C/8E81 4A          LSR A         ; Push LSB into Carry (Clear = Even number, Set = odd number)
  $9C/8E82 90 4D      BCC $4D      ; [$8ED1] ??? Exit
+
  $9C/8E82 90 4D      BCC $4D      ; [$8ED1] Exit if even number
  $9C/8E84 CE 87 05    DEC $0587 [$9C:0587]  A:004F X:0004 Y:9E53 P:envMxdizC
+
  $9C/8E84 CE 87 05    DEC $0587     ; Else, decrement Screen Brightness
  $9C/8E87 D0 48      BNE $48      ; [$8ED1] ??? Exit
+
  $9C/8E87 D0 48      BNE $48      ; [$8ED1] Exit if Screen Brightness isn't zero yet
  $9C/8E89 A9 10      LDA #$10               A:005D X:0004 Y:9E53 P:envMxdiZC
+
  $9C/8E89 A9 10      LDA #$10     ; (Number of Colors to do with the color Subroutine later)
  $9C/8E8B 8D A6 17    STA $17A6 [$9C:17A6]  A:0010 X:0004 Y:9E53 P:envMxdizC
+
  $9C/8E8B 8D A6 17    STA $17A6
  $9C/8E8E 9C A7 17    STZ $17A7 [$9C:17A7]  A:0010 X:0004 Y:9E53 P:envMxdizC
+
  $9C/8E8E 9C A7 17    STZ $17A7
 
  $9C/8E91 A9 00      LDA #$00      ; Setup the Address of CGRAM Buffer ($00/124B) in $20-$22
 
  $9C/8E91 A9 00      LDA #$00      ; Setup the Address of CGRAM Buffer ($00/124B) in $20-$22
 
  $9C/8E93 85 22      STA $22
 
  $9C/8E93 85 22      STA $22
 
  $9C/8E95 A2 4B 12    LDX #$124B
 
  $9C/8E95 A2 4B 12    LDX #$124B
 
  $9C/8E98 86 20      STX $20
 
  $9C/8E98 86 20      STX $20
  $9C/8E9A A9 9C      LDA #$9C               A:0000 X:124B Y:9E53 P:envMxdizC
+
  $9C/8E9A A9 9C      LDA #$9C     ; Setup the Address of a Palette ($9C/DCD4) in $23-25
  $9C/8E9C 85 25      STA $25   [$00:0025]  A:009C X:124B Y:9E53 P:eNvMxdizC
+
  $9C/8E9C 85 25      STA $25
  $9C/8E9E A2 D4 DC    LDX #$DCD4             A:009C X:124B Y:9E53 P:eNvMxdizC
+
  $9C/8E9E A2 D4 DC    LDX #$DCD4
  $9C/8EA1 86 23      STX $23   [$00:0023]  A:009C X:DCD4 Y:9E53 P:eNvMxdizC
+
  $9C/8EA1 86 23      STX $23
 
  $9C/8EA3 22 14 AA 83 JSL $83AA14[$83:AA14]  A:009C X:DCD4 Y:9E53 P:eNvMxdizC
 
  $9C/8EA3 22 14 AA 83 JSL $83AA14[$83:AA14]  A:009C X:DCD4 Y:9E53 P:eNvMxdizC
 
  $9C/8EA7 9C 87 05    STZ $0587    ; $2100 Buffer - Turn Screen off
 
  $9C/8EA7 9C 87 05    STZ $0587    ; $2100 Buffer - Turn Screen off
Line 21,675: Line 22,141:
 
  $9C/8EC3 7B          TDC          ; Clear 16-bit A
 
  $9C/8EC3 7B          TDC          ; Clear 16-bit A
 
  $9C/8EC4 AA          TAX          ; Clear X
 
  $9C/8EC4 AA          TAX          ; Clear X
  $9C/8EC5 8E 9C 17    STX $179C [$9C:179C]  A:0000 X:0000 Y:0020 P:envMxdiZc
+
  $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 ==
 +
 
 +
Like in the subroutine before, this subroutine handles different things depending on the value of a frame counter (in $179C).
 +
 
 +
* If the timer is <#0124, the screen fades in ($9C/87FB)
 +
* If the timer has reached #$124, ?????????? ($9C/8F29)
 +
* If the timer is between #$125 and #$1AD, ?????????? ($9C/8F34)
 +
* If the timer has reached #$1AE, ?????????? ($9C/8EDE)
  
  $9C/8ED2 AE 9C 17    LDX $179C  [$9C:179C]   A:0006 X:0006 Y:0020 P:envMxdizc
+
  $9C/8ED2 AE 9C 17    LDX $179C     ; Load Timer (Frame Counter)
  $9C/8ED5 E8          INX                    A:0006 X:0000 Y:0020 P:envMxdiZc
+
$9C/8ED5 E8          INX          ; Inc Timer
  $9C/8ED6 8E 9C 17    STX $179C [$9C:179C]  A:0006 X:0001 Y:0020 P:envMxdizc
+
$9C/8ED6 8E 9C 17    STX $179C    ; Store incremented Timer back
  $9C/8ED9 E0 AE 01   CPX #$01AE              A:0006 X:0001 Y:0020 P:envMxdizc
+
$9C/8ED9 E0 AE 01    CPX #$01AE    ; Has Timer reached #$01AE?
  $9C/8EDC D0 44       BNE $44   [$8F22]      A:0006 X:0001 Y:0020 P:eNvMxdizc
+
  $9C/8EDC D0 44      BNE $44      ; [$8F22] Branch if not
Code is missing here
+
$9C/8EDE A9 00      LDA #$00      ; Setup 24-bit address of VGRAM buffer ($00/12EB) in [$20]
  $9C/8F22 E0 24 01   CPX #$0124             A:0006 X:0001 Y:0020 P:eNvMxdizc
+
$9C/8EE0 85 22      STA $22
  $9C/8F25 90 54       BCC $54       ; [$8F7B] Branch if less than #$0124
+
$9C/8EE2 A2 EB 12    LDX #$12EB
Code is missing here
+
$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/8EF4 7B          TDC          ; Clear 16-bit A
 +
$9C/8EF5 AA          TAX          ; Clear X
 +
$9C/8EF6 8E 9C 17    STX $179C     ; Clear Frame Counter
 +
$9C/8EF9 8E 9E 17    STX $179E    ; Clear Special Frame Counter
 +
$9C/8EFC A9 1C      LDA #$1C      ; BG1 Tilemap address: $1C00, no mirroring
 +
$9C/8EFE 8D 8B 05    STA $058B
 +
$9C/8F01 A9 06      LDA #$06      ; BG2/3 on Main Screen
 +
$9C/8F03 8D A6 05    STA $05A6
 +
$9C/8F06 A9 01      LDA #$01      ; BG1 on Subscreen
 +
$9C/8F08 8D A7 05    STA $05A7
 +
$9C/8F0B A9 22      LDA #$22      ; NotMathWindow Mask
 +
$9C/8F0D 8D AA 05    STA $05AA
 +
$9C/8F10 A2 64 01    LDX #$0164
 +
$9C/8F13 8E 91 05    STX $0591    ; BG1 Horizontal Scroll: #$0164
 +
$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/8F1C 60          RTS
 +
$9C/8F1D 9C A7 05    STZ $05A7    ; Remove BG1 from Subscreen
 +
$9C/8F20 80 56      BRA $56      ; [$8F78] Increment Special Frame Counter/BG2 X-Scroll
 +
$9C/8F22 E0 24 01    CPX #$0124    ; Has Timer reached #$0124?
 +
$9C/8F25 90 54      BCC $54      ; [$8F7B] Branch if not (Screen fade in and exit)
 +
$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/8F2B 8D 9E 17    STA $179E  [$9C:179E]  A:0001 X:0124 Y:0020 P:envMxdizC
 +
  $9C/8F2E 9C 9F 17    STZ $179F [$9C:179F]  A:0001 X:0124 Y:0020 P:envMxdizC
 +
$9C/8F31 9C 9A 17    STZ $179A  [$9C:179A]  A:0001 X:0124 Y:0020 P:envMxdizC
 +
  $9C/8F34 AD 9F 17   LDA $179F  [$9C:179F]  A:0001 X:0124 Y:0020 P:envMxdizC
 +
$9C/8F37 C9 07      CMP #$07                A:0000 X:0124 Y:0020 P:envMxdiZC
 +
$9C/8F39 B0 E2      BCS $E2    [$8F1D]      A:0000 X:0124 Y:0020 P:eNvMxdizc
 +
$9C/8F3B CE 9E 17    DEC $179E  [$9C:179E]  A:0000 X:0124 Y:0020 P:eNvMxdizc
 +
  $9C/8F3E D0 38       BNE $38   [$8F78]      A:0000 X:0124 Y:0020 P:envMxdiZc
 +
$9C/8F40 A9 0F      LDA #$0F                A:0000 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/8F48 A9 00      LDA #$00      ; Setup 24-bit address of VGRAM buffer ($00/12EB) in [$20]
 +
$9C/8F4A 85 22      STA $22
 +
$9C/8F4C A2 4B 12    LDX #$124B
 +
$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/8F55 A2 A0 00   LDX #$00A0             A:0C63 X:0020 Y:0020 P:eNvMxdizc
 +
  $9C/8F58 C2 20       REP #$20                A:0C63 X:00A0 Y:0020 P:envMxdizc
 +
$9C/8F5A BD 4B 12    LDA $124B,x[$9C:12EB]  A:0C63 X:00A0 Y:0020 P:envmxdizc
 +
$9C/8F5D A0 19 00    LDY #$0019              A:0000 X:00A0 Y:0020 P:envmxdiZc
 +
$9C/8F60 22 AA 83 83 JSL $8383AA[$83:83AA]  A:0000 X:00A0 Y:0019 P:envmxdizc
 +
$9C/8F64 9D 4B 12    STA $124B,x[$9C:12EB]  A:0000 X:00A0 Y:009B P:eNvmxdizc
 +
$9C/8F67 9D 4B 14    STA $144B,x[$9C:14EB]  A:0000 X:00A0 Y:009B P:eNvmxdizc
 +
$9C/8F6A E8          INX                    A:0000 X:00A0 Y:009B P:eNvmxdizc
 +
$9C/8F6B E8          INX                    A:0000 X:00A1 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/8F71 E2 20      SEP #$20      ; A = 8-bit
 +
$9C/8F73 A9 01      LDA #$01      ; Set Flag for CGRAM Update
 +
$9C/8F75 8D 49 12    STA $1249
 +
$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,722: 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 21,910: Line 22,545:
 
  $9C/9C6E 8D C2 05    STA $05C2
 
  $9C/9C6E 8D C2 05    STA $05C2
 
  $9C/9C71 22 6A 8D 80 JSL $808D6A  ; Turn Brightness higher if not maximum
 
  $9C/9C71 22 6A 8D 80 JSL $808D6A  ; Turn Brightness higher if not maximum
  $9C/9C75 22 8A A1 80 JSL $80A18A  ; ??? Wait for NMI
+
  $9C/9C75 22 8A A1 80 JSL $80A18A  ; Wait for NMI
 
  $9C/9C79 18          CLC
 
  $9C/9C79 18          CLC
 
  $9C/9C7A 60          RTS
 
  $9C/9C7A 60          RTS
  
== $9C/9C7B ? ==
+
== $9C/9C7B ? Intro Text Shadow effect (and probably more?) ==
  
This subroutine merges data in WRAM. This builds a tilemap, IIRC.
+
This subroutine is called from $9C/8BA7. This is during the Startup of the game, where Japanese Vertical Text appears over a cloudy background. This subroutine calculates a proper shadow effect for that text. When this subroutine is called, at $7E/2000 is still the decompressed tiles for the text itself (in-game shown in white on BG1). This subroutine turns that graphic data into that shadow for BG3.
  
 
  $9C/9C7B C2 20      REP #$20      ; 16 Bit A
 
  $9C/9C7B C2 20      REP #$20      ; 16 Bit A
Line 22,147: 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,201: 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 ? ==
Line 22,427: Line 23,062:
 
  $CB/A087-$CB/A0A6 - Palette used in the intro for the manufacturer's logos and the intro
 
  $CB/A087-$CB/A0A6 - Palette used in the intro for the manufacturer's logos and the intro
 
  </pre>
 
  </pre>
 +
 +
= Bank $DE =
 +
== $DE/E907 GAME INTRO Part of Japanese Text Tileset (Compressed) ==
 +
 +
Gets Decompressed with $9C/9B15
 +
 +
== $DE/FD3B GAME INTRO Part of Japanese Text/Quest/Hermet/"Quest Presents" Tileset (Compressed) ==
 +
 +
Gets Decompressed with $9C/9B15
 +
 +
= Bank $DF =
 +
== $DF/8BEB GAME INTRO Part of Sky BG Tileset (Compressed) ==
 +
 +
Gets Decompressed with $9C/9B15
 +
 +
== $DF/9F80 GAME INTRO Part of Sky BG Tileset (Compressed) ==
 +
 +
Gets Decompressed with $9C/9B15
 +
 +
== $DF/B263 GAME INTRO Part of Sky BG Tileset (Compressed) ==
 +
 +
Gets Decompressed with $9C/9B15
 +
 +
== $DF/BC53 GAME INTRO Japanese Text Tilemap (Compressed) ==
 +
 +
Gets Decompressed with $9C/9B15
 +
 +
== $DF/BFBB GAME INTRO Sky BG Tilemap (Compressed) ==
 +
 +
Gets Decompressed with $9C/9B15
 +
 +
== $DF/C545 GAME INTRO Quest Logo Tilemap (Compressed) ==
 +
 +
Gets Decompressed with $9C/9B15
 +
 +
== $DF/C5DC GAME INTRO "Quest Presents" Tilemap (Compressed) ==
 +
 +
Gets Decompressed with $9C/9B15
 +
 +
== $DF/C66E GAME INTRO Hermit Logo Tilemap (Compressed) ==
 +
 +
Gets Decompressed with $9C/9B15
 +
 +
== $DF/CD20 GAME INTRO ??? (Compressed) ==
 +
 +
Gets Decompressed with $9C/9B15
 +
 +
Unknown Graphics Data, I think it is related to the Shadow Effect of he Vertical Japanese Text that appears above the Sky Background in the Game Intro
  
 
{{Internal Data|game=Tactics Ogre}}
 
{{Internal Data|game=Tactics Ogre}}

Latest revision as of 06:22, 20 March 2019

Contents