Difference between revisions of "Tactics Ogre:ROM map"

From Data Crystal
Jump to: navigation, search
($80/81C5 ?)
($80/B101 ?)
 
(346 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 1,228: Line 1,228:
 
  $80/9761 A5 A2      LDA $A2    [$00:00A2]  A:1700 X:0000 Y:0009 P:envMxdiZC
 
  $80/9761 A5 A2      LDA $A2    [$00:00A2]  A:1700 X:0000 Y:0009 P:envMxdiZC
 
  $80/9763 89 02      BIT #$02                A:1708 X:0000 Y:0009 P:envMxdizC
 
  $80/9763 89 02      BIT #$02                A:1708 X:0000 Y:0009 P:envMxdizC
  $80/9765 D0 4E      BNE $4E   [$97B5]     A:1708 X:0000 Y:0009 P:envMxdiZC
+
  $80/9765 D0 4E      BNE $4E       ; [$97B5] Leave this part out if Bit 1 is set
 
  $80/9767 A2 20 B0    LDX #$B020              A:1708 X:0000 Y:0009 P:envMxdiZC
 
  $80/9767 A2 20 B0    LDX #$B020              A:1708 X:0000 Y:0009 P:envMxdiZC
 
  $80/976A EC FE 16    CPX $16FE  [$80:16FE]  A:1708 X:B020 Y:0009 P:eNvMxdizC
 
  $80/976A EC FE 16    CPX $16FE  [$80:16FE]  A:1708 X:B020 Y:0009 P:eNvMxdizC
Line 1,261: Line 1,261:
 
  $80/97B5 A5 A2      LDA $A2    [$00:00A2]  A:1700 X:0000 Y:0009 P:envMxdiZC
 
  $80/97B5 A5 A2      LDA $A2    [$00:00A2]  A:1700 X:0000 Y:0009 P:envMxdiZC
 
  $80/97B7 89 01      BIT #$01                A:1708 X:0000 Y:0009 P:envMxdizC
 
  $80/97B7 89 01      BIT #$01                A:1708 X:0000 Y:0009 P:envMxdizC
  $80/97B9 D0 4C      BNE $4C   [$9807]     A:1708 X:0000 Y:0009 P:envMxdiZC
+
  $80/97B9 D0 4C      BNE $4C       ; [$9807] Exit if Bit 0 is set
 
  $80/97BB 89 08      BIT #$08                A:1708 X:0000 Y:0009 P:envMxdiZC
 
  $80/97BB 89 08      BIT #$08                A:1708 X:0000 Y:0009 P:envMxdiZC
 
  $80/97BD D0 08      BNE $08    [$97C7]      A:1708 X:0000 Y:0009 P:envMxdizC
 
  $80/97BD D0 08      BNE $08    [$97C7]      A:1708 X:0000 Y:0009 P:envMxdizC
;code is missing here
+
$80/97BF AE FE 16    LDX $16FE  [$80:16FE]  A:1700 X:0000 Y:0009 P:envMxdiZC
 +
$80/97C2 8E 00 17    STX $1700  [$80:1700]  A:1700 X:B040 Y:0009 P:eNvMxdizC
 +
$80/97C5 80 40      BRA $40    [$9807]      A:1700 X:B040 Y:0009 P:eNvMxdizC
 
  $80/97C7 A2 60 B0    LDX #$B060              A:1708 X:0000 Y:0009 P:envMxdizC
 
  $80/97C7 A2 60 B0    LDX #$B060              A:1708 X:0000 Y:0009 P:envMxdizC
 
  $80/97CA EC 00 17    CPX $1700  [$80:1700]  A:1708 X:B060 Y:0009 P:eNvMxdizC
 
  $80/97CA EC 00 17    CPX $1700  [$80:1700]  A:1708 X:B060 Y:0009 P:eNvMxdizC
Line 1,273: Line 1,275:
 
  $80/97D7 85 04      STA $04    [$00:0004]  A:17DD X:B060 Y:0009 P:eNvMxdizc
 
  $80/97D7 85 04      STA $04    [$00:0004]  A:17DD X:B060 Y:0009 P:eNvMxdizc
 
  $80/97D9 64 01      STZ $01    [$00:0001]  A:17DD X:B060 Y:0009 P:eNvMxdizc
 
  $80/97D9 64 01      STZ $01    [$00:0001]  A:17DD X:B060 Y:0009 P:eNvMxdizc
  $80/97DB AE 00 17    LDX $1700 [$80:1700]   A:17DD X:B060 Y:0009 P:eNvMxdizc
+
  $80/97DB AE 00 17    LDX $1700     ; Setup 24-bit Address on Bank $7E in [$20]
  $80/97DE 86 20      STX $20   [$00:0020]  A:17DD X:B060 Y:0009 P:eNvMxdizc
+
  $80/97DE 86 20      STX $20
  $80/97E0 A9 7E      LDA #$7E               A:17DD X:B060 Y:0009 P:eNvMxdizc
+
  $80/97E0 A9 7E      LDA #$7E
  $80/97E2 85 22      STA $22   [$00:0022]  A:177E X:B060 Y:0009 P:envMxdizc
+
  $80/97E2 85 22      STA $22
 
  $80/97E4 A0 00 00    LDY #$0000              A:177E X:B060 Y:0009 P:envMxdizc
 
  $80/97E4 A0 00 00    LDY #$0000              A:177E X:B060 Y:0009 P:envMxdizc
  $80/97E7 A2 71 05    LDX #$0571             A:177E X:B060 Y:0000 P:envMxdiZc
+
  $80/97E7 A2 71 05    LDX #$0571   ; Load BG1 X-Scroll
 
  $80/97EA 86 02      STX $02    [$00:0002]  A:177E X:0571 Y:0000 P:envMxdizc
 
  $80/97EA 86 02      STX $02    [$00:0002]  A:177E X:0571 Y:0000 P:envMxdizc
  $80/97EC AD EE 05    LDA $05EE [$80:05EE]  A:177E X:0571 Y:0000 P:envMxdizc
+
  $80/97EC AD EE 05    LDA $05EE     ; Load V Timer
 
  $80/97EF 20 10 98    JSR $9810  [$80:9810]  A:17DB X:0571 Y:0000 P:eNvMxdizc
 
  $80/97EF 20 10 98    JSR $9810  [$80:9810]  A:17DB X:0571 Y:0000 P:eNvMxdizc
  $80/97F2 F0 13      BEQ $13   [$9807]     A:0502 X:0571 Y:0006 P:envMxdizC
+
  $80/97F2 F0 13      BEQ $13       ; [$9807] Exit if empty
 
  $80/97F4 AE 04 17    LDX $1704  [$80:1704]  A:0502 X:0571 Y:0006 P:envMxdizC
 
  $80/97F4 AE 04 17    LDX $1704  [$80:1704]  A:0502 X:0571 Y:0006 P:envMxdizC
 
  $80/97F7 86 02      STX $02    [$00:0002]  A:0502 X:171A Y:0006 P:envMxdizC
 
  $80/97F7 86 02      STX $02    [$00:0002]  A:0502 X:171A Y:0006 P:envMxdizC
Line 1,295: Line 1,297:
  
 
  $80/9810 DA          PHX                    A:00DB X:CE1F Y:0000 P:eNvMxdizC
 
  $80/9810 DA          PHX                    A:00DB X:CE1F Y:0000 P:eNvMxdizC
  $80/9811 C5 04      CMP $04   [$00:0004]  A:00DB X:CE1F Y:0000 P:eNvMxdizC
+
  $80/9811 C5 04      CMP $04       ; Compare A with $04
  $80/9813 90 02      BCC $02   [$9817]     A:00DB X:CE1F Y:0000 P:eNvMxdizc
+
  $80/9813 90 02      BCC $02       ; [$9817] Store the lower value of both in $05
  $80/9815 A5 04      LDA $04   [$00:0004]  A:D102 X:CE1F Y:0006 P:envMxdiZC
+
  $80/9815 A5 04      LDA $04
  $80/9817 85 05      STA $05   [$00:0005]  A:00DB X:CE1F Y:0000 P:eNvMxdizc
+
  $80/9817 85 05      STA $05
 
  $80/9819 64 00      STZ $00    [$00:0000]  A:00DB X:CE1F Y:0000 P:eNvMxdizc
 
  $80/9819 64 00      STZ $00    [$00:0000]  A:00DB X:CE1F Y:0000 P:eNvMxdizc
 
  $80/981B C9 71      CMP #$71                A:00DB X:CE1F Y:0000 P:eNvMxdizc
 
  $80/981B C9 71      CMP #$71                A:00DB X:CE1F Y:0000 P:eNvMxdizc
  $80/981D 90 06      BCC $06   [$9825]     A:00DB X:CE1F Y:0000 P:envMxdizC
+
  $80/981D 90 06      BCC $06       ; [$9825] Branch if A < #$71
 
  $80/981F E9 70      SBC #$70                A:00DB X:CE1F Y:0000 P:envMxdizC
 
  $80/981F E9 70      SBC #$70                A:00DB X:CE1F Y:0000 P:envMxdizC
 
  $80/9821 85 00      STA $00    [$00:0000]  A:006B X:CE1F Y:0000 P:enVMxdizC
 
  $80/9821 85 00      STA $00    [$00:0000]  A:006B X:CE1F Y:0000 P:enVMxdizC
Line 1,308: Line 1,310:
 
  $80/9826 05 01      ORA $01    [$00:0001]  A:0070 X:0070 Y:0000 P:enVMxdizC
 
  $80/9826 05 01      ORA $01    [$00:0001]  A:0070 X:0070 Y:0000 P:enVMxdizC
 
  $80/9828 97 20      STA [$20],y[$7E:B000]  A:00F0 X:0070 Y:0000 P:eNVMxdizC
 
  $80/9828 97 20      STA [$20],y[$7E:B000]  A:00F0 X:0070 Y:0000 P:eNVMxdizC
  $80/982A C8          INY                     A:00F0 X:0070 Y:0000 P:eNVMxdizC
+
  $80/982A C8          INY           ; Increment Store Index
 
  $80/982B C2 20      REP #$20                A:00F0 X:0070 Y:0001 P:enVMxdizC
 
  $80/982B C2 20      REP #$20                A:00F0 X:0070 Y:0001 P:enVMxdizC
 
  $80/982D A5 02      LDA $02    [$00:0002]  A:00F0 X:0070 Y:0001 P:enVmxdizC
 
  $80/982D A5 02      LDA $02    [$00:0002]  A:00F0 X:0070 Y:0001 P:enVmxdizC
 
  $80/982F 97 20      STA [$20],y[$7E:B001]  A:CE1F X:0070 Y:0001 P:eNVmxdizC
 
  $80/982F 97 20      STA [$20],y[$7E:B001]  A:CE1F X:0070 Y:0001 P:eNVmxdizC
 
  $80/9831 E2 20      SEP #$20                A:CE1F X:0070 Y:0001 P:eNVmxdizC
 
  $80/9831 E2 20      SEP #$20                A:CE1F X:0070 Y:0001 P:eNVmxdizC
  $80/9833 C8          INY                     A:CE1F X:0070 Y:0001 P:eNVMxdizC
+
  $80/9833 C8          INY           ; Increment Store Index twice
  $80/9834 C8          INY                     A:CE1F X:0070 Y:0002 P:enVMxdizC
+
  $80/9834 C8          INY
 
  $80/9835 A5 01      LDA $01    [$00:0001]  A:CE1F X:0070 Y:0003 P:enVMxdizC
 
  $80/9835 A5 01      LDA $01    [$00:0001]  A:CE1F X:0070 Y:0003 P:enVMxdizC
 
  $80/9837 10 0E      BPL $0E    [$9847]      A:CE80 X:0070 Y:0003 P:eNVMxdizC
 
  $80/9837 10 0E      BPL $0E    [$9847]      A:CE80 X:0070 Y:0003 P:eNVMxdizC
Line 1,378: Line 1,380:
 
  $80/99B7 08          PHP                    A:0400 X:0002 Y:0002 P:envmxdizC
 
  $80/99B7 08          PHP                    A:0400 X:0002 Y:0002 P:envmxdizC
 
  $80/99B8 B0 04      BCS $04    [$99BE]      A:0400 X:0002 Y:0002 P:envmxdizC
 
  $80/99B8 B0 04      BCS $04    [$99BE]      A:0400 X:0002 Y:0002 P:envmxdizC
;code is missing here
+
$80/99BA 49 FF FF    EOR #$FFFF              A:FFF8 X:000A Y:0004 P:eNvmxdizc
 +
$80/99BD 1A          INC A                  A:0007 X:000A Y:0004 P:envmxdizc
 
  $80/99BE 4A          LSR A                  A:0400 X:0002 Y:0002 P:envmxdizC
 
  $80/99BE 4A          LSR A                  A:0400 X:0002 Y:0002 P:envmxdizC
 
  $80/99BF 4A          LSR A                  A:0200 X:0002 Y:0002 P:envmxdizc
 
  $80/99BF 4A          LSR A                  A:0200 X:0002 Y:0002 P:envmxdizc
Line 1,386: Line 1,389:
 
  $80/99C3 28          PLP                    A:0040 X:0002 Y:0002 P:envmxdizC
 
  $80/99C3 28          PLP                    A:0040 X:0002 Y:0002 P:envmxdizC
 
  $80/99C4 B0 04      BCS $04    [$99CA]      A:0040 X:0002 Y:0002 P:envmxdizC
 
  $80/99C4 B0 04      BCS $04    [$99CA]      A:0040 X:0002 Y:0002 P:envmxdizC
;code is missing here
+
$80/99C6 49 FF FF    EOR #$FFFF              A:0001 X:000A Y:0004 P:eNvmxdizc
 +
$80/99C9 1A          INC A                  A:FFFE X:000A Y:0004 P:eNvmxdizc
 
  $80/99CA 18          CLC                    A:0040 X:0002 Y:0002 P:envmxdizC
 
  $80/99CA 18          CLC                    A:0040 X:0002 Y:0002 P:envmxdizC
 
  $80/99CB 7D 43 07    ADC $0743,x[$80:0745]  A:0040 X:0002 Y:0002 P:envmxdizc
 
  $80/99CB 7D 43 07    ADC $0743,x[$80:0745]  A:0040 X:0002 Y:0002 P:envmxdizc
Line 1,554: Line 1,558:
 
  $80/9AEB E2 20      SEP #$20                A:0F7E X:003E Y:000C P:envmxdizc
 
  $80/9AEB E2 20      SEP #$20                A:0F7E X:003E Y:000C P:envmxdizc
 
  $80/9AED 80 D2      BRA $D2      ; [$9AC1] Loop
 
  $80/9AED 80 D2      BRA $D2      ; [$9AC1] Loop
;Code is missing here
+
$80/9AEF 5A          PHY                    A:0000 X:0006 Y:0004 P:envMxdiZC
 +
$80/9AF0 C2 20      REP #$20                A:0000 X:0006 Y:0004 P:envMxdiZC
 +
$80/9AF2 B9 85 0E    LDA $0E85,y[$80:0E89]  A:0000 X:0006 Y:0004 P:envmxdiZC
 +
$80/9AF5 99 83 0E    STA $0E83,y[$80:0E87]  A:0008 X:0006 Y:0004 P:envmxdizC
 +
$80/9AF8 C8          INY                    A:0008 X:0006 Y:0004 P:envmxdizC
 +
$80/9AF9 C8          INY                    A:0008 X:0006 Y:0005 P:envmxdizC
 +
$80/9AFA C9 FF FF    CMP #$FFFF              A:0008 X:0006 Y:0006 P:envmxdizC
 +
$80/9AFD D0 F3      BNE $F3    [$9AF2]      A:0008 X:0006 Y:0006 P:envmxdizc
 +
$80/9AFF E2 20      SEP #$20                A:FFFF X:0006 Y:000A P:envmxdiZC
 +
$80/9B01 7A          PLY                    A:FFFF X:0006 Y:000A P:envMxdiZC
 +
$80/9B02 80 BD      BRA $BD    [$9AC1]      A:FFFF X:0006 Y:0004 P:envMxdizC
 
  $80/9B04 A0 00 00    LDY #$0000              A:0E00 X:FFFF Y:0014 P:eNvMxdizc
 
  $80/9B04 A0 00 00    LDY #$0000              A:0E00 X:FFFF Y:0014 P:eNvMxdizc
 
  $80/9B07 BE 83 0E    LDX $0E83,y[$80:0E83]  A:0E00 X:FFFF Y:0000 P:envMxdiZc
 
  $80/9B07 BE 83 0E    LDX $0E83,y[$80:0E83]  A:0E00 X:FFFF Y:0000 P:envMxdiZc
Line 1,652: Line 1,666:
 
  $80/9BEA C9 0A 00    CMP #$000A              A:0006 X:0000 Y:0006 P:envmxdizC
 
  $80/9BEA C9 0A 00    CMP #$000A              A:0006 X:0000 Y:0006 P:envmxdizC
 
  $80/9BED 90 20      BCC $20    [$9C0F]      A:0006 X:0000 Y:0006 P:eNvmxdizc
 
  $80/9BED 90 20      BCC $20    [$9C0F]      A:0006 X:0000 Y:0006 P:eNvmxdizc
;code is missing here
+
$80/9BEF A5 00      LDA $00    [$00:0000]  A:000A X:0000 Y:000A P:envmxdiZC
 +
$80/9BF1 18          CLC                    A:0000 X:0000 Y:000A P:envmxdiZC
 +
$80/9BF2 65 02      ADC $02    [$00:0002]  A:0000 X:0000 Y:000A P:envmxdiZc
 +
$80/9BF4 4A          LSR A                  A:000A X:0000 Y:000A P:envmxdizc
 +
$80/9BF5 29 FE FF    AND #$FFFE              A:0005 X:0000 Y:000A P:envmxdizc
 +
$80/9BF8 85 04      STA $04    [$00:0004]  A:0004 X:0000 Y:000A P:envmxdizc
 +
$80/9BFA A6 00      LDX $00    [$00:0000]  A:0004 X:0000 Y:000A P:envmxdizc
 +
$80/9BFC A4 04      LDY $04    [$00:0004]  A:0004 X:0000 Y:000A P:envmxdiZc
 +
$80/9BFE 20 DC 9B    JSR $9BDC  [$80:9BDC]  A:0004 X:0000 Y:0004 P:envmxdizc
 +
$80/9C01 A6 04      LDX $04    [$00:0004]  A:12C0 X:0000 Y:0004 P:envmxdiZC
 +
$80/9C03 E8          INX                    A:12C0 X:0004 Y:0004 P:envmxdizC
 +
$80/9C04 E8          INX                    A:12C0 X:0005 Y:0004 P:envmxdizC
 +
$80/9C05 A4 02      LDY $02    [$00:0002]  A:12C0 X:0006 Y:0004 P:envmxdizC
 +
$80/9C07 20 DC 9B    JSR $9BDC  [$80:9BDC]  A:12C0 X:0006 Y:000A P:envmxdizC
 +
$80/9C0A 20 20 9C    JSR $9C20  [$80:9C20]  A:0C00 X:0000 Y:000A P:envmxdiZC
 +
$80/9C0D 80 07      BRA $07    [$9C16]      A:0004 X:3A17 Y:0006 P:envmxdiZC
 
  $80/9C0F E4 02      CPX $02    [$00:0002]  A:0006 X:0000 Y:0006 P:eNvmxdizc
 
  $80/9C0F E4 02      CPX $02    [$00:0002]  A:0006 X:0000 Y:0006 P:eNvmxdizc
 
  $80/9C11 F0 03      BEQ $03    [$9C16]      A:0006 X:0000 Y:0006 P:eNvmxdizc
 
  $80/9C11 F0 03      BEQ $03    [$9C16]      A:0006 X:0000 Y:0006 P:eNvmxdizc
Line 1,669: Line 1,698:
 
  $80/9C22 A4 00      LDY $00    [$00:0000]  A:0C00 X:3A11 Y:000A P:envmxdizC
 
  $80/9C22 A4 00      LDY $00    [$00:0000]  A:0C00 X:3A11 Y:000A P:envmxdizC
 
  $80/9C24 B9 83 0E    LDA $0E83,y[$7E:0E83]  A:0C00 X:3A11 Y:0000 P:envmxdiZC
 
  $80/9C24 B9 83 0E    LDA $0E83,y[$7E:0E83]  A:0C00 X:3A11 Y:0000 P:envmxdiZC
  $80/9C27 9D 00 00    STA $0000,x[$7E:3A11]   A:0002 X:3A11 Y:0000 P:envmxdizC
+
  $80/9C27 9D 00 00    STA $0000,x  ; Buffer values
  $80/9C2A C8          INY                     A:0002 X:3A11 Y:0000 P:envmxdizC
+
  $80/9C2A C8          INY           ; Increment Load Index twice
  $80/9C2B C8          INY                     A:0002 X:3A11 Y:0001 P:envmxdizC
+
  $80/9C2B C8          INY
  $80/9C2C E8          INX                     A:0002 X:3A11 Y:0002 P:envmxdizC
+
  $80/9C2C E8          INX           ; Increment Store Index twice
  $80/9C2D E8          INX                     A:0002 X:3A12 Y:0002 P:envmxdizC
+
  $80/9C2D E8          INX
 
  $80/9C2E C4 04      CPY $04    [$00:0004]  A:0002 X:3A13 Y:0002 P:envmxdizC
 
  $80/9C2E C4 04      CPY $04    [$00:0004]  A:0002 X:3A13 Y:0002 P:envmxdizC
  $80/9C30 90 F2      BCC $F2   [$9C24]     A:0002 X:3A13 Y:0002 P:eNvmxdizc
+
  $80/9C30 90 F2      BCC $F2       ; [$9C24] Loop if Y is less
  $80/9C32 F0 F0      BEQ $F0   [$9C24]     A:0000 X:3A15 Y:0004 P:envmxdiZC
+
  $80/9C32 F0 F0      BEQ $F0       ; [$9C24] Loop if Y is the same
 
  $80/9C34 86 04      STX $04    [$00:0004]  A:0004 X:3A17 Y:0006 P:envmxdizC
 
  $80/9C34 86 04      STX $04    [$00:0004]  A:0004 X:3A17 Y:0006 P:envmxdizC
 
  $80/9C36 A6 5C      LDX $5C    [$00:005C]  A:0004 X:3A17 Y:0006 P:envmxdizC
 
  $80/9C36 A6 5C      LDX $5C    [$00:005C]  A:0004 X:3A17 Y:0006 P:envmxdizC
Line 2,190: Line 2,219:
 
$0C contains the Number of Bytes to transfer
 
$0C contains the Number of Bytes to transfer
  
  $80/9FF4 AD C9 11    LDA $11C9    ; Load Number of Animation VRAM DMAs
+
  $80/9FF4 AD C9 11    LDA $11C9    ; Load Number of the next free Animation VRAM DMA slot
 
  $80/9FF7 1A          INC A        ; Increment by one
 
  $80/9FF7 1A          INC A        ; Increment by one
  $80/9FF8 29 1F      AND #$1F      ; ???
+
  $80/9FF8 29 1F      AND #$1F      ; Reset if it surpassed #$1F (circular buffer)
  $80/9FFA CD CA 11    CMP $11CA    ; ???
+
  $80/9FFA CD CA 11    CMP $11CA    ; Is it the same as Number of the first used Animation VRAM DMA slot
 
  $80/9FFD F0 28      BEQ $28      ; [$A027] Exit
 
  $80/9FFD F0 28      BEQ $28      ; [$A027] Exit
 
  $80/9FFF 7B          TDC          ; Clear 16-bit A
 
  $80/9FFF 7B          TDC          ; Clear 16-bit A
  $80/A000 AD C9 11    LDA $11C9    ; Load Number of Animation VRAM DMAs again
+
  $80/A000 AD C9 11    LDA $11C9    ; Load Number of the next free Animation VRAM DMA slot
 
  $80/A003 C2 21      REP #$21      ; 16-bit A, Clear Carry
 
  $80/A003 C2 21      REP #$21      ; 16-bit A, Clear Carry
 
  $80/A005 DA          PHX          ; Push DMA Source Address on Stack
 
  $80/A005 DA          PHX          ; Push DMA Source Address on Stack
Line 2,210: Line 2,239:
 
  $80/A017 68          PLA          ; Pull Source Bank from Stack (Pushed at $80/9FBA)
 
  $80/A017 68          PLA          ; Pull Source Bank from Stack (Pushed at $80/9FBA)
 
  $80/A018 9D 8A 11    STA $118A,x  ; Store it in Animation VRAM DMA Pipieline
 
  $80/A018 9D 8A 11    STA $118A,x  ; Store it in Animation VRAM DMA Pipieline
  $80/A01B AD C9 11    LDA $11C9    ; Load Number of Animation VRAM DMAs
+
  $80/A01B AD C9 11    LDA $11C9    ; Load Number of the next free Animation VRAM DMA slot
 
  $80/A01E 1A          INC A        ; Increment it
 
  $80/A01E 1A          INC A        ; Increment it
 
  $80/A01F 29 1F      AND #$1F      ; #$1F = Limit of Animation VRAM DMAs in Pipeline
 
  $80/A01F 29 1F      AND #$1F      ; #$1F = Limit of Animation VRAM DMAs in Pipeline
  $80/A021 8D C9 11    STA $11C9    ; Store back Number of Animation VRAM DMAs
+
  $80/A021 8D C9 11    STA $11C9    ; Store back Number of the next free Animation VRAM DMA slot
 
  $80/A024 18          CLC
 
  $80/A024 18          CLC
 
  $80/A025 AB          PLB          ; Pull Original Data Bank Register
 
  $80/A025 AB          PLB          ; Pull Original Data Bank Register
Line 2,453: Line 2,482:
 
== $80/A492 ? ==
 
== $80/A492 ? ==
  
  $80/A492 8B          PHB                     A:0080 X:3919 Y:0004 P:envMxdizc
+
'''"This line could be removed?"''': I'm not sure if it is necessary to change the Data Bank here.
  $80/A493 4B          PHK                     A:0080 X:3919 Y:0004 P:envMxdizc
+
 
  $80/A494 AB          PLB                     A:0080 X:3919 Y:0004 P:envMxdizc
+
  $80/A492 8B          PHB           ; This line could be removed?
  $80/A495 A9 71      LDA #$71               A:0080 X:3919 Y:0004 P:eNvMxdizc
+
  $80/A493 4B          PHK           ; This line could be removed?
  $80/A497 8D 8B 05    STA $058B [$80:058B]  A:0071 X:3919 Y:0004 P:envMxdizc
+
  $80/A494 AB          PLB           ; This line could be removed?
 +
  $80/A495 A9 71      LDA #$71     ; BG1 Tilemap at $7000 in VRAM, V-Mirror
 +
  $80/A497 8D 8B 05    STA $058B
 
  $80/A49A AE FE 16    LDX $16FE  [$80:16FE]  A:0071 X:3919 Y:0004 P:envMxdizc
 
  $80/A49A AE FE 16    LDX $16FE  [$80:16FE]  A:0071 X:3919 Y:0004 P:envMxdizc
 
  $80/A49D 8E 00 17    STX $1700  [$80:1700]  A:0071 X:B020 Y:0004 P:eNvMxdizc
 
  $80/A49D 8E 00 17    STX $1700  [$80:1700]  A:0071 X:B020 Y:0004 P:eNvMxdizc
 
  $80/A4A0 A9 08      LDA #$08                A:0071 X:B020 Y:0004 P:eNvMxdizc
 
  $80/A4A0 A9 08      LDA #$08                A:0071 X:B020 Y:0004 P:eNvMxdizc
 
  $80/A4A2 14 A2      TRB $A2    [$00:00A2]  A:0008 X:B020 Y:0004 P:envMxdizc
 
  $80/A4A2 14 A2      TRB $A2    [$00:00A2]  A:0008 X:B020 Y:0004 P:envMxdizc
  $80/A4A4 AE 95 05    LDX $0595 [$80:0595]  A:0008 X:B020 Y:0004 P:envMxdizc
+
  $80/A4A4 AE 95 05    LDX $0595     ; Set BG2 X Scroll to BG1 X Scroll
  $80/A4A7 8E 91 05    STX $0591 [$80:0591]  A:0008 X:00F0 Y:0004 P:envMxdizc
+
  $80/A4A7 8E 91 05    STX $0591
  $80/A4AA AE 97 05    LDX $0597 [$80:0597]  A:0008 X:00F0 Y:0004 P:envMxdizc
+
  $80/A4AA AE 97 05    LDX $0597     ; Set BG2 Y Scroll to BG1 Y Scroll
  $80/A4AD 8E 93 05    STX $0593 [$80:0593]  A:0008 X:0060 Y:0004 P:envMxdizc
+
  $80/A4AD 8E 93 05    STX $0593
  $80/A4B0 AB          PLB                     A:0008 X:0060 Y:0004 P:envMxdizc
+
  $80/A4B0 AB          PLB           ; This line could be removed?
  $80/A4B1 6B          RTL                     A:0008 X:0060 Y:0004 P:envMxdizc
+
  $80/A4B1 6B          RTL
  
 
== $80/A50F Divide X by A ==
 
== $80/A50F Divide X by A ==
Line 2,633: 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,651: 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,660: 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,671: 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,697: 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,711: 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,726: 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,741: 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,829: 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,836: 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,864: 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,905: 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,914: 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,025: 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,184: Line 3,234:
 
  $80/B00E AD BA 05    LDA $05BA
 
  $80/B00E AD BA 05    LDA $05BA
 
  $80/B011 F0 04      BEQ $04      ; [$B017]
 
  $80/B011 F0 04      BEQ $04      ; [$B017]
Missing Code
+
;code is missing here
 
  $80/B017 AE BB 05    LDX $05BB
 
  $80/B017 AE BB 05    LDX $05BB
 
  $80/B01A F0 04      BEQ $04      ; [$B020]
 
  $80/B01A F0 04      BEQ $04      ; [$B020]
Missing Code
+
;code is missing here
 
  $80/B020 20 40 B2    JSR $B240    ; ???
 
  $80/B020 20 40 B2    JSR $B240    ; ???
 
  $80/B023 22 73 81 88 JSL $888173  ; ???
 
  $80/B023 22 73 81 88 JSL $888173  ; ???
Line 3,203: Line 3,253:
 
  $80/B044 AD 38 00    LDA $0038    ; ???
 
  $80/B044 AD 38 00    LDA $0038    ; ???
 
  $80/B047 F0 17      BEQ $17      ; [$B060]
 
  $80/B047 F0 17      BEQ $17      ; [$B060]
 
+
;code is missing here
Missing Code
 
 
 
 
  $80/B060 A5 37      LDA $37    [$00:0037]  A:0000 X:00DB Y:0000 P:envMxdIZc
 
  $80/B060 A5 37      LDA $37    [$00:0037]  A:0000 X:00DB Y:0000 P:envMxdIZc
 
  $80/B062 F0 62      BEQ $62    [$B0C6]      A:0003 X:00DB Y:0000 P:envMxdIzc
 
  $80/B062 F0 62      BEQ $62    [$B0C6]      A:0003 X:00DB Y:0000 P:envMxdIzc
Line 3,225: Line 3,273:
 
  $80/B083 D4 28      PEI ($28)
 
  $80/B083 D4 28      PEI ($28)
 
  $80/B085 D4 2A      PEI ($2A)
 
  $80/B085 D4 2A      PEI ($2A)
  $80/B087 58          CLI                     A:0000 X:00DB Y:0000 P:envMxdIZc
+
  $80/B087 58          CLI           ; Activate Interrupts
 
  $80/B088 A5 37      LDA $37    [$00:0037]  A:0000 X:00DB Y:0000 P:envMxdiZc
 
  $80/B088 A5 37      LDA $37    [$00:0037]  A:0000 X:00DB Y:0000 P:envMxdiZc
  $80/B08A 89 01      BIT #$01               A:0003 X:00DB Y:0000 P:envMxdizc
+
  $80/B08A 89 01      BIT #$01
  $80/B08C F0 04      BEQ $04   [$B092]     A:0003 X:00DB Y:0000 P:envMxdizc
+
  $80/B08C F0 04      BEQ $04       ; [$B092] Don't do Figure Animation if Bit 0 is clear
 
  $80/B08E 22 5F 80 84 JSL $84805F  ; Do the Tile/Figure Animation
 
  $80/B08E 22 5F 80 84 JSL $84805F  ; Do the Tile/Figure Animation
 
  $80/B092 A5 37      LDA $37    [$00:0037]  A:0007 X:0004 Y:001C P:eNvMxdizc
 
  $80/B092 A5 37      LDA $37    [$00:0037]  A:0007 X:0004 Y:001C P:eNvMxdizc
Line 3,262: Line 3,310:
 
  $80/B0C3 FA          PLX
 
  $80/B0C3 FA          PLX
 
  $80/B0C4 86 00      STX $00
 
  $80/B0C4 86 00      STX $00
  $80/B0C6 22 0C 80 8F JSL $8F800C  ; ??? Sound related?
+
  $80/B0C6 22 0C 80 8F JSL $8F800C  ; ??? Sound related
 
  $80/B0CA C2 30      REP #$30      ; Restore everything from Stack
 
  $80/B0CA C2 30      REP #$30      ; Restore everything from Stack
 
  $80/B0CC 7A          PLY
 
  $80/B0CC 7A          PLY
Line 3,290: 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 ==
 +
 
 +
This only updates the first ten sprites!
  
  $80/B101 A5 37      LDA $37   [$00:0037]  A:00F2 X:26C0 Y:002E P:eNvMxdIzC
+
  $80/B101 A5 37      LDA $37       ; Load OAM Update Flag register
  $80/B103 89 02      BIT #$02               A:0003 X:26C0 Y:002E P:envMxdIzC
+
  $80/B103 89 02      BIT #$02     ; Check Flag for regular OAM Updates
  $80/B105 F0 2D      BEQ $2D   [$B134]     A:0003 X:26C0 Y:002E P:envMxdIzC
+
  $80/B105 F0 2D      BEQ $2D       ; [$B134] Exit if not
  $80/B107 A2 00 00    LDX #$0000             A:0003 X:26C0 Y:002E P:envMxdIzC
+
  $80/B107 A2 00 00    LDX #$0000   ; Set OAM Address to #$0000
  $80/B10A 8E 02 21    STX $2102 [$80:2102]  A:0003 X:0000 Y:002E P:envMxdIZC
+
  $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               A:0052 X:0320 Y:002E P:envMxdIzC
+
  $80/B11F A9 04      LDA #$04     ; DMA Destination: OAM --- $(21)04
  $80/B121 8D 01 43    STA $4301 [$80:4301]  A:0004 X:0320 Y:002E P:envMxdIzC
+
  $80/B121 8D 01 43    STA $4301
  $80/B124 A2 40 00    LDX #$0040             A:0004 X:0320 Y:002E P:envMxdIzC
+
  $80/B124 A2 40 00    LDX #$0040   ; Transfer #$40 Byte
  $80/B127 8E 05 43    STX $4305 [$80:4305]  A:0004 X:0040 Y:002E P:envMxdIzC
+
  $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               A:0000 X:0040 Y:002E P:envMxdIZC
+
  $80/B12F A9 01      LDA #$01     ; ACTIVATE DMA
  $80/B131 8D 0B 42    STA $420B [$80:420B]  A:0001 X:0040 Y:002E P:envMxdIzC
+
  $80/B131 8D 0B 42    STA $420B
  $80/B134 60          RTS                     A:0001 X:0040 Y:002E P:envMxdIzC
+
  $80/B134 60          RTS
  
 
== $80/B135 Update Graphics Settings Buffer Registers ==
 
== $80/B135 Update Graphics Settings Buffer Registers ==
Line 3,471: Line 3,521:
 
$11CA seems to be a counter and is an index for $0F49,y, $11C9 is a limit
 
$11CA seems to be a counter and is an index for $0F49,y, $11C9 is a limit
  
  $80/B2C2 AD CA 11    LDA $11CA [$80:11CA]  A:0080 X:0000 Y:0006 P:eNvMxdIzC
+
  $80/B2C2 AD CA 11    LDA $11CA     ; Load Number of the first Animation VRAM DMA
  $80/B2C5 CD C9 11    CMP $11C9 [$80:11C9]  A:0002 X:0000 Y:0006 P:envMxdIzC
+
  $80/B2C5 CD C9 11    CMP $11C9     ; Compare with Number of the last Animation VRAM DMA
  $80/B2C8 F0 60      BEQ $60      ; [$B32A] Exit
+
  $80/B2C8 F0 60      BEQ $60      ; [$B32A] Exit if equal
 
  $80/B2CA AD BD 05    LDA $05BD  [$80:05BD]  A:0002 X:0000 Y:0006 P:eNvMxdIzc
 
  $80/B2CA AD BD 05    LDA $05BD  [$80:05BD]  A:0002 X:0000 Y:0006 P:eNvMxdIzc
 
  $80/B2CD 30 14      BMI $14    [$B2E3]      A:0080 X:0000 Y:0006 P:eNvMxdIzc
 
  $80/B2CD 30 14      BMI $14    [$B2E3]      A:0080 X:0000 Y:0006 P:eNvMxdIzc
Line 3,486: Line 3,536:
 
  $80/B2DE E2 20      SEP #$20      ; 8-bit A
 
  $80/B2DE E2 20      SEP #$20      ; 8-bit A
 
  $80/B2E0 7B          TDC          ; Clear 16-bit A
 
  $80/B2E0 7B          TDC          ; Clear 16-bit A
  $80/B2E1 B0 47      BCS $47      ; [$B32A] Branch if A was higher or same as #$500
+
  $80/B2E1 B0 47      BCS $47      ; [$B32A] Exit if A was higher or same as #$500
 
  $80/B2E3 A9 01      LDA #$01      ; DMA Transfer Settings
 
  $80/B2E3 A9 01      LDA #$01      ; DMA Transfer Settings
 
  $80/B2E5 8D 00 43    STA $4300
 
  $80/B2E5 8D 00 43    STA $4300
Line 3,494: Line 3,544:
 
  $80/B2EF 8D 15 21    STA $2115
 
  $80/B2EF 8D 15 21    STA $2115
 
  $80/B2F2 7B          TDC          ; Clear 16-bit A
 
  $80/B2F2 7B          TDC          ; Clear 16-bit A
  $80/B2F3 AD CA 11    LDA $11CA [$80:11CA]  A:0000 X:0000 Y:0006 P:envMxdIZc
+
  $80/B2F3 AD CA 11    LDA $11CA     ; Load Number of the first Animation VRAM DMA
  $80/B2F6 0A          ASL A                   A:0002 X:0000 Y:0006 P:envMxdIzc
+
  $80/B2F6 0A          ASL A         ; Multiply by 2 and use it as Load Index in Y
  $80/B2F7 A8          TAY                     A:0004 X:0000 Y:0006 P:envMxdIzc
+
  $80/B2F7 A8          TAY
 
  $80/B2F8 BE 49 0F    LDX $0F49,y  ; Load Animation VRAM DMA Size
 
  $80/B2F8 BE 49 0F    LDX $0F49,y  ; Load Animation VRAM DMA Size
 
  $80/B2FB E0 81 00    CPX #$0081
 
  $80/B2FB E0 81 00    CPX #$0081
Line 3,510: Line 3,560:
 
  $80/B317 A9 01      LDA #$01      ; Activate DMA
 
  $80/B317 A9 01      LDA #$01      ; Activate DMA
 
  $80/B319 8D 0B 42    STA $420B
 
  $80/B319 8D 0B 42    STA $420B
  $80/B31C AD CA 11    LDA $11CA [$80:11CA]  A:0001 X:07C0 Y:0004 P:envMxdIzc
+
  $80/B31C AD CA 11    LDA $11CA     ; Increment Number of the first Animation VRAM DMA
  $80/B31F 1A          INC A         ; Increment Index
+
  $80/B31F 1A          INC A
  $80/B320 29 1F      AND #$1F      ; Reset it to zero if it surpassed #1F (maximum)
+
  $80/B320 29 1F      AND #$1F      ; Reset to zero if it surpassed #1F (this is a circular buffer)
  $80/B322 8D CA 11    STA $11CA     ; Store back
+
  $80/B322 8D CA 11    STA $11CA
  $80/B325 CD C9 11    CMP $11C9 [$80:11C9]  A:0003 X:07C0 Y:0004 P:envMxdIzc
+
  $80/B325 CD C9 11    CMP $11C9     ; Check if the Number of the last Animation VRAM DMA is reached
  $80/B328 D0 CC      BNE $CC      ; [$B2F6] Do next Animation VRAM DMA if unequal
+
  $80/B328 D0 CC      BNE $CC      ; [$B2F6] Do next Animation VRAM DMA if not
 
  $80/B32A 60          RTS
 
  $80/B32A 60          RTS
  
Line 3,847: Line 3,897:
 
  $80/B628 8D 5D 05    STA $055D  [$80:055D]  A:0200 X:0001 Y:00FF P:envmxdizc
 
  $80/B628 8D 5D 05    STA $055D  [$80:055D]  A:0200 X:0001 Y:00FF P:envmxdizc
 
  $80/B62B 9C C7 0E    STZ $0EC7    ; Clear VRAM DMA Pipeline Entries
 
  $80/B62B 9C C7 0E    STZ $0EC7    ; Clear VRAM DMA Pipeline Entries
  $80/B62E 9C C9 11    STZ $11C9 [$80:11C9]  A:0200 X:0001 Y:00FF P:envmxdizc
+
  $80/B62E 9C C9 11    STZ $11C9     ; Clear Number of the next free Animation VRAM DMA slot
 
  $80/B631 9C C5 0E    STZ $0EC5  [$80:0EC5]  A:0200 X:0001 Y:00FF P:envmxdizc
 
  $80/B631 9C C5 0E    STZ $0EC5  [$80:0EC5]  A:0200 X:0001 Y:00FF P:envmxdizc
 
  $80/B634 9C BB 05    STZ $05BB  [$80:05BB]  A:0200 X:0001 Y:00FF P:envmxdizc
 
  $80/B634 9C BB 05    STZ $05BB  [$80:05BB]  A:0200 X:0001 Y:00FF P:envmxdizc
Line 4,015: 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,055: 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[$88:A3DF]   A:003B X:0006 Y:0006 P:envMxdizc
+
  $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,109: Line 4,159:
 
  $80/B8B2 08          PHP                    A:0003 X:00EB Y:0002 P:envMxdizc
 
  $80/B8B2 08          PHP                    A:0003 X:00EB Y:0002 P:envMxdizc
 
  $80/B8B3 B9 AE 17    LDA $17AE,y[$80:17B0]  A:0003 X:00EB Y:0002 P:envMxdizc
 
  $80/B8B3 B9 AE 17    LDA $17AE,y[$80:17B0]  A:0003 X:00EB Y:0002 P:envMxdizc
  $80/B8B6 22 DF A3 88 JSL $88A3DF[$88:A3DF]   A:0035 X:00EB Y:0002 P:envMxdizc
+
  $80/B8B6 22 DF A3 88 JSL $88A3DF  ; Load Big Sprite Flag for this Character
 
  $80/B8BA B0 15      BCS $15    [$B8D1]      A:0035 X:00EB Y:0002 P:envMxdizc
 
  $80/B8BA B0 15      BCS $15    [$B8D1]      A:0035 X:00EB Y:0002 P:envMxdizc
 
  $80/B8BC B9 DE 19    LDA $19DE,y[$80:19E0]  A:0035 X:00EB Y:0002 P:envMxdizc
 
  $80/B8BC B9 DE 19    LDA $19DE,y[$80:19E0]  A:0035 X:00EB Y:0002 P:envMxdizc
Line 4,166: 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,179: 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[$88:A3DF]   A:0001 X:0000 Y:0000 P:envMxdizc
+
  $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
 
  $80/B96B A8          TAY                    A:0006 X:3913 Y:0040 P:envMxdizC
 
  $80/B96B A8          TAY                    A:0006 X:3913 Y:0040 P:envMxdizC
 
  $80/B96C B9 AF 17    LDA $17AF,y[$7E:17B5]  A:0006 X:3913 Y:0006 P:envMxdizC
 
  $80/B96C B9 AF 17    LDA $17AF,y[$7E:17B5]  A:0006 X:3913 Y:0006 P:envMxdizC
  $80/B96F 22 DF A3 88 JSL $88A3DF[$88:A3DF]   A:003B X:3913 Y:0006 P:envMxdizC
+
  $80/B96F 22 DF A3 88 JSL $88A3DF  ; Load Big Sprite Flag for this Character
 
  $80/B973 B0 10      BCS $10    [$B985]      A:003B X:3913 Y:0006 P:envMxdizc
 
  $80/B973 B0 10      BCS $10    [$B985]      A:003B X:3913 Y:0006 P:envMxdizc
 
  $80/B975 A6 5C      LDX $5C    [$00:005C]  A:003B X:3913 Y:0006 P:envMxdizc
 
  $80/B975 A6 5C      LDX $5C    [$00:005C]  A:003B X:3913 Y:0006 P:envMxdizc
Line 4,255: Line 4,305:
 
  $80/B9E0 6C 00 00    JMP ($0000)[$80:BC4F]  A:0006 X:000C Y:0006 P:envMxdizc
 
  $80/B9E0 6C 00 00    JMP ($0000)[$80:BC4F]  A:0006 X:000C Y:0006 P:envMxdizc
  
== $80/B9E3 Jump Table to $80/B9D1 ==
+
$80/B9E3 75 BA --- Entry #$00 - $BA75
 
+
  $80/B9E5 B2 BA --- Entry #$01 - $BAB2
75 BA
+
  $80/B9E7 DB BA --- Entry #$02 - $BADB
  B2 BA
+
  $80/B9E9 4F BC --- Entry #$03 - $BC4F
  DB BA
+
  $80/B9EB 81 BA --- Entry #$04 - $BA81
  4F BC
+
  $80/B9ED 51 BD --- Entry #$05 - $BD51
  81 BA
+
  $80/B9EF 5C BD --- Entry #$06 - $BD5C
  51 BD
+
  $80/B9F1 63 BD --- Entry #$07 - $BD63
  5C BD
+
  $80/B9F3 67 BD --- Entry #$08 - $BD67
  63 BD
+
  $80/B9F5 6E BD --- Entry #$09 - $BD6E
  67 BD
+
  $80/B9F7 78 BD --- Entry #$0A - $BD78
  6E BD
+
  $80/B9F9 87 BD --- Entry #$0B - $BD87
  78 BD
+
  $80/B9FB E0 BC --- Entry #$0C - $BCE0
  87 BD
+
  $80/B9FD 21 BD --- Entry #$0D - $BD21
  E0 BC
+
  $80/B9FF 94 BD --- Entry #$0E - $BD94
  21 BD
+
  $80/BA01 89 BA --- Entry #$0F - $BA89
  94 BD
+
  $80/BA03 BE BD --- Entry #$10 - $BDBE
  89 BA
+
  $80/BA05 FF BD --- Entry #$11 - $BDFF
  BE BD
+
  $80/BA07 1D BE --- Entry #$12 - $BE1D
  FF BD
+
  $80/BA09 89 BA --- Entry #$13 - $BA89
  1D BE
+
  $80/BA0B 89 BA --- Entry #$14 - $BA89
  89 BA
+
  $80/BA0D 50 BE --- Entry #$15 - $BE50
  89 BA
+
  $80/BA0F 63 BE --- Entry #$16 - $BE63
  50 BE
+
  $80/BA11 6D BE --- Entry #$17 - $BE6D
  63 BE
+
  $80/BA13 76 BE --- Entry #$18 - $BE76
  6D BE
+
  $80/BA15 8E BA --- Entry #$19 - $BA8E
  76 BE
+
  $80/BA17 A3 BE --- Entry #$1A - $BEA3
  8E BA
+
  $80/BA19 AB BE --- Entry #$1B - $BEAB
  A3 BE
+
  $80/BA1B 8E BE --- Entry #$1C - $BE8E
  AB BE
+
  $80/BA1D 95 BE --- Entry #$1D - $BE95
  8E BE
+
  $80/BA1F B9 BE --- Entry #$1E - $BEB9
  95 BE
+
  $80/BA21 D5 BE --- Entry #$1F - $BED5
  B9 BE
+
  $80/BA23 08 BF --- Entry #$20 - $BF08
  D5 BE
+
  $80/BA25 1C BF --- Entry #$21 - $BF1C
  08 BF
+
  $80/BA27 B9 BE --- Entry #$22 - $BEB9
  1C BF
+
  $80/BA29 D5 BE --- Entry #$23 - $BED5
  B9 BE
+
  $80/BA2B 25 BF --- Entry #$24 - $BF25
  D5 BE
+
  $80/BA2D B9 BE --- Entry #$25 - $BEB9
  25 BF
+
  $80/BA2F 39 BF --- Entry #$26 - $BF39
  B9 BE
+
  $80/BA31 71 BF --- Entry #$27 - $BF71
  39 BF
+
  $80/BA33 B9 BE --- Entry #$28 - $BEB9
  71 BF
+
  $80/BA35 D5 BE --- Entry #$29 - $BED5
  B9 BE
+
  $80/BA37 82 BF --- Entry #$2A - $BF82
  D5 BE
+
  $80/BA39 13 C0 --- Entry #$2B - $C013
  82 BF
+
  $80/BA3B DD C0 --- Entry #$2C - $C0DD
  13 C0
+
  $80/BA3D 0B C1 --- Entry #$2D - $C10B
  DD C0
+
  $80/BA3F 89 BA --- Entry #$2E - $BA89
  0B C1
+
  $80/BA41 97 BA --- Entry #$2F - $BA97
  89 BA
+
  $80/BA43 9F BB --- Entry #$30 - $BB9F
  97 BA
+
  $80/BA45 44 BB --- Entry #$31 - $BB44
  9F BB
+
  $80/BA47 99 BB --- Entry #$32 - $BB99
  44 BB
+
  $80/BA49 78 C0 --- Entry #$33 - $C078
  99 BB
+
  $80/BA4B AC C0 --- Entry #$34 - $C0AC
  78 C0
+
  $80/BA4D D4 C0 --- Entry #$35 - $C0D4
  AC C0
+
  $80/BA4F 89 BA --- Entry #$36 - $BA89
  D4 C0
+
  $80/BA51 89 BA --- Entry #$37 - $BA89
  89 BA
+
  $80/BA53 4B C1 --- Entry #$38 - $C14B
  89 BA
+
  $80/BA55 51 C1 --- Entry #$39 - $C151
  4B C1
+
  $80/BA57 57 C1 --- Entry #$3A - $C157
  51 C1
+
  $80/BA59 5E C1 --- Entry #$3B - $C15E
  57 C1
+
  $80/BA5B 64 C1 --- Entry #$3C - $C164
  5E C1
+
  $80/BA5D 44 BD --- Entry #$3D - $BD44
  64 C1
+
  $80/BA5F 22 C0 --- Entry #$3E - $C022
  44 BD
+
  $80/BA61 39 C0 --- Entry #$3F - $C039
  22 C0
+
  $80/BA63 6B C0 --- Entry #$40 - $C06B
  39 C0
+
  $80/BA65 6F C0 --- Entry #$41 - $C06F
  6B C0
+
  $80/BA67 89 BA --- Entry #$42 - $BA89
  6F C0
+
  $80/BA69 89 BA --- Entry #$43 - $BA89
  89 BA
+
  $80/BA6B 89 BA --- Entry #$44 - $BA89
  89 BA
+
  $80/BA6D 89 BA --- Entry #$45 - $BA89
  89 BA
+
  $80/BA6F EF BF --- Entry #$46 - $BFEF
  89 BA
+
  $80/BA71 0A C0 --- Entry #$47 - $C00A
  EF BF
+
  $80/BA73 B5 BE --- Entry #$48 - $BEB5
  0A C0
 
  B5 BE
 
  
 
== $80/BA75 ? ==
 
== $80/BA75 ? ==
Line 4,346: Line 4,394:
 
  $80/BC54 B9 03 06    LDA $0603,y[$80:0609]  A:0006 X:0008 Y:0006 P:envMxdizc
 
  $80/BC54 B9 03 06    LDA $0603,y[$80:0609]  A:0006 X:0008 Y:0006 P:envMxdizc
 
  $80/BC57 D0 03      BNE $03    [$BC5C]      A:0001 X:0008 Y:0006 P:envMxdizc
 
  $80/BC57 D0 03      BNE $03    [$BC5C]      A:0001 X:0008 Y:0006 P:envMxdizc
;code is missing here
+
$80/BC59 4C DC BC    JMP $BCDC  [$80:BCDC]  A:0000 X:0008 Y:0006 P:envMxdiZc
 
  $80/BC5C 20 29 D9    JSR $D929  [$80:D929]  A:0001 X:0008 Y:0006 P:envMxdizc
 
  $80/BC5C 20 29 D9    JSR $D929  [$80:D929]  A:0001 X:0008 Y:0006 P:envMxdizc
 
  $80/BC5F C2 20      REP #$20                A:0001 X:0008 Y:0006 P:envMxdizc
 
  $80/BC5F C2 20      REP #$20                A:0001 X:0008 Y:0006 P:envMxdizc
Line 4,380: Line 4,428:
 
  $80/BCD8 9D 83 0C    STA $0C83,x[$80:0C8B]  A:8101 X:0008 Y:000A P:envMxdizc
 
  $80/BCD8 9D 83 0C    STA $0C83,x[$80:0C8B]  A:8101 X:0008 Y:000A P:envMxdizc
 
  $80/BCDB 60          RTS                    A:8101 X:0008 Y:000A P:envMxdizc
 
  $80/BCDB 60          RTS                    A:8101 X:0008 Y:000A P:envMxdizc
 +
 +
== $80/BCDC ? ==
 +
 +
$80/BCDC 9E 03 06    STZ $0603,x[$80:060B]  A:0000 X:0008 Y:0006 P:envMxdiZc
 +
$80/BCDF 60          RTS                    A:0000 X:0008 Y:0006 P:envMxdiZc
 +
 +
== $80/BD51 ? ==
 +
 +
$80/BD51 86 3D      STX $3D    [$00:003D]  A:000A X:0006 Y:000A P:envMxdizc
 +
$80/BD53 FE C3 08    INC $08C3,x[$80:08C9]  A:000A X:0006 Y:000A P:envMxdizc
 +
$80/BD56 20 A7 D1    JSR $D1A7  [$80:D1A7]  A:000A X:0006 Y:000A P:envMxdizc
 +
$80/BD59 20 24 D1    JSR $D124  [$80:D124]  A:00FF X:0006 Y:0002 P:envMxdizc
 +
$80/BD5C 20 9E D0    JSR $D09E  [$80:D09E]  A:0010 X:0006 Y:001A P:envMxdizc
 +
$80/BD5F 20 A4 99    JSR $99A4  [$80:99A4]  A:6201 X:0006 Y:0004 P:envMxdizc
 +
$80/BD62 60          RTS                    A:8107 X:0006 Y:0004 P:envMxdizc
 +
 +
== $80/BD63 ? ==
 +
 +
$80/BD63 20 58 D3    JSR $D358  [$80:D358]  A:000E X:0006 Y:000E P:envMxdizc
 +
$80/BD66 60          RTS                    A:0000 X:0006 Y:0004 P:envMxdiZc
  
 
== $80/C23F ? ==
 
== $80/C23F ? ==
  
  $80/C23F DA          PHX                     A:0034 X:0006 Y:0004 P:envMxdizc
+
  $80/C23F DA          PHX           ; Buffer X and Y on stack
  $80/C240 5A          PHY                     A:0034 X:0006 Y:0004 P:envMxdizc
+
  $80/C240 5A          PHY
  $80/C241 7B          TDC                     A:0034 X:0006 Y:0004 P:envMxdizc
+
  $80/C241 7B          TDC           ; Clear 16-bit A
 
  $80/C242 BD C4 0B    LDA $0BC4,x[$80:0BCA]  A:0000 X:0006 Y:0004 P:envMxdiZc
 
  $80/C242 BD C4 0B    LDA $0BC4,x[$80:0BCA]  A:0000 X:0006 Y:0004 P:envMxdiZc
 
  $80/C245 A8          TAY                    A:0004 X:0006 Y:0004 P:envMxdizc
 
  $80/C245 A8          TAY                    A:0004 X:0006 Y:0004 P:envMxdizc
 
  $80/C246 BD 44 0A    LDA $0A44,x[$80:0A4A]  A:0004 X:0006 Y:0004 P:envMxdizc
 
  $80/C246 BD 44 0A    LDA $0A44,x[$80:0A4A]  A:0004 X:0006 Y:0004 P:envMxdizc
  $80/C249 EB          XBA                     A:0007 X:0006 Y:0004 P:envMxdizc
+
  $80/C249 EB          XBA           ; Multiply by #$20
  $80/C24A C2 20      REP #$20               A:0700 X:0006 Y:0004 P:envMxdiZc
+
  $80/C24A C2 20      REP #$20
  $80/C24C 4A          LSR A                   A:0700 X:0006 Y:0004 P:envmxdiZc
+
  $80/C24C 4A          LSR A
  $80/C24D 4A          LSR A                   A:0380 X:0006 Y:0004 P:envmxdizc
+
  $80/C24D 4A          LSR A
  $80/C24E 4A          LSR A                   A:01C0 X:0006 Y:0004 P:envmxdizc
+
  $80/C24E 4A          LSR A
  $80/C24F E2 20      SEP #$20               A:00E0 X:0006 Y:0004 P:envmxdizc
+
  $80/C24F E2 20      SEP #$20
 
  $80/C251 1D 04 0A    ORA $0A04,x[$80:0A0A]  A:00E0 X:0006 Y:0004 P:envMxdizc
 
  $80/C251 1D 04 0A    ORA $0A04,x[$80:0A0A]  A:00E0 X:0006 Y:0004 P:envMxdizc
 
  $80/C254 AA          TAX                    A:00E9 X:0006 Y:0004 P:eNvMxdizc
 
  $80/C254 AA          TAX                    A:00E9 X:0006 Y:0004 P:eNvMxdizc
 
  $80/C255 B9 C7 1D    LDA $1DC7,y[$80:1DCB]  A:00E9 X:00E9 Y:0004 P:envMxdizc
 
  $80/C255 B9 C7 1D    LDA $1DC7,y[$80:1DCB]  A:00E9 X:00E9 Y:0004 P:envMxdizc
 
  $80/C258 20 7E C2    JSR $C27E  [$80:C27E]  A:0001 X:00E9 Y:0004 P:envMxdizc
 
  $80/C258 20 7E C2    JSR $C27E  [$80:C27E]  A:0001 X:00E9 Y:0004 P:envMxdizc
  $80/C25B 7A          PLY                     A:0004 X:00E9 Y:0004 P:envMxdizc
+
  $80/C25B 7A          PLY           ; Restore Y and X from stack
  $80/C25C FA          PLX                     A:0004 X:00E9 Y:0004 P:envMxdizc
+
  $80/C25C FA          PLX
  $80/C25D 60          RTS                     A:0004 X:0006 Y:0004 P:envMxdizc
+
  $80/C25D 60          RTS
  
 
== $80/C276 ? ==
 
== $80/C276 ? ==
Line 4,418: Line 4,486:
 
  $80/C280 C9 02      CMP #$02                A:0000 X:00EB Y:070B P:envMxdiZc
 
  $80/C280 C9 02      CMP #$02                A:0000 X:00EB Y:070B P:envMxdiZc
 
  $80/C282 D0 0E      BNE $0E    [$C292]      A:0000 X:00EB Y:070B P:eNvMxdizc
 
  $80/C282 D0 0E      BNE $0E    [$C292]      A:0000 X:00EB Y:070B P:eNvMxdizc
;code is missing here
+
$80/C284 22 E1 AD 86 JSL $86ADE1[$86:ADE1]  A:0202 X:0210 Y:0002 P:envMxdiZC
  $80/C292 7B          TDC                    A:0000 X:00EB Y:070B P:eNvMxdizc
+
  $80/C288 90 08      BCC $08    [$C292]      A:0201 X:0210 Y:0002 P:eNvMxdizc
  $80/C293 BF 00 C8 7F LDA $7FC800,x[$7F:C8EB] A:0000 X:00EB Y:070B P:envMxdiZc
+
  $80/C28A 7B          TDC          ; Clear 16-bit A
 +
$80/C28B BF 00 C8 7F LDA $7FC800,x ; Load value from the Step Map
 +
$80/C28F 3A          DEC A                  A:000A X:018C Y:000C P:envMxdizC
 +
$80/C290 38          SEC                    A:0009 X:018C Y:000C P:envMxdizC
 +
$80/C291 60          RTS
 +
$80/C292 7B          TDC          ; Clear 16-bit A
 +
$80/C293 BF 00 C8 7F LDA $7FC800,x ; Load value from the Step Map
 
  $80/C297 18          CLC                    A:0003 X:00EB Y:070B P:envMxdizc
 
  $80/C297 18          CLC                    A:0003 X:00EB Y:070B P:envMxdizc
  $80/C298 60          RTS                     A:0003 X:00EB Y:070B P:envMxdizc
+
  $80/C298 60          RTS
  
 
== $80/C2E0 ? ==
 
== $80/C2E0 ? ==
Line 4,627: 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,710: 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,761: Line 4,836:
 
  $80/D06B BD 03 09    LDA $0903,x[$80:0919]  A:6006 X:0016 Y:0012 P:envMxdiZC
 
  $80/D06B BD 03 09    LDA $0903,x[$80:0919]  A:6006 X:0016 Y:0012 P:envMxdiZC
 
  $80/D06E F0 0B      BEQ $0B    [$D07B]      A:6000 X:0016 Y:0012 P:envMxdiZC
 
  $80/D06E F0 0B      BEQ $0B    [$D07B]      A:6000 X:0016 Y:0012 P:envMxdiZC
 +
;code is missing here
 
  $80/D07B 60          RTS                    A:6000 X:0016 Y:0012 P:envMxdiZC
 
  $80/D07B 60          RTS                    A:6000 X:0016 Y:0012 P:envMxdiZC
 +
 +
== $80/D09E ? ==
 +
 +
$80/D09E BD 03 09    LDA $0903,x[$80:0909]  A:0010 X:0006 Y:001A P:envMxdizc
 +
$80/D0A1 D0 0C      BNE $0C    [$D0AF]      A:0008 X:0006 Y:001A P:envMxdizc
 +
$80/D0A3 20 24 D1    JSR $D124  [$80:D124]  A:0000 X:0006 Y:000C P:envMxdiZc
 +
$80/D0A6 90 07      BCC $07    [$D0AF]      A:0013 X:0006 Y:0020 P:envMxdizc
 +
$80/D0A8 20 A7 D1    JSR $D1A7  [$80:D1A7]  A:00FF X:0006 Y:002C P:envMxdiZC
 +
$80/D0AB 90 F6      BCC $F6    ; [$D0A3] Branch if no Error has occured
 +
$80/D0AD 80 71      BRA $71    ; [$D120] Branch if Error has occured
 +
$80/D0AF DE 03 09    DEC $0903,x[$80:0909]  A:0008 X:0006 Y:001A P:envMxdizc
 +
$80/D0B2 BD 04 0A    LDA $0A04,x[$80:0A0A]  A:0008 X:0006 Y:001A P:envMxdizc
 +
$80/D0B5 48          PHA                    A:0009 X:0006 Y:001A P:envMxdizc
 +
$80/D0B6 BD 44 0A    LDA $0A44,x[$80:0A4A]  A:0009 X:0006 Y:001A P:envMxdizc
 +
$80/D0B9 48          PHA                    A:0007 X:0006 Y:001A P:envMxdizc
 +
$80/D0BA 20 63 C3    JSR $C363  [$80:C363]  A:0007 X:0006 Y:001A P:envMxdizc
 +
$80/D0BD 68          PLA                    A:0988 X:0006 Y:001A P:envMxdizc
 +
$80/D0BE EB          XBA                    A:0907 X:0006 Y:001A P:envMxdizc
 +
$80/D0BF 68          PLA                    A:0709 X:0006 Y:001A P:envMxdizc
 +
$80/D0C0 DD 04 0A    CMP $0A04,x[$80:0A0A]  A:0709 X:0006 Y:001A P:envMxdizc
 +
$80/D0C3 D0 06      BNE $06    [$D0CB]      A:0709 X:0006 Y:001A P:envMxdiZC
 +
$80/D0C5 EB          XBA                    A:0709 X:0006 Y:001A P:envMxdiZC
 +
$80/D0C6 DD 44 0A    CMP $0A44,x[$80:0A4A]  A:0907 X:0006 Y:001A P:envMxdizC
 +
$80/D0C9 F0 03      BEQ $03    [$D0CE]      A:0907 X:0006 Y:001A P:envMxdiZC
 +
$80/D0CB FE C3 0C    INC $0CC3,x[$80:0CC9]  A:0709 X:0006 Y:000C P:eNvMxdizc
 +
$80/D0CE BD 03 07    LDA $0703,x[$80:0709]  A:0907 X:0006 Y:001A P:envMxdiZC
 +
$80/D0D1 29 BF      AND #$BF                A:0906 X:0006 Y:001A P:envMxdizC
 +
$80/D0D3 9D 03 07    STA $0703,x[$80:0709]  A:0906 X:0006 Y:001A P:envMxdizC
 +
$80/D0D6 7B          TDC                    A:0906 X:0006 Y:001A P:envMxdizC
 +
$80/D0D7 BD 83 08    LDA $0883,x[$80:0889]  A:0000 X:0006 Y:001A P:envMxdiZC
 +
$80/D0DA A8          TAY                    A:0000 X:0006 Y:001A P:envMxdiZC
 +
$80/D0DB B9 6D B8    LDA $B86D,y[$80:B86D]  A:0000 X:0006 Y:0000 P:envMxdiZC
 +
$80/D0DE 1D 03 07    ORA $0703,x[$80:0709]  A:0000 X:0006 Y:0000 P:envMxdiZC
 +
$80/D0E1 9D 03 07    STA $0703,x[$80:0709]  A:0006 X:0006 Y:0000 P:envMxdizC
 +
$80/D0E4 20 D1 C3    JSR $C3D1  [$80:C3D1]  A:0006 X:0006 Y:0000 P:envMxdizC
 +
$80/D0E7 DA          PHX                    A:F7FF X:0006 Y:0000 P:eNvMxdizC
 +
$80/D0E8 7B          TDC                    A:F7FF X:0006 Y:0000 P:eNvMxdizC
 +
$80/D0E9 BD C3 0C    LDA $0CC3,x[$80:0CC9]  A:0000 X:0006 Y:0000 P:envMxdiZC
 +
$80/D0EC AA          TAX                    A:0000 X:0006 Y:0000 P:envMxdiZC
 +
$80/D0ED BF 00 F9 7F LDA $7FF900,x[$7F:F900] A:0000 X:0000 Y:0000 P:envMxdiZC
 +
$80/D0F1 FA          PLX                    A:0004 X:0000 Y:0000 P:envMxdizC
 +
$80/D0F2 0A          ASL A                  A:0004 X:0006 Y:0000 P:envMxdizC
 +
$80/D0F3 85 01      STA $01    [$00:0001]  A:0008 X:0006 Y:0000 P:envMxdizc
 +
$80/D0F5 64 00      STZ $00    [$00:0000]  A:0008 X:0006 Y:0000 P:envMxdizc
 +
$80/D0F7 C2 20      REP #$20                A:0008 X:0006 Y:0000 P:envMxdizc
 +
$80/D0F9 BD 83 0A    LDA $0A83,x[$80:0A89]  A:0008 X:0006 Y:0000 P:envmxdizc
 +
$80/D0FC 38          SEC                    A:07FC X:0006 Y:0000 P:envmxdizc
 +
$80/D0FD E5 00      SBC $00    [$00:0000]  A:07FC X:0006 Y:0000 P:envmxdizC
 +
$80/D0FF E2 20      SEP #$20                A:FFFC X:0006 Y:0000 P:eNvmxdizc
 +
$80/D101 7B          TDC                    A:FFFC X:0006 Y:0000 P:eNvMxdizc
 +
$80/D102 B0 11      BCS $11    [$D115]      A:0000 X:0006 Y:0000 P:envMxdiZc
 +
$80/D104 C2 20      REP #$20                A:0000 X:0006 Y:0000 P:envMxdiZc
 +
$80/D106 A5 00      LDA $00    [$00:0000]  A:0000 X:0006 Y:0000 P:envmxdiZc
 +
$80/D108 9D 83 0A    STA $0A83,x[$80:0A89]  A:0800 X:0006 Y:0000 P:envmxdizc
 +
$80/D10B A9 FF FF    LDA #$FFFF              A:0800 X:0006 Y:0000 P:envmxdizc
 +
$80/D10E 9D 43 0B    STA $0B43,x[$80:0B49]  A:FFFF X:0006 Y:0000 P:eNvmxdizc
 +
$80/D111 E2 20      SEP #$20                A:FFFF X:0006 Y:0000 P:eNvmxdizc
 +
$80/D113 A9 01      LDA #$01                A:FFFF X:0006 Y:0000 P:eNvMxdizc
 +
$80/D115 9D 04 09    STA $0904,x[$80:090A]  A:FF01 X:0006 Y:0000 P:envMxdizc
 +
$80/D118 20 B2 D3    JSR $D3B2  [$80:D3B2]  A:FF01 X:0006 Y:0000 P:envMxdizc
 +
$80/D11B 20 50 D4    JSR $D450  [$80:D450]  A:0001 X:0006 Y:0004 P:envMxdiZC
 +
$80/D11E 80 03      BRA $03    [$D123]      A:6201 X:0006 Y:0004 P:envMxdizc
 +
$80/D120 20 7B CF    JSR $CF7B  [$80:CF7B]  A:00FF X:0006 Y:0002 P:envMxdiZC
 +
$80/D123 60          RTS                    A:6201 X:0006 Y:0004 P:envMxdizc
  
 
== $80/D124 ? ==
 
== $80/D124 ? ==
Line 4,826: Line 4,966:
 
  $80/D1A3 18          CLC                    A:0010 X:0006 Y:001A P:envMxdizc
 
  $80/D1A3 18          CLC                    A:0010 X:0006 Y:001A P:envMxdizc
 
  $80/D1A4 60          RTS                    A:0010 X:0006 Y:001A P:envMxdizc
 
  $80/D1A4 60          RTS                    A:0010 X:0006 Y:001A P:envMxdizc
 +
$80/D1A5 38          SEC                    A:00FF X:0006 Y:002C P:envMxdiZC
 +
$80/D1A6 60          RTS                    A:00FF X:0006 Y:002C P:envMxdiZC
  
 
== $80/D1A7 ? ==
 
== $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,837: 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
;code is missing here
+
$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,849: 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
 +
$80/D20F A8          TAY          ; Transfer Figure Number in Y as Load Index
 +
$80/D210 B9 AE 17    LDA $17AE,y  ; Check Figure's Character Sprite
 +
$80/D213 F0 43      BEQ $43      ; [$D258] If empty, clear Carry (Error Flag) and Exit
 +
$80/D215 C9 F0      CMP #$F0               A:003B X:0044 Y:0006 P:envMxdizc
 +
$80/D217 B0 16      BCS $16      ; [$D22F] Branch if equal or higher
 +
$80/D219 B9 DE 19    LDA $19DE,y[$80:19E4]  A:003B X:0044 Y:0006 P:envMxdizc
 +
$80/D21C 89 01      BIT #$01                A:0000 X:0044 Y:0006 P:envMxdiZc
 +
  $80/D21E D0 0F       BNE $0F   [$D22F]      A:0000 X:0044 Y:0006 P:envMxdiZc
 +
$80/D220 B9 DF 19    LDA $19DF,y[$80:19E5]  A:0000 X:0044 Y:0006 P:envMxdiZc
 +
$80/D223 89 20      BIT #$20                A:0040 X:0044 Y:0006 P:envMxdizc
 +
  $80/D225 D0 31      BNE $31      ; [$D258] clear Carry (Error Flag) and Exit
 +
  $80/D227 B9 2E 1A    LDA $1A2E,y[$80:1A34]  A:0040 X:0044 Y:0006 P:envMxdiZc
 +
$80/D22A 4A          LSR A                  A:0000 X:0044 Y:0006 P:envMxdiZc
 +
$80/D22B C5 02      CMP $02    [$00:0002]  A:0000 X:0044 Y:0006 P:envMxdiZc
 +
$80/D22D D0 29      BNE $29      ; [$D258] clear Carry (Error Flag) and Exit
 +
$80/D22F BE 3E 1E    LDX $1E3E,y[$80:1E44]  A:0000 X:0044 Y:0006 P:envMxdiZC
 +
$80/D232 BD C4 08    LDA $08C4,x[$80:08CA]  A:0000 X:0006 Y:0006 P:envMxdizC
 +
$80/D235 C9 FF      CMP #$FF                A:000A X:0006 Y:0006 P:envMxdizC
 +
$80/D237 D0 1F      BNE $1F      ; [$D258] clear Carry (Error Flag) and Exit
 
;code is missing here
 
;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          ; Set Carry (Error Flag)
 +
$80/D25D 60          RTS
 +
 
 +
== $80/D358 ? ==
 +
 
 +
$80/D358 7B          TDC                    A:000E X:0006 Y:000E P:envMxdizc
 +
$80/D359 BD 03 0E    LDA $0E03,x[$80:0E09]  A:0000 X:0006 Y:000E P:envMxdiZc
 +
$80/D35C 1A          INC A                  A:0000 X:0006 Y:000E P:envMxdiZc
 +
$80/D35D 1A          INC A                  A:0001 X:0006 Y:000E P:envMxdizc
 +
$80/D35E 4A          LSR A                  A:0002 X:0006 Y:000E P:envMxdizc
 +
$80/D35F 22 93 CA 84 JSL $84CA93[$84:CA93]  A:0001 X:0006 Y:000E P:envMxdizc
 +
$80/D363 7B          TDC                    A:0001 X:0006 Y:000E P:eNvMxdizc
 +
$80/D364 BD C4 0B    LDA $0BC4,x[$80:0BCA]  A:0000 X:0006 Y:000E P:envMxdiZc
 +
$80/D367 A8          TAY                    A:0004 X:0006 Y:000E P:envMxdizc
 +
$80/D368 B9 DF 19    LDA $19DF,y[$80:19E3]  A:0004 X:0006 Y:0004 P:envMxdizc
 +
$80/D36B 89 40      BIT #$40                A:0040 X:0006 Y:0004 P:envMxdizc
 +
$80/D36D F0 0F      BEQ $0F    [$D37E]      A:0040 X:0006 Y:0004 P:envMxdizc
 +
$80/D36F 89 10      BIT #$10                A:0040 X:0006 Y:0004 P:envMxdizc
 +
$80/D371 F0 05      BEQ $05    [$D378]      A:0040 X:0006 Y:0004 P:envMxdiZc
 +
$80/D378 22 9F C1 84 JSL $84C19F[$84:C19F]  A:0040 X:0006 Y:0004 P:envMxdiZc
 +
$80/D37C 80 06      BRA $06    [$D384]      A:4601 X:0006 Y:0004 P:eNvMxdizc
 +
;code is missing here
 +
$80/D384 7B          TDC                    A:4601 X:0006 Y:0004 P:eNvMxdizc
 +
$80/D385 B9 3E 1E    LDA $1E3E,y[$80:1E42]  A:0000 X:0006 Y:0004 P:envMxdiZc
 +
$80/D388 A8          TAY                     A:0004 X:0006 Y:0004 P:envMxdizc
 +
$80/D389 B9 04 07    LDA $0704,y[$80:0708]  A:0004 X:0006 Y:0004 P:envMxdizc
 +
$80/D38C 29 FE      AND #$FE                A:0001 X:0006 Y:0004 P:envMxdizc
 +
$80/D38E 99 04 07    STA $0704,y[$80:0708]  A:0000 X:0006 Y:0004 P:envMxdiZc
 +
$80/D391 A9 01      LDA #$01                A:0000 X:0006 Y:0004 P:envMxdiZc
 +
$80/D393 99 43 08    STA $0843,y[$80:0847]  A:0001 X:0006 Y:0004 P:envMxdizc
 +
$80/D396 A9 FF      LDA #$FF                A:0001 X:0006 Y:0004 P:envMxdizc
 +
$80/D398 99 C4 08    STA $08C4,y[$80:08C8]  A:00FF X:0006 Y:0004 P:eNvMxdizc
 +
$80/D39B BD 03 07    LDA $0703,x[$80:0709]  A:00FF X:0006 Y:0004 P:eNvMxdizc
 +
$80/D39E 29 40      AND #$40                A:0006 X:0006 Y:0004 P:envMxdizc
 +
$80/D3A0 48          PHA                    A:0000 X:0006 Y:0004 P:envMxdiZc
 +
$80/D3A1 B9 03 07    LDA $0703,y[$80:0707]  A:0000 X:0006 Y:0004 P:envMxdiZc
 +
$80/D3A4 29 BF      AND #$BF                A:0006 X:0006 Y:0004 P:envMxdizc
 +
$80/D3A6 03 01      ORA $01,s  [$00:1FCB]  A:0006 X:0006 Y:0004 P:envMxdizc
 +
$80/D3A8 99 03 07    STA $0703,y[$80:0707]  A:0006 X:0006 Y:0004 P:envMxdizc
 +
$80/D3AB 68          PLA                    A:0006 X:0006 Y:0004 P:envMxdizc
 +
$80/D3AC 9E 03 06    STZ $0603,x[$80:0609]  A:0000 X:0006 Y:0004 P:envMxdiZc
 +
$80/D3AF 84 3D      STY $3D    [$00:003D]  A:0000 X:0006 Y:0004 P:envMxdiZc
 +
  $80/D3B1 60          RTS                    A:0000 X:0006 Y:0004 P:envMxdiZc
  
 
== $80/D3B2 ? ==
 
== $80/D3B2 ? ==
  
  $80/D3B2 7B          TDC                     A:FF01 X:0006 Y:0000 P:envMxdizc
+
  $80/D3B2 7B          TDC           ; Clear 16-bit A
 
  $80/D3B3 BD C4 0B    LDA $0BC4,x[$80:0BCA]  A:0000 X:0006 Y:0000 P:envMxdiZc
 
  $80/D3B3 BD C4 0B    LDA $0BC4,x[$80:0BCA]  A:0000 X:0006 Y:0000 P:envMxdiZc
  $80/D3B6 A8          TAY                     A:0004 X:0006 Y:0000 P:envMxdizc
+
  $80/D3B6 A8          TAY           ; Transfer value (Character Class/Sprite) in Y as Load Index
 
  $80/D3B7 B9 DE 19    LDA $19DE,y[$80:19E2]  A:0004 X:0006 Y:0004 P:envMxdizc
 
  $80/D3B7 B9 DE 19    LDA $19DE,y[$80:19E2]  A:0004 X:0006 Y:0004 P:envMxdizc
 
  $80/D3BA 89 01      BIT #$01                A:0000 X:0006 Y:0004 P:envMxdiZc
 
  $80/D3BA 89 01      BIT #$01                A:0000 X:0006 Y:0004 P:envMxdiZc
  $80/D3BC D0 73      BNE $73   [$D431]     A:0000 X:0006 Y:0004 P:envMxdiZc
+
  $80/D3BC D0 73      BNE $73       ; [$D431] Exit if flag is set
 
  $80/D3BE BD 03 06    LDA $0603,x[$80:0609]  A:0000 X:0006 Y:0004 P:envMxdiZc
 
  $80/D3BE BD 03 06    LDA $0603,x[$80:0609]  A:0000 X:0006 Y:0004 P:envMxdiZc
 
  $80/D3C1 C9 30      CMP #$30                A:0001 X:0006 Y:0004 P:envMxdizc
 
  $80/D3C1 C9 30      CMP #$30                A:0001 X:0006 Y:0004 P:envMxdizc
Line 4,870: Line 5,077:
 
;code is missing here
 
;code is missing here
 
  $80/D3C9 B9 AE 17    LDA $17AE,y[$80:17B2]  A:0001 X:0006 Y:0004 P:eNvMxdizc
 
  $80/D3C9 B9 AE 17    LDA $17AE,y[$80:17B2]  A:0001 X:0006 Y:0004 P:eNvMxdizc
  $80/D3CC 22 DF A3 88 JSL $88A3DF[$88:A3DF]   A:0034 X:0006 Y:0004 P:envMxdizc
+
  $80/D3CC 22 DF A3 88 JSL $88A3DF  ; Load Big Sprite Flag for this Character
  $80/D3D0 90 2F      BCC $2F   [$D401]     A:0034 X:0006 Y:0004 P:envMxdizc
+
  $80/D3D0 90 2F      BCC $2F       ; [$D401] Branch if Sprite isn't big
 +
;code is missing here
 
  $80/D401 20 22 D5    JSR $D522  [$80:D522]  A:0034 X:0006 Y:0004 P:envMxdizc
 
  $80/D401 20 22 D5    JSR $D522  [$80:D522]  A:0034 X:0006 Y:0004 P:envMxdizc
  $80/D404 09 00      ORA #$00               A:0000 X:0006 Y:0004 P:envMxdizc
+
  $80/D404 09 00      ORA #$00     ; Do this to set the Zero flag again
  $80/D406 F0 0B      BEQ $0B   [$D413]     A:0000 X:0006 Y:0004 P:envMxdiZc
+
  $80/D406 F0 0B      BEQ $0B       ; [$D413] Exit if A is zero
 
;code is missing here
 
;code is missing here
 
  $80/D413 7B          TDC                    A:0000 X:0006 Y:0004 P:envMxdiZc
 
  $80/D413 7B          TDC                    A:0000 X:0006 Y:0004 P:envMxdiZc
 
  $80/D414 BD C4 0B    LDA $0BC4,x[$80:0BCA]  A:0000 X:0006 Y:0004 P:envMxdiZc
 
  $80/D414 BD C4 0B    LDA $0BC4,x[$80:0BCA]  A:0000 X:0006 Y:0004 P:envMxdiZc
  $80/D417 DA          PHX                     A:0004 X:0006 Y:0004 P:envMxdizc
+
  $80/D417 DA          PHX           ; Buffer X on Stack
 
  $80/D418 AA          TAX                    A:0004 X:0006 Y:0004 P:envMxdizc
 
  $80/D418 AA          TAX                    A:0004 X:0006 Y:0004 P:envMxdizc
 
  $80/D419 22 D9 A5 88 JSL $88A5D9[$88:A5D9]  A:0004 X:0004 Y:0004 P:envMxdizc
 
  $80/D419 22 D9 A5 88 JSL $88A5D9[$88:A5D9]  A:0004 X:0004 Y:0004 P:envMxdizc
  $80/D41D FA          PLX                     A:0001 X:0004 Y:0004 P:envMxdizc
+
  $80/D41D FA          PLX           ; Restore X from Stack
 
  $80/D41E DD 03 06    CMP $0603,x[$80:0609]  A:0001 X:0006 Y:0004 P:envMxdizc
 
  $80/D41E DD 03 06    CMP $0603,x[$80:0609]  A:0001 X:0006 Y:0004 P:envMxdizc
  $80/D421 F0 0E      BEQ $0E   [$D431]     A:0001 X:0006 Y:0004 P:envMxdiZC
+
  $80/D421 F0 0E      BEQ $0E       ; [$D431] Exit if equal
 
;code is missing here
 
;code is missing here
  $80/D431 60          RTS                    A:0001 X:0006 Y:0004 P:envMxdiZC
+
  $80/D431 60          RTS
 +
 
 +
== $80/D450 ? ==
 +
 
 +
$80/D450 7B          TDC                     A:0001 X:0006 Y:0004 P:envMxdiZC
 +
$80/D451 BD C4 0B    LDA $0BC4,x[$80:0BCA]  A:0000 X:0006 Y:0004 P:envMxdiZC
 +
$80/D454 A8          TAY                    A:0004 X:0006 Y:0004 P:envMxdizC
 +
$80/D455 B9 DE 19    LDA $19DE,y[$80:19E2]  A:0004 X:0006 Y:0004 P:envMxdizC
 +
$80/D458 89 01      BIT #$01                A:0000 X:0006 Y:0004 P:envMxdiZC
 +
$80/D45A D0 5A      BNE $5A    [$D4B6]      A:0000 X:0006 Y:0004 P:envMxdiZC
 +
$80/D45C 89 02      BIT #$02                A:0000 X:0006 Y:0004 P:envMxdiZC
 +
$80/D45E F0 1E      BEQ $1E    [$D47E]      A:0000 X:0006 Y:0004 P:envMxdiZC
 +
;code is missing here
 +
$80/D47E BD 04 06    LDA $0604,x[$80:060A]  A:0000 X:0006 Y:0004 P:envMxdiZC
 +
$80/D481 C9 32      CMP #$32                A:0002 X:0006 Y:0004 P:envMxdizC
 +
$80/D483 B0 04      BCS $04    [$D489]      A:0002 X:0006 Y:0004 P:eNvMxdizc
 +
$80/D485 C9 10      CMP #$10                A:0002 X:0006 Y:0004 P:eNvMxdizc
 +
$80/D487 B0 2D      BCS $2D    [$D4B6]      A:0002 X:0006 Y:0004 P:eNvMxdizc
 +
$80/D489 C9 02      CMP #$02                A:0002 X:0006 Y:0004 P:eNvMxdizc
 +
$80/D48B 90 29      BCC $29    [$D4B6]      A:0002 X:0006 Y:0004 P:envMxdiZC
 +
$80/D48D C9 08      CMP #$08                A:0002 X:0006 Y:0004 P:envMxdiZC
 +
$80/D48F B0 0E      BCS $0E    [$D49F]      A:0002 X:0006 Y:0004 P:eNvMxdizc
 +
$80/D491 BD 83 08    LDA $0883,x[$80:0889]  A:0002 X:0006 Y:0004 P:eNvMxdizc
 +
$80/D494 C9 02      CMP #$02                A:0000 X:0006 Y:0004 P:envMxdiZc
 +
$80/D496 7B          TDC                    A:0000 X:0006 Y:0004 P:eNvMxdizc
 +
$80/D497 90 02      BCC $02    [$D49B]      A:0000 X:0006 Y:0004 P:envMxdiZc
 +
$80/D49B 18          CLC                    A:0000 X:0006 Y:0004 P:envMxdiZc
 +
$80/D49C 7D 04 06    ADC $0604,x[$80:060A]  A:0000 X:0006 Y:0004 P:envMxdiZc
 +
$80/D49F DD C4 06    CMP $06C4,x[$80:06CA]  A:0002 X:0006 Y:0004 P:envMxdizc
 +
$80/D4A2 F0 0D      BEQ $0D    [$D4B1]      A:0002 X:0006 Y:0004 P:envMxdizc
 +
$80/D4A4 9D C4 06    STA $06C4,x[$80:06CA]  A:0002 X:0006 Y:0004 P:envMxdizc
 +
$80/D4A7 EB          XBA                    A:0002 X:0006 Y:0004 P:envMxdizc
 +
$80/D4A8 BD C3 06    LDA $06C3,x[$80:06C9]  A:0200 X:0006 Y:0004 P:envMxdiZc
 +
$80/D4AB 22 15 B9 84 JSL $84B915[$84:B915]  A:0220 X:0006 Y:0004 P:envMxdizc
 +
$80/D4AF A6 3B      LDX $3B    [$00:003B]  A:6200 X:0220 Y:0004 P:eNvMxdizc
 +
$80/D4B1 A9 01      LDA #$01                A:6200 X:0006 Y:0004 P:envMxdizc
 +
$80/D4B3 9D 04 06    STA $0604,x[$80:060A]  A:6201 X:0006 Y:0004 P:envMxdizc
 +
$80/D4B6 60          RTS                    A:6201 X:0006 Y:0004 P:envMxdizc
 +
 
 +
== $80/D4B7 ? ==
 +
 
 +
$80/D4B7 7B          TDC                    A:8101 X:0006 Y:0002 P:envMxdizc
 +
$80/D4B8 BD 03 0E    LDA $0E03,x[$80:0E09]  A:0000 X:0006 Y:0002 P:envMxdiZc
 +
$80/D4BB A8          TAY                    A:0000 X:0006 Y:0002 P:envMxdiZc
 +
$80/D4BC B9 E8 1E    LDA $1EE8,y[$80:1EE8]  A:0000 X:0006 Y:0000 P:envMxdiZc
 +
$80/D4BF 9D C3 06    STA $06C3,x[$80:06C9]  A:0020 X:0006 Y:0000 P:envMxdizc
 +
$80/D4C2 5A          PHY                    A:0020 X:0006 Y:0000 P:envMxdizc
 +
$80/D4C3 BD 04 06    LDA $0604,x[$80:060A]  A:0020 X:0006 Y:0000 P:envMxdizc
 +
$80/D4C6 C9 01      CMP #$01                A:0002 X:0006 Y:0000 P:envMxdizc
 +
$80/D4C8 F0 48      BEQ $48    [$D512]      A:0002 X:0006 Y:0000 P:envMxdizC
 +
$80/D4CA C9 2D      CMP #$2D                A:0002 X:0006 Y:0000 P:envMxdizC
 +
$80/D4CC F0 44      BEQ $44    [$D512]      A:0002 X:0006 Y:0000 P:eNvMxdizc
 +
$80/D4CE C9 1F      CMP #$1F                A:0002 X:0006 Y:0000 P:eNvMxdizc
 +
$80/D4D0 F0 40      BEQ $40    [$D512]      A:0002 X:0006 Y:0000 P:eNvMxdizc
 +
$80/D4D2 C9 20      CMP #$20                A:0002 X:0006 Y:0000 P:eNvMxdizc
 +
$80/D4D4 D0 10      BNE $10    [$D4E6]      A:0002 X:0006 Y:0000 P:eNvMxdizc
 +
;code is missing here
 +
$80/D4E6 9D 44 0C    STA $0C44,x[$80:0C4A]  A:0002 X:0006 Y:0000 P:eNvMxdizc
 +
$80/D4E9 7B          TDC                    A:0002 X:0006 Y:0000 P:eNvMxdizc
 +
$80/D4EA BD 04 06    LDA $0604,x[$80:060A]  A:0000 X:0006 Y:0000 P:envMxdiZc
 +
$80/D4ED A8          TAY                    A:0002 X:0006 Y:0000 P:envMxdizc
 +
$80/D4EE DA          PHX                    A:0002 X:0006 Y:0002 P:envMxdizc
 +
$80/D4EF BB          TYX                    A:0002 X:0006 Y:0002 P:envMxdizc
 +
$80/D4F0 BF 00 80 8B LDA $8B8000,x[$8B:8002] A:0002 X:0002 Y:0002 P:envMxdizc
 +
$80/D4F4 FA          PLX                    A:0001 X:0002 Y:0002 P:envMxdizc
 +
$80/D4F5 DD 04 06    CMP $0604,x[$80:060A]  A:0001 X:0006 Y:0002 P:envMxdizc
 +
$80/D4F8 F0 18      BEQ $18    [$D512]      A:0001 X:0006 Y:0002 P:eNvMxdizc
 +
$80/D4FA 48          PHA                    A:0001 X:0006 Y:0002 P:eNvMxdizc
 +
$80/D4FB 98          TYA                    A:0001 X:0006 Y:0002 P:eNvMxdizc
 +
$80/D4FC DD C4 06    CMP $06C4,x[$80:06CA]  A:0002 X:0006 Y:0002 P:envMxdizc
 +
$80/D4FF F0 0D      BEQ $0D    [$D50E]      A:0002 X:0006 Y:0002 P:envMxdizc
 +
$80/D501 9D C4 06    STA $06C4,x[$80:06CA]  A:0002 X:0006 Y:0002 P:envMxdizc
 +
$80/D504 EB          XBA                    A:0002 X:0006 Y:0002 P:envMxdizc
 +
$80/D505 BD C3 06    LDA $06C3,x[$80:06C9]  A:0200 X:0006 Y:0002 P:envMxdiZc
 +
$80/D508 22 15 B9 84 JSL $84B915[$84:B915]  A:0220 X:0006 Y:0002 P:envMxdizc
 +
$80/D50C A6 3B      LDX $3B    [$00:003B]  A:6200 X:0220 Y:0004 P:eNvMxdizc
 +
$80/D50E 68          PLA                    A:6200 X:0006 Y:0004 P:envMxdizc
 +
$80/D50F 9D 04 06    STA $0604,x[$80:060A]  A:6201 X:0006 Y:0004 P:envMxdizc
 +
$80/D512 7A          PLY                    A:6201 X:0006 Y:0004 P:envMxdizc
 +
$80/D513 BD 44 0C    LDA $0C44,x[$80:0C4A]  A:6201 X:0006 Y:0000 P:envMxdiZc
 +
$80/D516 DD 04 06    CMP $0604,x[$80:060A]  A:6202 X:0006 Y:0000 P:envMxdizc
 +
$80/D519 D0 06      BNE $06    [$D521]      A:6202 X:0006 Y:0000 P:envMxdizC
 +
;code is missing here
 +
$80/D521 60          RTS                    A:6202 X:0006 Y:0000 P:envMxdizC
  
 
== $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/D56C F0 04      BEQ $04   [$D572]      A:0804 X:0008 Y:0008 P:eNvMxdizc
 +
$80/D56E C8          INY          ; Increment Load Index twice
 +
$80/D56F C8          INY
 +
$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 8B          PHB                     A:0000 X:0002 Y:D207 P:envMxdiZC
 +
$80/D581 4B          PHK                    A:0000 X:0002 Y:D207 P:envMxdiZC
 +
$80/D582 AB          PLB                    A:0000 X:0002 Y:D207 P:envMxdiZC
 +
$80/D583 48          PHA                    A:0000 X:0002 Y:D207 P:eNvMxdizC
 +
$80/D584 A6 91      LDX $91    [$00:0091]  A:0000 X:0002 Y:D207 P:eNvMxdizC
 +
$80/D586 BD DF 19    LDA $19DF,x[$80:19E1]  A:0000 X:0002 Y:D207 P:envMxdizC
 +
$80/D589 89 40      BIT #$40                A:0040 X:0002 Y:D207 P:envMxdizC
 +
$80/D58B D0 08      BNE $08    [$D595]      A:0040 X:0002 Y:D207 P:envMxdizC
 +
;code is missing here
 +
$80/D595 BC 3E 1E    LDY $1E3E,x[$80:1E40]  A:0040 X:0002 Y:D207 P:envMxdizC
 +
$80/D598 B9 04 07    LDA $0704,y[$80:0706]  A:0040 X:0002 Y:0002 P:envMxdizC
 +
$80/D59B 09 01      ORA #$01                A:0000 X:0002 Y:0002 P:envMxdiZC
 +
$80/D59D 99 04 07    STA $0704,y[$80:0706]  A:0001 X:0002 Y:0002 P:envMxdizC
 +
$80/D5A0 B9 03 07    LDA $0703,y[$80:0705]  A:0001 X:0002 Y:0002 P:envMxdizC
 +
$80/D5A3 85 09      STA $09    [$00:0009]  A:0044 X:0002 Y:0002 P:envMxdizC
 +
$80/D5A5 BB          TYX                    A:0044 X:0002 Y:0002 P:envMxdizC
 +
$80/D5A6 20 7C B8    JSR $B87C  [$80:B87C]  A:0044 X:0002 Y:0002 P:envMxdizC
 +
$80/D5A9 90 03      BCC $03    [$D5AE]      A:0000 X:0006 Y:0002 P:envMxdiZc
 +
;code is missing here
 +
$80/D5AE 8A          TXA                    A:0000 X:0006 Y:0002 P:envMxdiZc
 +
$80/D5AF 99 C4 08    STA $08C4,y[$80:08C6]  A:0006 X:0006 Y:0002 P:envMxdizc
 +
$80/D5B2 B9 04 0A    LDA $0A04,y[$80:0A06]  A:0006 X:0006 Y:0002 P:envMxdizc
 +
$80/D5B5 85 00      STA $00    [$00:0000]  A:000B X:0006 Y:0002 P:envMxdizc
 +
$80/D5B7 B9 44 0A    LDA $0A44,y[$80:0A46]  A:000B X:0006 Y:0002 P:envMxdizc
 +
$80/D5BA 85 01      STA $01    [$00:0001]  A:0007 X:0006 Y:0002 P:envMxdizc
 +
$80/D5BC B9 84 0A    LDA $0A84,y[$80:0A86]  A:0007 X:0006 Y:0002 P:envMxdizc
 +
$80/D5BF 85 02      STA $02    [$00:0002]  A:0006 X:0006 Y:0002 P:envMxdizc
 +
$80/D5C1 5A          PHY                    A:0006 X:0006 Y:0002 P:envMxdizc
 +
$80/D5C2 A0 01 00    LDY #$0001              A:0006 X:0006 Y:0002 P:envMxdizc
 +
$80/D5C5 A5 13      LDA $13    [$00:0013]  A:0006 X:0006 Y:0001 P:envMxdizc
 +
$80/D5C7 22 C6 81 8B JSL $8B81C6[$8B:81C6]  A:0030 X:0006 Y:0001 P:envMxdizc
 +
$80/D5CB 7A          PLY                    A:070B X:0006 Y:0001 P:eNvMxdizc
 +
$80/D5CC B9 03 0A    LDA $0A03,y[$80:0A05]  A:070B X:0006 Y:0002 P:envMxdizc
 +
$80/D5CF 9D 03 0A    STA $0A03,x[$80:0A09]  A:0780 X:0006 Y:0002 P:eNvMxdizc
 +
$80/D5D2 B9 43 0A    LDA $0A43,y[$80:0A45]  A:0780 X:0006 Y:0002 P:eNvMxdizc
 +
$80/D5D5 9D 43 0A    STA $0A43,x[$80:0A49]  A:0780 X:0006 Y:0002 P:eNvMxdizc
 +
$80/D5D8 B9 83 0A    LDA $0A83,y[$80:0A85]  A:0780 X:0006 Y:0002 P:eNvMxdizc
 +
$80/D5DB 9D 83 0A    STA $0A83,x[$80:0A89]  A:0700 X:0006 Y:0002 P:envMxdiZc
 +
$80/D5DE B9 C4 09    LDA $09C4,y[$80:09C6]  A:0700 X:0006 Y:0002 P:envMxdiZc
 +
$80/D5E1 9D C4 09    STA $09C4,x[$80:09CA]  A:07FF X:0006 Y:0002 P:eNvMxdizc
 +
$80/D5E4 B9 C3 09    LDA $09C3,y[$80:09C5]  A:07FF X:0006 Y:0002 P:eNvMxdizc
 +
$80/D5E7 9D C3 09    STA $09C3,x[$80:09C9]  A:07FF X:0006 Y:0002 P:eNvMxdizc
 +
$80/D5EA A9 FF      LDA #$FF                A:07FF X:0006 Y:0002 P:eNvMxdizc
 +
$80/D5EC 99 C4 09    STA $09C4,y[$80:09C6]  A:07FF X:0006 Y:0002 P:eNvMxdizc
 +
$80/D5EF 99 C3 09    STA $09C3,y[$80:09C5]  A:07FF X:0006 Y:0002 P:eNvMxdizc
 +
$80/D5F2 B9 C4 0B    LDA $0BC4,y[$80:0BC6]  A:07FF X:0006 Y:0002 P:eNvMxdizc
 +
$80/D5F5 9D C4 0B    STA $0BC4,x[$80:0BCA]  A:0702 X:0006 Y:0002 P:envMxdizc
 +
$80/D5F8 68          PLA                    A:0702 X:0006 Y:0002 P:envMxdizc
 +
$80/D5F9 9D 03 0E    STA $0E03,x[$80:0E09]  A:0700 X:0006 Y:0002 P:envMxdiZc
 +
$80/D5FC A5 09      LDA $09    [$00:0009]  A:0700 X:0006 Y:0002 P:envMxdiZc
 +
$80/D5FE 9D 03 07    STA $0703,x[$80:0709]  A:0744 X:0006 Y:0002 P:envMxdizc
 +
$80/D601 A5 0A      LDA $0A    [$00:000A]  A:0744 X:0006 Y:0002 P:envMxdizc
 +
$80/D603 9D 43 06    STA $0643,x[$80:0649]  A:0770 X:0006 Y:0002 P:envMxdizc
 +
$80/D606 A5 0B      LDA $0B    [$00:000B]  A:0770 X:0006 Y:0002 P:envMxdizc
 +
$80/D608 9D 44 06    STA $0644,x[$80:064A]  A:0706 X:0006 Y:0002 P:envMxdizc
 +
$80/D60B A9 10      LDA #$10                A:0706 X:0006 Y:0002 P:envMxdizc
 +
$80/D60D 9D C3 08    STA $08C3,x[$80:08C9]  A:0710 X:0006 Y:0002 P:envMxdizc
 +
$80/D610 A5 0A      LDA $0A    [$00:000A]  A:0710 X:0006 Y:0002 P:envMxdizc
 +
$80/D612 C9 50      CMP #$50                A:0770 X:0006 Y:0002 P:envMxdizc
 +
$80/D614 90 03      BCC $03    [$D619]      A:0770 X:0006 Y:0002 P:envMxdizC
 +
$80/D616 FE C3 08    INC $08C3,x[$80:08C9]  A:0770 X:0006 Y:0002 P:envMxdizC
 +
$80/D619 AD EC 1E    LDA $1EEC  [$80:1EEC]  A:0770 X:0006 Y:0002 P:envMxdizC
 +
$80/D61C 9D C3 06    STA $06C3,x[$80:06C9]  A:0720 X:0006 Y:0002 P:envMxdizC
 +
$80/D61F A9 01      LDA #$01                A:0720 X:0006 Y:0002 P:envMxdizC
 +
$80/D621 9D 04 09    STA $0904,x[$80:090A]  A:0701 X:0006 Y:0002 P:envMxdizC
 +
$80/D624 A5 12      LDA $12    [$00:0012]  A:0701 X:0006 Y:0002 P:envMxdizC
 +
$80/D626 C9 02      CMP #$02                A:0702 X:0006 Y:0002 P:envMxdizC
 +
$80/D628 B0 1F      BCS $1F    [$D649]      A:0702 X:0006 Y:0002 P:envMxdiZC
 +
;code is missing here
 +
$80/D649 20 A4 99    JSR $99A4  [$80:99A4]  A:0702 X:0006 Y:0002 P:envMxdiZC
 +
$80/D64C 20 9A 9B    JSR $9B9A  [$80:9B9A]  A:8107 X:0006 Y:0002 P:envMxdizc
 +
$80/D64F DA          PHX                    A:FFFF X:0006 Y:0006 P:eNvMxdizC
 +
$80/D650 A5 0C      LDA $0C    [$00:000C]  A:FFFF X:0006 Y:0006 P:eNvMxdizC
 +
$80/D652 C9 FF      CMP #$FF                A:FFFF X:0006 Y:0006 P:eNvMxdizC
 +
$80/D654 F0 3F      BEQ $3F    [$D695]      A:FFFF X:0006 Y:0006 P:envMxdiZC
 +
;code is missing here
 +
$80/D695 9B          TXY                    A:FFFF X:0006 Y:0006 P:envMxdiZC
 +
$80/D696 A5 0D      LDA $0D    [$00:000D]  A:FFFF X:0006 Y:0006 P:envMxdizC
 +
$80/D698 C9 FF      CMP #$FF                A:FFFF X:0006 Y:0006 P:eNvMxdizC
 +
$80/D69A F0 33      BEQ $33    [$D6CF]      A:FFFF X:0006 Y:0006 P:envMxdiZC
 +
;code is missing here
 +
$80/D6CF FA          PLX                    A:FFFF X:0006 Y:0006 P:envMxdiZC
 +
$80/D6D0 20 21 CE    JSR $CE21  [$80:CE21]  A:FFFF X:0006 Y:0006 P:envMxdizC
 +
$80/D6D3 A6 91      LDX $91    [$00:0091]  A:FFFF X:0008 Y:0008 P:eNvMxdizC
 +
$80/D6D5 BC 3E 1E    LDY $1E3E,x[$80:1E40]  A:FFFF X:0002 Y:0008 P:envMxdizC
 +
$80/D6D8 84 3B      STY $3B    [$00:003B]  A:FFFF X:0002 Y:0002 P:envMxdizC
 +
$80/D6DA AB          PLB                    A:FFFF X:0002 Y:0002 P:envMxdizC
 +
$80/D6DB 6B          RTL                    A:FFFF X:0002 Y:0002 P:eNvMxdizC
  
 
== $80/D929 ? ==
 
== $80/D929 ? ==
  
  $80/D929 5A          PHY                     A:0001 X:0008 Y:0006 P:envMxdizc
+
  $80/D929 5A          PHY           ; Buffer Y on Stack
  $80/D92A D4 00      PEI ($00)       [$BC4F]      A:0001 X:0008 Y:0006 P:envMxdizc
+
  $80/D92A D4 00      PEI ($00)     ; Buffer $00-$03 on Stack
  $80/D92C D4 02      PEI ($02)       [$1000]      A:0001 X:0008 Y:0006 P:envMxdizc
+
  $80/D92C D4 02      PEI ($02)
  $80/D92E 7B          TDC                     A:0001 X:0008 Y:0006 P:envMxdizc
+
  $80/D92E 7B          TDC           ; Clear 16-bit A
 
  $80/D92F BD C4 08    LDA $08C4,x[$80:08CC]  A:0000 X:0008 Y:0006 P:envMxdiZc
 
  $80/D92F BD C4 08    LDA $08C4,x[$80:08CC]  A:0000 X:0008 Y:0006 P:envMxdiZc
 
  $80/D932 A8          TAY                    A:0006 X:0008 Y:0006 P:envMxdizc
 
  $80/D932 A8          TAY                    A:0006 X:0008 Y:0006 P:envMxdizc
Line 4,961: Line 5,348:
 
  $80/D9CA A8          TAY                    A:0004 X:0008 Y:0006 P:envMxdizc
 
  $80/D9CA A8          TAY                    A:0004 X:0008 Y:0006 P:envMxdizc
 
  $80/D9CB B9 AE 17    LDA $17AE,y[$80:17B2]  A:0004 X:0008 Y:0004 P:envMxdizc
 
  $80/D9CB B9 AE 17    LDA $17AE,y[$80:17B2]  A:0004 X:0008 Y:0004 P:envMxdizc
  $80/D9CE 22 DF A3 88 JSL $88A3DF[$88:A3DF]   A:0034 X:0008 Y:0004 P:envMxdizc
+
  $80/D9CE 22 DF A3 88 JSL $88A3DF  ; Load Big Sprite Flag for this Character
 
  $80/D9D2 A9 01      LDA #$01                A:0034 X:0008 Y:0004 P:envMxdizc
 
  $80/D9D2 A9 01      LDA #$01                A:0034 X:0008 Y:0004 P:envMxdizc
 
  $80/D9D4 90 01      BCC $01    [$D9D7]      A:0001 X:0008 Y:0004 P:envMxdizc
 
  $80/D9D4 90 01      BCC $01    [$D9D7]      A:0001 X:0008 Y:0004 P:envMxdizc
 +
;code is missing here
 
  $80/D9D7 9D 04 06    STA $0604,x[$80:060C]  A:0001 X:0008 Y:0004 P:envMxdizc
 
  $80/D9D7 9D 04 06    STA $0604,x[$80:060C]  A:0001 X:0008 Y:0004 P:envMxdizc
;code is missing here
+
  $80/D9DA 7A          PLY           ; Restore $00-$03 from Stack
  $80/D9DA 7A          PLY                     A:0001 X:0008 Y:0004 P:envMxdizc
+
  $80/D9DB 84 02      STY $02
  $80/D9DB 84 02      STY $02   [$00:0002]  A:0001 X:0008 Y:1000 P:envMxdizc
+
  $80/D9DD 7A          PLY
  $80/D9DD 7A          PLY                     A:0001 X:0008 Y:1000 P:envMxdizc
+
  $80/D9DE 84 00      STY $00
  $80/D9DE 84 00      STY $00   [$00:0000]  A:0001 X:0008 Y:BC4F P:eNvMxdizc
+
  $80/D9E0 7A          PLY           ; Restore Y from Stack
  $80/D9E0 7A          PLY                     A:0001 X:0008 Y:BC4F P:eNvMxdizc
+
  $80/D9E1 60          RTS
  $80/D9E1 60          RTS                     A:0001 X:0008 Y:0006 P:envMxdizc
 
  
 
== $80/DA78 ? ==
 
== $80/DA78 ? ==
Line 4,987: Line 5,374:
 
  $80/DA8F 60          RTS                    A:0001 X:0006 Y:0004 P:envMxdizc
 
  $80/DA8F 60          RTS                    A:0001 X:0006 Y:0004 P:envMxdizc
  
== $80/DA90 ? ==
+
== $80/DA90 ? Step Map related ==
  
 
  $80/DA90 DA          PHX          ; Buffer X and Y on Stack
 
  $80/DA90 DA          PHX          ; Buffer X and Y on Stack
Line 5,007: Line 5,394:
 
  $80/DAAD AA          TAX                    A:00E9 X:0008 Y:0008 P:eNvMxdizc
 
  $80/DAAD AA          TAX                    A:00E9 X:0008 Y:0008 P:eNvMxdizc
 
  $80/DAAE 7B          TDC          ; Clear 16-bit A
 
  $80/DAAE 7B          TDC          ; Clear 16-bit A
  $80/DAAF BF 00 DC 7F LDA $7FDC00,x[$7F:DCE9] A:0000 X:00E9 Y:0008 P:envMxdiZc
+
  $80/DAAF BF 00 DC 7F LDA $7FDC00,x ; Load "value from Map which Figure Stands where"
  $80/DAB3 30 2B      BMI $2B   [$DAE0]     A:0004 X:00E9 Y:0008 P:envMxdizc
+
  $80/DAB3 30 2B      BMI $2B       ; [$DAE0] If negative, load value from Step Map and exit
 
  $80/DAB5 C5 01      CMP $01    [$00:0001]  A:0004 X:00E9 Y:0008 P:envMxdizc
 
  $80/DAB5 C5 01      CMP $01    [$00:0001]  A:0004 X:00E9 Y:0008 P:envMxdizc
  $80/DAB7 F0 27      BEQ $27    [$DAE0]      A:0004 X:00E9 Y:0008 P:envMxdiZC
+
  $80/DAB7 F0 27      BEQ $27       ; [$DAE0] If equal, load value from Step Map and exit
;code is missing here
+
$80/DAB9 A8          TAY                    A:0006 X:0044 Y:0010 P:eNvMxdizc
  $80/DAE0 BF 00 C8 7F LDA $7FC800,x[$7F:C8E9] A:0004 X:00E9 Y:0008 P:envMxdiZC
+
$80/DABA B9 DE 19    LDA $19DE,y[$80:19E4]  A:0006 X:0044 Y:0006 P:envMxdizc
 +
$80/DABD 4A          LSR A                  A:0000 X:0044 Y:0006 P:envMxdiZc
 +
$80/DABE B0 20      BCS $20   [$DAE0]      A:0000 X:0044 Y:0006 P:envMxdiZc
 +
$80/DAC0 B9 AE 17    LDA $17AE,y  ; Load Character Sprite
 +
  $80/DAC3 C9 F0      CMP #$F0                A:003B X:0044 Y:0006 P:envMxdizc
 +
$80/DAC5 B0 19      BCS $19      ; [$DAE0] If equal, load value from Step Map and exit
 +
$80/DAC7 B9 C6 1D    LDA $1DC6,y[$80:1DCC]  A:003B X:0044 Y:0006 P:envMxdizc
 +
$80/DACA 18          CLC                    A:000B X:0044 Y:0006 P:envMxdizc
 +
$80/DACB 69 03      ADC #$03                A:000B X:0044 Y:0006 P:envMxdizc
 +
$80/DACD 0A          ASL A                  A:000E X:0044 Y:0006 P:envMxdizc
 +
$80/DACE 85 01      STA $01    [$00:0001]  A:001C X:0044 Y:0006 P:envMxdizc
 +
$80/DAD0 7B          TDC                    A:001C X:0044 Y:0006 P:envMxdizc
 +
$80/DAD1 A5 00      LDA $00    [$00:0000]  A:0000 X:0044 Y:0006 P:envMxdiZc
 +
$80/DAD3 A8          TAY                    A:000E X:0044 Y:0006 P:envMxdizc
 +
$80/DAD4 B9 84 0A    LDA $0A84,y[$80:0A92]  A:000E X:0044 Y:000E P:envMxdizc
 +
$80/DAD7 C5 01      CMP $01    [$00:0001]  A:0016 X:0044 Y:000E P:envMxdizc
 +
$80/DAD9 90 05      BCC $05    [$DAE0]      A:0016 X:0044 Y:000E P:eNvMxdizc
 +
$80/DADB A5 01      LDA $01    [$00:0001]  A:001D X:0063 Y:0012 P:envMxdizC
 +
$80/DADD 4A          LSR A                  A:001C X:0063 Y:0012 P:envMxdizC
 +
$80/DADE 80 04      BRA $04    [$DAE4]     A:000E X:0063 Y:0012 P:envMxdizc
 +
$80/DAE0 BF 00 C8 7F LDA $7FC800,x ; Load value from Step Map
 
  $80/DAE4 7A          PLY          ; Restore $00/$01 from Stack
 
  $80/DAE4 7A          PLY          ; Restore $00/$01 from Stack
 
  $80/DAE5 84 00      STY $00
 
  $80/DAE5 84 00      STY $00
Line 5,526: 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,554: 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 5,636: 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 5,668: 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 5,679: 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 5,892: Line 6,301:
 
  $81/8326 18          CLC                    A:A87E X:3300 Y:3C00 P:envMxdizc
 
  $81/8326 18          CLC                    A:A87E X:3300 Y:3C00 P:envMxdizc
 
  $81/8327 6B          RTL                    A:A87E X:3300 Y:3C00 P:envMxdizc
 
  $81/8327 6B          RTL                    A:A87E X:3300 Y:3C00 P:envMxdizc
 +
$81/8328 20 13 96    JSR $9613  [$81:9613]  A:00FF X:45D9 Y:45D9 P:envMxdiZC
 +
$81/832B BD 54 00    LDA $0054,x[$7E:462D]  A:D133 X:45D9 Y:3919 P:envMxdizc
 +
$81/832E FA          PLX                    A:D103 X:45D9 Y:3919 P:envMxdizc
 +
$81/832F 1A          INC A                  A:D103 X:3911 Y:3919 P:envMxdizc
 +
$81/8330 C5 C1      CMP $C1    [$00:00C1]  A:D104 X:3911 Y:3919 P:envMxdizc
 +
$81/8332 D0 14      BNE $14    [$8348]      A:D104 X:3911 Y:3919 P:envMxdiZC
 +
$81/8334 C6 C1      DEC $C1    [$00:00C1]  A:D104 X:3911 Y:3919 P:envMxdiZC
 +
$81/8336 BC 04 00    LDY $0004,x[$7E:3915]  A:D104 X:3911 Y:3919 P:envMxdizC
 +
$81/8339 84 5A      STY $5A    [$00:005A]  A:D104 X:3911 Y:45D9 P:envMxdizC
 +
$81/833B 9E 04 00    STZ $0004,x[$7E:3915]  A:D104 X:3911 Y:45D9 P:envMxdizC
 +
$81/833E 9E 05 00    STZ $0005,x[$7E:3916]  A:D104 X:3911 Y:45D9 P:envMxdizC
 +
$81/8341 A9 00      LDA #$00                A:D104 X:3911 Y:45D9 P:envMxdizC
 +
$81/8343 9D 02 00    STA $0002,x[$7E:3913]  A:D100 X:3911 Y:45D9 P:envMxdiZC
 +
$81/8346 80 05      BRA $05    [$834D]      A:D100 X:3911 Y:45D9 P:envMxdiZC
 +
;code is missing here
 +
$81/834D DA          PHX                    A:D100 X:3911 Y:45D9 P:envMxdiZC
 +
$81/834E 20 D6 9C    JSR $9CD6  [$81:9CD6]  A:D100 X:3911 Y:45D9 P:envMxdiZC
 +
$81/8351 20 06 9D    JSR $9D06  [$81:9D06]  A:E07F X:45D9 Y:5400 P:envMxdizc
 +
$81/8354 FA          PLX                    A:A87E X:45D9 Y:3C00 P:envMxdizc
 +
$81/8355 BD 03 00    LDA $0003,x[$7E:3914]  A:A87E X:3911 Y:3C00 P:envMxdizc
 +
$81/8358 C9 00      CMP #$00                A:A803 X:3911 Y:3C00 P:envMxdizc
 +
$81/835A F0 11      BEQ $11    [$836D]      A:A803 X:3911 Y:3C00 P:envMxdizC
 +
$81/835C C9 04      CMP #$04                A:A803 X:3911 Y:3C00 P:envMxdizC
 +
$81/835E F0 0D      BEQ $0D    [$836D]      A:A803 X:3911 Y:3C00 P:eNvMxdizc
 +
$81/8360 A9 01      LDA #$01                A:A803 X:3911 Y:3C00 P:eNvMxdizc
 +
$81/8362 20 A5 80    JSR $80A5  [$81:80A5]  A:A801 X:3911 Y:3C00 P:envMxdizc
 +
$81/8365 9E 52 00    STZ $0052,x[$7E:396B]  A:0001 X:3919 Y:3C00 P:envMxdizc
 +
$81/8368 9E 53 00    STZ $0053,x[$7E:396C]  A:0001 X:3919 Y:3C00 P:envMxdizc
 +
$81/836B 80 03      BRA $03    [$8370]      A:0001 X:3919 Y:3C00 P:envMxdizc
 +
$81/836D 20 FA 80    JSR $80FA  [$81:80FA]  A:A804 X:3911 Y:3C00 P:envMxdiZC
 +
$81/8370 FA          PLX          ; Restore $02-$05 from Stack
 +
$81/8371 86 04      STX $04
 +
$81/8373 FA          PLX
 +
$81/8374 86 02      STX $02
 +
$81/8376 FA          PLX          ; Restore X from Stack
 +
$81/8377 AB          PLB          ; Restore Data Bank from Stack
 +
$81/8378 38          SEC                    A:0001 X:1758 Y:3C00 P:envMxdizc
 +
$81/8379 6B          RTL
  
 
== $81/837A ? ==
 
== $81/837A ? ==
Line 5,942: Line 6,389:
 
  $81/83D0 C5 C1      CMP $C1    [$00:00C1]  A:0003 X:3911 Y:002D P:envMxdizC
 
  $81/83D0 C5 C1      CMP $C1    [$00:00C1]  A:0003 X:3911 Y:002D P:envMxdizC
 
  $81/83D2 D0 14      BNE $14    [$83E8]      A:0003 X:3911 Y:002D P:eNvMxdizc
 
  $81/83D2 D0 14      BNE $14    [$83E8]      A:0003 X:3911 Y:002D P:eNvMxdizc
;code is missing here
+
$81/83D4 C6 C1      DEC $C1    [$00:00C1]  A:CC03 X:3911 Y:0000 P:envMxdiZC
 +
$81/83D6 BC 06 00    LDY $0006,x[$7E:3917]  A:CC03 X:3911 Y:0000 P:envMxdizC
 +
$81/83D9 84 5A      STY $5A    [$00:005A]  A:CC03 X:3911 Y:3919 P:envMxdizC
 +
$81/83DB 9E 06 00    STZ $0006,x[$7E:3917]  A:CC03 X:3911 Y:3919 P:envMxdizC
 +
$81/83DE 9E 07 00    STZ $0007,x[$7E:3918]  A:CC03 X:3911 Y:3919 P:envMxdizC
 +
$81/83E1 A9 00      LDA #$00                A:CC03 X:3911 Y:3919 P:envMxdizC
 +
$81/83E3 9D 03 00    STA $0003,x[$7E:3914]  A:CC00 X:3911 Y:3919 P:envMxdiZC
 +
$81/83E6 80 05      BRA $05    [$83ED]      A:CC00 X:3911 Y:3919 P:envMxdiZC
 
  $81/83E8 A9 04      LDA #$04                A:0003 X:3911 Y:002D P:eNvMxdizc
 
  $81/83E8 A9 04      LDA #$04                A:0003 X:3911 Y:002D P:eNvMxdizc
 
  $81/83EA 9D 03 00    STA $0003,x[$7E:3914]  A:0004 X:3911 Y:002D P:envMxdizc
 
  $81/83EA 9D 03 00    STA $0003,x[$7E:3914]  A:0004 X:3911 Y:002D P:envMxdizc
Line 5,959: Line 6,413:
 
  $81/8407 9E 53 00    STZ $0053,x[$7E:462C]  A:0000 X:45D9 Y:3C00 P:envMxdiZc
 
  $81/8407 9E 53 00    STZ $0053,x[$7E:462C]  A:0000 X:45D9 Y:3C00 P:envMxdiZc
 
  $81/840A 80 03      BRA $03    [$840F]      A:0000 X:45D9 Y:3C00 P:envMxdiZc
 
  $81/840A 80 03      BRA $03    [$840F]      A:0000 X:45D9 Y:3C00 P:envMxdiZc
;code is missing here
+
$81/840C 20 FA 80    JSR $80FA  [$81:80FA]  A:AC00 X:3911 Y:3C00 P:envMxdiZC
 
  $81/840F FA          PLX                    A:0000 X:45D9 Y:3C00 P:envMxdiZc
 
  $81/840F FA          PLX                    A:0000 X:45D9 Y:3C00 P:envMxdiZc
 
  $81/8410 86 04      STX $04    [$00:0004]  A:0000 X:0200 Y:3C00 P:envMxdizc
 
  $81/8410 86 04      STX $04    [$00:0004]  A:0000 X:0200 Y:3C00 P:envMxdizc
Line 5,996: Line 6,450:
 
  $81/84CC C9 01      CMP #$01                A:0000 X:3911 Y:0002 P:envMxdiZC
 
  $81/84CC C9 01      CMP #$01                A:0000 X:3911 Y:0002 P:envMxdiZC
 
  $81/84CE D0 54      BNE $54    [$8524]      A:0000 X:3911 Y:0002 P:eNvMxdizc
 
  $81/84CE D0 54      BNE $54    [$8524]      A:0000 X:3911 Y:0002 P:eNvMxdizc
;code is missing here
+
$81/84D0 DA          PHX                    A:0001 X:3911 Y:0002 P:envMxdiZC
 +
$81/84D1 9B          TXY                    A:0001 X:3911 Y:0002 P:envMxdiZC
 +
$81/84D2 BE 04 00    LDX $0004,y[$7E:3915]  A:0001 X:3911 Y:3911 P:envMxdizC
 +
$81/84D5 20 C4 A7    JSR $A7C4  [$81:A7C4]  A:0001 X:45D9 Y:3911 P:envMxdizC
 +
$81/84D8 FA          PLX                    A:A801 X:45D9 Y:3C00 P:envMxdizc
 +
$81/84D9 BC 02 00    LDY $0002,x[$7E:3913]  A:A801 X:3911 Y:3C00 P:envMxdizc
 +
$81/84DC 84 00      STY $00    [$00:0000]  A:A801 X:3911 Y:0301 P:envMxdizc
 +
$81/84DE 20 A5 85    JSR $85A5  [$81:85A5]  A:A801 X:3911 Y:0301 P:envMxdizc
 +
$81/84E1 A5 00      LDA $00    [$00:0000]  A:A801 X:3911 Y:0301 P:envMxdiZC
 +
$81/84E3 9D 02 00    STA $0002,x[$7E:3913]  A:A801 X:3911 Y:0301 P:envMxdizC
 +
$81/84E6 C9 03      CMP #$03                A:A801 X:3911 Y:0301 P:envMxdizC
 +
$81/84E8 F0 07      BEQ $07    [$84F1]      A:A801 X:3911 Y:0301 P:eNvMxdizc
 +
$81/84EA C9 02      CMP #$02                A:A801 X:3911 Y:0301 P:eNvMxdizc
 +
$81/84EC F0 03      BEQ $03    [$84F1]      A:A801 X:3911 Y:0301 P:eNvMxdizc
 +
$81/84EE 4C 89 85    JMP $8589  [$81:8589]  A:A801 X:3911 Y:0301 P:eNvMxdizc
 
  $81/84F1 A5 01      LDA $01    [$00:0001]  A:0003 X:3911 Y:0301 P:envMxdiZC
 
  $81/84F1 A5 01      LDA $01    [$00:0001]  A:0003 X:3911 Y:0301 P:envMxdiZC
 
  $81/84F3 C9 01      CMP #$01                A:0003 X:3911 Y:0301 P:envMxdizC
 
  $81/84F3 C9 01      CMP #$01                A:0003 X:3911 Y:0301 P:envMxdizC
Line 6,102: Line 6,570:
 
  $81/8B5D 6B          RTL                    A:0000 X:0001 Y:00FF P:envMxdiZC
 
  $81/8B5D 6B          RTL                    A:0000 X:0001 Y:00FF P:envMxdiZC
  
;table is missing here
+
$81/8B5E 80
 +
$81/8B5F 00
 +
$81/8B60 02
  
 
== $81/8B61 ? ==
 
== $81/8B61 ? ==
Line 6,138: Line 6,608:
 
  $81/8BEB AA          TAX                    A:0000 X:45D9 Y:0006 P:envMxdiZc
 
  $81/8BEB AA          TAX                    A:0000 X:45D9 Y:0006 P:envMxdiZc
 
  $81/8BEC 7C EF 8B    JMP ($8BEF,x)[$81:8C0B] A:0000 X:0000 Y:0006 P:envMxdiZc
 
  $81/8BEC 7C EF 8B    JMP ($8BEF,x)[$81:8C0B] A:0000 X:0000 Y:0006 P:envMxdiZc
; Data Table is missing here
+
 
 +
$81/8BEF 0B 8C --- Entry #$00 - $8C0B
 +
$81/8BF1 F6 8C --- Entry #$01 - $8CF6
 +
$81/8BF3 56 8C --- Entry #$02 - $8C56
 +
$81/8BF5 5A 8C --- Entry #$03 - $8C5A
 +
$81/8BF7 56 8C --- Entry #$04 - $8C56
 +
$81/8BF9 07 8C --- Entry #$05 - $8C07
 +
$81/8BFB F6 8C --- Entry #$06 - $8CF6
 +
$81/8BFD 91 8D --- Entry #$07 - $8D91
 +
$81/8BFF 27 8E --- Entry #$08 - $8E27
 +
$81/8C01 27 8E --- Entry #$09 - $8E27
 +
$81/8C03 5C 8C --- Entry #$0A - $8C5C
 +
$81/8C05 56 8C --- Entry #$0B - $8C56
  
 
== $81/8C0B ? ==
 
== $81/8C0B ? ==
Line 6,173: Line 6,655:
 
  $81/8C43 88          DEY                    A:0006 X:45D9 Y:0005 P:envMxdizC
 
  $81/8C43 88          DEY                    A:0006 X:45D9 Y:0005 P:envMxdizC
 
  $81/8C44 10 CB      BPL $CB    [$8C11]      A:0006 X:45D9 Y:0004 P:envMxdizC
 
  $81/8C44 10 CB      BPL $CB    [$8C11]      A:0006 X:45D9 Y:0004 P:envMxdizC
 +
$81/8C46 A6 D8      LDX $D8    [$00:00D8]  A:0003 X:3300 Y:FFFE P:eNvMxdizC
 +
$81/8C48 7B          TDC                    A:0003 X:3919 Y:FFFE P:envMxdizC
 +
$81/8C49 9D 52 00    STA $0052,x[$7E:396B]  A:0000 X:3919 Y:FFFE P:envMxdiZC
 +
$81/8C4C 9D 53 00    STA $0053,x[$7E:396C]  A:0000 X:3919 Y:FFFE P:envMxdiZC
 +
$81/8C4F A5 0C      LDA $0C    [$00:000C]  A:0000 X:3919 Y:FFFE P:envMxdiZC
 +
$81/8C51 9D 51 00    STA $0051,x[$7E:396A]  A:0001 X:3919 Y:FFFE P:envMxdizC
 +
$81/8C54 80 08      BRA $08    [$8C5E]      A:0001 X:3919 Y:FFFE P:envMxdizC
 
;code is missing here
 
;code is missing here
 
  $81/8C5E 64 0B      STZ $0B    [$00:000B]  A:45D9 X:45D9 Y:3919 P:envMxdizc
 
  $81/8C5E 64 0B      STZ $0B    [$00:000B]  A:45D9 X:45D9 Y:3919 P:envMxdizc
Line 6,193: Line 6,682:
 
  $81/8C84 3A          DEC A                  A:0004 X:45D9 Y:3919 P:envMxdizC
 
  $81/8C84 3A          DEC A                  A:0004 X:45D9 Y:3919 P:envMxdizC
 
  $81/8C85 80 02      BRA $02    [$8C89]      A:0003 X:45D9 Y:3919 P:envMxdizC
 
  $81/8C85 80 02      BRA $02    [$8C89]      A:0003 X:45D9 Y:3919 P:envMxdizC
 +
$81/8C87 A5 02      LDA $02    [$00:0002]  A:0044 X:3919 Y:FFFE P:envMxdizc
 
  $81/8C89 9D 55 00    STA $0055,x[$7E:462E]  A:0003 X:45D9 Y:3919 P:envMxdizC
 
  $81/8C89 9D 55 00    STA $0055,x[$7E:462E]  A:0003 X:45D9 Y:3919 P:envMxdizC
 
  $81/8C8C 9E 56 00    STZ $0056,x[$7E:462F]  A:0003 X:45D9 Y:3919 P:envMxdizC
 
  $81/8C8C 9E 56 00    STZ $0056,x[$7E:462F]  A:0003 X:45D9 Y:3919 P:envMxdizC
Line 6,285: Line 6,775:
 
  $81/90FF 89 40      BIT #$40                A:0004 X:45D9 Y:3919 P:envMxdizc
 
  $81/90FF 89 40      BIT #$40                A:0004 X:45D9 Y:3919 P:envMxdizc
 
  $81/9101 F0 40      BEQ $40    [$9143]      A:0004 X:45D9 Y:3919 P:envMxdiZc
 
  $81/9101 F0 40      BEQ $40    [$9143]      A:0004 X:45D9 Y:3919 P:envMxdiZc
;code is missing here
+
$81/9103 C2 20      REP #$20                A:0044 X:3919 Y:FFFE P:envMxdizc
 +
$81/9105 BD 60 00    LDA $0060,x[$7E:3979]  A:0044 X:3919 Y:FFFE P:envmxdizc
 +
$81/9108 38          SEC                    A:053A X:3919 Y:FFFE P:envmxdizc
 +
$81/9109 FD 59 00    SBC $0059,x[$7E:3972]  A:053A X:3919 Y:FFFE P:envmxdizC
 +
$81/910C FD 59 00    SBC $0059,x[$7E:3972]  A:0523 X:3919 Y:FFFE P:envmxdizC
 +
$81/910F E9 02 00    SBC #$0002              A:050C X:3919 Y:FFFE P:envmxdizC
 +
$81/9112 29 FF 07    AND #$07FF              A:050A X:3919 Y:FFFE P:envmxdizC
 +
$81/9115 9D 60 00    STA $0060,x[$7E:3979]  A:050A X:3919 Y:FFFE P:envmxdizC
 +
$81/9118 BD 64 00    LDA $0064,x[$7E:397D]  A:050A X:3919 Y:FFFE P:envmxdizC
 +
$81/911B 38          SEC                    A:067A X:3919 Y:FFFE P:envmxdizC
 +
$81/911C FD 59 00    SBC $0059,x[$7E:3972]  A:067A X:3919 Y:FFFE P:envmxdizC
 +
$81/911F FD 59 00    SBC $0059,x[$7E:3972]  A:0663 X:3919 Y:FFFE P:envmxdizC
 +
$81/9122 E9 02 00    SBC #$0002              A:064C X:3919 Y:FFFE P:envmxdizC
 +
$81/9125 29 FF 07    AND #$07FF              A:064A X:3919 Y:FFFE P:envmxdizC
 +
$81/9128 9D 64 00    STA $0064,x[$7E:397D]  A:064A X:3919 Y:FFFE P:envmxdizC
 +
$81/912B BD 6A 00    LDA $006A,x[$7E:3983]  A:064A X:3919 Y:FFFE P:envmxdizC
 +
$81/912E 18          CLC                    A:03C0 X:3919 Y:FFFE P:envmxdizC
 +
$81/912F 69 06 00    ADC #$0006              A:03C0 X:3919 Y:FFFE P:envmxdizc
 +
$81/9132 9D 68 00    STA $0068,x[$7E:3981]  A:03C6 X:3919 Y:FFFE P:envmxdizc
 +
$81/9135 69 02 00    ADC #$0002              A:03C6 X:3919 Y:FFFE P:envmxdizc
 +
$81/9138 9D 62 00    STA $0062,x[$7E:397B]  A:03C8 X:3919 Y:FFFE P:envmxdizc
 +
$81/913B 09 00 80    ORA #$8000              A:03C8 X:3919 Y:FFFE P:envmxdizc
 +
$81/913E 9D 66 00    STA $0066,x[$7E:397F]  A:83C8 X:3919 Y:FFFE P:eNvmxdizc
 +
$81/9141 80 33      BRA $33    [$9176]      A:83C8 X:3919 Y:FFFE P:eNvmxdizc
 
  $81/9143 C2 21      REP #$21                A:0004 X:45D9 Y:3919 P:envMxdiZc
 
  $81/9143 C2 21      REP #$21                A:0004 X:45D9 Y:3919 P:envMxdiZc
 
  $81/9145 BD 6A 00    LDA $006A,x[$7E:4643]  A:0004 X:45D9 Y:3919 P:envmxdiZc
 
  $81/9145 BD 6A 00    LDA $006A,x[$7E:4643]  A:0004 X:45D9 Y:3919 P:envmxdiZc
Line 6,356: Line 6,869:
 
  $81/9227 60          RTS                    A:0000 X:45D9 Y:45D9 P:envMxdizc
 
  $81/9227 60          RTS                    A:0000 X:45D9 Y:45D9 P:envMxdizc
  
;table is missing here
+
$81/9228 40 92 --- Entry #$00 - $9240
 +
$81/922A 41 92 --- Entry #$01 - $9241
 +
$81/922C 76 92 --- Entry #$02 - $9276
 +
$81/922E 76 92 --- Entry #$03 - $9276
 +
$81/9230 76 92 --- Entry #$04 - $9276
 +
$81/9232 76 92 --- Entry #$05 - $9276
 +
$81/9234 41 92 --- Entry #$06 - $9241
 +
$81/9236 76 92 --- Entry #$07 - $9276
 +
$81/9238 76 92 --- Entry #$08 - $9276
 +
$81/923A 76 92 --- Entry #$09 - $9276
 +
$81/923C 76 92 --- Entry #$0A - $9276
 +
$81/923E 76 92 --- Entry #$0B - $9276
 +
 
 +
== $81/9240 RTS ==
 +
 
 +
$81/9240 60          RTS          ; This line could be removed - Point to another RTS!
  
 
== $81/92EE ? ==
 
== $81/92EE ? ==
Line 6,405: Line 6,933:
 
== $81/9346 ? ==
 
== $81/9346 ? ==
  
  $81/9346 A2 00 A8    LDX #$A800             A:0000 X:45D9 Y:001E P:envMxdizc
+
Why does line 9357 not jump to 937B?
  $81/9349 86 20      STX $20   [$00:0020]  A:0000 X:A800 Y:001E P:eNvMxdizc
+
 
  $81/934B A9 7E      LDA #$7E               A:0000 X:A800 Y:001E P:eNvMxdizc
+
  $81/9346 A2 00 A8    LDX #$A800   ; Setup Address $7E/A800 in [$20]
  $81/934D 85 22      STA $22   [$00:0022]  A:007E X:A800 Y:001E P:envMxdizc
+
  $81/9349 86 20      STX $20
  $81/934F 7B          TDC                     A:007E X:A800 Y:001E P:envMxdizc
+
  $81/934B A9 7E      LDA #$7E
 +
  $81/934D 85 22      STA $22
 +
  $81/934F 7B          TDC           ; Clear 16-bit A
 
  $81/9350 A6 D8      LDX $D8    [$00:00D8]  A:0000 X:A800 Y:001E P:envMxdiZc
 
  $81/9350 A6 D8      LDX $D8    [$00:00D8]  A:0000 X:A800 Y:001E P:envMxdiZc
 
  $81/9352 BD 3F 02    LDA $023F,x[$7E:4818]  A:0000 X:45D9 Y:001E P:envMxdizc
 
  $81/9352 BD 3F 02    LDA $023F,x[$7E:4818]  A:0000 X:45D9 Y:001E P:envMxdizc
Line 6,426: Line 6,956:
 
  $81/9370 20 D8 9B    JSR $9BD8  [$81:9BD8]  A:2FC5 X:45D9 Y:019E P:envMxdizc
 
  $81/9370 20 D8 9B    JSR $9BD8  [$81:9BD8]  A:2FC5 X:45D9 Y:019E P:envMxdizc
 
  $81/9373 60          RTS                    A:A87E X:45D9 Y:3C00 P:envMxdizc
 
  $81/9373 60          RTS                    A:A87E X:45D9 Y:3C00 P:envMxdizc
;code is missing here
+
$81/9374 A6 D8      LDX $D8    [$00:00D8]  A:FFFF X:000C Y:001E P:envMxdiZC
 +
$81/9376 A9 FF      LDA #$FF                A:FFFF X:45D9 Y:001E P:envMxdizC
 +
$81/9378 9D 3F 02    STA $023F,x[$7E:4818]  A:FFFF X:45D9 Y:001E P:eNvMxdizC
 +
$81/937B 60          RTS                    A:FFFF X:45D9 Y:001E P:eNvMxdizC
 +
 
  
== $81/937C ? Address Table for the Subroutine above ==
+
$81/937C 98 93 --- Entry #$00 - $9398
 +
$81/937E CB 93 --- Entry #$01 - $93CB
 +
$81/9380 01 94 --- Entry #$02 - $9401
 +
$81/9382 39 94 --- Entry #$03 - $9439
 +
$81/9384 6B 94 --- Entry #$04 - $946B
 +
$81/9386 C3 94 --- Entry #$05 - $94C3
 +
$81/9388 FF FF --- Entry #$06 - $FFFF
 +
$81/938A C3 94 --- Entry #$07 - $94C3
 +
$81/938C 6B 94 --- Entry #$08 - $946B
 +
$81/938E 39 94 --- Entry #$09 - $9439
 +
$81/9390 01 94 --- Entry #$0A - $9401
 +
$81/9392 CB 93 --- Entry #$0B - $93CB
 +
$81/9394 98 93 --- Entry #$0C - $9398
 +
$81/9396 FF FF --- Entry #$0D - $FFFF
  
 
== $81/9398 ? ==
 
== $81/9398 ? ==
Line 6,459: Line 7,006:
 
  $81/93C9 18          CLC                    A:2FC5 X:D331 Y:019E P:envMxdizc
 
  $81/93C9 18          CLC                    A:2FC5 X:D331 Y:019E P:envMxdizc
 
  $81/93CA 60          RTS                    A:2FC5 X:D331 Y:019E P:envMxdizc
 
  $81/93CA 60          RTS                    A:2FC5 X:D331 Y:019E P:envMxdizc
 +
 +
== $81/93CB ? ==
 +
 +
$81/93CB A6 D8      LDX $D8    [$00:00D8]  A:93CB X:0002 Y:001E P:eNvMxdizc
 +
$81/93CD C2 21      REP #$21                A:93CB X:45D9 Y:001E P:envMxdizc
 +
$81/93CF BD 5B 00    LDA $005B,x[$7E:4634]  A:93CB X:45D9 Y:001E P:envmxdizc
 +
$81/93D2 4A          LSR A                  A:0006 X:45D9 Y:001E P:envmxdizc
 +
$81/93D3 7D 57 00    ADC $0057,x[$7E:4630]  A:0003 X:45D9 Y:001E P:envmxdizc
 +
$81/93D6 3A          DEC A                  A:0006 X:45D9 Y:001E P:envmxdizc
 +
$81/93D7 85 04      STA $04    [$00:0004]  A:0005 X:45D9 Y:001E P:envmxdizc
 +
$81/93D9 BD 59 00    LDA $0059,x[$7E:4632]  A:0005 X:45D9 Y:001E P:envmxdizc
 +
$81/93DC 4A          LSR A                  A:0018 X:45D9 Y:001E P:envmxdizc
 +
$81/93DD 7D 55 00    ADC $0055,x[$7E:462E]  A:000C X:45D9 Y:001E P:envmxdizc
 +
$81/93E0 3A          DEC A                  A:000F X:45D9 Y:001E P:envmxdizc
 +
$81/93E1 3A          DEC A                  A:000E X:45D9 Y:001E P:envmxdizc
 +
$81/93E2 85 06      STA $06    [$00:0006]  A:000D X:45D9 Y:001E P:envmxdizc
 +
$81/93E4 A5 04      LDA $04    [$00:0004]  A:000D X:45D9 Y:001E P:envmxdizc
 +
$81/93E6 EB          XBA                    A:0005 X:45D9 Y:001E P:envmxdizc
 +
$81/93E7 4A          LSR A                  A:0500 X:45D9 Y:001E P:envmxdiZc
 +
$81/93E8 4A          LSR A                  A:0280 X:45D9 Y:001E P:envmxdizc
 +
$81/93E9 65 06      ADC $06    [$00:0006]  A:0140 X:45D9 Y:001E P:envmxdizc
 +
$81/93EB 65 06      ADC $06    [$00:0006]  A:014D X:45D9 Y:001E P:envmxdizc
 +
$81/93ED A8          TAY                    A:015A X:45D9 Y:001E P:envmxdizc
 +
$81/93EE E2 20      SEP #$20                A:015A X:45D9 Y:015A P:envmxdizc
 +
$81/93F0 A9 02      LDA #$02                A:015A X:45D9 Y:015A P:envMxdizc
 +
$81/93F2 85 00      STA $00    [$00:0000]  A:0102 X:45D9 Y:015A P:envMxdizc
 +
$81/93F4 64 02      STZ $02    [$00:0002]  A:0102 X:45D9 Y:015A P:envMxdizc
 +
$81/93F6 A2 31 D3    LDX #$D331              A:0102 X:45D9 Y:015A P:envMxdizc
 +
$81/93F9 A9 81      LDA #$81                A:0102 X:D331 Y:015A P:eNvMxdizc
 +
$81/93FB 22 41 D3 81 JSL $81D341[$81:D341]  A:0181 X:D331 Y:015A P:eNvMxdizc
 +
$81/93FF 18          CLC                    A:2FC5 X:D331 Y:01A0 P:envMxdizc
 +
$81/9400 60          RTS                    A:2FC5 X:D331 Y:01A0 P:envMxdizc
  
 
== $81/9401 ? ==
 
== $81/9401 ? ==
Line 6,657: Line 7,236:
 
  $81/9593 C9 FE      CMP #$FE                A:0033 X:45D9 Y:3919 P:envMxdizc
 
  $81/9593 C9 FE      CMP #$FE                A:0033 X:45D9 Y:3919 P:envMxdizc
 
  $81/9595 D0 6B      BNE $6B    [$9602]      A:0033 X:45D9 Y:3919 P:envMxdizc
 
  $81/9595 D0 6B      BNE $6B    [$9602]      A:0033 X:45D9 Y:3919 P:envMxdizc
 +
;code is missing here
 +
$81/959E C2 21      REP #$21                A:0001 X:3919 Y:1406 P:envMxdizc
 +
$81/95A0 BD 57 00    LDA $0057,x[$7E:3970]  A:0001 X:3919 Y:1406 P:envmxdizc
 +
$81/95A3 7D 5B 00    ADC $005B,x[$7E:3974]  A:0014 X:3919 Y:1406 P:envmxdizc
 +
$81/95A6 0A          ASL A                  A:001A X:3919 Y:1406 P:envmxdizc
 +
$81/95A7 0A          ASL A                  A:0034 X:3919 Y:1406 P:envmxdizc
 +
$81/95A8 0A          ASL A                  A:0068 X:3919 Y:1406 P:envmxdizc
 +
$81/95A9 E2 20      SEP #$20                A:00D0 X:3919 Y:1406 P:envmxdizc
 +
$81/95AB C9 D0      CMP #$D0                A:00D0 X:3919 Y:1406 P:envMxdizc
 +
$81/95AD B0 08      BCS $08    [$95B7]      A:00D0 X:3919 Y:1406 P:envMxdiZC
 +
$81/95AF 85 23      STA $23    [$00:0023]  A:00C8 X:3919 Y:130A P:eNvMxdizc
 +
$81/95B1 A9 01      LDA #$01                A:00C8 X:3919 Y:130A P:eNvMxdizc
 +
$81/95B3 22 7A EA 81 JSL $81EA7A[$81:EA7A]  A:0001 X:3919 Y:130A P:envMxdizc
 +
$81/95B7 A6 D8      LDX $D8    [$00:00D8]  A:00D0 X:3919 Y:1406 P:envMxdiZC
 +
$81/95B9 BC 52 00    LDY $0052,x[$7E:396B]  A:00D0 X:3919 Y:1406 P:envMxdizC
 +
$81/95BC F0 0B      BEQ $0B    [$95C9]      A:00D0 X:3919 Y:0000 P:envMxdiZC
 +
;code is missing here
 +
$81/95C9 A6 D8      LDX $D8    [$00:00D8]  A:00D0 X:3919 Y:0000 P:envMxdiZC
 +
$81/95CB 20 AC 96    JSR $96AC  [$81:96AC]  A:00D0 X:3919 Y:0000 P:envMxdizC
 +
$81/95CE 80 32      BRA $32    [$9602]      A:0001 X:0000 Y:2C80 P:envMxdizC
 
;code is missing here
 
;code is missing here
 
  $81/9602 FA          PLX          ; Restore $02-$0B from Stack
 
  $81/9602 FA          PLX          ; Restore $02-$0B from Stack
Line 6,783: 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 6,800: 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 6,810: 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 6,849: Line 7,448:
 
  $81/9757 3A          DEC A                  A:0003 X:45D9 Y:0308 P:envMxdizc
 
  $81/9757 3A          DEC A                  A:0003 X:45D9 Y:0308 P:envMxdizc
 
  $81/9758 80 05      BRA $05    [$975F]      A:0002 X:45D9 Y:0308 P:envMxdizc
 
  $81/9758 80 05      BRA $05    [$975F]      A:0002 X:45D9 Y:0308 P:envMxdizc
;code is missing here
+
$81/975A BD 57 00    LDA $0057,x[$7E:3970]  A:0012 X:3919 Y:1406 P:envMxdizc
 +
$81/975D 3A          DEC A                  A:0014 X:3919 Y:1406 P:envMxdizc
 +
$81/975E 3A          DEC A                  A:0013 X:3919 Y:1406 P:envMxdizc
 
  $81/975F C2 20      REP #$20                A:0002 X:45D9 Y:0308 P:envMxdizc
 
  $81/975F C2 20      REP #$20                A:0002 X:45D9 Y:0308 P:envMxdizc
 
  $81/9761 EB          XBA                    A:0002 X:45D9 Y:0308 P:envmxdizc
 
  $81/9761 EB          XBA                    A:0002 X:45D9 Y:0308 P:envmxdizc
Line 7,135: Line 7,736:
 
  $81/9991 C2 21      REP #$21                A:2F8E X:45D9 Y:0276 P:eNvMxdizc
 
  $81/9991 C2 21      REP #$21                A:2F8E X:45D9 Y:0276 P:eNvMxdizc
 
  $81/9993 30 24      BMI $24    [$99B9]      A:2F8E X:45D9 Y:0276 P:eNvmxdizc
 
  $81/9993 30 24      BMI $24    [$99B9]      A:2F8E X:45D9 Y:0276 P:eNvmxdizc
;code is missing here
+
$81/9995 BD 57 00    LDA $0057,x[$7E:3970]  A:2F12 X:3919 Y:06BA P:envmxdizc
 +
$81/9998 3A          DEC A                  A:0014 X:3919 Y:06BA P:envmxdizc
 +
$81/9999 3A          DEC A                  A:0013 X:3919 Y:06BA P:envmxdizc
 +
$81/999A EB          XBA                    A:0012 X:3919 Y:06BA P:envmxdizc
 +
$81/999B 4A          LSR A                  A:1200 X:3919 Y:06BA P:envmxdiZc
 +
$81/999C 4A          LSR A                  A:0900 X:3919 Y:06BA P:envmxdizc
 +
$81/999D 65 20      ADC $20    [$00:0020]  A:0480 X:3919 Y:06BA P:envmxdizc
 +
$81/999F A8          TAY                    A:04A4 X:3919 Y:06BA P:envmxdizc
 +
$81/99A0 A9 CC 03    LDA #$03CC              A:04A4 X:3919 Y:04A4 P:envmxdizc
 +
$81/99A3 05 04      ORA $04    [$00:0004]  A:03CC X:3919 Y:04A4 P:envmxdizc
 +
$81/99A5 97 26      STA [$26],y[$7E:ACA4]  A:2FCC X:3919 Y:04A4 P:envmxdizc
 +
$81/99A7 98          TYA                    A:2FCC X:3919 Y:04A4 P:envmxdizc
 +
$81/99A8 18          CLC                    A:04A4 X:3919 Y:04A4 P:envmxdizc
 +
$81/99A9 69 40 00    ADC #$0040              A:04A4 X:3919 Y:04A4 P:envmxdizc
 +
$81/99AC 29 FF 07    AND #$07FF              A:04E4 X:3919 Y:04A4 P:envmxdizc
 +
$81/99AF A8          TAY                    A:04E4 X:3919 Y:04A4 P:envmxdizc
 +
$81/99B0 A9 CD 03    LDA #$03CD              A:04E4 X:3919 Y:04E4 P:envmxdizc
 +
$81/99B3 05 04      ORA $04    [$00:0004]  A:03CD X:3919 Y:04E4 P:envmxdizc
 +
$81/99B5 97 26      STA [$26],y[$7E:ACE4]  A:2FCD X:3919 Y:04E4 P:envmxdizc
 +
$81/99B7 80 23      BRA $23    [$99DC]      A:2FCD X:3919 Y:04E4 P:envmxdizc
 
  $81/99B9 BD 57 00    LDA $0057,x[$7E:4630]  A:2F8E X:45D9 Y:0276 P:eNvmxdizc
 
  $81/99B9 BD 57 00    LDA $0057,x[$7E:4630]  A:2F8E X:45D9 Y:0276 P:eNvmxdizc
 
  $81/99BC 7D 5B 00    ADC $005B,x[$7E:4634]  A:0003 X:45D9 Y:0276 P:envmxdizc
 
  $81/99BC 7D 5B 00    ADC $005B,x[$7E:4634]  A:0003 X:45D9 Y:0276 P:envmxdizc
Line 7,312: 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,326: 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,344: 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,387: 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,399: 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 7,609: Line 8,247:
 
  $81/9E67 29 3F      AND #$3F                A:0004 X:45D9 Y:2000 P:envMxdiZc
 
  $81/9E67 29 3F      AND #$3F                A:0004 X:45D9 Y:2000 P:envMxdiZc
 
  $81/9E69 80 01      BRA $01    [$9E6C]      A:0004 X:45D9 Y:2000 P:envMxdizc
 
  $81/9E69 80 01      BRA $01    [$9E6C]      A:0004 X:45D9 Y:2000 P:envMxdizc
 +
$81/9E6B 7B          TDC                    A:0044 X:3919 Y:2000 P:envMxdizc
 
  $81/9E6C 85 08      STA $08    [$00:0008]  A:0004 X:45D9 Y:2000 P:envMxdizc
 
  $81/9E6C 85 08      STA $08    [$00:0008]  A:0004 X:45D9 Y:2000 P:envMxdizc
 
  $81/9E6E C9 00      CMP #$00                A:0004 X:45D9 Y:2000 P:envMxdizc
 
  $81/9E6E C9 00      CMP #$00                A:0004 X:45D9 Y:2000 P:envMxdizc
Line 7,633: Line 8,272:
 
  $81/9EA0 89 40      BIT #$40                A:0004 X:45D9 Y:03EE P:envMxdizc
 
  $81/9EA0 89 40      BIT #$40                A:0004 X:45D9 Y:03EE P:envMxdizc
 
  $81/9EA2 F0 04      BEQ $04    [$9EA8]      A:0004 X:45D9 Y:03EE P:envMxdiZc
 
  $81/9EA2 F0 04      BEQ $04    [$9EA8]      A:0004 X:45D9 Y:03EE P:envMxdiZc
 +
$81/9EA4 29 3F      AND #$3F                A:0044 X:3919 Y:2000 P:envMxdizc
 +
$81/9EA6 80 01      BRA $01    [$9EA9]      A:0004 X:3919 Y:2000 P:envMxdizc
 
  $81/9EA8 7B          TDC                    A:0004 X:45D9 Y:03EE P:envMxdiZc
 
  $81/9EA8 7B          TDC                    A:0004 X:45D9 Y:03EE P:envMxdiZc
 
  $81/9EA9 85 09      STA $09    [$00:0009]  A:0000 X:45D9 Y:03EE P:envMxdiZc
 
  $81/9EA9 85 09      STA $09    [$00:0009]  A:0000 X:45D9 Y:03EE P:envMxdiZc
 
  $81/9EAB C9 00      CMP #$00                A:0000 X:45D9 Y:03EE P:envMxdiZc
 
  $81/9EAB C9 00      CMP #$00                A:0000 X:45D9 Y:03EE P:envMxdiZc
 
  $81/9EAD F0 26      BEQ $26    [$9ED5]      A:0000 X:45D9 Y:03EE P:envMxdiZC
 
  $81/9EAD F0 26      BEQ $26    [$9ED5]      A:0000 X:45D9 Y:03EE P:envMxdiZC
 +
$81/9EAF 85 04      STA $04    [$00:0004]  A:0004 X:3919 Y:2000 P:envMxdizC
 +
$81/9EB1 BD 55 00    LDA $0055,x[$7E:396E]  A:0004 X:3919 Y:2000 P:envMxdizC
 +
$81/9EB4 18          CLC                    A:0006 X:3919 Y:2000 P:envMxdizC
 +
$81/9EB5 7D 59 00    ADC $0059,x[$7E:3972]  A:0006 X:3919 Y:2000 P:envMxdizc
 +
$81/9EB8 38          SEC                    A:001D X:3919 Y:2000 P:envMxdizc
 +
$81/9EB9 E5 04      SBC $04    [$00:0004]  A:001D X:3919 Y:2000 P:envMxdizC
 +
$81/9EBB 85 02      STA $02    [$00:0002]  A:0019 X:3919 Y:2000 P:envMxdizC
 +
$81/9EBD BD 57 00    LDA $0057,x[$7E:3970]  A:0019 X:3919 Y:2000 P:envMxdizC
 +
$81/9EC0 85 03      STA $03    [$00:0003]  A:0014 X:3919 Y:2000 P:envMxdizC
 +
$81/9EC2 BD 5B 00    LDA $005B,x[$7E:3974]  A:0014 X:3919 Y:2000 P:envMxdizC
 +
$81/9EC5 85 05      STA $05    [$00:0005]  A:0006 X:3919 Y:2000 P:envMxdizC
 +
$81/9EC7 A0 EE 03    LDY #$03EE              A:0006 X:3919 Y:2000 P:envMxdizC
 +
$81/9ECA A2 00 A8    LDX #$A800              A:0006 X:3919 Y:03EE P:envMxdizC
 +
$81/9ECD A9 7E      LDA #$7E                A:0006 X:A800 Y:03EE P:eNvMxdizC
 +
$81/9ECF 22 96 D2 81 JSL $81D296[$81:D296]  A:007E X:A800 Y:03EE P:envMxdizC
 +
$81/9ED3 A6 D8      LDX $D8    [$00:00D8]  A:0000 X:A800 Y:03EE P:envMxdizc
 
  $81/9ED5 BD 55 00    LDA $0055,x[$7E:462E]  A:0000 X:45D9 Y:03EE P:envMxdiZC
 
  $81/9ED5 BD 55 00    LDA $0055,x[$7E:462E]  A:0000 X:45D9 Y:03EE P:envMxdiZC
 
  $81/9ED8 18          CLC                    A:0003 X:45D9 Y:03EE P:envMxdizC
 
  $81/9ED8 18          CLC                    A:0003 X:45D9 Y:03EE P:envMxdizC
Line 7,690: Line 8,347:
 
  $81/9F3B 89 40      BIT #$40                A:0004 X:45D9 Y:0000 P:envMxdizc
 
  $81/9F3B 89 40      BIT #$40                A:0004 X:45D9 Y:0000 P:envMxdizc
 
  $81/9F3D F0 07      BEQ $07    [$9F46]      A:0004 X:45D9 Y:0000 P:envMxdiZc
 
  $81/9F3D F0 07      BEQ $07    [$9F46]      A:0004 X:45D9 Y:0000 P:envMxdiZc
;code is missing here
+
$81/9F3F BD 59 00    LDA $0059,x[$7E:3972]  A:0044 X:3919 Y:0000 P:envMxdizc
 +
$81/9F42 38          SEC                    A:0017 X:3919 Y:0000 P:envMxdizc
 +
$81/9F43 E5 00      SBC $00    [$00:0000]  A:0017 X:3919 Y:0000 P:envMxdizC
 +
$81/9F45 A8          TAY                    A:0013 X:3919 Y:0000 P:envMxdizC
 
  $81/9F46 C2 21      REP #$21                A:0004 X:45D9 Y:0000 P:envMxdiZc
 
  $81/9F46 C2 21      REP #$21                A:0004 X:45D9 Y:0000 P:envMxdiZc
 
  $81/9F48 98          TYA                    A:0004 X:45D9 Y:0000 P:envmxdiZc
 
  $81/9F48 98          TYA                    A:0004 X:45D9 Y:0000 P:envmxdiZc
Line 7,716: Line 8,376:
 
  $81/9F8E 4A          LSR A                  A:1900 X:45D9 Y:02B0 P:envmxdizc
 
  $81/9F8E 4A          LSR A                  A:1900 X:45D9 Y:02B0 P:envmxdizc
 
  $81/9F8F 90 03      BCC $03    [$9F94]      A:0C80 X:45D9 Y:02B0 P:envmxdizc
 
  $81/9F8F 90 03      BCC $03    [$9F94]      A:0C80 X:45D9 Y:02B0 P:envmxdizc
;code is missing here
+
$81/9F91 A0 C8 02    LDY #$02C8              A:0000 X:3919 Y:02B0 P:envmxdiZC
 
  $81/9F94 98          TYA                    A:0C80 X:45D9 Y:02B0 P:envmxdizc
 
  $81/9F94 98          TYA                    A:0C80 X:45D9 Y:02B0 P:envmxdizc
 
  $81/9F95 09 00 04    ORA #$0400              A:02B0 X:45D9 Y:02B0 P:envmxdizc
 
  $81/9F95 09 00 04    ORA #$0400              A:02B0 X:45D9 Y:02B0 P:envmxdizc
Line 7,759: Line 8,419:
 
  $81/A03A A6 D8      LDX $D8    [$00:00D8]  A:0246 X:0246 Y:0542 P:envMxdizc
 
  $81/A03A A6 D8      LDX $D8    [$00:00D8]  A:0246 X:0246 Y:0542 P:envMxdizc
 
  $81/A03C 60          RTS                    A:0246 X:45D9 Y:0542 P:envMxdizc
 
  $81/A03C 60          RTS                    A:0246 X:45D9 Y:0542 P:envMxdizc
 
== $81/9F24 ? ==
 
 
$80/9F24 8B          PHB          ; Buffer Data Bank on Stack
 
$80/9F25 4B          PHK          ; Set Data Bank to $80
 
$80/9F26 AB          PLB
 
$80/9F27 20 2C 9F    JSR $9F2C  [$80:9F2C]  A:027E X:AC88 Y:3E44 P:eNvMxdizc
 
$80/9F2A AB          PLB          ; Restore Data Bank from Stack
 
$80/9F2B 6B          RTL
 
  
 
== $81/9F2C Add entry to VRAM Pipeline ==
 
== $81/9F2C Add entry to VRAM Pipeline ==
Line 7,900: Line 8,551:
 
  $81/A59F 60          RTS                    A:5C00 X:45D9 Y:03AA P:envMxdizc
 
  $81/A59F 60          RTS                    A:5C00 X:45D9 Y:03AA P:envMxdizc
  
== $81/A5A0 ? Subroutine Address Table for the subroutine above ==
 
  
  $81/A5A0 B8 A5
+
  $81/A5A0 B8 A5 --- $A5B8 - Entry #$00
  $81/A5A2 29 A6
+
  $81/A5A2 29 A6 --- $A629 - Entry #$01
  $81/A5A4 F9 A5
+
  $81/A5A4 F9 A5 --- $A5F9 - Entry #$02
  $81/A5A6 F9 A5
+
  $81/A5A6 F9 A5 --- $A5F9 - Entry #$03
  $81/A5A8 F9 A5
+
  $81/A5A8 F9 A5 --- $A5F9 - Entry #$04
  $81/A5AA E1 A5
+
  $81/A5AA E1 A5 --- $A5E1 - Entry #$05
  $81/A5AC 29 A6
+
  $81/A5AC 29 A6 --- $A629 - Entry #$06
  $81/A5AE F9 A5
+
  $81/A5AE F9 A5 --- $A5F9 - Entry #$07
  $81/A5B0 F8 A5
+
  $81/A5B0 F8 A5 --- $A5F8 - Entry #$08
  $81/A5B2 F8 A5
+
  $81/A5B2 F8 A5 --- $A5F8 - Entry #$09
  $81/A5B4 F9 A5
+
  $81/A5B4 F9 A5 --- $A5F9 - Entry #$0A
  $81/A5B6 F9 A5
+
  $81/A5B6 F9 A5 --- $A5F9 - Entry #$0B
  
 
== $81/A5B8 ? ==
 
== $81/A5B8 ? ==
Line 7,926: Line 8,576:
 
  $81/A5C8 A9 00 5C    LDA #$5C00              A:6000 X:45D9 Y:0879 P:envmxdizc
 
  $81/A5C8 A9 00 5C    LDA #$5C00              A:6000 X:45D9 Y:0879 P:envmxdizc
 
  $81/A5CB 80 09      BRA $09    [$A5D6]      A:5C00 X:45D9 Y:0879 P:envmxdizc
 
  $81/A5CB 80 09      BRA $09    [$A5D6]      A:5C00 X:45D9 Y:0879 P:envmxdizc
;code is missing here
+
$81/A5CD A9 00 5C    LDA #$5C00              A:0000 X:3919 Y:087A P:envmxdiZC
 +
$81/A5D0 9D 78 00    STA $0078,x[$7E:3991]  A:5C00 X:3919 Y:087A P:envmxdizC
 +
$81/A5D3 A9 00 58    LDA #$5800              A:5C00 X:3919 Y:087A P:envmxdizC
 
  $81/A5D6 9D 74 00    STA $0074,x[$7E:464D]  A:5C00 X:45D9 Y:0879 P:envmxdizc
 
  $81/A5D6 9D 74 00    STA $0074,x[$7E:464D]  A:5C00 X:45D9 Y:0879 P:envmxdizc
 
  $81/A5D9 9D 76 00    STA $0076,x[$7E:464F]  A:5C00 X:45D9 Y:0879 P:envmxdizc
 
  $81/A5D9 9D 76 00    STA $0076,x[$7E:464F]  A:5C00 X:45D9 Y:0879 P:envmxdizc
Line 8,032: Line 8,684:
 
  $81/A88A 60          RTS                    A:4501 X:45D9 Y:0002 P:envMxdizc
 
  $81/A88A 60          RTS                    A:4501 X:45D9 Y:0002 P:envMxdizc
  
  $81/A88B E1 A8
+
== $81/A88B ? Address Table for $81/A7FC ==
  $81/A88D D0 A9
+
 
  $81/A88F 00 00
+
  $81/A88B E1 A8 --- $A8E1 - Entry #00
  $81/A891 C3 AA
+
  $81/A88D D0 A9 --- $A9D0 - Entry #01
  $81/A893 82 AC
+
  $81/A88F 00 00 --- $0000 - Entry #02
  $81/A895 0A AD
+
  $81/A891 C3 AA --- $AAC3 - Entry #03
  $81/A897 BE AE
+
  $81/A893 82 AC --- $AC82 - Entry #04
  $81/A899 20 AF
+
  $81/A895 0A AD --- $AD0A - Entry #05
  $81/A89B 69 B0
+
  $81/A897 BE AE --- $AEBE - Entry #06
  $81/A89D D1 B1
+
  $81/A899 20 AF --- $AF20 - Entry #07
  $81/A89F 06 B2
+
  $81/A89B 69 B0 --- $B069 - Entry #08
  $81/A8A1 5A AB
+
  $81/A89D D1 B1 --- $B1D1 - Entry #09
  $81/A8A3 BA AB
+
  $81/A89F 06 B2 --- $B206 - Entry #0A
  $81/A8A5 07 AB
+
  $81/A8A1 5A AB --- $AB5A - Entry #0B
  $81/A8A7 20 B1
+
  $81/A8A3 BA AB --- $ABBA - Entry #0C
  $81/A8A9 AB A8
+
  $81/A8A5 07 AB --- $AB07 - Entry #0D
 +
  $81/A8A7 20 B1 --- $B120 - Entry #0E
 +
  $81/A8A9 AB A8 --- $A8AB - Entry #0F
  
 
== $81/A8AB ? ==
 
== $81/A8AB ? ==
Line 8,087: Line 8,741:
 
== $81/A8EF ? ==
 
== $81/A8EF ? ==
  
  $81/A8EF C2 21      REP #$21               A:0000 X:45D9 Y:0000 P:envMxdizc
+
  $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                     A:E083 X:196B Y:0000 P:eNvmxdizc
+
  $81/A902 A8          TAY           ; Buffer Compressed Data Address in Y
  $81/A903 E2 20      SEP #$20               A:E083 X:196B Y:E083 P:eNvmxdizc
+
  $81/A903 E2 20      SEP #$20     ; A = 8-bit
 
  $81/A905 BF 02 80 A3 LDA $A38002,x[$A3:996D] A:E083 X:196B Y:E083 P:eNvMxdizc
 
  $81/A905 BF 02 80 A3 LDA $A38002,x[$A3:996D] A:E083 X:196B Y:E083 P:eNvMxdizc
  $81/A909 85 00      STA $00   [$00:0000]  A:E0AA X:196B Y:E083 P:eNvMxdizc
+
  $81/A909 85 00      STA $00       ; Buffer Compressed Data Bank in $00
  $81/A90B A2 00 D4    LDX #$D400             A:E0AA X:196B Y:E083 P:eNvMxdizc
+
  $81/A90B A2 00 D4    LDX #$D400   ; Decompression Command address is $A1/D400
  $81/A90E 86 23      STX $23   [$00:0023]  A:E0AA X:D400 Y:E083 P:eNvMxdizc
+
  $81/A90E 86 23      STX $23
  $81/A910 A9 7E      LDA #$7E               A:E0AA X:D400 Y:E083 P:eNvMxdizc
+
  $81/A910 A9 7E      LDA #$7E     ; Decompression Store address on Bank $7E
  $81/A912 85 22      STA $22   [$00:0022]  A:E07E X:D400 Y:E083 P:envMxdizc
+
  $81/A912 85 22      STA $22
  $81/A914 A9 A1      LDA #$A1               A:E07E X:D400 Y:E083 P:envMxdizc
+
  $81/A914 A9 A1      LDA #$A1
  $81/A916 85 25      STA $25   [$00:0025]  A:E0A1 X:D400 Y:E083 P:eNvMxdizc
+
  $81/A916 85 25      STA $25
  $81/A918 BB          TYX                     A:E0A1 X:D400 Y:E083 P:eNvMxdizc
+
  $81/A918 BB          TYX           ; Transfer Compressed Data Address in X
  $81/A919 A5 00      LDA $00   [$00:0000]  A:E0A1 X:E083 Y:E083 P:eNvMxdizc
+
  $81/A919 A5 00      LDA $00       ; Load Compressed Data Bank in A
 
  $81/A91B 22 CC F7 81 JSL $81F7CC[$81:F7CC]  A:E0AA X:E083 Y:E083 P:eNvMxdizc
 
  $81/A91B 22 CC F7 81 JSL $81F7CC[$81:F7CC]  A:E0AA X:E083 Y:E083 P:eNvMxdizc
 
  $81/A91F C2 21      REP #$21                A:00C3 X:E0E6 Y:0092 P:envMxdizC
 
  $81/A91F C2 21      REP #$21                A:00C3 X:E0E6 Y:0092 P:envMxdizC
Line 8,143: 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 8,187: Line 8,842:
 
  $81/AA2D AB          PLB                    A:A801 X:45D9 Y:3C00 P:envMxdizc
 
  $81/AA2D AB          PLB                    A:A801 X:45D9 Y:3C00 P:envMxdizc
 
  $81/AA2E 60          RTS                    A:A801 X:45D9 Y:3C00 P:envMxdizc
 
  $81/AA2E 60          RTS                    A:A801 X:45D9 Y:3C00 P:envMxdizc
 +
 +
$81/AA2F C2 21      REP #$21                A:0006 X:45D9 Y:4EF1 P:envMxdiZC
 +
$81/AA31 BC 43 00    LDY $0043,x[$7E:461C]  A:0006 X:45D9 Y:4EF1 P:envmxdiZc
 +
$81/AA34 A5 29      LDA $29    [$00:0029]  A:0006 X:45D9 Y:45D9 P:envmxdizc
 +
$81/AA36 99 13 00    STA $0013,y[$7E:45EC]  A:4CC3 X:45D9 Y:45D9 P:envmxdizc
 +
$81/AA39 E2 20      SEP #$20                A:4CC3 X:45D9 Y:45D9 P:envmxdizc
 +
$81/AA3B A5 2B      LDA $2B    [$00:002B]  A:4CC3 X:45D9 Y:45D9 P:envMxdizc
 +
$81/AA3D 99 15 00    STA $0015,y[$7E:45EE]  A:4C7E X:45D9 Y:45D9 P:envMxdizc
 +
$81/AA40 4C AD AA    JMP $AAAD  [$81:AAAD]  A:4C7E X:45D9 Y:45D9 P:envMxdizc
 +
 +
$81/AA43 C2 21      REP #$21                A:0000 X:45D9 Y:45D9 P:envMxdizc
 +
$81/AA45 8A          TXA                    A:0000 X:45D9 Y:45D9 P:envmxdizc
 +
$81/AA46 DD 43 00    CMP $0043,x[$7E:461C]  A:45D9 X:45D9 Y:45D9 P:envmxdizc
 +
$81/AA49 F0 18      BEQ $18    [$AA63]      A:45D9 X:45D9 Y:45D9 P:eNvmxdizc
 +
$81/AA4B BD 43 00    LDA $0043,x[$7E:461C]  A:45D9 X:45D9 Y:45D9 P:eNvmxdizc
 +
$81/AA4E 3A          DEC A                  A:45DC X:45D9 Y:45D9 P:envmxdizc
 +
$81/AA4F 3A          DEC A                  A:45DB X:45D9 Y:45D9 P:envmxdizc
 +
$81/AA50 3A          DEC A                  A:45DA X:45D9 Y:45D9 P:envmxdizc
 +
$81/AA51 9D 43 00    STA $0043,x[$7E:461C]  A:45D9 X:45D9 Y:45D9 P:envmxdizc
 +
$81/AA54 A8          TAY                    A:45D9 X:45D9 Y:45D9 P:envmxdizc
 +
$81/AA55 B9 13 00    LDA $0013,y[$7E:45EC]  A:45D9 X:45D9 Y:45D9 P:envmxdizc
 +
$81/AA58 85 29      STA $29    [$00:0029]  A:4C9B X:45D9 Y:45D9 P:envmxdizc
 +
$81/AA5A E2 20      SEP #$20                A:4C9B X:45D9 Y:45D9 P:envmxdizc
 +
$81/AA5C B9 15 00    LDA $0015,y[$7E:45EE]  A:4C9B X:45D9 Y:45D9 P:envMxdizc
 +
$81/AA5F 85 2B      STA $2B    [$00:002B]  A:4C7E X:45D9 Y:45D9 P:envMxdizc
 +
$81/AA61 80 9C      BRA $9C    [$A9FF]      A:4C7E X:45D9 Y:45D9 P:envMxdizc
 +
 +
$81/AA63 E2 20      SEP #$20                A:45D9 X:45D9 Y:4D2B P:envmxdiZC
 +
$81/AA65 20 E7 C3    JSR $C3E7  [$81:C3E7]  A:45D9 X:45D9 Y:4D2B P:envMxdiZC
 +
$81/AA68 20 D8 9B    JSR $9BD8  [$81:9BD8]  A:5D0F X:45D9 Y:5D40 P:envMxdizc
 +
$81/AA6B 20 99 AB    JSR $AB99  [$81:AB99]  A:A87E X:45D9 Y:3C00 P:envMxdizc
 +
$81/AA6E B0 1C      BCS $1C    [$AA8C]      A:0003 X:45D9 Y:3C00 P:envMxdiZC
 +
;code is missing here
 +
$81/AA8C A6 D8      LDX $D8    [$00:00D8]  A:0003 X:45D9 Y:3C00 P:envMxdiZC
 +
$81/AA8E A9 04      LDA #$04                A:0003 X:45D9 Y:3C00 P:envMxdizC
 +
$81/AA90 20 FF D3    JSR $D3FF  [$81:D3FF]  A:0004 X:45D9 Y:3C00 P:envMxdizC
 +
$81/AA93 A6 D8      LDX $D8    [$00:00D8]  A:0004 X:45D9 Y:3C00 P:envMxdizC
 +
$81/AA95 BD 72 00    LDA $0072,x[$7E:464B]  A:0004 X:45D9 Y:3C00 P:envMxdizC
 +
$81/AA98 38          SEC                    A:0006 X:45D9 Y:3C00 P:envMxdizC
 +
$81/AA99 FD 19 02    SBC $0219,x[$7E:47F2]  A:0006 X:45D9 Y:3C00 P:envMxdizC
 +
$81/AA9C 4A          LSR A                  A:0002 X:45D9 Y:3C00 P:envMxdizC
 +
$81/AA9D 48          PHA                    A:0001 X:45D9 Y:3C00 P:envMxdizc
 +
$81/AA9E C2 20      REP #$20                A:0001 X:45D9 Y:3C00 P:envMxdizc
 +
$81/AAA0 20 8E C4    JSR $C48E  [$81:C48E]  A:0001 X:45D9 Y:3C00 P:envmxdizc
 +
$81/AAA3 E2 20      SEP #$20                A:0016 X:45D9 Y:4FAD P:envmxdizc
 +
$81/AAA5 68          PLA                    A:0016 X:45D9 Y:4FAD P:envMxdizc
 +
$81/AAA6 3A          DEC A                  A:0001 X:45D9 Y:4FAD P:envMxdizc
 +
$81/AAA7 D0 F4      BNE $F4    [$AA9D]      A:0000 X:45D9 Y:4FAD P:envMxdiZc
 +
$81/AAA9 A9 01      LDA #$01                A:0000 X:45D9 Y:4FAD P:envMxdiZc
 +
$81/AAAB AB          PLB                    A:0001 X:45D9 Y:4FAD P:envMxdizc
 +
$81/AAAC 60          RTS                    A:0001 X:45D9 Y:4FAD P:envMxdizc
 +
 +
$81/AAAD A6 D8      LDX $D8    [$00:00D8]  A:4C7E X:45D9 Y:45D9 P:envMxdizc
 +
$81/AAAF A5 B4      LDA $B4    [$00:00B4]  A:4C7E X:45D9 Y:45D9 P:envMxdizc
 +
$81/AAB1 9D 17 02    STA $0217,x[$7E:47F0]  A:4C01 X:45D9 Y:45D9 P:envMxdizc
 +
$81/AAB4 A9 03      LDA #$03                A:4C01 X:45D9 Y:45D9 P:envMxdizc
 +
$81/AAB6 20 19 D4    JSR $D419  [$81:D419]  A:4C03 X:45D9 Y:45D9 P:envMxdizc
 +
$81/AAB9 20 E7 C3    JSR $C3E7  [$81:C3E7]  A:45DA X:45D9 Y:45D9 P:envMxdizc
 +
$81/AABC 20 D8 9B    JSR $9BD8  [$81:9BD8]  A:5C0F X:45D9 Y:45D9 P:envMxdizC
 +
$81/AABF A9 01      LDA #$01                A:A87E X:45D9 Y:3C00 P:envMxdizc
 +
$81/AAC1 AB          PLB                    A:A801 X:45D9 Y:3C00 P:envMxdizc
 +
$81/AAC2 60          RTS                    A:A801 X:45D9 Y:3C00 P:envMxdizc
 +
 +
== $81/AAC3 ? TEXTBOX related? ==
 +
 +
$81/AAC3 A6 D8      LDX $D8    [$00:00D8]  A:0000 X:0006 Y:0006 P:envMxdizc
 +
$81/AAC5 BD 1B 02    LDA $021B,x[$7E:47F4]  A:0000 X:45D9 Y:0006 P:envMxdizc
 +
$81/AAC8 DD 72 00    CMP $0072,x[$7E:464B]  A:0006 X:45D9 Y:0006 P:envMxdizc
 +
$81/AACB 90 09      BCC $09    [$AAD6]      A:0006 X:45D9 Y:0006 P:envMxdiZC
 +
$81/AACD 9E 2E 02    STZ $022E,x[$7E:4807]  A:0006 X:45D9 Y:0006 P:envMxdiZC
 +
$81/AAD0 9E 1B 02    STZ $021B,x[$7E:47F4]  A:0006 X:45D9 Y:0006 P:envMxdiZC
 +
$81/AAD3 4C 3F AB    JMP $AB3F  [$81:AB3F]  A:0006 X:45D9 Y:0006 P:envMxdiZC
 +
;code is missing here
 +
$81/AB3F A6 D8      LDX $D8    [$00:00D8]  A:0006 X:45D9 Y:0006 P:envMxdiZC
 +
$81/AB41 20 99 AB    JSR $AB99  [$81:AB99]  A:0006 X:45D9 Y:0006 P:envMxdizC
 +
$81/AB44 B0 0F      BCS $0F    [$AB55]      A:0003 X:45D9 Y:0006 P:envMxdiZC
 +
;code is missing here
 +
$81/AB55 A9 0B      LDA #$0B                A:0003 X:45D9 Y:0006 P:envMxdiZC
 +
$81/AB57 20 19 D4    JSR $D419  [$81:D419]  A:000B X:45D9 Y:0006 P:envMxdizC
 +
$81/AB5A A6 D8      LDX $D8    [$00:00D8]  A:45DB X:45D9 Y:0006 P:envMxdizC
 +
$81/AB5C 20 DE AC    JSR $ACDE  [$81:ACDE]  A:45DB X:45D9 Y:0006 P:envMxdizC
 +
$81/AB5F AD 65 05    LDA $0565  [$7E:0565]  A:FFFF X:45D9 Y:4E9B P:envMxdiZC
 +
$81/AB62 89 80      BIT #$80                A:FF00 X:45D9 Y:4E9B P:envMxdiZC
 +
$81/AB64 D0 05      BNE $05    [$AB6B]      A:FF00 X:45D9 Y:4E9B P:envMxdiZC
 +
$81/AB66 20 EE AB    JSR $ABEE  [$81:ABEE]  A:FF00 X:45D9 Y:4E9B P:envMxdiZC
 +
$81/AB69 80 24      BRA $24    [$AB8F]      A:D900 X:45D9 Y:6F80 P:envMxdizc
 +
$81/AB6B 20 AE AB    JSR $ABAE  [$81:ABAE]  A:FF80 X:45D9 Y:4E9B P:eNvMxdizC
 +
$81/AB6E A6 D8      LDX $D8    [$00:00D8]  A:FF00 X:45D9 Y:4E9B P:envMxdiZC
 +
$81/AB70 20 F1 AB    JSR $ABF1    ; Show and animate Gloved Hand
 +
$81/AB73 20 2F D4    JSR $D42F  [$81:D42F]  A:2301 X:45D9 Y:0006 P:envMxdizc
 +
$81/AB76 A5 A5      LDA $A5    [$00:00A5]  A:2301 X:45D9 Y:0006 P:envMxdizc
 +
$81/AB78 89 08      BIT #$08                A:230C X:45D9 Y:0006 P:envMxdizc
 +
$81/AB7A F0 13      BEQ $13    [$AB8F]      A:230C X:45D9 Y:0006 P:envMxdizc
 +
$81/AB7C 20 2F D4    JSR $D42F  [$81:D42F]  A:230C X:45D9 Y:0006 P:envMxdizc
 +
$81/AB7F 20 11 CF    JSR $CF11  [$81:CF11]  A:230C X:45D9 Y:0006 P:envMxdizc
 +
$81/AB82 A6 D8      LDX $D8    [$00:00D8]  A:23EE X:45D9 Y:45D9 P:eNvMxdizc
 +
$81/AB84 9E 1B 02    STZ $021B,x[$7E:47F4]  A:23EE X:45D9 Y:45D9 P:envMxdizc
 +
$81/AB87 A9 FF      LDA #$FF                A:23EE X:45D9 Y:45D9 P:envMxdizc
 +
$81/AB89 9D 17 02    STA $0217,x[$7E:47F0]  A:23FF X:45D9 Y:45D9 P:eNvMxdizc
 +
$81/AB8C 9E 19 02    STZ $0219,x[$7E:47F2]  A:23FF X:45D9 Y:45D9 P:eNvMxdizc
 +
$81/AB8F 20 E7 C3    JSR $C3E7  [$81:C3E7]  A:D900 X:45D9 Y:6F80 P:envMxdizc
 +
$81/AB92 20 D8 9B    JSR $9BD8  [$81:9BD8]  A:5C0F X:45D9 Y:45D9 P:envMxdizC
 +
$81/AB95 A9 01      LDA #$01                A:A87E X:45D9 Y:3C00 P:envMxdizc
 +
$81/AB97 AB          PLB                    A:A801 X:45D9 Y:3C00 P:envMxdizc
 +
$81/AB98 60          RTS                    A:A801 X:45D9 Y:3C00 P:envMxdizc
  
 
== $81/AB99 ? ==
 
== $81/AB99 ? ==
Line 8,213: Line 8,973:
 
  $81/ABEF 80 02      BRA $02    [$ABF3]      A:0000 X:45D9 Y:4E9B P:envMxdiZC
 
  $81/ABEF 80 02      BRA $02    [$ABF3]      A:0000 X:45D9 Y:4E9B P:envMxdiZC
  
== $81/ABF1 ? ==
+
== $81/ABF1 TEXTBOX: Show and animate Gloved Hand ==
 +
 
 +
At the End of a Textbox, there can appear a Gloved Hand Icon that moves up and down to signalize that this message will go on. This gets animated here.
  
 
  $81/ABF1 A9 01      LDA #$01                A:FF00 X:45D9 Y:4E9B P:envMxdizC
 
  $81/ABF1 A9 01      LDA #$01                A:FF00 X:45D9 Y:4E9B P:envMxdizC
Line 8,220: Line 8,982:
 
  $81/ABF5 20 1E BC    JSR $BC1E  [$81:BC1E]  A:0000 X:45D9 Y:4E9B P:envMxdiZC
 
  $81/ABF5 20 1E BC    JSR $BC1E  [$81:BC1E]  A:0000 X:45D9 Y:4E9B P:envMxdiZC
 
  $81/ABF8 85 04      STA $04    [$00:0004]  A:00D0 X:45D9 Y:4E9B P:envmxdizc
 
  $81/ABF8 85 04      STA $04    [$00:0004]  A:00D0 X:45D9 Y:4E9B P:envmxdizc
  $81/ABFA A5 00      LDA $00   [$00:0000]  A:00D0 X:45D9 Y:4E9B P:envmxdizc
+
  $81/ABFA A5 00      LDA $00       ; Load X-Position of the right corner of the active textbox? (result of testing)
  $81/ABFC 3A          DEC A                   A:0013 X:45D9 Y:4E9B P:envmxdizc
+
  $81/ABFC 3A          DEC A         ; Decrement twice to move the Gloved Hand 2 Tiles to the left
  $81/ABFD 3A          DEC A                   A:0012 X:45D9 Y:4E9B P:envmxdizc
+
  $81/ABFD 3A          DEC A
  $81/ABFE 0A          ASL A                   A:0011 X:45D9 Y:4E9B P:envmxdizc
+
  $81/ABFE 0A          ASL A         ; Multiply by 2
 
  $81/ABFF 65 04      ADC $04    [$00:0004]  A:0022 X:45D9 Y:4E9B P:envmxdizc
 
  $81/ABFF 65 04      ADC $04    [$00:0004]  A:0022 X:45D9 Y:4E9B P:envmxdizc
 
  $81/AC01 29 FF 07    AND #$07FF              A:00F2 X:45D9 Y:4E9B P:envmxdizc
 
  $81/AC01 29 FF 07    AND #$07FF              A:00F2 X:45D9 Y:4E9B P:envmxdizc
 
  $81/AC04 85 04      STA $04    [$00:0004]  A:00F2 X:45D9 Y:4E9B P:envmxdizc
 
  $81/AC04 85 04      STA $04    [$00:0004]  A:00F2 X:45D9 Y:4E9B P:envmxdizc
  $81/AC06 A5 02      LDA $02   [$00:0002]  A:00F2 X:45D9 Y:4E9B P:envmxdizc
+
  $81/AC06 A5 02      LDA $02       ; Load Y-Position of the lower edge of the active textbox? (result of testing)
  $81/AC08 3A          DEC A                   A:0005 X:45D9 Y:4E9B P:envmxdizc
+
  $81/AC08 3A          DEC A         ; Decrement to move the Gloved Hand one Tile up
  $81/AC09 EB          XBA                     A:0004 X:45D9 Y:4E9B P:envmxdizc
+
  $81/AC09 EB          XBA           ; Multiply by #$20 (one Tilemap line = #$20 bytes)
  $81/AC0A 4A          LSR A                   A:0400 X:45D9 Y:4E9B P:envmxdiZc
+
  $81/AC0A 4A          LSR A
  $81/AC0B 4A          LSR A                   A:0200 X:45D9 Y:4E9B P:envmxdizc
+
  $81/AC0B 4A          LSR A
  $81/AC0C 65 04      ADC $04   [$00:0004]  A:0100 X:45D9 Y:4E9B P:envmxdizc
+
  $81/AC0C 65 04      ADC $04       ; Add X-Position in this line
 
  $81/AC0E 29 FF 07    AND #$07FF              A:01F2 X:45D9 Y:4E9B P:envmxdizc
 
  $81/AC0E 29 FF 07    AND #$07FF              A:01F2 X:45D9 Y:4E9B P:envmxdizc
  $81/AC11 AA          TAX                     A:01F2 X:45D9 Y:4E9B P:envmxdizc
+
  $81/AC11 AA          TAX           ; Transfer in X as Store Index
 
  $81/AC12 A3 01      LDA $01,s  [$00:1FC3]  A:01F2 X:01F2 Y:4E9B P:envmxdizc
 
  $81/AC12 A3 01      LDA $01,s  [$00:1FC3]  A:01F2 X:01F2 Y:4E9B P:envmxdizc
 
  $81/AC14 F0 05      BEQ $05    [$AC1B]      A:0000 X:01F2 Y:4E9B P:envmxdiZc
 
  $81/AC14 F0 05      BEQ $05    [$AC1B]      A:0000 X:01F2 Y:4E9B P:envmxdiZc
  $81/AC16 A0 E6 AB    LDY #$ABE6             A:0101 X:01F2 Y:4E9B P:envmxdizc
+
  $81/AC16 A0 E6 AB    LDY #$ABE6   ; Tilemap Address for the Gloved Hand Icon
 
  $81/AC19 80 03      BRA $03    [$AC1E]      A:0101 X:01F2 Y:ABE6 P:eNvmxdizc
 
  $81/AC19 80 03      BRA $03    [$AC1E]      A:0101 X:01F2 Y:ABE6 P:eNvmxdizc
  $81/AC1B A0 DE AB    LDY #$ABDE             A:0000 X:01F2 Y:4E9B P:envmxdiZc
+
  $81/AC1B A0 DE AB    LDY #$ABDE   ; Tilemap Address to hide the Gloved Hand Icon
  $81/AC1E 84 20      STY $20   [$00:0020]   A:0000 X:01F2 Y:ABDE P:eNvmxdizc
+
  $81/AC1E 84 20      STY $20       ; Build source address of Tilemap in [$20]
  $81/AC20 E2 20      SEP #$20               A:0000 X:01F2 Y:ABDE P:eNvmxdizc
+
  $81/AC20 E2 20      SEP #$20     ; A = 8-bit
  $81/AC22 A9 81      LDA #$81               A:0000 X:01F2 Y:ABDE P:eNvMxdizc
+
  $81/AC22 A9 81      LDA #$81     ; Bank of the Tilemap is in both cases $81
  $81/AC24 85 22      STA $22   [$00:0022]  A:0081 X:01F2 Y:ABDE P:eNvMxdizc
+
  $81/AC24 85 22      STA $22
  $81/AC26 20 51 AC    JSR $AC51 [$81:AC51]  A:0081 X:01F2 Y:ABDE P:eNvMxdizc
+
  $81/AC26 20 51 AC    JSR $AC51     ; Write Gloved Hand Icon into BG Tilemap buffer (2x2 tiles)
 
  $81/AC29 A3 01      LDA $01,s  [$00:1FC3]  A:23F3 X:01F2 Y:0006 P:eNvMxdizc
 
  $81/AC29 A3 01      LDA $01,s  [$00:1FC3]  A:23F3 X:01F2 Y:0006 P:eNvMxdizc
 
  $81/AC2B D0 1F      BNE $1F    [$AC4C]      A:2300 X:01F2 Y:0006 P:envMxdiZc
 
  $81/AC2B D0 1F      BNE $1F    [$AC4C]      A:2300 X:01F2 Y:0006 P:envMxdiZc
  $81/AC2D A2 D7 D9    LDX #$D9D7             A:2300 X:01F2 Y:0006 P:envMxdiZc
+
  $81/AC2D A2 D7 D9    LDX #$D9D7   ; DMA Source Address 1 - Gloved Hand Up sprite tiles
  $81/AC30 AD B9 05    LDA $05B9 [$7E:05B9]  A:2300 X:D9D7 Y:0006 P:eNvMxdizc
+
  $81/AC30 AD B9 05    LDA $05B9     ; Load General Frame Counter to decide which tiles to take
  $81/AC33 89 10      BIT #$10               A:23E2 X:D9D7 Y:0006 P:eNvMxdizc
+
  $81/AC33 89 10      BIT #$10     ; Each 16 frames, the animation changes
  $81/AC35 F0 03      BEQ $03   [$AC3A]     A:23E2 X:D9D7 Y:0006 P:eNvMxdiZc
+
  $81/AC35 F0 03      BEQ $03       ; [$AC3A] If Bit is set, use Source Address 2
  $81/AC37 A2 17 DA    LDX #$DA17             A:23F5 X:D9D7 Y:0006 P:eNvMxdizc
+
  $81/AC37 A2 17 DA    LDX #$DA17   ; DMA Source Address 2 - Gloved Hand Down sprite tiles
  $81/AC3A A0 40 00    LDY #$0040             A:23E2 X:D9D7 Y:0006 P:eNvMxdiZc
+
  $81/AC3A A0 40 00    LDY #$0040   ; Number of Bytes to transfer
  $81/AC3D 84 0C      STY $0C   [$00:000C]  A:23E2 X:D9D7 Y:0040 P:envMxdizc
+
  $81/AC3D 84 0C      STY $0C
  $81/AC3F A0 80 6F    LDY #$6F80             A:23E2 X:D9D7 Y:0040 P:envMxdizc
+
  $81/AC3F A0 80 6F    LDY #$6F80   ; VRAM Destination
  $81/AC42 A9 80      LDA #$80               A:23E2 X:D9D7 Y:6F80 P:envMxdizc
+
  $81/AC42 A9 80      LDA #$80     ; VRAM Settings (for $2115)
  $81/AC44 85 0E      STA $0E   [$00:000E]  A:2380 X:D9D7 Y:6F80 P:eNvMxdizc
+
  $81/AC44 85 0E      STA $0E
  $81/AC46 A9 81      LDA #$81               A:2380 X:D9D7 Y:6F80 P:eNvMxdizc
+
  $81/AC46 A9 81      LDA #$81     ; DMA Source Bank
  $81/AC48 22 24 9F 80 JSL $809F24[$80:9F24]   A:2381 X:D9D7 Y:6F80 P:eNvMxdizc
+
  $81/AC48 22 24 9F 80 JSL $809F24  ; VRAM DMA
 
  $81/AC4C 68          PLA                    A:D980 X:0000 Y:6F80 P:envMxdizc
 
  $81/AC4C 68          PLA                    A:D980 X:0000 Y:6F80 P:envMxdizc
 
  $81/AC4D 68          PLA                    A:D900 X:0000 Y:6F80 P:envMxdiZc
 
  $81/AC4D 68          PLA                    A:D900 X:0000 Y:6F80 P:envMxdiZc
Line 8,264: Line 9,026:
 
  $81/AC50 60          RTS                    A:D900 X:45D9 Y:6F80 P:envMxdizc
 
  $81/AC50 60          RTS                    A:D900 X:45D9 Y:6F80 P:envMxdizc
  
== $81/AC51 ? ==
+
== $81/AC51 TEXTBOX: Write Glove Hand into Tilemap ==
  
 
This loads four subsequent double-bytes from [$20] and puts it to x, x+2, x+#$40 and x+#$42.
 
This loads four subsequent double-bytes from [$20] and puts it to x, x+2, x+#$40 and x+#$42.
Line 8,360: Line 9,122:
 
  $81/ADE2 C6 0E      DEC $0E    [$00:000E]  A:420D X:3919 Y:420D P:envmxdizc
 
  $81/ADE2 C6 0E      DEC $0E    [$00:000E]  A:420D X:3919 Y:420D P:envmxdizc
 
  $81/ADE4 D0 EE      BNE $EE    [$ADD4]      A:420D X:3919 Y:420D P:envmxdizc
 
  $81/ADE4 D0 EE      BNE $EE    [$ADD4]      A:420D X:3919 Y:420D P:envmxdizc
 +
$81/ADE6 18          CLC                    A:4EF1 X:45D9 Y:4EF1 P:envmxdiZc
 
  $81/ADE7 E2 20      SEP #$20                A:FFFF X:3919 Y:41DB P:envmxdiZC
 
  $81/ADE7 E2 20      SEP #$20                A:FFFF X:3919 Y:41DB P:envmxdiZC
 
  $81/ADE9 60          RTS                    A:FFFF X:3919 Y:41DB P:envMxdiZC
 
  $81/ADE9 60          RTS                    A:FFFF X:3919 Y:41DB P:envMxdiZC
Line 8,516: Line 9,279:
 
  $81/BC41 6F 16 42 00 ADC $004216[$00:4216]  A:0010 X:45D9 Y:4E9B P:envmxdizc
 
  $81/BC41 6F 16 42 00 ADC $004216[$00:4216]  A:0010 X:45D9 Y:4E9B P:envmxdizc
 
  $81/BC45 60          RTS                    A:00D0 X:45D9 Y:4E9B P:envmxdizc
 
  $81/BC45 60          RTS                    A:00D0 X:45D9 Y:4E9B P:envmxdizc
 +
 +
== $81/BCA7 ? ==
 +
 +
$81/BCA7 BD 19 02    LDA $0219,x[$7E:47F2]  A:978C X:45D9 Y:45D9 P:envMxdizC
 +
$81/BCAA DD 72 00    CMP $0072,x[$7E:464B]  A:9700 X:45D9 Y:45D9 P:envMxdiZC
 +
$81/BCAD 60          RTS                    A:9700 X:45D9 Y:45D9 P:eNvMxdizc
  
 
== $81/BCAE ? ==
 
== $81/BCAE ? ==
Line 8,523: 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
;code is missing here
+
$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/BCC6 38         SEC                     A:0001 X:45D9 Y:45D9 P:envMxdizC
 +
  $81/BCC7 60          RTS                    A:0001 X:45D9 Y:45D9 P:envMxdizC
 
  $81/BCC8 A4 D8      LDY $D8    [$00:00D8]  A:0001 X:45D9 Y:4D2B P:envMxdizC
 
  $81/BCC8 A4 D8      LDY $D8    [$00:00D8]  A:0001 X:45D9 Y:4D2B P:envMxdizC
 
  $81/BCCA 7B          TDC                    A:0001 X:45D9 Y:45D9 P:envMxdizC
 
  $81/BCCA 7B          TDC                    A:0001 X:45D9 Y:45D9 P:envMxdizC
Line 8,543: Line 9,315:
 
  $81/BCE0 AA          TAX                    A:0000 X:45D9 Y:45D9 P:envmxdiZc
 
  $81/BCE0 AA          TAX                    A:0000 X:45D9 Y:45D9 P:envmxdiZc
 
  $81/BCE1 7C E4 BC    JMP ($BCE4,x)[$81:BF99] A:0000 X:0000 Y:45D9 P:envmxdiZc
 
  $81/BCE1 7C E4 BC    JMP ($BCE4,x)[$81:BF99] A:0000 X:0000 Y:45D9 P:envmxdiZc
;table is missing here
+
 
 +
$81/BCE4 99 BF --- Entry #$00 - $BF99
 +
$81/BCE6 B4 BD --- Entry #$01 - $BDB4
 +
$81/BCE8 B4 BD --- Entry #$02 - $BDB4
 +
$81/BCEA B4 BD --- Entry #$03 - $BDB4
 +
$81/BCEC B4 BD --- Entry #$04 - $BDB4
 +
$81/BCEE B4 BD --- Entry #$05 - $BDB4
 +
$81/BCF0 B4 BD --- Entry #$06 - $BDB4
 +
$81/BCF2 B4 BD --- Entry #$07 - $BDB4
 +
$81/BCF4 B4 BD --- Entry #$08 - $BDB4
 +
$81/BCF6 B4 BD --- Entry #$09 - $BDB4
 +
$81/BCF8 B4 BD --- Entry #$0A - $BDB4
 +
$81/BCFA B4 BD --- Entry #$0B - $BDB4
 +
$81/BCFC B4 BD --- Entry #$0C - $BDB4
 +
$81/BCFE B4 BD --- Entry #$0D - $BDB4
 +
$81/BD00 B4 BD --- Entry #$0E - $BDB4
 +
$81/BD02 B4 BD --- Entry #$0F - $BDB4
 +
$81/BD04 9D BD --- Entry #$10 - $BD9D
 +
$81/BD06 9D BD --- Entry #$11 - $BD9D
 +
$81/BD08 70 BE --- Entry #$12 - $BE70
 +
$81/BD0A 8D BE --- Entry #$13 - $BE8D
 +
$81/BD0C 03 BE --- Entry #$14 - $BE03
 +
$81/BD0E AA BE --- Entry #$15 - $BEAA
 +
$81/BD10 41 BE --- Entry #$16 - $BE41
 +
$81/BD12 62 BE --- Entry #$17 - $BE62
 +
$81/BD14 E5 BD --- Entry #$18 - $BDE5
 +
$81/BD16 B1 BE --- Entry #$19 - $BEB1
 +
$81/BD18 E6 BE --- Entry #$1A - $BEE6
 +
$81/BD1A 64 BF --- Entry #$1B - $BF64
 +
$81/BD1C F8 BE --- Entry #$1C - $BEF8
 +
$81/BD1E 10 BF --- Entry #$1D - $BF10
 +
$81/BD20 28 BD --- Entry #$1E - $BD28
 +
$81/BD22 6B BD --- Entry #$1F - $BD6B
  
 
== $81/BD98 ? ==
 
== $81/BD98 ? ==
Line 8,562: Line 9,366:
 
  $81/BDAF 20 DA C4    JSR $C4DA  [$81:C4DA]  A:00C1 X:45D9 Y:45D9 P:eNvmxdizc
 
  $81/BDAF 20 DA C4    JSR $C4DA  [$81:C4DA]  A:00C1 X:45D9 Y:45D9 P:eNvmxdizc
 
  $81/BDB2 80 E4      BRA $E4    [$BD98]      A:233A X:0110 Y:45D9 P:envMxdizc
 
  $81/BDB2 80 E4      BRA $E4    [$BD98]      A:233A X:0110 Y:45D9 P:envMxdizc
 +
 +
== $81/BDB4 ? ==
 +
 +
$81/BDB4 E2 20      SEP #$20                A:0008 X:0008 Y:45D9 P:envmxdizc
 +
$81/BDB6 20 AE C3    JSR $C3AE  [$81:C3AE]  A:0008 X:0008 Y:45D9 P:envMxdizc
 +
$81/BDB9 C2 20      REP #$20                A:0008 X:45D9 Y:45D9 P:envMxdizc
 +
$81/BDBB B0 DB      BCS $DB    [$BD98]      A:0008 X:45D9 Y:45D9 P:envmxdizc
 +
$81/BDBD A7 29      LDA [$29]  [$7E:4CA0]  A:0008 X:45D9 Y:45D9 P:envmxdizc
 +
$81/BDBF EB          XBA                    A:6904 X:45D9 Y:45D9 P:envmxdizc
 +
$81/BDC0 E6 29      INC $29    [$00:0029]  A:0469 X:45D9 Y:45D9 P:envmxdizc
 +
$81/BDC2 E6 29      INC $29    [$00:0029]  A:0469 X:45D9 Y:45D9 P:envmxdizc
 +
$81/BDC4 20 DA C4    JSR $C4DA  [$81:C4DA]  A:0469 X:45D9 Y:45D9 P:envmxdizc
 +
$81/BDC7 80 CF      BRA $CF    [$BD98]      A:2181 X:01A0 Y:45D9 P:envMxdizc
  
 
== $81/BDC9 ? ==
 
== $81/BDC9 ? ==
Line 8,579: Line 9,396:
 
  $81/BDE1 A6 D8      LDX $D8    [$00:00D8]  A:978C X:07C0 Y:45D9 P:eNvMxdizc
 
  $81/BDE1 A6 D8      LDX $D8    [$00:00D8]  A:978C X:07C0 Y:45D9 P:eNvMxdizc
 
  $81/BDE3 80 B3      BRA $B3    [$BD98]      A:978C X:45D9 Y:45D9 P:envMxdizc
 
  $81/BDE3 80 B3      BRA $B3    [$BD98]      A:978C X:45D9 Y:45D9 P:envMxdizc
 +
 +
== $81/BDE5 ? ==
 +
 +
$81/BDE5 20 9E BF    JSR $BF9E  [$81:BF9E]  A:0030 X:0030 Y:3919 P:envmxdizc
 +
$81/BDE8 E6 29      INC $29    [$00:0029]  A:3F7E X:3919 Y:3919 P:envmxdizc
 +
$81/BDEA E2 20      SEP #$20                A:3F7E X:3919 Y:3919 P:envmxdizc
 +
$81/BDEC A6 D8      LDX $D8    [$00:00D8]  A:3F7E X:3919 Y:3919 P:envMxdizc
 +
$81/BDEE BC 3A 02    LDY $023A,x[$7E:3B53]  A:3F7E X:3919 Y:3919 P:envMxdizc
 +
$81/BDF1 A7 29      LDA [$29]  [$7E:3FDA]  A:3F7E X:3919 Y:0000 P:envMxdiZc
 +
$81/BDF3 22 F0 E6 81 JSL $81E6F0[$81:E6F0]  A:3F0D X:3919 Y:0000 P:envMxdizc
 +
$81/BDF7 84 29      STY $29    [$00:0029]  A:007E X:0018 Y:B824 P:envMxdizc
 +
$81/BDF9 85 2B      STA $2B    [$00:002B]  A:007E X:0018 Y:B824 P:envMxdizc
 +
$81/BDFB A6 D8      LDX $D8    [$00:00D8]  A:007E X:0018 Y:B824 P:envMxdizc
 +
$81/BDFD FE 3A 02    INC $023A,x[$7E:3B53]  A:007E X:3919 Y:B824 P:envMxdizc
 +
$81/BE00 4C 98 BD    JMP $BD98  [$81:BD98]  A:007E X:3919 Y:B824 P:envMxdizc
 +
 +
== $81/BE41 ? ==
 +
 +
$81/BE41 E6 29      INC $29    [$00:0029]  A:002C X:002C Y:45D9 P:envmxdizc
 +
$81/BE43 E2 20      SEP #$20                A:002C X:002C Y:45D9 P:envmxdizc
 +
$81/BE45 A9 FF      LDA #$FF                A:002C X:002C Y:45D9 P:envMxdizc
 +
$81/BE47 99 17 02    STA $0217,y[$7E:47F0]  A:00FF X:002C Y:45D9 P:eNvMxdizc
 +
$81/BE4A B9 19 02    LDA $0219,y[$7E:47F2]  A:00FF X:002C Y:45D9 P:eNvMxdizc
 +
$81/BE4D 1A          INC A                  A:0000 X:002C Y:45D9 P:envMxdiZc
 +
$81/BE4E 1A          INC A                  A:0001 X:002C Y:45D9 P:envMxdizc
 +
$81/BE4F 99 19 02    STA $0219,y[$7E:47F2]  A:0002 X:002C Y:45D9 P:envMxdizc
 +
$81/BE52 B9 1B 02    LDA $021B,y[$7E:47F4]  A:0002 X:002C Y:45D9 P:envMxdizc
 +
$81/BE55 1A          INC A                  A:0000 X:002C Y:45D9 P:envMxdiZc
 +
$81/BE56 1A          INC A                  A:0001 X:002C Y:45D9 P:envMxdizc
 +
$81/BE57 99 1B 02    STA $021B,y[$7E:47F4]  A:0002 X:002C Y:45D9 P:envMxdizc
 +
$81/BE5A C2 20      REP #$20                A:0002 X:002C Y:45D9 P:envMxdizc
 +
$81/BE5C 20 8E C4    JSR $C48E  [$81:C48E]  A:0002 X:002C Y:45D9 P:envmxdizc
 +
$81/BE5F 4C 98 BD    JMP $BD98  [$81:BD98]  A:0016 X:002C Y:4EA5 P:envmxdizc
 +
 +
== $81/BF99 ? ==
 +
 +
$81/BF99 BB          TYX                    A:0000 X:0000 Y:45D9 P:envmxdiZc
 +
$81/BF9A E2 20      SEP #$20                A:0000 X:45D9 Y:45D9 P:envmxdizc
 +
$81/BF9C 18          CLC                    A:0000 X:45D9 Y:45D9 P:envMxdizc
 +
$81/BF9D 60          RTS                    A:0000 X:45D9 Y:45D9 P:envMxdizc
  
 
== $81/BF9E ? ==
 
== $81/BF9E ? ==
Line 8,616: 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 8,627: 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 8,635: 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 8,645: 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 9,093: Line 9,950:
 
  $81/D45B 88          DEY                    A:0001 X:3919 Y:0003 P:envMxdizc
 
  $81/D45B 88          DEY                    A:0001 X:3919 Y:0003 P:envMxdizc
 
  $81/D45C 10 F3      BPL $F3    [$D451]      A:0001 X:3919 Y:0002 P:envMxdizc
 
  $81/D45C 10 F3      BPL $F3    [$D451]      A:0001 X:3919 Y:0002 P:envMxdizc
; code is missing here
+
$81/D45E 68          PLA          ; Restore A from Stack
 +
$81/D45F 38          SEC                    A:0002 X:3300 Y:FFFE P:envMxdizC
 +
$81/D460 60          RTS                    A:0002 X:3300 Y:FFFE P:envMxdizC
 
  $81/D461 68          PLA          ; Restore A from Stack
 
  $81/D461 68          PLA          ; Restore A from Stack
 
  $81/D462 18          CLC                    A:0002 X:3911 Y:0002 P:envMxdizC
 
  $81/D462 18          CLC                    A:0002 X:3911 Y:0002 P:envMxdizC
Line 9,102: Line 9,961:
 
  $81/D4B0 22 7B F5 81 JSL $81F57B[$81:F57B]  A:0032 X:3300 Y:0879 P:envMxdizc
 
  $81/D4B0 22 7B F5 81 JSL $81F57B[$81:F57B]  A:0032 X:3300 Y:0879 P:envMxdizc
 
  $81/D4B4 6B          RTL                    A:0032 X:0013 Y:0009 P:envMxdizc
 
  $81/D4B4 6B          RTL                    A:0032 X:0013 Y:0009 P:envMxdizc
 +
 +
== $81/D9D7 GRAPHICS: Textbox "Go On" Hand Sprite, Low Position ==
 +
 +
SIZE: $40, ($81/D9D7 - $81/DA16)
 +
USED AT: $81/ABF1
 +
 +
At the End of a Textbox, there can appear a Gloved Hand Icon that moves up and down to signalize that this message will go on. These $40 bytes are the sprites tiles for the low position of this Gloved Hand.
 +
 +
== $81/DA17 GRAPHICS: Textbox "Go On" Hand Sprite, High Position ==
 +
 +
SIZE: $40, ($81/DA17 - $81/DA46)
 +
USED AT: $81/ABF1
 +
 +
At the End of a Textbox, there can appear a Gloved Hand Icon that moves up and down to signalize that this message will go on. These $40 bytes are the sprites tiles for the high position of this Gloved Hand.
  
 
== $81/DA64 ? ==
 
== $81/DA64 ? ==
Line 9,234: Line 10,107:
 
  $81/E81D 6B          RTL                    A:007E X:0018 Y:B824 P:envMxdizc
 
  $81/E81D 6B          RTL                    A:007E X:0018 Y:B824 P:envMxdizc
  
== $81/E836 ? ==
+
== $81/E836 ? Deactivate HDMA Window mask and other stuff ==
  
This clears $175F and alle registers from $176D to $1775.
+
This clears $175F and all registers from $176D to $1775.
  
  $81/E836 9C 5F 17    STZ $175F [$80:175F]  A:A108 X:00DC Y:0000 P:envMxdizC
+
  $81/E836 9C 5F 17    STZ $175F     ; Deactivate HDMA Window mask
  $81/E839 A2 00 B1    LDX #$B100             A:A108 X:00DC Y:0000 P:envMxdizC
+
  $81/E839 A2 00 B1    LDX #$B100     ; (Re?)set Window Mask HDMA Table Start Address to $B100
  $81/E83C 8E 61 17    STX $1761 [$80:1761]  A:A108 X:B100 Y:0000 P:eNvMxdizC
+
  $81/E83C 8E 61 17    STX $1761
 
  $81/E83F A2 08 00    LDX #$0008    ; Setup Loop counter
 
  $81/E83F A2 08 00    LDX #$0008    ; Setup Loop counter
 
  $81/E842 9E 6D 17    STZ $176D,x    ; Clear $176D-$1775
 
  $81/E842 9E 6D 17    STZ $176D,x    ; Clear $176D-$1775
Line 9,430: Line 10,303:
 
== $81/E9D7 ? ==
 
== $81/E9D7 ? ==
  
  $81/E9D7 C2 20      REP #$20               A:0032 X:5299 Y:2B00 P:envMxdizc
+
Executed every time a textbox pops up.
  $81/E9D9 29 FF 00    AND #$00FF             A:0032 X:5299 Y:2B00 P:envmxdizc
+
 
  $81/E9DC 0A          ASL A                   A:0032 X:5299 Y:2B00 P:envmxdizc
+
  $81/E9D7 C2 20      REP #$20     ; A = 16-bit
  $81/E9DD 0A          ASL A                   A:0064 X:5299 Y:2B00 P:envmxdizc
+
  $81/E9D9 29 FF 00    AND #$00FF   ; Clear High Byte of A
  $81/E9DE 0A          ASL A                   A:00C8 X:5299 Y:2B00 P:envmxdizc
+
  $81/E9DC 0A          ASL A         ; Multiply A by 8
  $81/E9DF 48          PHA                     A:0190 X:5299 Y:2B00 P:envmxdizc
+
  $81/E9DD 0A          ASL A
  $81/E9E0 E2 20      SEP #$20               A:0190 X:5299 Y:2B00 P:envmxdizc
+
  $81/E9DE 0A          ASL A
 +
  $81/E9DF 48          PHA           ; Buffer A on stack
 +
  $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 9,456: 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 9,526: 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 9,567: 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 9,609: 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 ==
 +
 +
A is a Character Sprite number ($17AE)
  
 
  $81/EB86 DA          PHX          ; Buffer X on Stack
 
  $81/EB86 DA          PHX          ; Buffer X on Stack
Line 9,623: Line 10,500:
 
  $81/EB91 6B          RTL
 
  $81/EB91 6B          RTL
  
;table is missing here
+
00 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E
 +
0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E
 +
1F 20 21 22 23 24 25 26 27 28 28 29 2A 2B 2F 2E
 +
6C 62 30 31 32 33 34 35 36 37 38 39 3A 3B 3E 3C
 +
3D 4C 4D 68 4F 50 51 52 53 54 55 3F 3B 3E 3C 3D
 +
40 41 42 43 44 45 46 47 48 49 4A 4B 56 57 58 59
 +
5A 64 2D 65 2C 2C 2D 3F 56 3A 75 65 6D 80 81 82
 +
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 9,653: 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 9,763: Line 10,656:
 
  $81/F65E AA          TAX                    A:0000 X:07C0 Y:971B P:envmxdiZc
 
  $81/F65E AA          TAX                    A:0000 X:07C0 Y:971B P:envmxdiZc
 
  $81/F65F 7C 62 F6    JMP ($F662,x)[$81:F797] A:0000 X:0000 Y:971B P:envmxdiZc
 
  $81/F65F 7C 62 F6    JMP ($F662,x)[$81:F797] A:0000 X:0000 Y:971B P:envmxdiZc
;table is missing here
+
 
 +
$81/F662 97 F7 --- Entry #$00 - $F797
 +
$81/F664 B2 F6 --- Entry #$01 - $F6B2
 +
$81/F666 B2 F6 --- Entry #$02 - $F6B2
 +
$81/F668 B2 F6 --- Entry #$03 - $F6B2
 +
$81/F66A B2 F6 --- Entry #$04 - $F6B2
 +
$81/F66C B2 F6 --- Entry #$05 - $F6B2
 +
$81/F66E B2 F6 --- Entry #$06 - $F6B2
 +
$81/F670 B2 F6 --- Entry #$07 - $F6B2
 +
$81/F672 B2 F6 --- Entry #$08 - $F6B2
 +
$81/F674 B2 F6 --- Entry #$09 - $F6B2
 +
$81/F676 B2 F6 --- Entry #$0A - $F6B2
 +
$81/F678 B2 F6 --- Entry #$0B - $F6B2
 +
$81/F67A B2 F6 --- Entry #$0C - $F6B2
 +
$81/F67C B2 F6 --- Entry #$0D - $F6B2
 +
$81/F67E B2 F6 --- Entry #$0E - $F6B2
 +
$81/F680 B2 F6 --- Entry #$0F - $F6B2
 +
$81/F682 AA F6 --- Entry #$10 - $F6AA
 +
$81/F684 AA F6 --- Entry #$11 - $F6AA
 +
$81/F686 29 F7 --- Entry #$12 - $F729
 +
$81/F688 30 F7 --- Entry #$13 - $F730
 +
$81/F68A 0F F7 --- Entry #$14 - $F70F
 +
$81/F68C 35 F7 --- Entry #$15 - $F735
 +
$81/F68E 16 F7 --- Entry #$16 - $F716
 +
$81/F690 A2 F6 --- Entry #$17 - $F6A2
 +
$81/F692 E8 F6 --- Entry #$18 - $F6E8
 +
$81/F694 38 F7 --- Entry #$19 - $F738
 +
$81/F696 5F F7 --- Entry #$1A - $F75F
 +
$81/F698 90 F7 --- Entry #$1B - $F790
 +
$81/F69A 79 F7 --- Entry #$1C - $F779
 +
$81/F69C 5F F7 --- Entry #$1D - $F75F
 +
$81/F69E 3D F7 --- Entry #$1E - $F73D
 +
$81/F6A0 2E F7 --- Entry #$1F - $F72E
 +
 
 +
;code is missing here
 +
 
 
  $81/F6A6 E2 21      SEP #$21                A:00C1 X:07C0 Y:9717 P:envMxdizc
 
  $81/F6A6 E2 21      SEP #$21                A:00C1 X:07C0 Y:9717 P:envMxdizc
 
  $81/F6A8 80 90      BRA $90    [$F63A]      A:00C1 X:07C0 Y:9717 P:envMxdizC
 
  $81/F6A8 80 90      BRA $90    [$F63A]      A:00C1 X:07C0 Y:9717 P:envMxdizC
Line 9,817: Line 10,745:
 
  $81/F79A 60          RTS                    A:0000 X:0000 Y:971B P:envMxdiZc
 
  $81/F79A 60          RTS                    A:0000 X:0000 Y:971B P:envMxdiZc
  
== $81/F7CC ? ==
+
== $81/F7CC ? Some Decompression ==
  
A contains a data bank
+
This subroutine is for decompression. It works with not less than three 24-bit-addresses: The Address of the Decompression Commands ([$23], i. e. $23-$25), the address of the Compressed Data (in X and A when this subroutine is entered) and the Store Address ([$20], i. e. $20-$22). After some setup (the MVN command in $AC, for instance), the subroutine loads a byte from [$23] and depending on its value, it jumps to a different decompression segment.
 +
 
 +
Please Read the Segment under "Tutorials" about this decompression subroutine.
 +
 
 +
    A - Compressed Data Bank
 +
    X - Compressed Data Address
 +
  $06  - Flag Byte for decompression
 +
  $07  - Bitwise Counter for when to load a new byte into $06
 +
  $09  - AND-Mask
 +
  $0C  - Number of Bytes to do for MVN, LOW BYTE
 +
  $0D  - Number of Bytes to do for MVN, HIGH BYTE
 +
[$20] - 24-bit Decompression Store Address
 +
[$23] - 24-bit Load Address, contains the commands for Decompression
 +
  $28  - Buffer for the Compressed Data Bank (this subroutine is entered with it in A)
 +
 
 +
Notes:
 +
 
 +
At the bottom, this subroutine loads a Data Byte with Flags and stores it in $06. It also sets up a Bitwise Counter in $07 that keeps track when the next Flag Byte has to be loaded. If the bit/flag is set, the next Data Byte gets transfered as it is; if the bit/flag is cleared, a decompression is done.
  
 
  $81/F7CC 8B          PHB          ; Buffer Data Bank on Stack
 
  $81/F7CC 8B          PHB          ; Buffer Data Bank on Stack
Line 9,826: Line 10,771:
 
  $81/F7D1 2B          PLD
 
  $81/F7D1 2B          PLD
 
  $81/F7D2 48          PHA          ; Set Data Bank to A
 
  $81/F7D2 48          PHA          ; Set Data Bank to A
  $81/F7D3 85 28      STA $28   [$00:0028]  A:E0AA X:E083 Y:0879 P:envMxdiZc
+
  $81/F7D3 85 28      STA $28       ; Buffer Data Bank in $28, too
 
  $81/F7D5 AB          PLB
 
  $81/F7D5 AB          PLB
  $81/F7D6 A5 22      LDA $22   [$00:0022]   A:E0AA X:E083 Y:0879 P:eNvMxdizc
+
  $81/F7D6 A5 22      LDA $22       ; Setup Code in $AC --- MVN-Command, Destination Bank is the same as [$20]
  $81/F7D8 85 AD      STA $AD   [$00:00AD]  A:E07E X:E083 Y:0879 P:envMxdizc
+
  $81/F7D8 85 AD      STA $AD
  $81/F7DA A9 54      LDA #$54               A:E07E X:E083 Y:0879 P:envMxdizc
+
  $81/F7DA A9 54      LDA #$54     ; #$54 = MVN
  $81/F7DC 85 AC      STA $AC   [$00:00AC]  A:E054 X:E083 Y:0879 P:envMxdizc
+
  $81/F7DC 85 AC      STA $AC
  $81/F7DE A9 60      LDA #$60               A:E054 X:E083 Y:0879 P:envMxdizc
+
  $81/F7DE A9 60      LDA #$60     ; #$60 = RTS
  $81/F7E0 85 AF      STA $AF   [$00:00AF]  A:E060 X:E083 Y:0879 P:envMxdizc
+
  $81/F7E0 85 AF      STA $AF
  $81/F7E2 A7 23      LDA [$23] [$A1:D400]  A:E060 X:E083 Y:0879 P:envMxdizc
+
  $81/F7E2 A7 23      LDA [$23]     ; Load Decompression Command Data Byte
  $81/F7E4 F0 36      BEQ $36   [$F81C]     A:E004 X:E083 Y:0879 P:envMxdizc
+
  $81/F7E4 F0 36      BEQ $36       ; [$F81C] Branch if Data Byte = #$00
  $81/F7E6 3A          DEC A                   A:E004 X:E083 Y:0879 P:envMxdizc
+
  $81/F7E6 3A          DEC A
  $81/F7E7 D0 03      BNE $03   [$F7EC]     A:E003 X:E083 Y:0879 P:envMxdizc
+
  $81/F7E7 D0 03      BNE $03       ; [$F7EC] Branch if Data Byte was > #$01
  $81/F7E9 4C AA F8    JMP $F8AA [$81:F8AA]  A:F500 X:F5A4 Y:F5A4 P:envMxdiZc
+
  $81/F7E9 4C AA F8    JMP $F8AA     ; Jump if Data Byte was = #$01
  $81/F7EC 3A          DEC A                   A:E003 X:E083 Y:0879 P:envMxdizc
+
  $81/F7EC 3A          DEC A
  $81/F7ED D0 03      BNE $03   [$F7F2]     A:E002 X:E083 Y:0879 P:envMxdizc
+
  $81/F7ED D0 03      BNE $03       ; [$F7F2] Branch if Data Byte was > #$02
 
;code is missing here
 
;code is missing here
  $81/F7F2 3A          DEC A                   A:E002 X:E083 Y:0879 P:envMxdizc
+
  $81/F7F2 3A          DEC A
  $81/F7F3 F0 09      BEQ $09   [$F7FE]     A:E001 X:E083 Y:0879 P:envMxdizc
+
  $81/F7F3 F0 09      BEQ $09       ; [$F7FE] Branch if Data Byte was = #$03
  $81/F7F5 3A          DEC A                   A:E001 X:E083 Y:0879 P:envMxdizc
+
  $81/F7F5 3A          DEC A
  $81/F7F6 D0 03      BNE $03   [$F7FB]     A:E000 X:E083 Y:0879 P:envMxdiZc
+
  $81/F7F6 D0 03      BNE $03       ; [$F7FB] Branch if Data Byte was > #$04
  $81/F7F8 4C 8D F8    JMP $F88D [$81:F88D]  A:E000 X:E083 Y:0879 P:envMxdiZc
+
  $81/F7F8 4C 8D F8    JMP $F88D     ; Jump if Data Byte was = #$04
 
;code is missing here
 
;code is missing here
  $81/F81C A0 01 00    LDY #$0001             A:FB00 X:8320 Y:2B00 P:envMxdiZc
+
  $81/F81C A0 01 00    LDY #$0001   ; Load first Argument Byte for Decompression Command
  $81/F81F B7 23      LDA [$23],y[$C9:FB6F]  A:FB00 X:8320 Y:0001 P:envMxdizc
+
  $81/F81F B7 23      LDA [$23],y
  $81/F821 85 0A      STA $0A   [$00:000A]  A:FB03 X:8320 Y:0001 P:envMxdizc
+
  $81/F821 85 0A      STA $0A       ; Store Argument Byte (Bit length of Number of Bytes to Do) in $0A
  $81/F823 64 0B      STZ $0B   [$00:000B]  A:FB03 X:8320 Y:0001 P:envMxdizc
+
  $81/F823 64 0B      STZ $0B       ; Clear "High Byte" for 16-bit-Loading $0A
$81/F825 A4 0A      LDY $0A   [$00:000A]  A:FB03 X:8320 Y:0001 P:envMxdizc
+
$81/F825 A4 0A      LDY $0A       ; 16-bit-Load $0A into Y
  $81/F827 C8          INY                     A:FB03 X:8320 Y:0003 P:envMxdizc
+
  $81/F827 C8          INY           ; Increment Decomp Command Load Index
  $81/F828 20 D0 F9    JSR $F9D0  [$81:F9D0]  A:FB03 X:8320 Y:0004 P:envMxdizc
+
  $81/F828 20 D0 F9    JSR $F9D0     ; Create AND-Mask and Jump Command for Calc of Number of Bytes to Do
$81/F82B C2 21       REP #$21               A:F9C7 X:8320 Y:0000 P:eNvMxdizc
+
  $81/F82B C2 21       REP #$21     ; A = 16-bit, Clear Carry
  $81/F82D E6 23      INC $23   [$00:0023]  A:F9C7 X:8320 Y:0000 P:eNvmxdizc
+
  $81/F82D E6 23      INC $23       ; Increment Decomp Command Load Address twice
  $81/F82F E6 23      INC $23   [$00:0023]  A:F9C7 X:8320 Y:0000 P:eNvmxdizc
+
  $81/F82F E6 23      INC $23
$81/F831 A7 23      LDA [$23] [$C9:FB70]  A:F9C7 X:8320 Y:0000 P:eNvmxdizc
+
$81/F831 A7 23      LDA [$23]     ; Load next Decomp Command Double-Byte
  $81/F833 85 0E      STA $0E   [$00:000E]  A:001E X:8320 Y:0000 P:envmxdizc
+
  $81/F833 85 0E      STA $0E       ; Set as Loop Counter Limit
  $81/F835 E6 23      INC $23   [$00:0023]  A:001E X:8320 Y:0000 P:envmxdizc
+
  $81/F835 E6 23      INC $23       ; Increment Decomp Command Load Address twice
  $81/F837 E6 23      INC $23   [$00:0023]  A:001E X:8320 Y:0000 P:eNvmxdizc
+
  $81/F837 E6 23      INC $23
  $81/F839 A4 20      LDY $20   [$00:0020]  A:001E X:8320 Y:0000 P:eNvmxdizc
+
  $81/F839 A4 20      LDY $20       ; Load the Store Address into Y for MVN
  $81/F83B 65 20      ADC $20   [$00:0020]  A:001E X:8320 Y:5299 P:envmxdizc
+
  $81/F83B 65 20      ADC $20       ; A = Loop Counter Limit + Store Position = ...
  $81/F83D 85 26      STA $26   [$00:0026]  A:52B7 X:8320 Y:5299 P:envmxdizc
+
  $81/F83D 85 26      STA $26       ; ... = $26 = End Position of this Decompression
  $81/F83F E2 20      SEP #$20               A:52B7 X:8320 Y:5299 P:envmxdizc
+
  $81/F83F E2 20      SEP #$20     ; A = 8-bit
  $81/F841 64 0D      STZ $0D   [$00:000D]  A:52B7 X:8320 Y:5299 P:envMxdizc
+
  $81/F841 64 0D      STZ $0D       ; Clear High Byte of MVN Number of Bytes to Do
  $81/F843 C4 26      CPY $26   [$00:0026]  A:52B7 X:8320 Y:5299 P:envMxdizc
+
  $81/F843 C4 26      CPY $26       ; Was the End Position of this Decompression reached?
  $81/F845 F0 43      BEQ $43   [$F88A]     A:52B7 X:8320 Y:5299 P:eNvMxdizc
+
  $81/F845 F0 43      BEQ $43       ; [$F88A] Exit if equal
  $81/F847 BD 00 00    LDA $0000,x[$C3:8320]   A:52B7 X:8320 Y:5299 P:eNvMxdizc
+
  $81/F847 BD 00 00    LDA $0000,x  ; Load Next Compressed Data Byte
  $81/F84A 30 28      BMI $28   [$F874]     A:5271 X:8320 Y:5299 P:envMxdizc
+
  $81/F84A 30 28      BMI $28       ; [$F874] Branch if MSB (a flag) is set
  $81/F84C 0A          ASL A                   A:5271 X:8320 Y:5299 P:envMxdizc
+
  $81/F84C 0A          ASL A         ; Push (clear) flag bit out of Data Byte
  $81/F84D 20 C3 F9    JSR $F9C3 [$81:F9C3]  A:52E2 X:8320 Y:5299 P:eNvMxdizc
+
  $81/F84D 20 C3 F9    JSR $F9C3     ; Crop Number of Bytes to Do from Loaded Data Byte
  $81/F850 3A          DEC A                   A:520A X:8320 Y:5299 P:envMxdizc
+
  $81/F850 3A          DEC A         ; Decrement MVN Number of Bytes to Do (because MVN always does one more)
  $81/F851 85 0C      STA $0C   [$00:000C]  A:5209 X:8320 Y:5299 P:envMxdizc
+
  $81/F851 85 0C      STA $0C       ; Buffer Number of Bytes to do (for MVN) in $0C
  $81/F853 A5 25      LDA $25   [$00:0025]   A:5209 X:8320 Y:5299 P:envMxdizc
+
  $81/F853 A5 25      LDA $25       ; Set the Bank of [$23] as Source Bank for MVN
  $81/F855 85 AE      STA $AE   [$00:00AE]  A:52C9 X:8320 Y:5299 P:eNvMxdizc
+
  $81/F855 85 AE      STA $AE
  $81/F857 BD 00 00    LDA $0000,x[$C3:8320]   A:52C9 X:8320 Y:5299 P:eNvMxdizc
+
  $81/F857 BD 00 00    LDA $0000,x  ; Load Compressed Data Double Byte (Source Address Offset) and...
  $81/F85A 25 09      AND $09   [$00:0009]  A:5271 X:8320 Y:5299 P:envMxdizc
+
  $81/F85A 25 09      AND $09       ; ... remove Number of Bytes to Do from Double Byte
  $81/F85C EB          XBA                     A:5201 X:8320 Y:5299 P:envMxdizc
+
  $81/F85C EB          XBA
  $81/F85D BD 01 00    LDA $0001,x[$C3:8321]  A:0152 X:8320 Y:5299 P:envMxdizc
+
  $81/F85D BD 01 00    LDA $0001,x
  $81/F860 E8          INX                     A:014A X:8320 Y:5299 P:envMxdizc
+
  $81/F860 E8          INX           ; Increment Data Load Index twice
  $81/F861 E8          INX                     A:014A X:8321 Y:5299 P:eNvMxdizc
+
  $81/F861 E8          INX
  $81/F862 C2 21      REP #$21               A:014A X:8322 Y:5299 P:eNvMxdizc
+
  $81/F862 C2 21      REP #$21     ; A = 16-bit, Clear Carry
  $81/F864 65 23      ADC $23   [$00:0023]  A:014A X:8322 Y:5299 P:eNvmxdizc
+
  $81/F864 65 23      ADC $23       ; Add Data Load Address to Offset for MVN Source Address
  $81/F866 DA          PHX                     A:FCBC X:8322 Y:5299 P:eNvmxdizc
+
  $81/F866 DA          PHX           ; Buffer Load Index on Stack
  $81/F867 AA          TAX                     A:FCBC X:8322 Y:5299 P:eNvmxdizc
+
  $81/F867 AA          TAX           ; Replace X with A for MVN (Source Address)
  $81/F868 A5 0C      LDA $0C   [$00:000C]  A:FCBC X:FCBC Y:5299 P:eNvmxdizc
+
  $81/F868 A5 0C      LDA $0C       ; Load Number of Bytes to do for MVN
  $81/F86A 8B          PHB                     A:0009 X:FCBC Y:5299 P:envmxdizc
+
  $81/F86A 8B          PHB           ; Buffer Data Bank on Stack
  $81/F86B 20 AC 00    JSR $00AC [$81:00AC]  A:0009 X:FCBC Y:5299 P:envmxdizc
+
  $81/F86B 20 AC 00    JSR $00AC     ; MVN
  $81/F86E AB          PLB                     A:FFFF X:FCC6 Y:52A3 P:envmxdizc
+
  $81/F86E AB          PLB           ; Restore Data Bank from Stack
  $81/F86F FA          PLX                     A:FFFF X:FCC6 Y:52A3 P:eNvmxdizc
+
  $81/F86F FA          PLX           ; Restore Load Index from Stack
  $81/F870 E2 20      SEP #$20               A:FFFF X:8322 Y:52A3 P:eNvmxdizc
+
  $81/F870 E2 20      SEP #$20     ; A = 8-bit
  $81/F872 80 CF      BRA $CF   [$F843]     A:FFFF X:8322 Y:52A3 P:eNvMxdizc
+
  $81/F872 80 CF      BRA $CF       ; [$F843] Loop
  $81/F874 E8          INX                     A:FF87 X:DCC5 Y:52A1 P:eNvMxdizc
+
  $81/F875 29 7F      AND #$7F               A:FF87 X:DCC6 Y:52A1 P:eNvMxdizc
+
  $81/F874 E8          INX           ; Increment Compressed Data Load Index
  $81/F877 85 0C      STA $0C   [$00:000C]  A:FF07 X:DCC6 Y:52A1 P:envMxdizc
+
  $81/F875 29 7F      AND #$7F     ; Remove Flag Bit
  $81/F879 A5 28      LDA $28   [$00:0028]  A:FF07 X:DCC6 Y:52A1 P:envMxdizc
+
  $81/F877 85 0C      STA $0C       ; Buffer Number of Bytes to Do in $0C
  $81/F87B 85 AE      STA $AE   [$00:00AE]  A:FFC8 X:DCC6 Y:52A1 P:eNvMxdizc
+
  $81/F879 A5 28      LDA $28       ; Set Bank of Compressed Data as Source Bank for MVN
  $81/F87D C2 20      REP #$20               A:FFC8 X:DCC6 Y:52A1 P:eNvMxdizc
+
  $81/F87B 85 AE      STA $AE
  $81/F87F A5 0C      LDA $0C   [$00:000C]  A:FFC8 X:DCC6 Y:52A1 P:eNvmxdizc
+
  $81/F87D C2 20      REP #$20     ; A = 16-bit
  $81/F881 8B          PHB                     A:0007 X:DCC6 Y:52A1 P:envmxdizc
+
  $81/F87F A5 0C      LDA $0C       ; Load Number of Bytes to Do in A for MVN
  $81/F882 20 AC 00    JSR $00AC [$81:00AC]  A:0007 X:DCC6 Y:52A1 P:envmxdizc
+
  $81/F881 8B          PHB           ; Buffer Data Bank on Stack
  $81/F885 AB          PLB                     A:FFFF X:DCCE Y:52A9 P:envmxdizc
+
  $81/F882 20 AC 00    JSR $00AC     ; MVN
  $81/F886 E2 20      SEP #$20               A:FFFF X:DCCE Y:52A9 P:eNvmxdizc
+
  $81/F885 AB          PLB           ; Restore Data Bank from Stack
  $81/F888 80 B9      BRA $B9   [$F843]     A:FFFF X:DCCE Y:52A9 P:eNvMxdizc
+
  $81/F886 E2 20      SEP #$20     ; A = 8-bit
  $81/F88A 2B          PLD                     A:FFFF X:8326 Y:52B7 P:envMxdiZC
+
  $81/F888 80 B9      BRA $B9       ; [$F843] Loop
  $81/F88B AB          PLB                     A:FFFF X:8326 Y:52B7 P:envMxdiZC
+
  $81/F88C 6B          RTL                     A:FFFF X:8326 Y:52B7 P:envMxdizC
+
  $81/F88A 2B          PLD           ; Restore Direct Page from Stack
  $81/F88D A0 01 00    LDY #$0001             A:E000 X:E083 Y:0879 P:envMxdiZc
+
  $81/F88B AB          PLB           ; Restore Data Bank from Stack
  $81/F890 B7 23      LDA [$23],y[$A1:D401]  A:E000 X:E083 Y:0001 P:envMxdizc
+
  $81/F88C 6B          RTL
  $81/F892 85 0A      STA $0A   [$00:000A]  A:E003 X:E083 Y:0001 P:envMxdizc
+
  $81/F894 64 0B      STZ $0B   [$00:000B]  A:E003 X:E083 Y:0001 P:envMxdizc
+
  $81/F88D A0 01 00    LDY #$0001   ; Load first Argument Byte for Decompression Command
  $81/F896 A4 0A      LDY $0A   [$00:000A]  A:E003 X:E083 Y:0001 P:envMxdizc
+
  $81/F890 B7 23      LDA [$23],y
  $81/F898 20 D0 F9    JSR $F9D0  [$81:F9D0]  A:E003 X:E083 Y:0003 P:envMxdizc
+
  $81/F892 85 0A      STA $0A       ; Store Argument Byte (Bit length of Number of Bytes to Do) in $0A
$81/F89B C2 20      REP #$20               A:F9C7 X:E083 Y:0000 P:eNvMxdizc
+
  $81/F894 64 0B      STZ $0B       ; Clear "High Byte" for 16-bit-Loading $0A
  $81/F89D E6 23      INC $23   [$00:0023]  A:F9C7 X:E083 Y:0000 P:eNvmxdizc
+
  $81/F896 A4 0A      LDY $0A       ; 16-bit-Load $0A into Y
  $81/F89F E6 23      INC $23   [$00:0023]  A:F9C7 X:E083 Y:0000 P:eNvmxdizc
+
  $81/F898 20 D0 F9    JSR $F9D0     ; Create AND-Mask and Jump Command for Calc of Number of Bytes to Do
$81/F8A1 BD 00 00    LDA $0000,x[$AA:E083]   A:F9C7 X:E083 Y:0000 P:eNvmxdizc
+
  $81/F89B C2 20      REP #$20     ; A = 16-bit
  $81/F8A4 85 0E      STA $0E   [$00:000E]  A:0092 X:E083 Y:0000 P:envmxdizc
+
  $81/F89D E6 23      INC $23       ; Increment Decomp Command Load Address twice
  $81/F8A6 E8          INX                     A:0092 X:E083 Y:0000 P:envmxdizc
+
  $81/F89F E6 23      INC $23
  $81/F8A7 E8          INX                     A:0092 X:E084 Y:0000 P:eNvmxdizc
+
$81/F8A1 BD 00 00    LDA $0000,x  ; Load Data Double-Byte
  $81/F8A8 80 1E      BRA $1E   [$F8C8]     A:0092 X:E085 Y:0000 P:eNvmxdizc
+
  $81/F8A4 85 0E      STA $0E       ; Set as Loop Counter Limit
  $81/F8AA A0 01 00    LDY #$0001             A:F500 X:F5A4 Y:F5A4 P:envMxdiZc
+
  $81/F8A6 E8          INX           ; Increment Compressed Data Load Index twice
  $81/F8AD B7 23      LDA [$23],y[$A4:EFEE]  A:F500 X:F5A4 Y:0001 P:envMxdizc
+
  $81/F8A7 E8          INX
  $81/F8AF 85 0A      STA $0A   [$00:000A]  A:F504 X:F5A4 Y:0001 P:envMxdizc
+
  $81/F8A8 80 1E      BRA $1E       ; [$F8C8]
  $81/F8B1 64 0B      STZ $0B   [$00:000B]  A:F504 X:F5A4 Y:0001 P:envMxdizc
+
  $81/F8B3 A4 0A      LDY $0A   [$00:000A]  A:F504 X:F5A4 Y:0001 P:envMxdizc
+
  $81/F8AA A0 01 00    LDY #$0001   ; Load first Argument Byte for Decompression Command
  $81/F8B5 20 D0 F9    JSR $F9D0 [$81:F9D0]  A:F504 X:F5A4 Y:0004 P:envMxdizc
+
  $81/F8AD B7 23      LDA [$23],y
  $81/F8B8 C2 21      REP #$21               A:F9C8 X:F5A4 Y:0000 P:eNvMxdizc
+
  $81/F8AF 85 0A      STA $0A       ; Store Argument Byte (Bit length of Number of Bytes to Do) in $0A
  $81/F8BA A0 02 00    LDY #$0002             A:F9C8 X:F5A4 Y:0000 P:eNvmxdizc
+
  $81/F8B1 64 0B      STZ $0B       ; Clear "High Byte" for 16-bit-Loading $0A
  $81/F8BD B7 23      LDA [$23],y[$A4:EFEF]  A:F9C8 X:F5A4 Y:0002 P:envmxdizc
+
  $81/F8B3 A4 0A      LDY $0A       ; 16-bit-Load $0A into Y
$81/F8BF 85 0E      STA $0E   [$00:000E]  A:0020 X:F5A4 Y:0002 P:envmxdizc
+
  $81/F8B5 20 D0 F9    JSR $F9D0     ; Create AND-Mask and Jump Command for Calc of Number of Bytes to Do
  $81/F8C1 A9 04 00    LDA #$0004             A:0020 X:F5A4 Y:0002 P:envmxdizc
+
  $81/F8B8 C2 21      REP #$21     ; A = 16-bit, Clear Carry
  $81/F8C4 65 23      ADC $23   [$00:0023]  A:0004 X:F5A4 Y:0002 P:envmxdizc
+
  $81/F8BA A0 02 00    LDY #$0002   ; Load second and third Argument Bytes for Decompression Command
  $81/F8C6 85 23      STA $23   [$00:0023]  A:EFF1 X:F5A4 Y:0002 P:eNvmxdizc
+
  $81/F8BD B7 23      LDA [$23],y
  $81/F8C8 E2 20      SEP #$20               A:0092 X:E085 Y:0000 P:eNvmxdizc
+
$81/F8BF 85 0E      STA $0E       ; Set as Loop Counter Limit
  $81/F8CA 64 0D      STZ $0D   [$00:000D]  A:0092 X:E085 Y:0000 P:eNvMxdizc
+
  $81/F8C1 A9 04 00    LDA #$0004   ; Increment Address in [$23] four times
$81/F8CC A5 25      LDA $25   [$00:0025]   A:0092 X:E085 Y:0000 P:eNvMxdizc
+
  $81/F8C4 65 23      ADC $23
  $81/F8CE 85 AE      STA $AE   [$00:00AE]  A:00A1 X:E085 Y:0000 P:eNvMxdizc
+
  $81/F8C6 85 23      STA $23
  $81/F8D0 A0 00 00    LDY #$0000             A:00A1 X:E085 Y:0000 P:eNvMxdizc
+
  $81/F8C8 E2 20      SEP #$20     ; A = 8-bit
  $81/F8D3 A9 FF      LDA #$FF               A:00A1 X:E085 Y:0000 P:envMxdiZc
+
  $81/F8CA 64 0D      STZ $0D       ; Clear High Byte of MVN Number of Bytes to Do
  $81/F8D5 85 07      STA $07   [$00:0007]  A:00FF X:E085 Y:0000 P:eNvMxdizc
+
$81/F8CC A5 25      LDA $25       ; MVN Source Bank = Bank of [$23]
  $81/F8D7 BD 00 00    LDA $0000,x[$AA:E085]  A:00FF X:E085 Y:0000 P:eNvMxdizc
+
  $81/F8CE 85 AE      STA $AE
$81/F8DA 85 06      STA $06   [$00:0006]  A:0025 X:E085 Y:0000 P:envMxdizc
+
  $81/F8D0 A0 00 00    LDY #$0000   ; Setup Store Index
  $81/F8DC E8          INX                     A:0025 X:E085 Y:0000 P:envMxdizc
+
  $81/F8DD 06 06      ASL $06   [$00:0006]  A:0025 X:E086 Y:0000 P:eNvMxdizc
+
  $81/F8D3 A9 FF      LDA #$FF     ; Setup Bitwise Counter in $07
$81/F8DF 90 11      BCC $11   [$F8F2]     A:0025 X:E086 Y:0000 P:envMxdizc
+
  $81/F8D5 85 07      STA $07
  $81/F8E1 BD 00 00    LDA $0000,x[$AA:E08A]   A:0006 X:E08A Y:0006 P:envMxdizC
+
  $81/F8D7 BD 00 00    LDA $0000,x   ; Load Command Flag Byte and store it in $06
  $81/F8E4 97 20      STA [$20],y[$7E:45DF]  A:004F X:E08A Y:0006 P:envMxdizC
+
$81/F8DA 85 06      STA $06
  $81/F8E6 E8          INX                     A:004F X:E08A Y:0006 P:envMxdizC
+
  $81/F8DC E8          INX           ; Increment Data Load Index
  $81/F8E7 C8          INY                     A:004F X:E08B Y:0006 P:eNvMxdizC
+
  $81/F8E8 C4 0E      CPY $0E   [$00:000E]  A:0003 X:E088 Y:0003 P:eNvMxdizC
+
  $81/F8DD 06 06      ASL $06       ; Shift next Flag out of $06 and branch accordingly
  $81/F8EA F0 35      BEQ $35   [$F921]     A:0003 X:E088 Y:0003 P:eNvMxdizc
+
$81/F8DF 90 11      BCC $11       ; [$F8F2] Branch if Flag not set
  $81/F8EC 06 07      ASL $07   [$00:0007]  A:0003 X:E088 Y:0003 P:eNvMxdizc
+
  $81/F8E1 BD 00 00    LDA $0000,x  ; Else, transfer the Data Byte as it is
  $81/F8EE D0 ED      BNE $ED   [$F8DD]     A:0003 X:E088 Y:0003 P:eNvMxdizC
+
  $81/F8E4 97 20      STA [$20],y
  $81/F8F0 80 E1      BRA $E1   [$F8D3]     A:0020 X:E093 Y:0017 P:envMxdiZC
+
  $81/F8E6 E8          INX           ; Increment Load Index
  $81/F8F2 BD 00 00    LDA $0000,x[$AA:E086]   A:0025 X:E086 Y:0000 P:envMxdizc
+
  $81/F8E7 C8          INY           ; Increment Store Index
  $81/F8F5 20 C3 F9    JSR $F9C3  [$81:F9C3]  A:000E X:E086 Y:0000 P:envMxdizc
+
  $81/F8E8 C4 0E      CPY $0E       ; Compare Y with Loop Counter Limit
$81/F8F8 3A          DEC A                   A:0003 X:E086 Y:0000 P:envMxdizc
+
  $81/F8EA F0 35      BEQ $35       ; [$F921] Exit if Limit is reached
  $81/F8F9 85 0C      STA $0C   [$00:000C]  A:0002 X:E086 Y:0000 P:envMxdizc
+
  $81/F8EC 06 07      ASL $07       ; Shift a Bit out of the Bitwise Counter
  $81/F8FB BD 00 00    LDA $0000,x[$AA:E086]  A:0002 X:E086 Y:0000 P:envMxdizc
+
  $81/F8EE D0 ED      BNE $ED       ; [$F8DD] Normal small loop if $07 isn't empty jet
  $81/F8FE 25 09      AND $09   [$00:0009]  A:000E X:E086 Y:0000 P:envMxdizc
+
  $81/F8F0 80 E1      BRA $E1       ; [$F8D3] Loop, reset Bitwise Counter and load new Flag Byte
  $81/F900 EB          XBA                     A:000E X:E086 Y:0000 P:envMxdizc
+
  $81/F901 BD 01 00    LDA $0001,x[$AA:E087]  A:0E00 X:E086 Y:0000 P:envMxdiZc
+
  $81/F8F2 BD 00 00    LDA $0000,x  ; Load Compressed Data Byte
$81/F904 E8          INX                     A:0E15 X:E086 Y:0000 P:envMxdizc
+
  $81/F8F5 20 C3 F9    JSR $F9C3     ; Crop Number of Bytes to Do from Loaded Data Byte
  $81/F905 E8          INX                     A:0E15 X:E087 Y:0000 P:eNvMxdizc
+
  $81/F8F8 3A          DEC A         ; Decrement MVN Number of Bytes to Do (because MVN always does one more)
  $81/F906 C2 21      REP #$21               A:0E15 X:E088 Y:0000 P:eNvMxdizc
+
  $81/F8F9 85 0C      STA $0C       ; Buffer MVN Number of Bytes to Do in $0C
  $81/F908 65 23      ADC $23   [$00:0023]  A:0E15 X:E088 Y:0000 P:eNvmxdizc
+
  $81/F8FB BD 00 00    LDA $0000,x   ; Load Compressed Data Double Byte (Source Address Offset) and...
$81/F90A DA          PHX                     A:E217 X:E088 Y:0000 P:eNvmxdizc
+
  $81/F8FE 25 09      AND $09       ; ... remove Number of Bytes to Do from Double Byte
  $81/F90B AA          TAX                     A:E217 X:E088 Y:0000 P:eNvmxdizc
+
  $81/F900 EB          XBA
  $81/F90C 98          TYA                     A:E217 X:E217 Y:0000 P:eNvmxdizc
+
  $81/F901 BD 01 00    LDA $0001,x
  $81/F90D 65 20      ADC $20   [$00:0020]  A:0000 X:E217 Y:0000 P:envmxdiZc
+
$81/F904 E8          INX           ; Increment Compressed Data Load Index twice
$81/F90F A8          TAY                     A:45D9 X:E217 Y:0000 P:envmxdizc
+
  $81/F905 E8          INX
  $81/F910 A5 0C      LDA $0C   [$00:000C]  A:45D9 X:E217 Y:45D9 P:envmxdizc
+
  $81/F906 C2 21      REP #$21     ; A = 16-bit, Clear Carry
  $81/F912 8B          PHB                     A:0002 X:E217 Y:45D9 P:envmxdizc
+
  $81/F908 65 23      ADC $23       ; Add Data Load Address to Offset for MVN Source Address
  $81/F913 20 AC 00    JSR $00AC  [$81:00AC]  A:0002 X:E217 Y:45D9 P:envmxdizc
+
$81/F90A DA          PHX           ; Buffer Comp Data Load Index on Stack
$81/F916 AB          PLB                     A:FFFF X:E21A Y:45DC P:envmxdizc
+
  $81/F90B AA          TAX           ; Transfer MVN Source Address in X for Upcoming MVN
  $81/F917 98          TYA                     A:FFFF X:E21A Y:45DC P:eNvmxdizc
+
  $81/F90C 98          TYA           ; Add Data Store Address to Data Store Index for Upcoming MVN
  $81/F918 38          SEC                     A:45DC X:E21A Y:45DC P:envmxdizc
+
  $81/F90D 65 20      ADC $20
  $81/F919 E5 20      SBC $20   [$00:0020]  A:45DC X:E21A Y:45DC P:envmxdizC
+
$81/F90F A8          TAY
  $81/F91B A8          TAY                     A:0003 X:E21A Y:45DC P:envmxdizC
+
  $81/F910 A5 0C      LDA $0C       ; Load Number of Bytes to Do in A for MVN
  $81/F91C FA          PLX                     A:0003 X:E21A Y:0003 P:envmxdizC
+
  $81/F912 8B          PHB           ; Buffer Data Bank on Stack
  $81/F91D E2 20      SEP #$20               A:0003 X:E088 Y:0003 P:eNvmxdizC
+
  $81/F913 20 AC 00    JSR $00AC     ; MVN
  $81/F91F 80 C7      BRA $C7   [$F8E8]     A:0003 X:E088 Y:0003 P:eNvMxdizC
+
  $81/F916 AB          PLB           ; Restore Data Bank from Stack
 +
  $81/F917 98          TYA           ; Remove Data Store Address from Data Store Index in Y
 +
  $81/F918 38          SEC
 +
  $81/F919 E5 20      SBC $20
 +
  $81/F91B A8          TAY
 +
  $81/F91C FA          PLX           ; Restore Comp Data Load Index from Stack
 +
  $81/F91D E2 20      SEP #$20     ; A = 8-bit
 +
  $81/F91F 80 C7      BRA $C7       ; [$F8E8] Do next Data Byte
 +
 
  $81/F921 2B          PLD          ; Restore Direct Page from Stack
 
  $81/F921 2B          PLD          ; Restore Direct Page from Stack
 
  $81/F922 AB          PLB          ; Restore Data Bank from Stack
 
  $81/F922 AB          PLB          ; Restore Data Bank from Stack
Line 9,993: Line 10,946:
 
  $81/F9C3 6C 0A 00    JMP ($000A)[$81:F9C7]  A:000E X:E086 Y:0000 P:envMxdizc
 
  $81/F9C3 6C 0A 00    JMP ($000A)[$81:F9C7]  A:000E X:E086 Y:0000 P:envMxdizc
  
== $81/F9C7 ? ==
+
;code is missing here
 
 
$81/F9C3 jumps here.
 
 
 
 
  $81/F9C7 4A          LSR A        ; divide by #$20
 
  $81/F9C7 4A          LSR A        ; divide by #$20
 
  $81/F9C8 4A          LSR A
 
  $81/F9C8 4A          LSR A
Line 10,006: Line 10,956:
 
  $81/F9CF 60          RTS
 
  $81/F9CF 60          RTS
  
== $81/F9D0 ? ==
+
== $81/F9D0 ? Decompression: Prepare AND-Mask, Prepare MVN Size Calculation ==
 +
 
 +
This prepares $0A for the subroutine above ($81/F9C3).
  
  $81/F9D0 A9 FF      LDA #$FF               A:E003 X:E083 Y:0003 P:envMxdizc
+
Y contains a number betw. 1 and 8, this subroutine creates AND-Mask where the corresponding number of bits are cleared, beginning with the MSB, and that is stored in $09 (Y = #$03 ==> $09 = #%0001.1111)
  $81/F9D2 4A          LSR A                   A:E0FF X:E083 Y:0003 P:eNvMxdizc
+
 
  $81/F9D3 88          DEY                     A:E07F X:E083 Y:0003 P:envMxdizC
+
The second part changes the Jump Address in $0A according to the value that is stored there. It makes the Subroutine at $81/F9C3 jump over a number of LSR A commands, accordingly.
  $81/F9D4 D0 FC      BNE $FC   [$F9D2]     A:E07F X:E083 Y:0002 P:envMxdizC
+
 
  $81/F9D6 85 09      STA $09   [$00:0009]  A:E01F X:E083 Y:0000 P:envMxdiZC
+
  $81/F9D0 A9 FF      LDA #$FF     ; #$FF = AND-Mask blanket
  $81/F9D8 7B          TDC                     A:E01F X:E083 Y:0000 P:envMxdiZC
+
  $81/F9D2 4A          LSR A         ; Push one bit out of the AND-Mask...
  $81/F9D9 A5 0A      LDA $0A   [$00:000A]  A:0000 X:E083 Y:0000 P:envMxdiZC
+
  $81/F9D3 88          DEY           ; ... for every DEY...
  $81/F9DB C2 21      REP #$21               A:0003 X:E083 Y:0000 P:envMxdizC
+
  $81/F9D4 D0 FC      BNE $FC       ; [$F9D2] ... until Y = #$00
  $81/F9DD 69 C4 F9    ADC #$F9C4             A:0003 X:E083 Y:0000 P:envmxdizc
+
  $81/F9D6 85 09      STA $09       ; Then, store the AND-Mask
  $81/F9E0 85 0A      STA $0A   [$00:000A]  A:F9C7 X:E083 Y:0000 P:eNvmxdizc
+
  $81/F9D8 7B          TDC           ; Clear 16-bit A
  $81/F9E2 E2 20      SEP #$20               A:F9C7 X:E083 Y:0000 P:eNvmxdizc
+
  $81/F9D9 A5 0A      LDA $0A
  $81/F9E4 60          RTS                     A:F9C7 X:E083 Y:0000 P:eNvMxdizc
+
  $81/F9DB C2 21      REP #$21     ; A = 16-bit, Clear Carry
 +
  $81/F9DD 69 C4 F9    ADC #$F9C4   ; Add Address Offset
 +
  $81/F9E0 85 0A      STA $0A       ; Store Jump Address
 +
  $81/F9E2 E2 20      SEP #$20     ; A = 8-bit
 +
  $81/F9E4 60          RTS
  
 
== $81/F9E5 Decompression subroutine ==
 
== $81/F9E5 Decompression subroutine ==
Line 10,172: Line 11,128:
  
 
  $81/FCA2 5A          PHY                    A:0135 X:0002 Y:4440 P:envMxdizC
 
  $81/FCA2 5A          PHY                    A:0135 X:0002 Y:4440 P:envMxdizC
  $81/FCA3 D4 5C      PEI ($5C)       [$45D9]      A:0135 X:0002 Y:4440 P:envMxdizC
+
  $81/FCA3 D4 5C      PEI ($5C) [$45D9]      A:0135 X:0002 Y:4440 P:envMxdizC
  $81/FCA5 22 DF A3 88 JSL $88A3DF[$88:A3DF]   A:0135 X:0002 Y:4440 P:envMxdizC
+
  $81/FCA5 22 DF A3 88 JSL $88A3DF  ; Load Big Sprite Flag for this Character
 
  $81/FCA9 B0 29      BCS $29    [$FCD4]      A:0035 X:0002 Y:4440 P:envMxdizc
 
  $81/FCA9 B0 29      BCS $29    [$FCD4]      A:0035 X:0002 Y:4440 P:envMxdizc
 
  $81/FCAB A9 80      LDA #$80                A:0035 X:0002 Y:4440 P:envMxdizc
 
  $81/FCAB A9 80      LDA #$80                A:0035 X:0002 Y:4440 P:envMxdizc
Line 10,426: Line 11,382:
 
  $82/98AF BD AE 17    LDA $17AE,x  ; Character graphic
 
  $82/98AF BD AE 17    LDA $17AE,x  ; Character graphic
 
  $82/98B2 8D 9F 1E    STA $1E9F
 
  $82/98B2 8D 9F 1E    STA $1E9F
  $82/98B5 BD AF 17    LDA $17AF,x  ; ???
+
  $82/98B5 BD AF 17    LDA $17AF,x  ; Character Class
 
  $82/98B8 8D 66 1E    STA $1E66
 
  $82/98B8 8D 66 1E    STA $1E66
 
  $82/98BB BD D7 17    LDA $17D7,x  ; Character Element
 
  $82/98BB BD D7 17    LDA $17D7,x  ; Character Element
Line 10,458: 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 10,481: 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 10,674: Line 11,630:
 
  $82/DE60 AC 16 42    LDY $4216  [$8B:4216]  A:0004 X:001A Y:2141 P:envMxdizc
 
  $82/DE60 AC 16 42    LDY $4216  [$8B:4216]  A:0004 X:001A Y:2141 P:envMxdizc
 
  $82/DE63 8C C6 16    STY $16C6  [$8B:16C6]  A:0004 X:001A Y:0080 P:envMxdizc
 
  $82/DE63 8C C6 16    STY $16C6  [$8B:16C6]  A:0004 X:001A Y:0080 P:envMxdizc
  $82/DE66 AD BE 16    LDA $16BE [$8B:16BE]  A:0004 X:001A Y:0080 P:envMxdizc
+
  $82/DE66 AD BE 16    LDA $16BE     ; Load Index for Compressed ? Data
  $82/DE69 0A          ASL A                   A:0003 X:001A Y:0080 P:envMxdizc
+
  $82/DE69 0A          ASL A         ; Multiply by 2 (addresses are 2 byte in size)
  $82/DE6A AA          TAX                     A:0006 X:001A Y:0080 P:envMxdizc
+
  $82/DE6A AA          TAX           ; Transfer in X and Buffer on Stack
  $82/DE6B DA          PHX                     A:0006 X:0006 Y:0080 P:envMxdizc
+
  $82/DE6B DA          PHX
 
  $82/DE6C 4B          PHK          ; Set Data Bank to $82
 
  $82/DE6C 4B          PHK          ; Set Data Bank to $82
 
  $82/DE6D AB          PLB
 
  $82/DE6D AB          PLB
Line 10,686: Line 11,642:
 
  $82/DE77 A9 A2      LDA #$A2      ; Bank of the Compressed Data
 
  $82/DE77 A9 A2      LDA #$A2      ; Bank of the Compressed Data
 
  $82/DE79 22 E5 F9 81 JSL $81F9E5  ; Decompression Subroutine
 
  $82/DE79 22 E5 F9 81 JSL $81F9E5  ; Decompression Subroutine
  $82/DE7D FA          PLX                     A:FFFF X:8CB6 Y:0AC0 P:eNvMxdizC
+
  $82/DE7D FA          PLX           ; Resotre Load Index for Compressed ? Data
  $82/DE7E C2 21      REP #$21               A:FFFF X:0006 Y:0AC0 P:envMxdizC
+
  $82/DE7E C2 21      REP #$21     ; A = 16-bit, Clear Carry
 
  $82/DE80 AF 00 00 7F LDA $7F0000[$7F:0000]  A:FFFF X:0006 Y:0AC0 P:envmxdizc
 
  $82/DE80 AF 00 00 7F LDA $7F0000[$7F:0000]  A:FFFF X:0006 Y:0AC0 P:envmxdizc
 
  $82/DE84 85 A6      STA $A6    [$00:00A6]  A:0444 X:0006 Y:0AC0 P:envmxdizc
 
  $82/DE84 85 A6      STA $A6    [$00:00A6]  A:0444 X:0006 Y:0AC0 P:envmxdizc
Line 10,694: Line 11,650:
 
  $82/DE8C A9 00 00    LDA #$0000              A:0844 X:0006 Y:0AC0 P:envmxdizc
 
  $82/DE8C A9 00 00    LDA #$0000              A:0844 X:0006 Y:0AC0 P:envmxdizc
 
  $82/DE8F 65 0E      ADC $0E    [$00:000E]  A:0000 X:0006 Y:0AC0 P:envmxdiZc
 
  $82/DE8F 65 0E      ADC $0E    [$00:000E]  A:0000 X:0006 Y:0AC0 P:envmxdiZc
  $82/DE91 85 20      STA $20   [$00:0020]  A:0AC0 X:0006 Y:0AC0 P:envmxdizc
+
  $82/DE91 85 20      STA $20       ; Set as Decompression Store Address
 
  $82/DE93 85 AA      STA $AA    [$00:00AA]  A:0AC0 X:0006 Y:0AC0 P:envmxdizc
 
  $82/DE93 85 AA      STA $AA    [$00:00AA]  A:0AC0 X:0006 Y:0AC0 P:envmxdizc
  $82/DE95 BF 2E A9 A4 LDA $A4A92E,x[$A4:A934] A:0AC0 X:0006 Y:0AC0 P:envmxdizc
+
  $82/DE95 BF 2E A9 A4 LDA $A4A92E,x ; Load Compressed Data Address and transfer it to X
  $82/DE99 AA          TAX                     A:ABFA X:0006 Y:0AC0 P:eNvmxdizc
+
  $82/DE99 AA          TAX           ; for upcoming Decompression
  $82/DE9A A9 1F 9C    LDA #$9C1F             A:ABFA X:ABFA Y:0AC0 P:eNvmxdizc
+
  $82/DE9A A9 1F 9C    LDA #$9C1F   ; Decompression Command Address: $A5/9C1F
  $82/DE9D 85 23      STA $23   [$00:0023]  A:9C1F X:ABFA Y:0AC0 P:eNvmxdizc
+
  $82/DE9D 85 23      STA $23
  $82/DE9F E2 20      SEP #$20               A:9C1F X:ABFA Y:0AC0 P:eNvmxdizc
+
  $82/DE9F E2 20      SEP #$20     ; A = 8-bit
  $82/DEA1 A9 A5      LDA #$A5               A:9C1F X:ABFA Y:0AC0 P:eNvMxdizc
+
  $82/DEA1 A9 A5      LDA #$A5
  $82/DEA3 85 25      STA $25   [$00:0025]  A:9CA5 X:ABFA Y:0AC0 P:eNvMxdizc
+
  $82/DEA3 85 25      STA $25
  $82/DEA5 A9 A4      LDA #$A4               A:9CA5 X:ABFA Y:0AC0 P:eNvMxdizc
+
  $82/DEA5 A9 A4      LDA #$A4     ; Compressed Data Bank: $A4
 
  $82/DEA7 22 CC F7 81 JSL $81F7CC[$81:F7CC]  A:9CA4 X:ABFA Y:0AC0 P:eNvMxdizc
 
  $82/DEA7 22 CC F7 81 JSL $81F7CC[$81:F7CC]  A:9CA4 X:ABFA Y:0AC0 P:eNvMxdizc
 
  $82/DEAB A9 7E      LDA #$7E                A:0400 X:AC89 Y:0400 P:eNvMxdizC
 
  $82/DEAB A9 7E      LDA #$7E                A:0400 X:AC89 Y:0400 P:eNvMxdizC
Line 10,711: Line 11,667:
 
  $82/DEB3 85 20      STA $20    [$00:0020]  A:2000 X:AC89 Y:0400 P:envmxdizC
 
  $82/DEB3 85 20      STA $20    [$00:0020]  A:2000 X:AC89 Y:0400 P:envmxdizC
 
  $82/DEB5 AD C4 16    LDA $16C4  [$82:16C4]  A:2000 X:AC89 Y:0400 P:envmxdizC
 
  $82/DEB5 AD C4 16    LDA $16C4  [$82:16C4]  A:2000 X:AC89 Y:0400 P:envmxdizC
  $82/DEB8 0A          ASL A                   A:001A X:AC89 Y:0400 P:envmxdizC
+
  $82/DEB8 0A          ASL A         ; Multiply value by 3 to use it as Load Index
  $82/DEB9 6D C4 16    ADC $16C4 [$82:16C4]  A:0034 X:AC89 Y:0400 P:envmxdizc
+
  $82/DEB9 6D C4 16    ADC $16C4     ; (Each Entry is 3 Bytes in Size)
  $82/DEBC AA          TAX                     A:004E X:AC89 Y:0400 P:envmxdizc
+
  $82/DEBC AA          TAX
 
  $82/DEBD BF 7E BB A6 LDA $A6BB7E,x[$A6:BBCC] A:004E X:004E Y:0400 P:envmxdizc
 
  $82/DEBD BF 7E BB A6 LDA $A6BB7E,x[$A6:BBCC] A:004E X:004E Y:0400 P:envmxdizc
 
  $82/DEC1 A8          TAY                    A:B7F4 X:004E Y:0400 P:eNvmxdizc
 
  $82/DEC1 A8          TAY                    A:B7F4 X:004E Y:0400 P:eNvmxdizc
Line 10,763: 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 [$82:16CA]  A:878B X:2000 Y:0003 P:eNvMxdizc
+
  $82/DF3C AD CA 16    LDA $16CA     ; Setup Outer Loop Counter:
  $82/DF3F 85 00      STA $00   [$00:0000]  A:871E X:2000 Y:0003 P:envMxdizc
+
  $82/DF3F 85 00      STA $00       ; Width of the Map of the Map on the NE-SW-Axis
 
  $82/DF41 A2 21 00    LDX #$0021              A:871E X:2000 Y:0003 P:envMxdizc
 
  $82/DF41 A2 21 00    LDX #$0021              A:871E X:2000 Y:0003 P:envMxdizc
  $82/DF44 AD C8 16    LDA $16C8 [$82:16C8]  A:871E X:0021 Y:0003 P:envMxdizc
+
  $82/DF44 AD C8 16    LDA $16C8     ; Setup Inner Loop Counter:
  $82/DF47 85 01      STA $01   [$00:0001]  A:871E X:0021 Y:0003 P:envMxdizc
+
  $82/DF47 85 01      STA $01       ; Width of the Map of the Map on the NW-SE-Axis
 
  $82/DF49 DA          PHX                    A:871E X:0021 Y:0003 P:envMxdizc
 
  $82/DF49 DA          PHX                    A:871E X:0021 Y:0003 P:envMxdizc
 
  $82/DF4A 7B          TDC                    A:871E X:0021 Y:0003 P:envMxdizc
 
  $82/DF4A 7B          TDC                    A:871E X:0021 Y:0003 P:envMxdizc
Line 10,789: Line 11,745:
 
  $82/DF85 9F 00 D0 7F STA $7FD000,x[$7F:D021] A:0003 X:0021 Y:0003 P:envMxdizc
 
  $82/DF85 9F 00 D0 7F STA $7FD000,x[$7F:D021] A:0003 X:0021 Y:0003 P:envMxdizc
 
  $82/DF89 29 1F      AND #$1F                A:0003 X:0021 Y:0003 P:envMxdizc
 
  $82/DF89 29 1F      AND #$1F                A:0003 X:0021 Y:0003 P:envMxdizc
  $82/DF8B 9F 00 D4 7F STA $7FD400,x[$7F:D421] A:0003 X:0021 Y:0003 P:envMxdizc
+
  $82/DF8B 9F 00 D4 7F STA $7FD400,x   ; Store in "Object" Type Map
  $82/DF8F 5A          PHY                     A:0003 X:0021 Y:0003 P:envMxdizc
+
  $82/DF8F 5A          PHY             ; Buffer Data Load Index on Stack
  $82/DF90 A8          TAY                     A:0003 X:0021 Y:0003 P:envMxdizc
+
  $82/DF90 A8          TAY             ; Transfer "Object" Type value in Y as Load Index
 
  $82/DF91 B7 26      LDA [$26],y[$8B:87E0]  A:0003 X:0021 Y:0003 P:envMxdizc
 
  $82/DF91 B7 26      LDA [$26],y[$8B:87E0]  A:0003 X:0021 Y:0003 P:envMxdizc
  $82/DF93 7A          PLY                     A:0017 X:0021 Y:0003 P:envMxdizc
+
  $82/DF93 7A          PLY             ; Restore Data Load Index from Stack
  $82/DF94 9F 00 CC 7F STA $7FCC00,x[$7F:CC21] A:0017 X:0021 Y:0003 P:envMxdizc
+
  $82/DF94 9F 00 CC 7F STA $7FCC00,x   ; Store in Terrain Type Map
  $82/DF98 C8          INY                     A:0017 X:0021 Y:0003 P:envMxdizc
+
  $82/DF98 C8          INY             ; Increment Load Index
  $82/DF99 E8          INX                     A:0017 X:0021 Y:0004 P:envMxdizc
+
  $82/DF99 E8          INX             ; Increment Store Index
  $82/DF9A C6 01      DEC $01   [$00:0001]  A:0017 X:0022 Y:0004 P:envMxdizc
+
  $82/DF9A C6 01      DEC $01         ; Decrement Inner Loop Counter
  $82/DF9C D0 AC      BNE $AC   [$DF4A]     A:0017 X:0022 Y:0004 P:envMxdizc
+
  $82/DF9C D0 AC      BNE $AC         ; [$DF4A] Loop until Counter is empty
 
  $82/DF51 7B          TDC                    A:00E2 X:0023 Y:0005 P:envMxdizC
 
  $82/DF51 7B          TDC                    A:00E2 X:0023 Y:0005 P:envMxdizC
 
  $82/DF52 9F 00 C8 7F STA $7FC800,x[$7F:C823] A:0000 X:0023 Y:0005 P:envMxdiZC
 
  $82/DF52 9F 00 C8 7F STA $7FC800,x[$7F:C823] A:0000 X:0023 Y:0005 P:envMxdiZC
Line 10,818: Line 11,774:
 
  $82/DFA4 AA          TAX                    A:0041 X:003F Y:0021 P:envmxdizc
 
  $82/DFA4 AA          TAX                    A:0041 X:003F Y:0021 P:envmxdizc
 
  $82/DFA5 E2 20      SEP #$20                A:0041 X:0041 Y:0021 P:envmxdizc
 
  $82/DFA5 E2 20      SEP #$20                A:0041 X:0041 Y:0021 P:envmxdizc
  $82/DFA7 C6 00      DEC $00   [$00:0000]  A:0041 X:0041 Y:0021 P:envMxdizc
+
  $82/DFA7 C6 00      DEC $00       ; Decrement Outer Loop Counter
  $82/DFA9 D0 99      BNE $99   [$DF44]     A:0041 X:0041 Y:0021 P:envMxdizc
+
  $82/DFA9 D0 99      BNE $99       ; [$DF44] Loop until Counter is empty
 
  $82/DFAB EE C8 16    INC $16C8  [$82:16C8]  A:03E1 X:03E1 Y:0387 P:envMxdiZc
 
  $82/DFAB EE C8 16    INC $16C8  [$82:16C8]  A:03E1 X:03E1 Y:0387 P:envMxdiZc
 
  $82/DFAE EE CA 16    INC $16CA  [$82:16CA]  A:03E1 X:03E1 Y:0387 P:envMxdizc
 
  $82/DFAE EE CA 16    INC $16CA  [$82:16CA]  A:03E1 X:03E1 Y:0387 P:envMxdizc
Line 10,862: Line 11,818:
 
  $82/DFF5 AA          TAX                    A:03C1 X:03E1 Y:0387 P:envmxdizc
 
  $82/DFF5 AA          TAX                    A:03C1 X:03E1 Y:0387 P:envmxdizc
 
  $82/DFF6 7B          TDC                    A:03C1 X:03C1 Y:0387 P:envmxdizc
 
  $82/DFF6 7B          TDC                    A:03C1 X:03C1 Y:0387 P:envmxdizc
  $82/DFF7 E2 20      SEP #$20               A:0000 X:03C1 Y:0387 P:envmxdiZc
+
  $82/DFF7 E2 20      SEP #$20     ; A = 8-bit
  $82/DFF9 BF 00 C8 7F LDA $7FC800,x[$7F:CBC1] A:0000 X:03C1 Y:0387 P:envMxdiZc
+
  $82/DFF9 BF 00 C8 7F LDA $7FC800,x ; Load Entry of the Step Map
 
  $82/DFFD C2 20      REP #$20                A:000A X:03C1 Y:0387 P:envMxdizc
 
  $82/DFFD C2 20      REP #$20                A:000A X:03C1 Y:0387 P:envMxdizc
 
  $82/DFFF C9 00 00    CMP #$0000              A:000A X:03C1 Y:0387 P:envmxdizc
 
  $82/DFFF C9 00 00    CMP #$0000              A:000A X:03C1 Y:0387 P:envmxdizc
Line 10,869: Line 11,825:
 
  $82/E004 C9 FF 00    CMP #$00FF              A:000A X:03C1 Y:0387 P:envmxdizC
 
  $82/E004 C9 FF 00    CMP #$00FF              A:000A X:03C1 Y:0387 P:envmxdizC
 
  $82/E007 D0 21      BNE $21    [$E02A]      A:000A X:03C1 Y:0387 P:eNvmxdizc
 
  $82/E007 D0 21      BNE $21    [$E02A]      A:000A X:03C1 Y:0387 P:eNvmxdizc
 +
;code is missing here
 
  $82/E02A AD C8 16    LDA $16C8  [$82:16C8]  A:000A X:03C1 Y:0387 P:eNvmxdizc
 
  $82/E02A AD C8 16    LDA $16C8  [$82:16C8]  A:000A X:03C1 Y:0387 P:eNvmxdizc
 
  $82/E02D 3A          DEC A                  A:001F X:03C1 Y:0387 P:envmxdizc
 
  $82/E02D 3A          DEC A                  A:001F X:03C1 Y:0387 P:envmxdizc
Line 10,890: Line 11,847:
 
  $82/E04E C9 FF 00    CMP #$00FF              A:001E X:003E Y:0387 P:envmxdizC
 
  $82/E04E C9 FF 00    CMP #$00FF              A:001E X:003E Y:0387 P:envmxdizC
 
  $82/E051 D0 21      BNE $21    [$E074]      A:001E X:003E Y:0387 P:eNvmxdizc
 
  $82/E051 D0 21      BNE $21    [$E074]      A:001E X:003E Y:0387 P:eNvmxdizc
 +
;code is missing here
 
  $82/E074 A5 00      LDA $00    [$00:0000]  A:001E X:003E Y:0387 P:eNvmxdizc
 
  $82/E074 A5 00      LDA $00    [$00:0000]  A:001E X:003E Y:0387 P:eNvmxdizc
 
  $82/E076 8D CE 16    STA $16CE  [$82:16CE]  A:FFA0 X:003E Y:0387 P:eNvmxdizc
 
  $82/E076 8D CE 16    STA $16CE  [$82:16CE]  A:FFA0 X:003E Y:0387 P:eNvmxdizc
Line 10,961: 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 10,979: 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 10,988: 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,000: 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,026: 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,037: 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 11,130: 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 11,151: 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 11,196: 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 11,209: 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 11,510: Line 12,481:
 
  $82/EB9D 8C E6 16    STY $16E6  [$82:16E6]  A:0780 X:0000 Y:FFFF P:eNvMxdizc
 
  $82/EB9D 8C E6 16    STY $16E6  [$82:16E6]  A:0780 X:0000 Y:FFFF P:eNvMxdizc
 
  $82/EBA0 6B          RTL                    A:0780 X:0000 Y:FFFF P:eNvMxdizc
 
  $82/EBA0 6B          RTL                    A:0780 X:0000 Y:FFFF P:eNvMxdizc
 +
 +
== $82/EBA5 ? ==
 +
 +
$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/EBAA 38          SEC                    A:0000 X:002E Y:0026 P:envmxdiZC
 +
$82/EBAB ED DA 16    SBC $16DA  [$82:16DA]  A:0000 X:002E Y:0026 P:envmxdiZC
 +
$82/EBAE 90 31      BCC $31    [$EBE1]      A:0001 X:002E Y:0026 P:envmxdizc
 +
;code is missing here
 +
$82/EBE1 AD E4 16    LDA $16E4  [$82:16E4]  A:0001 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/EBE8 90 2F      BCC $2F      ; [$EC19] Exit
 +
$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/EBEF 38          SEC                    A:0900 X:002E Y:0026 P:envmxdizC
 +
$82/EBF0 ED E6 16    SBC $16E6  [$82:16E6]  A:0900 X:002E Y:0026 P:envmxdizC
 +
$82/EBF3 0A          ASL A                  A:0580 X:002E Y:0026 P:envmxdizC
 +
$82/EBF4 EB          XBA                    A:0B00 X:002E Y:0026 P:envmxdizc
 +
$82/EBF5 85 02      STA $02    [$00:0002]  A:000B X:002E Y:0026 P:envmxdizc
 +
$82/EBF7 AD E2 16    LDA $16E2  [$82:16E2]  A:000B X:002E Y:0026 P:envmxdizc
 +
$82/EBFA 29 7F 00    AND #$007F              A:000E X:002E Y:0026 P:envmxdizc
 +
$82/EBFD 0A          ASL A                  A:000E X:002E Y:0026 P:envmxdizc
 +
$82/EBFE 0A          ASL A                  A:001C X:002E Y:0026 P:envmxdizc
 +
$82/EBFF 0A          ASL A                  A:0038 X:002E Y:0026 P:envmxdizc
 +
$82/EC00 85 04      STA $04    [$00:0004]  A:0070 X:002E Y:0026 P:envmxdizc
 +
$82/EC02 AD E6 16    LDA $16E6  [$82:16E6]  A:0070 X:002E Y:0026 P:envmxdizc
 +
$82/EC05 29 80 3F    AND #$3F80              A:0380 X:002E Y:0026 P:envmxdizc
 +
$82/EC08 4A          LSR A                  A:0380 X:002E Y:0026 P:envmxdizc
 +
$82/EC09 4A          LSR A                  A:01C0 X:002E Y:0026 P:envmxdizc
 +
$82/EC0A 4A          LSR A                  A:00E0 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/EC0E E2 20      SEP #$20      ; A = 8-bit
 +
$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/EC15 22 8A A1 80 JSL $80A18A  ; Wait for NMI
 +
$82/EC19 E2 20      SEP #$20      ; A = 8-bit
 +
$82/EC1B 60          RTS
  
 
== $82/F0FC ? ==
 
== $82/F0FC ? ==
Line 11,722: 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 11,752: 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 11,780: 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 11,795: 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 11,811: 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 11,894: 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 11,926: 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 12,236: 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 12,256: 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 12,262: 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 12,345: Line 13,368:
 
  $82/FB0D AB          PLB
 
  $82/FB0D AB          PLB
 
  $82/FB0E 6B          RTL
 
  $82/FB0E 6B          RTL
 +
 +
== $82/FCEA ? ==
 +
 +
$82/FCEA AF 89 BD 7E LDA $7EBD89[$7E:BD89]  A:0268 X:003E Y:0387 P:envMxdizc
 +
$82/FCEE C9 12      CMP #$12                A:020C X:003E Y:0387 P:envMxdizc
 +
$82/FCF0 B0 04      BCS $04    [$FCF6]      A:020C X:003E Y:0387 P:eNvMxdizc
 +
$82/FCF2 C9 06      CMP #$06                A:020C X:003E Y:0387 P:eNvMxdizc
 +
$82/FCF4 B0 6B      BCS $6B    [$FD61]      A:020C X:003E Y:0387 P:envMxdizC
 +
;code is missing here
 +
$82/FD61 AD BE 16    LDA $16BE  [$82:16BE]  A:020C X:003E Y:0387 P:envMxdizC
 +
$82/FD64 C9 03      CMP #$03                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
 +
$82/FD74 A9 01      LDA #$01      ; Setup $01 as Row Counter
 +
$82/FD76 85 01      STA $01
 +
$82/FD78 A9 01      LDA #$01      ; Setup $00 as Tile per Row Counter
 +
$82/FD7A 85 00      STA $00
 +
$82/FD7C 7B          TDC          ; Clear 16-bit A
 +
$82/FD7D A5 01      LDA $01      ; Load Row Counter value
 +
$82/FD7F C2 20      REP #$20      ; A = 16-bit
 +
$82/FD81 EB          XBA          ; Row Counter value * #$20
 +
$82/FD82 4A          LSR A
 +
$82/FD83 4A          LSR A
 +
$82/FD84 4A          LSR A
 +
$82/FD85 E2 20      SEP #$20      ; A = 8-bit
 +
$82/FD87 05 00      ORA $00      ; Add Tile per Row Counter
 +
$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/FD8D E8          INX          ; Increment Store Index
 +
$82/FD8E E6 00      INC $00      ; Increment Tile per Row Counter
 +
$82/FD90 A5 00      LDA $00      ; Check if Tile per Row Counter has exceeded...
 +
$82/FD92 CD C8 16    CMP $16C8    ; the Map Width on the NW-SE-Axis
 +
$82/FD95 90 F3      BCC $F3      ; [$FD8A] Loop if not
 +
$82/FD97 E6 01      INC $01      ; Else, increment the Row Counter
 +
$82/FD99 A5 01      LDA $01      ; Check if it has exceeded the Map Width/NE-SW-Axis
 +
$82/FD9B CD CA 16    CMP $16CA
 +
$82/FD9E 90 D8      BCC $D8      ; [$FD78] If not, Loop, else exit
 +
$82/FDA0 60          RTS
 +
 +
== $82/FDC0 ? ==
 +
 +
$82/FDC0 7B          TDC                    A:0021 X:0021 Y:0387 P:envMxdizc
 +
$82/FDC1 BF 00 D0 7F LDA $7FD000,x[$7F:D021] A:0000 X:0021 Y:0387 P:envMxdiZc
 +
$82/FDC5 29 1F      AND #$1F                A:0003 X:0021 Y:0387 P:envMxdizc
 +
$82/FDC7 C9 1F      CMP #$1F                A:0003 X:0021 Y:0387 P:envMxdizc
 +
$82/FDC9 D0 2F      BNE $2F    [$FDFA]      A:0003 X:0021 Y:0387 P:eNvMxdizc
 +
$82/FDCB BF 00 D0 7F LDA $7FD000,x[$7F:D1C6] A:001F X:01C6 Y:0387 P:envMxdiZC
 +
$82/FDCF 29 E0      AND #$E0                A:007F X:01C6 Y:0387 P:envMxdizC
 +
$82/FDD1 38          SEC                    A:0060 X:01C6 Y:0387 P:envMxdizC
 +
$82/FDD2 E9 40      SBC #$40                A:0060 X:01C6 Y:0387 P:envMxdizC
 +
$82/FDD4 B0 01      BCS $01    [$FDD7]      A:0020 X:01C6 Y:0387 P:envMxdizC
 +
$82/FDD6 7B          TDC                    A:00C0 X:034D Y:0387 P:eNvMxdizc
 +
$82/FDD7 09 1E      ORA #$1E                A:0020 X:01C6 Y:0387 P:envMxdizC
 +
$82/FDD9 9F 00 D0 7F STA $7FD000,x[$7F:D1C6] 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/FDE3 5A          PHY            ; Buffer Y on stack
 +
$82/FDE4 A8          TAY            ; Transfer "Object" Type Map value in Y as Load Index
 +
$82/FDE5 B7 26      LDA [$26],y    ; Load value from Data Table
 +
$82/FDE7 7A          PLY            ; Restore Y from stack
 +
$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/FDF0 3A          DEC A
 +
$82/FDF1 3A          DEC A
 +
$82/FDF2 9F 00 C8 7F STA $7FC800,x
 +
$82/FDF6 9F 00 D8 7F STA $7FD800,x  ; Set lowered value as Height Map value
 +
$82/FDFA 60          RTS
  
 
= Bank $83 =
 
= Bank $83 =
Line 12,350: 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