Difference between revisions of "Tactics Ogre:ROM map"

From Data Crystal
Jump to: navigation, search
(Added stuff from today)
(Current update)
Line 274: Line 274:
  
 
  Is just a RTS
 
  Is just a RTS
 +
 +
== $80/81C5 ? ==
 +
 +
$80/81C5 20 39 AD    JSR $AD39    ; RNG?
 +
$80/81C8 20 09 E0    JSR $E009  [$80:E009]  A:0015 X:0004 Y:000A P:envMxdizc
 +
$80/81CB AD C0 05    LDA $05C0  [$80:05C0]  A:0000 X:003E Y:000A P:eNvMxdizc
 +
$80/81CE D0 0C      BNE $0C    [$81DC]      A:0000 X:003E Y:000A P:envMxdiZc
 +
$80/81D0 20 BA B9    JSR $B9BA  [$80:B9BA]  A:0000 X:003E Y:000A P:envMxdiZc
 +
$80/81D3 20 BE 9A    JSR $9ABE  [$80:9ABE]  A:00C9 X:0040 Y:0000 P:envMxdiZC
 +
$80/81D6 20 0A 8A    JSR $8A0A  [$80:8A0A]  A:0E00 X:FFFF Y:0014 P:eNvMxdizC
 +
$80/81D9 20 F3 8B    JSR $8BF3  [$80:8BF3]  A:0048 X:003C Y:0000 P:envMxdiZC
 +
$80/81DC 22 19 80 86 JSL $868019[$86:8019]  A:0000 X:003C Y:0000 P:envMxdiZC
 +
$80/81E0 20 F0 95    JSR $95F0  [$80:95F0]  A:0001 X:0541 Y:0100 P:eNvMxdizC
 +
$80/81E3 A9 01      LDA #$01      ; Set Flag for a CGRAM Update
 +
$80/81E5 8D 49 12    STA $1249
 +
$80/81E8 60          RTS
  
 
== $80/8900 Increment Jump Table Index? ==
 
== $80/8900 Increment Jump Table Index? ==
Line 280: Line 296:
 
  $80/8903 9C C0 05    STZ $05C0    ; ... and set the other to zero?
 
  $80/8903 9C C0 05    STZ $05C0    ; ... and set the other to zero?
 
  $80/8906 60          RTS
 
  $80/8906 60          RTS
 +
 +
== $80/897D ? ==
 +
 +
$80/897D A2 20 00    LDX #$0020              A:101F X:001F Y:0001 P:eNvMxdizC
 +
$80/8980 AD 91 05    LDA $0591    ; Load BG1 H-Scroll Low Byte
 +
$80/8983 29 07      AND #$07      ; Check if any of the lowest three bits is set
 +
$80/8985 F0 01      BEQ $01      ; [$8988] Branch if not
 +
$80/8988 8A          TXA                    A:1000 X:0020 Y:0001 P:envMxdiZC
 +
$80/8989 85 00      STA $00    [$00:0000]  A:1020 X:0020 Y:0001 P:envMxdizC
 +
$80/898B A0 1C 00    LDY #$001C              A:1020 X:0020 Y:0001 P:envMxdizC
 +
$80/898E AD 93 05    LDA $0593  [$80:0593]  A:1020 X:0020 Y:001C P:envMxdizC
 +
$80/8991 29 07      AND #$07                A:1010 X:0020 Y:001C P:envMxdizC
 +
$80/8993 F0 01      BEQ $01    [$8996]      A:1000 X:0020 Y:001C P:envMxdiZC
 +
$80/8996 98          TYA                    A:1000 X:0020 Y:001C P:envMxdiZC
 +
$80/8997 85 02      STA $02    [$00:0002]  A:101C X:0020 Y:001C P:envMxdizC
 +
$80/8999 AE 91 05    LDX $0591  [$80:0591]  A:101C X:0020 Y:001C P:envMxdizC
 +
$80/899C 86 04      STX $04    [$00:0004]  A:101C X:01A0 Y:001C P:envMxdizC
 +
$80/899E AC 93 05    LDY $0593  [$80:0593]  A:101C X:01A0 Y:001C P:envMxdizC
 +
$80/89A1 84 06      STY $06    [$00:0006]  A:101C X:01A0 Y:0110 P:envMxdizC
 +
$80/89A3 A9 03      LDA #$03                A:101C X:01A0 Y:0110 P:envMxdizC
 +
$80/89A5 22 FC F0 82 JSL $82F0FC[$82:F0FC]  A:1003 X:01A0 Y:0110 P:envMxdizC
 +
$80/89A9 60          RTS                    A:0700 X:0028 Y:7BA0 P:eNvMxdizc
 +
  
 
== $80/89AA BATTLE: Long Jump to Check if the Cursor is in Screen Center ==
 
== $80/89AA BATTLE: Long Jump to Check if the Cursor is in Screen Center ==
Line 421: Line 460:
 
  $80/8C03 49 FF FF    EOR #$FFFF    ; Turn the difference in a positive number
 
  $80/8C03 49 FF FF    EOR #$FFFF    ; Turn the difference in a positive number
 
  $80/8C06 1A          INC A        ; (INC A is part of the turning into a positive number)
 
  $80/8C06 1A          INC A        ; (INC A is part of the turning into a positive number)
$80/8C20 E2 20      SEP #$20                A:0001 X:3300 Y:0002 P:envmxdizC
+
  $80/8C07 85 0C      STA $0C      ; Store (positive) Difference of the H-Scrolls in $0C
$80/8C22 A5 67      LDA $67    [$00:0067]  A:0001 X:3300 Y:0002 P:envMxdizC
 
$80/8C24 1A          INC A                  A:0008 X:3300 Y:0002 P:envMxdizC
 
$80/8C25 20 F0 A8    JSR $A8F0    ; Calculate the Square Number of A
 
$80/8C28 C2 20      REP #$20                A:0051 X:3300 Y:0002 P:envMxdizC
 
$80/8C2A 85 04      STA $04    [$00:0004]  A:0051 X:3300 Y:0002 P:envmxdizC
 
$80/8C2C A5 0C      LDA $0C    [$00:000C]  A:0051 X:3300 Y:0002 P:envmxdizC
 
$80/8C2E 22 01 A9 80 JSL $80A901[$80:A901]  A:0001 X:3300 Y:0002 P:envmxdizC
 
; Code is missing here
 
  $80/8C07 85 0C      STA $0C      ; Store Difference in $0C
 
 
  $80/8C09 AD 93 05    LDA $0593    ; Load BG1 VScroll Buffer
 
  $80/8C09 AD 93 05    LDA $0593    ; Load BG1 VScroll Buffer
 
  $80/8C0C 38          SEC          ; Subtract another BG1 VScroll Buffer
 
  $80/8C0C 38          SEC          ; Subtract another BG1 VScroll Buffer
Line 436: Line 466:
 
  $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 Difference 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
; Code is missing here
+
$80/8C20 E2 20      SEP #$20                A:0001 X:3300 Y:0002 P:envmxdizC
  $80/8C32 D4 02      PEI ($02)    ; Buffer $00-$03 on Stack
+
$80/8C22 A5 67      LDA $67      ; ??? (seems to be always 8)
 +
$80/8C24 1A          INC A        ; ???
 +
$80/8C25 20 F0 A8    JSR $A8F0    ; Calculate the Square Number of A
 +
$80/8C28 C2 20      REP #$20      ; 16-bit A
 +
$80/8C2A 85 04      STA $04      ; ?? $04 = ($6C + 1)²  (= #$51)
 +
$80/8C2C A5 0C      LDA $0C      ; Load (positive) Difference of the H-Scrolls in $0C
 +
$80/8C2E 22 01 A9 80 JSL $80A901  ; Calculate the Square Number of 16-bit A
 +
  $80/8C32 D4 02      PEI ($02)    ; Buffer $00-$03 on Stack (which is the Square Number Result)
 
  $80/8C34 D4 00      PEI ($00)
 
  $80/8C34 D4 00      PEI ($00)
  $80/8C36 A5 0E      LDA $0E   [$00:000E]  A:0000 X:3300 Y:0002 P:eNvmxdizc
+
  $80/8C36 A5 0E      LDA $0E       ; Load (positive) Difference of the V-Scrolls in $0E
  $80/8C38 22 01 A9 80 JSL $80A901[$80:A901]   A:0000 X:3300 Y:0002 P:envmxdiZc
+
  $80/8C38 22 01 A9 80 JSL $80A901  ; Calculate the Square Number of 16-bit A
  $80/8C3C 18          CLC                     A:0000 X:3300 Y:0002 P:eNvmxdizc
+
  $80/8C3C 18          CLC           ; Clear Carry
  $80/8C3D 68          PLA                     A:0000 X:3300 Y:0002 P:eNvmxdizc
+
  $80/8C3D 68          PLA           ; Pull the the two low bytes of the H-Scroll-Square Number
  $80/8C3E 65 00      ADC $00   [$00:0000]  A:0001 X:3300 Y:0002 P:envmxdizc
+
  $80/8C3E 65 00      ADC $00       ; Add V-Scroll-Square Number low bytes
  $80/8C40 85 00      STA $00   [$00:0000]  A:0001 X:3300 Y:0002 P:envmxdizc
+
  $80/8C40 85 00      STA $00       ; Store in $00/1
  $80/8C42 68          PLA                     A:0001 X:3300 Y:0002 P:envmxdizc
+
  $80/8C42 68          PLA           ; Pull the the two high bytes of the H-Scroll-Square Number
  $80/8C43 65 02      ADC $02   [$00:0002]  A:0000 X:3300 Y:0002 P:envmxdiZc
+
  $80/8C43 65 02      ADC $02       ; Add V-Scroll-Square Number high bytes
  $80/8C45 85 02      STA $02   [$00:0002]  A:0000 X:3300 Y:0002 P:envmxdiZc
+
  $80/8C45 85 02      STA $02       ; Store in $02/3
  $80/8C47 A5 00      LDA $00   [$00:0000]  A:0000 X:3300 Y:0002 P:envmxdiZc
+
  $80/8C47 A5 00      LDA $00       ; If the Low Bytes of the added Square Numbers is higher/same than $04...
  $80/8C49 C5 04      CMP $04   [$00:0004]  A:0001 X:3300 Y:0002 P:envmxdizc
+
  $80/8C49 C5 04      CMP $04       ; ... then this CMP sets the Carry that gets subrtracted...
  $80/8C4B A5 02      LDA $02   [$00:0002]  A:0001 X:3300 Y:0002 P:eNvmxdizc
+
  $80/8C4B A5 02      LDA $02       ; ... from the added Square Numbers High Bytes in these two lines
  $80/8C4D E9 00 00    SBC #$0000             A:0000 X:3300 Y:0002 P:envmxdiZc
+
  $80/8C4D E9 00 00    SBC #$0000
  $80/8C50 90 25      BCC $25   [$8C77]     A:FFFF X:3300 Y:0002 P:eNvmxdizc
+
  $80/8C50 90 25      BCC $25       ; [$8C77] Branch if this subtraction needed the borrow
 
  $80/8C52 22 FC AB 80 JSL $80ABFC[$80:ABFC]  A:0000 X:003C Y:0002 P:envmxdiZC
 
  $80/8C52 22 FC AB 80 JSL $80ABFC[$80:ABFC]  A:0000 X:003C Y:0002 P:envmxdiZC
 
  $80/8C56 85 08      STA $08    [$00:0008]  A:0010 X:003C Y:0002 P:eNvmxdizC
 
  $80/8C56 85 08      STA $08    [$00:0008]  A:0010 X:003C Y:0002 P:eNvmxdizC
Line 479: Line 516:
 
  $80/8C7F E5 0C      SBC $0C
 
  $80/8C7F E5 0C      SBC $0C
 
  $80/8C81 85 0C      STA $0C
 
  $80/8C81 85 0C      STA $0C
  $80/8C83 98          TYA                     A:FFFF X:3300 Y:0002 P:eNvmxdizc
+
  $80/8C83 98          TYA           ; Test if Bit 0 in Y is set (Signal for negative difference in V-Scroll)
  $80/8C84 89 01 00    BIT #$0001             A:0002 X:3300 Y:0002 P:envmxdizc
+
  $80/8C84 89 01 00    BIT #$0001
  $80/8C87 F0 06      BEQ $06   [$8C8F]     A:0002 X:3300 Y:0002 P:envmxdiZc
+
  $80/8C87 F0 06      BEQ $06       ; [$8C8F] Branch if positive difference
 +
; Code is missing here
 +
$80/8C8F A5 0C      LDA $0C      ; Load (positive/negative) Difference of the H-Scrolls
 +
$80/8C91 18          CLC
 +
$80/8C92 6D 71 05    ADC $0571    ; Add BG1 H-Scroll
 +
$80/8C95 8D 91 05    STA $0591    ; Set as BG1 H-Scroll
 +
$80/8C98 8D 95 05    STA $0595    ; Set as BG2 H-Scroll
 +
$80/8C9B A5 0E      LDA $0E      ; Load (positive/negative) Difference of the V-Scrolls
 +
$80/8C9D 18          CLC
 +
$80/8C9E 6D 73 05    ADC $0573    ; Add BG1 V-Scroll
 +
$80/8CA1 8D 93 05    STA $0593    ; Set as BG1 V-Scroll
 +
$80/8CA4 8D 97 05    STA $0597    ; Set as BG2 V-Scroll
 +
$80/8CA7 AE 91 05    LDX $0591    ; X = BG1 H-Scroll
 +
$80/8CAA AC 93 05    LDY $0593    ; Y = BG1 V-Scroll
 +
$80/8CAD EC 71 05    CPX $0571    ; Compare new H-Scroll to the old
 +
$80/8CB0 30 1A      BMI $1A      ; [$8CCC] Branch if the difference was negative = scroll value got less
 +
; Code is missing here
 +
$80/8CCC AD 71 05    LDA $0571    ; Load old H-Scroll
 +
$80/8CCF 29 F8 FF    AND #$FFF8    ; Remove lowest 3 Bits
 +
$80/8CD2 85 00      STA $00      ; Buffer in $00
 +
$80/8CD4 8A          TXA          ; A = BG1 H-Scroll
 +
$80/8CD5 29 F8 FF    AND #$FFF8    ; Remove lowest 3 Bits
 +
$80/8CD8 C5 00      CMP $00      ; Check if the difference between old and new H-Scroll is bigger than 8px
 +
$80/8CDA F0 07      BEQ $07      ; [$8CE3] Branch if not
 
; Code is missing here
 
; Code is missing here
$80/8C8F A5 0C       LDA $0C    [$00:000C]  A:0002 X:3300 Y:0002 P:envmxdiZc
+
$80/8CDC E2 20       SEP #$20                A:00D8 X:00DF Y:0060 P:eNvmxdizc
$80/8C91 18          CLC                    A:FFFF X:3300 Y:0002 P:eNvmxdizc
+
$80/8CDE 20 45 8D    JSR $8D45 [$80:8D45]  A:00D8 X:00DF Y:0060 P:eNvMxdizc
$80/8C92 6D 71 05    ADC $0571  [$80:0571]  A:FFFF X:3300 Y:0002 P:eNvmxdizc
+
$80/8CE1 C2 20       REP #$20                A:0038 X:0006 Y:781B P:eNvMxdizc
$80/8C95 8D 91 05    STA $0591  [$80:0591]  A:00E5 X:3300 Y:0002 P:envmxdizC
+
  $80/8CE3 AE 91 05    LDX $0591     ; X = BG1 H-Scroll
$80/8C98 8D 95 05    STA $0595  [$80:0595]  A:00E5 X:3300 Y:0002 P:envmxdizC
+
  $80/8CE6 AC 93 05    LDY $0593     ; Y = BG1 V-Scroll
$80/8C9B A5 0E      LDA $0E    [$00:000E]  A:00E5 X:3300 Y:0002 P:envmxdizC
+
  $80/8CE9 CC 73 05    CPY $0573     ; Compare new Y-Scroll to the old
$80/8C9D 18          CLC                    A:0000 X:3300 Y:0002 P:envmxdiZC
+
  $80/8CEC 30 1A      BMI $1A       ; [$8D08] Branch if the difference was negative = scroll value got less
$80/8C9E 6D 73 05    ADC $0573  [$80:0573]  A:0000 X:3300 Y:0002 P:envmxdiZc
+
  $80/8CEE AD 73 05    LDA $0573     ; Load old V-Scroll
$80/8CA1 8D 93 05    STA $0593  [$80:0593]  A:0060 X:3300 Y:0002 P:envmxdizc
+
  $80/8CF1 3A          DEC A         ; ??? Decrement V-Scroll by 1 (why?)
$80/8CA4 8D 97 05    STA $0597  [$80:0597]  A:0060 X:3300 Y:0002 P:envmxdizc
+
  $80/8CF2 29 F8 FF    AND #$FFF8   ; Remove lowest 3 Bits
$80/8CA7 AE 91 05    LDX $0591  [$80:0591]  A:0060 X:3300 Y:0002 P:envmxdizc
+
  $80/8CF5 85 00      STA $00       ; Buffer in $00
$80/8CAA AC 93 05    LDY $0593  [$80:0593]  A:0060 X:00E5 Y:0002 P:envmxdizc
+
  $80/8CF7 98          TYA           ; A = BG1 V-Scroll
$80/8CAD EC 71 05    CPX $0571  [$80:0571]  A:0060 X:00E5 Y:0060 P:envmxdizc
+
  $80/8CF8 3A          DEC A         ; ??? Decrement V-Scroll by 1 (why?)
$80/8CB0 30 1A      BMI $1A   [$8CCC]      A:0060 X:00E5 Y:0060 P:eNvmxdizc
+
  $80/8CF9 29 F8 FF    AND #$FFF8   ; Remove lowest 3 Bits
$80/8CCC AD 71 05    LDA $0571 [$80:0571]  A:0060 X:00E5 Y:0060 P:eNvmxdizc
+
  $80/8CFC C5 00      CMP $00       ; Check if the difference between old and new H-Scroll is bigger than 8px
$80/8CCF 29 F8 FF    AND #$FFF8              A:00E6 X:00E5 Y:0060 P:envmxdizc
 
$80/8CD2 85 00       STA $00    [$00:0000]  A:00E0 X:00E5 Y:0060 P:envmxdizc
 
$80/8CD4 8A          TXA                    A:00E0 X:00E5 Y:0060 P:envmxdizc
 
$80/8CD5 29 F8 FF    AND #$FFF8              A:00E5 X:00E5 Y:0060 P:envmxdizc
 
$80/8CD8 C5 00      CMP $00    [$00:0000]  A:00E0 X:00E5 Y:0060 P:envmxdizc
 
$80/8CDA F0 07      BEQ $07    [$8CE3]      A:00E0 X:00E5 Y:0060 P:envmxdiZC
 
  $80/8CE3 AE 91 05    LDX $0591 [$80:0591]  A:00E0 X:00E5 Y:0060 P:envmxdiZC
 
  $80/8CE6 AC 93 05    LDY $0593 [$80:0593]  A:00E0 X:00E5 Y:0060 P:envmxdizC
 
  $80/8CE9 CC 73 05    CPY $0573 [$80:0573]  A:00E0 X:00E5 Y:0060 P:envmxdizC
 
  $80/8CEC 30 1A      BMI $1A   [$8D08]     A:00E0 X:00E5 Y:0060 P:envmxdiZC
 
  $80/8CEE AD 73 05    LDA $0573 [$80:0573]  A:00E0 X:00E5 Y:0060 P:envmxdiZC
 
  $80/8CF1 3A          DEC A                   A:0060 X:00E5 Y:0060 P:envmxdizC
 
  $80/8CF2 29 F8 FF    AND #$FFF8             A:005F X:00E5 Y:0060 P:envmxdizC
 
  $80/8CF5 85 00      STA $00   [$00:0000]  A:0058 X:00E5 Y:0060 P:envmxdizC
 
  $80/8CF7 98          TYA                     A:0058 X:00E5 Y:0060 P:envmxdizC
 
  $80/8CF8 3A          DEC A                   A:0060 X:00E5 Y:0060 P:envmxdizC
 
  $80/8CF9 29 F8 FF    AND #$FFF8             A:005F X:00E5 Y:0060 P:envmxdizC
 
  $80/8CFC C5 00      CMP $00   [$00:0000]  A:0058 X:00E5 Y:0060 P:envmxdizC
 
 
  $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
 +
 +
== $80/8D45 ? ==
 +
 +
$80/8D45 A9 01      LDA #$01                A:00D8 X:00DF Y:0060 P:eNvMxdizc
 +
$80/8D47 85 00      STA $00    [$00:0000]  A:0001 X:00DF Y:0060 P:envMxdizc
 +
$80/8D49 A9 1C      LDA #$1C                A:0001 X:00DF Y:0060 P:envMxdizc
 +
$80/8D4B 85 02      STA $02    [$00:0002]  A:001C X:00DF Y:0060 P:envMxdizc
 +
$80/8D4D 98          TYA                    A:001C X:00DF Y:0060 P:envMxdizc
 +
$80/8D4E 29 07      AND #$07                A:0060 X:00DF Y:0060 P:envMxdizc
 +
$80/8D50 F0 02      BEQ $02    [$8D54]      A:0000 X:00DF Y:0060 P:envMxdiZc
 +
; Code is missing here
 +
$80/8D54 86 04      STX $04    [$00:0004]  A:0000 X:00DF Y:0060 P:envMxdiZc
 +
$80/8D56 84 06      STY $06    [$00:0006]  A:0000 X:00DF Y:0060 P:envMxdiZc
 +
$80/8D58 22 60 81 99 JSL $998160[$99:8160]  A:0000 X:00DF Y:0060 P:envMxdiZc
 +
$80/8D5C 90 07      BCC $07    [$8D65]      A:0000 X:00DF Y:0060 P:envMxdizC
 +
$80/8D5E A9 03      LDA #$03                A:0000 X:00DF Y:0060 P:envMxdizC
 +
$80/8D60 22 FC F0 82 JSL $82F0FC[$82:F0FC]  A:0003 X:00DF Y:0060 P:envMxdizC
 +
$80/8D64 60          RTS                    A:0038 X:0006 Y:781B P:eNvMxdizc
  
 
== $80/8D6A Long Jump to Fade Screen In or Out ==
 
== $80/8D6A Long Jump to Fade Screen In or Out ==
  
  $80/8D6A 8B          PHB          ; Buffer Program Bank
+
  $80/8D6A 8B          PHB          ; Buffer Data Bank
  $80/8D6B 4B          PHK          ; Set $80 as Program Bank
+
  $80/8D6B 4B          PHK          ; Set $80 as Data Bank
 
  $80/8D6C AB          PLB
 
  $80/8D6C AB          PLB
 
  $80/8D6D 20 72 8D    JSR $8D72    ; Fade Screen In or Out
 
  $80/8D6D 20 72 8D    JSR $8D72    ; Fade Screen In or Out
  $80/8D70 AB          PLB          ; Restore Program Bank
+
  $80/8D70 AB          PLB          ; Restore Data Bank
 
  $80/8D71 6B          RTL
 
  $80/8D71 6B          RTL
  
Line 557: Line 617:
 
  $80/8DA4 8D 87 05    STA $0587
 
  $80/8DA4 8D 87 05    STA $0587
 
  $80/8DA7 60          RTS
 
  $80/8DA7 60          RTS
 +
 +
== $80/8DA8 BATTLE: Load Palette Number for Color Cycling ==
 +
 +
$80/8DA8 8B          PHB          ; Buffer Data Bank
 +
$80/8DA9 4B          PHK          ; Set $80 as Data Bank
 +
$80/8DAA AB          PLB                    A:0000 X:0000 Y:0320 P:envMxdiZC
 +
$80/8DAB A5 A3      LDA $A3    [$00:00A3]  A:0000 X:0000 Y:0320 P:eNvMxdizC
 +
$80/8DAD 89 02      BIT #$02                A:0000 X:0000 Y:0320 P:envMxdiZC
 +
$80/8DAF F0 0C      BEQ $0C    [$8DBD]      A:0000 X:0000 Y:0320 P:envMxdiZC
 +
; Code is missing here
 +
$80/8DBD BD 56 1A    LDA $1A56,x[$80:1A56]  A:0000 X:0000 Y:0320 P:envMxdiZC
 +
$80/8DC0 18          CLC                    A:0007 X:0000 Y:0320 P:envMxdizC
 +
$80/8DC1 69 10      ADC #$10                A:0007 X:0000 Y:0320 P:envMxdizc
 +
$80/8DC3 AB          PLB          ; Restore Data Bank
 +
$80/8DC4 6B          RTL
 +
 +
== $80/8DC5 BATTLE: Long Jump to Setup HDMA Data Tables for Color Cycling ==
 +
 +
$80/8DC5 8B          PHB          ; Buffer Data Bank
 +
$80/8DC6 4B          PHK          ; Set $80 as Data Bank
 +
$80/8DC7 AB          PLB
 +
$80/8DC8 20 CD 8D    JSR $8DCD    ; Setup HDMA Data Tables for Color Cycling
 +
$80/8DCB AB          PLB          ; Restore Data Bank
 +
$80/8DCC 6B          RTL
 +
 +
== $80/8DCD BATTLE: Setup HDMA Data Tables for Color Cycling ==
 +
 +
This prepares the Data Tables for two HDMAs that do color cycling.
 +
 +
The Data Tables are going to be at $7E/BEBE and $7E/C0BE (and $7E/BFBE and $7E/C1BE, more on that later). They will consist of two bytes CGRAM address followed by two bytes of Color Data.
 +
 +
The second half of the subroutine is executed twice: At $8DE6, it jumps to the next line as a subroutine; it executes everything and then reaches a RTS. This RTS moves it back to $8DE9 where it executes everything again. As the Store Index in X isn't changed, it goes on writing the same stuff in the registers after whose who where worked off in the first run.
 +
 +
$80/8DCD 7B          TDC          ; Clear 16-bit A
 +
$80/8DCE A5 9C      LDA $9C      ; Load Index which Palette to use
 +
$80/8DD0 C2 20      REP #$20      ; 16-bit A
 +
$80/8DD2 29 FF 00    AND #$00FF    ; This line could be removed
 +
$80/8DD5 0A          ASL A        ; Multiply by 2, each entry is 2 bytes in size
 +
$80/8DD6 AA          TAX
 +
$80/8DD7 BF EE E3 84 LDA $84E3EE,x ; Load Palette Address
 +
$80/8DDB 85 20      STA $20      ; Setup Load Address for Palettes in $20/1
 +
$80/8DDD E2 20      SEP #$20      ; 8-bit A
 +
$80/8DDF A9 84      LDA #$84      ; Set Load Address Bank to $84 in $22
 +
$80/8DE1 85 22      STA $22
 +
$80/8DE3 A2 00 00    LDX #$0000    ; Clear Store Index
 +
$80/8DE6 20 E9 8D    JSR $8DE9    ; EXECUTE THE REST OF THE SUBROUTINE TWICE
 +
 +
$80/8DE9 8B          PHB          ; Buffer Data Bank on Stack
 +
$80/8DEA A9 7E      LDA #$7E      ; Set Data Bank to $7E
 +
$80/8DEC 48          PHA
 +
$80/8DED AB          PLB
 +
$80/8DEE A0 00 00    LDY #$0000    ; Clear Data Load Index
 +
$80/8DF1 A9 4E      LDA #$4E      ; Set as 1st color to change with the 1st table #$(00)4E
 +
$80/8DF3 9D BF BE    STA $BEBF,x
 +
$80/8DF6 A9 5E      LDA #$5E      ; Set as 2nd color to change with the 1st table #$(00)5E
 +
$80/8DF8 9D C3 BE    STA $BEC3,x
 +
$80/8DFB A9 6E      LDA #$6E      ; Set as 1st color to change with the 2nd table #$(00)6E
 +
$80/8DFD 9D BF C0    STA $C0BF,x
 +
$80/8E00 A9 7E      LDA #$7E      ; Set as 2nd color to change with the 2nd table #$(00)7E
 +
$80/8E02 9D C3 C0    STA $C0C3,x
 +
$80/8E05 C2 20      REP #$20      ; 16-bit A
 +
$80/8E07 B7 20      LDA [$20],y  ; Load Byte (Color)
 +
$80/8E09 9D C0 BE    STA $BEC0,x  ; Color for CGRAM entry #$004E
 +
$80/8E0C 9D C4 BE    STA $BEC4,x  ; Color for CGRAM entry #$005E
 +
$80/8E0F 9D C0 C0    STA $C0C0,x  ; Color for CGRAM entry #$006E
 +
$80/8E12 9D C4 C0    STA $C0C4,x  ; Color for CGRAM entry #$007E
 +
$80/8E15 8A          TXA          ; Increment Store Index by 8 - do the next 2 entries
 +
$80/8E16 18          CLC
 +
$80/8E17 69 08 00    ADC #$0008
 +
$80/8E1A AA          TAX
 +
$80/8E1B E2 20      SEP #$20      ; 8-bit A
 +
$80/8E1D C8          INY          ; Increment Load Index for the next color twice
 +
$80/8E1E C8          INY
 +
$80/8E1F C0 20 00    CPY #$0020    ; Loop until it has done sixteen colors
 +
$80/8E22 90 CD      BCC $CD      ; [$8DF1]
 +
$80/8E24 88          DEY          ; Decrement Load Index for the next color twice - do the colors backwards
 +
$80/8E25 88          DEY
 +
$80/8E26 A9 4E      LDA #$4E      ; Set as 1st color to change with the 1st table #$(00)4E
 +
$80/8E28 9D BF BE    STA $BEBF,x
 +
$80/8E2B A9 5E      LDA #$5E      ; Set as 2nd color to change with the 1st table #$(00)5E
 +
$80/8E2D 9D C3 BE    STA $BEC3,x
 +
$80/8E30 A9 6E      LDA #$6E      ; Set as 1st color to change with the 2nd table #$(00)6E
 +
$80/8E32 9D BF C0    STA $C0BF,x
 +
$80/8E35 A9 7E      LDA #$7E      ; Set as 2nd color to change with the 2nd table #$(00)7E
 +
$80/8E37 9D C3 C0    STA $C0C3,x
 +
$80/8E3A C2 20      REP #$20      ; 16-bit A
 +
$80/8E3C B7 20      LDA [$20],y  ; Load Byte (Color)
 +
$80/8E3E 9D C0 BE    STA $BEC0,x  ; Color for CGRAM entry #$004E
 +
$80/8E41 9D C4 BE    STA $BEC4,x  ; Color for CGRAM entry #$005E
 +
$80/8E44 9D C0 C0    STA $C0C0,x  ; Color for CGRAM entry #$006E
 +
$80/8E47 9D C4 C0    STA $C0C4,x  ; Color for CGRAM entry #$007E
 +
$80/8E4A 8A          TXA          ; Increment Store Index by 8 - do the next 2 entries
 +
$80/8E4B 18          CLC
 +
$80/8E4C 69 08 00    ADC #$0008
 +
$80/8E4F AA          TAX
 +
$80/8E50 E2 20      SEP #$20      ; 8-bit A
 +
$80/8E52 88          DEY          ; Decrement Load Index for the next color twice - do the colors backwards
 +
$80/8E53 88          DEY
 +
$80/8E54 10 D0      BPL $D0      ; [$8E26] Loop until it has done sixteen colors
 +
$80/8E56 C2 20      REP #$20      ; 16-bit A
 +
$80/8E58 AD 93 05    LDA $0593    ; Copy BG1 V-Scroll value in $BE88
 +
$80/8E5B 8D 88 BE    STA $BE88
 +
$80/8E5E E2 20      SEP #$20      ; 8-bit A
 +
$80/8E60 AB          PLB          ; Restore Data Bank from Stack
 +
$80/8E61 60          RTS
 +
 +
== $80/8E62 BATTLE: Color HDMA related ==
 +
 +
Executed while movement possibilities are shown
 +
 +
$80/8E62 8B          PHB          ; Buffer Data Bank on Stack - this line could be removed
 +
$80/8E63 4B          PHK          ; Set Data Bank to $80 - this line could be removed
 +
$80/8E64 AB          PLB          ; this line could be removed
 +
$80/8E65 20 6A 8E    JSR $8E6A  [$80:8E6A]  A:0060 X:0200 Y:FFFE P:eNvMxdizc
 +
$80/8E68 AB          PLB          ; Restore Data Bank - this line could be removed
 +
$80/8E69 6B          RTL
 +
 +
== $80/8E6A BATTLE: Color HDMA related ==
 +
 +
Executed while movement possibilities are shown
 +
 +
$80/8E6A 8B          PHB          ; Buffer Data Bank on Stack
 +
$80/8E6B A9 7E      LDA #$7E      ; Set Data Bank to $7E - this line could be removed
 +
$80/8E6D 48          PHA
 +
$80/8E6E AB          PLB
 +
$80/8E6F A2 8A BE    LDX #$BE8A              A:007E X:0200 Y:FFFE P:envMxdizc
 +
$80/8E72 8E 84 BE    STX $BE84  [$7E:BE84]  A:007E X:BE8A Y:FFFE P:eNvMxdizc
 +
$80/8E75 A2 00 00    LDX #$0000              A:007E X:BE8A Y:FFFE P:eNvMxdizc
 +
$80/8E78 AD EE 05    LDA $05EE    ; Load $4209 Buffer (V Timer Low Byte)
 +
$80/8E7B 48          PHA          ; Copy it on Stack
 +
$80/8E7C C9 41      CMP #$41      ; Check if it is more than #$40
 +
$80/8E7E 90 02      BCC $02      ; [$8E82] if not, use that value...
 +
$80/8E80 A9 40      LDA #$40      ; ... else, use #$40
 +
$80/8E82 09 80      ORA #$80                A:0040 X:0000 Y:FFFE P:envMxdizC
 +
$80/8E84 9D 8A BE    STA $BE8A,x[$7E:BE8A]  A:00C0 X:0000 Y:FFFE P:eNvMxdizC
 +
$80/8E87 9D 97 BE    STA $BE97,x[$7E:BE97]  A:00C0 X:0000 Y:FFFE P:eNvMxdizC
 +
$80/8E8A 9D A4 BE    STA $BEA4,x[$7E:BEA4]  A:00C0 X:0000 Y:FFFE P:eNvMxdizC
 +
$80/8E8D 9D B1 BE    STA $BEB1,x[$7E:BEB1]  A:00C0 X:0000 Y:FFFE P:eNvMxdizC
 +
$80/8E90 E8          INX                    A:00C0 X:0000 Y:FFFE P:eNvMxdizC
 +
$80/8E91 C2 20      REP #$20                A:00C0 X:0001 Y:FFFE P:envMxdizC
 +
$80/8E93 A9 BE BE    LDA #$BEBE              A:00C0 X:0001 Y:FFFE P:envmxdizC
 +
$80/8E96 9D 8A BE    STA $BE8A,x[$7E:BE8B]  A:BEBE X:0001 Y:FFFE P:eNvmxdizC
 +
$80/8E99 9D A4 BE    STA $BEA4,x[$7E:BEA5]  A:BEBE X:0001 Y:FFFE P:eNvmxdizC
 +
$80/8E9C A9 BE C0    LDA #$C0BE              A:BEBE X:0001 Y:FFFE P:eNvmxdizC
 +
$80/8E9F 9D 97 BE    STA $BE97,x[$7E:BE98]  A:C0BE X:0001 Y:FFFE P:eNvmxdizC
 +
$80/8EA2 9D B1 BE    STA $BEB1,x[$7E:BEB2]  A:C0BE X:0001 Y:FFFE P:eNvmxdizC
 +
$80/8EA5 E2 20      SEP #$20                A:C0BE X:0001 Y:FFFE P:eNvmxdizC
 +
$80/8EA7 E8          INX                    A:C0BE X:0001 Y:FFFE P:eNvMxdizC
 +
$80/8EA8 E8          INX                    A:C0BE X:0002 Y:FFFE P:envMxdizC
 +
$80/8EA9 68          PLA          ; Pull the Copy of the $4209 Buffer value from stack
 +
$80/8EAA C9 41      CMP #$41
 +
$80/8EAC 90 04      BCC $04      ; [$8EB2] Branch and go on if it is less than #$40
 +
$80/8EAE E9 40      SBC #$40      ; Subtract #$40
 +
$80/8EB0 80 C9      BRA $C9      ; [$8E7B] Loop
 +
$80/8EB2 9E 8A BE    STZ $BE8A,x[$7E:BE96]  A:C01B X:000C Y:FFFE P:eNvMxdizc
 +
$80/8EB5 9E 97 BE    STZ $BE97,x[$7E:BEA3]  A:C01B X:000C Y:FFFE P:eNvMxdizc
 +
$80/8EB8 9E A4 BE    STZ $BEA4,x[$7E:BEB0]  A:C01B X:000C Y:FFFE P:eNvMxdizc
 +
$80/8EBB 9E B1 BE    STZ $BEB1,x[$7E:BEBD]  A:C01B X:000C Y:FFFE P:eNvMxdizc
 +
$80/8EBE 9C 86 BE    STZ $BE86  [$7E:BE86]  A:C01B X:000C Y:FFFE P:eNvMxdizc
 +
$80/8EC1 A9 81      LDA #$81                A:C01B X:000C Y:FFFE P:eNvMxdizc
 +
$80/8EC3 8D 87 BE    STA $BE87  [$7E:BE87]  A:C081 X:000C Y:FFFE P:eNvMxdizc
 +
$80/8EC6 AB          PLB          ; Restore Data Bank - this line could be removed
 +
$80/8EC7 60          RTS
 +
 +
== $80/8EC8 BATTLE: Long Jump to Setup Color HDMAs ==
 +
 +
Executed while movement possibilities are shown
 +
 +
$80/8EC8 8B          PHB          ; Buffer Data Bank on Stack
 +
$80/8EC9 4B          PHK          ; Set Data Bank to $80
 +
$80/8ECA AB          PLB
 +
$80/8ECB 20 D0 8E    JSR $8ED0    ; Setup Color HDMAs
 +
$80/8ECE AB          PLB          ; Restore Data Bank
 +
$80/8ECF 6B          RTL
 +
 +
== $80/8ED0 BATTLE: Setup Color HDMAs ==
 +
 +
Executed while movement possibilities are shown
 +
 +
$80/8ED0 A9 43      LDA #$43      ; DMA Settings - Write 2 regs twice, use HDMA Table
 +
$80/8ED2 8D 30 43    STA $4330
 +
$80/8ED5 A9 21      LDA #$21      ; HDMA Destination: $2121/2 CGRAM Address/Data Register
 +
$80/8ED7 8D 31 43    STA $4331
 +
$80/8EDA A2 8A BE    LDX #$BE8A    ; HDMA Table at $7E/BE8A
 +
$80/8EDD 8E 32 43    STX $4332
 +
$80/8EE0 A9 7E      LDA #$7E
 +
$80/8EE2 8D 34 43    STA $4334
 +
$80/8EE5 A9 7E      LDA #$7E      ; Bytes to be transfered to CGRAM during HDMA are on Bank $7E
 +
$80/8EE7 8D 37 43    STA $4337
 +
$80/8EEA A9 08      LDA #$08      ; Add Activation Flag for the HDMA
 +
$80/8EEC 0C B0 05    TSB $05B0
 +
$80/8EEF A9 43      LDA #$43      ; DMA Settings - Write 2 regs twice, use HDMA Table
 +
$80/8EF1 8D 20 43    STA $4320
 +
$80/8EF4 A9 21      LDA #$21      ; HDMA Destination: $2121/2 CGRAM Address/Data Register
 +
$80/8EF6 8D 21 43    STA $4321
 +
$80/8EF9 A2 97 BE    LDX #$BE97    ; HDMA Table at $7E/BE97
 +
$80/8EFC 8E 22 43    STX $4322
 +
$80/8EFF A9 7E      LDA #$7E
 +
$80/8F01 8D 24 43    STA $4324
 +
$80/8F04 A9 7E      LDA #$7E      ; Bytes to be transfered to CGRAM during HDMA are on Bank $7E
 +
$80/8F06 8D 27 43    STA $4327
 +
$80/8F09 A9 04      LDA #$04      ; Add Activation Flag for the HDMA
 +
$80/8F0B 0C B0 05    TSB $05B0
 +
$80/8F0E 60          RTS
  
 
== $80/8FA8 ??? ==
 
== $80/8FA8 ??? ==
Line 697: Line 961:
 
  $80/9B28 DD 03 0C    CMP $0C03,x[$80:0C0F]  A:0F7E X:000C Y:000A P:envmxdizC
 
  $80/9B28 DD 03 0C    CMP $0C03,x[$80:0C0F]  A:0F7E X:000C Y:000A P:envmxdizC
 
  $80/9B2B 90 2B      BCC $2B    [$9B58]      A:0F7E X:000C Y:000A P:eNvmxdizc
 
  $80/9B2B 90 2B      BCC $2B    [$9B58]      A:0F7E X:000C Y:000A P:eNvmxdizc
 +
$80/9B2D F0 29      BEQ $29    [$9B58]      A:0F40 X:0012 Y:000A P:envmxdiZC
 
;Code is missing here
 
;Code is missing here
 
  $80/9B58 BE 85 0E    LDX $0E85,y[$80:0E8F]  A:0F7E X:000C Y:000A P:eNvmxdizc
 
  $80/9B58 BE 85 0E    LDX $0E85,y[$80:0E8F]  A:0F7E X:000C Y:000A P:eNvmxdizc
Line 1,069: Line 1,334:
 
  $80/9FB6 60          RTS
 
  $80/9FB6 60          RTS
  
== $80/9FB7 ? ==
+
== $80/9FB7 Animation VRAM DMA ==
 +
 
 +
This subroutine is for small DMAs to the VRAM; it is used for updating Sprite Tiles (for moving animations or animated Rhombs, for example).
 +
 
 +
It checks if FBLANK is active (or the brightness is turned completely down) or not. If it is, it does a direct DMA to VRAM. If not, it adds it to a special Pipeline for these DMAs.
 +
 
 +
Y: VRAM Destination $2116
 +
 
 +
X: Source Address
 +
 
 +
A: Source Bank
 +
 
 +
$0C: Number of bytes
  
 
  $80/9FB7 8B          PHB          ; Buffer Program Bank
 
  $80/9FB7 8B          PHB          ; Buffer Program Bank
 
  $80/9FB8 4B          PHK          ; Change Program Bank
 
  $80/9FB8 4B          PHK          ; Change Program Bank
 
  $80/9FB9 AB          PLB
 
  $80/9FB9 AB          PLB
  $80/9FBA 48          PHA          ; Buffer A
+
  $80/9FBA 48          PHA          ; Buffer A (Source Bank)
 
  $80/9FBB AD 6A 05    LDA $056A    ; $2100 Buffer - FBLANK / Screen Brightness
 
  $80/9FBB AD 6A 05    LDA $056A    ; $2100 Buffer - FBLANK / Screen Brightness
 
  $80/9FBE 10 34      BPL $34      ; [$9FF4] Branch if there's no FBLANK active
 
  $80/9FBE 10 34      BPL $34      ; [$9FF4] Branch if there's no FBLANK active
Line 1,111: Line 1,388:
 
  $80/9FF3 60          RTS
 
  $80/9FF3 60          RTS
  
== $80/9FF4 ? ==
+
== $80/9FF4 Add Entry to Animation VRAM DMA Pipeline ==
  
  $80/9FF4 AD C9 11    LDA $11C9 [$80:11C9]  A:B803 X:B880 Y:4440 P:envMxdizc
+
X contains the DMA Source Address
  $80/9FF7 1A          INC A                   A:B81A X:B880 Y:4440 P:envMxdizc
+
 
  $80/9FF8 29 1F      AND #$1F               A:B81B X:B880 Y:4440 P:envMxdizc
+
Y contains the VRAM Destination
  $80/9FFA CD CA 11    CMP $11CA [$80:11CA]  A:B81B X:B880 Y:4440 P:envMxdizc
+
 
  $80/9FFD F0 28      BEQ $28   [$A027]     A:B81B X:B880 Y:4440 P:envMxdizC
+
$0C contains the Number of Bytes to transfer
  $80/9FFF 7B          TDC                     A:B81B X:B880 Y:4440 P:envMxdizC
+
 
  $80/A000 AD C9 11    LDA $11C9 [$80:11C9]  A:0000 X:B880 Y:4440 P:envMxdiZC
+
  $80/9FF4 AD C9 11    LDA $11C9     ; Load Number of Animation VRAM DMAs
  $80/A003 C2 21      REP #$21               A:001A X:B880 Y:4440 P:envMxdizC
+
  $80/9FF7 1A          INC A         ; Increment by one
  $80/A005 DA          PHX                     A:001A X:B880 Y:4440 P:envmxdizc
+
  $80/9FF8 29 1F      AND #$1F     ; ???
  $80/A006 0A          ASL A                   A:001A X:B880 Y:4440 P:envmxdizc
+
  $80/9FFA CD CA 11    CMP $11CA     ; ???
  $80/A007 AA          TAX                     A:0034 X:B880 Y:4440 P:envmxdizc
+
  $80/9FFD F0 28      BEQ $28       ; [$A027] Exit
  $80/A008 98          TYA                     A:0034 X:0034 Y:4440 P:envmxdizc
+
  $80/9FFF 7B          TDC           ; Clear 16-bit A
  $80/A009 9D C9 10    STA $10C9,x[$80:10FD]   A:4440 X:0034 Y:4440 P:envmxdizc
+
  $80/A000 AD C9 11    LDA $11C9     ; Load Number of Animation VRAM DMAs again
  $80/A00C A5 0C      LDA $0C   [$00:000C]  A:4440 X:0034 Y:4440 P:envmxdizc
+
  $80/A003 C2 21      REP #$21     ; 16-bit A, Clear Carry
  $80/A00E 9D 49 0F    STA $0F49,x[$80:0F7D]   A:0040 X:0034 Y:4440 P:envmxdizc
+
  $80/A005 DA          PHX           ; Push DMA Source Address on Stack
  $80/A011 68          PLA                     A:0040 X:0034 Y:4440 P:envmxdizc
+
  $80/A006 0A          ASL A         ; Multiply Number of Animation VRAM DMAs by 2
  $80/A012 9D 09 10    STA $1009,x[$80:103D]   A:B880 X:0034 Y:4440 P:eNvmxdizc
+
  $80/A007 AA          TAX           ; Transfer in X to use it as a store Index
  $80/A015 E2 20      SEP #$20               A:B880 X:0034 Y:4440 P:eNvmxdizc
+
  $80/A008 98          TYA           ; Transfer VRAM Destination in A
  $80/A017 68          PLA                     A:B880 X:0034 Y:4440 P:eNvMxdizc
+
  $80/A009 9D C9 10    STA $10C9,x  ; Store it in Animation VRAM DMA Pipieline
  $80/A018 9D 8A 11    STA $118A,x[$80:11BE]   A:B8B9 X:0034 Y:4440 P:eNvMxdizc
+
  $80/A00C A5 0C      LDA $0C       ; Number of Bytes to transfer
  $80/A01B AD C9 11    LDA $11C9 [$80:11C9]  A:B8B9 X:0034 Y:4440 P:eNvMxdizc
+
  $80/A00E 9D 49 0F    STA $0F49,x  ; Store it in Animation VRAM DMA Pipieline
  $80/A01E 1A          INC A                   A:B81A X:0034 Y:4440 P:envMxdizc
+
  $80/A011 68          PLA           ; Pull DMA Source Address from Stack
  $80/A01F 29 1F      AND #$1F               A:B81B X:0034 Y:4440 P:envMxdizc
+
  $80/A012 9D 09 10    STA $1009,x  ; Store it in Animation VRAM DMA Pipieline
  $80/A021 8D C9 11    STA $11C9 [$80:11C9]  A:B81B X:0034 Y:4440 P:envMxdizc
+
  $80/A015 E2 20      SEP #$20     ; 8-bit A
 +
  $80/A017 68          PLA           ; Pull Source Bank from Stack (Pushed at $80/9FBA)
 +
  $80/A018 9D 8A 11    STA $118A,x  ; Store it in Animation VRAM DMA Pipieline
 +
  $80/A01B AD C9 11    LDA $11C9     ; Load Number of Animation VRAM DMAs
 +
  $80/A01E 1A          INC A         ; Increment it
 +
  $80/A01F 29 1F      AND #$1F     ; #$1F = Limit of Animation VRAM DMAs in Pipeline
 +
  $80/A021 8D C9 11    STA $11C9     ; Store back Number of Animation VRAM DMAs
 
  $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
 
  $80/A026 6B          RTL
 
  $80/A026 6B          RTL
 +
 +
== $80/A0E4 Add Entry to the VRAM Read DMA Pipeline ==
 +
 +
This adds an entry to the VRAM Read DMA Pipeline.
 +
 +
X contains the Number of Bytes to transfer
 +
 +
Y contains the VRAM Address from where to load
 +
 +
$80/A0E4 8B          PHB          ; Buffer Data Bank Register on Stack
 +
$80/A0E5 4B          PHK          ; Set Data Bank Register to $80
 +
$80/A0E6 AB          PLB
 +
$80/A0E7 DA          PHX          ; Push Number of Bytes to transfer on Stack
 +
$80/A0E8 7B          TDC          ; Clear 16-bit A
 +
$80/A0E9 AD CE 11    LDA $11CE    ; Load Number of outstanding VRAM Read DMAs
 +
$80/A0EC C9 10      CMP #$10      ; Look if the maximum of outstanding DMAs is reached
 +
$80/A0EE B0 15      BCS $15      ; [$A105] Exit if it is
 +
$80/A0F0 0A          ASL A        ; Multiply by 2 and use it as Store Index (each entry is 2 bytes in size)
 +
$80/A0F1 AA          TAX
 +
$80/A0F2 C2 20      REP #$20      ; 16-bit A
 +
$80/A0F4 98          TYA          ; Transfer the VRAM Address from where to load in A
 +
$80/A0F5 9D D0 11    STA $11D0,x  ; Store VRAM Address from where to load in the Pipeline
 +
$80/A0F8 68          PLA          ; Pull Number of Bytes to transfer from Stack
 +
$80/A0F9 9D F0 11    STA $11F0,x  ; Store Number of Bytes to transfer in the Pipeline
 +
$80/A0FC AA          TAX          ; Transfer Number of Bytes to transfer back in X
 +
$80/A0FD E2 20      SEP #$20      ; Set A back to 8-bit
 +
$80/A0FF EE CE 11    INC $11CE    ; Increment Number of Read DMAs to do
 +
$80/A102 9C CB 11    STZ $11CB    ; Enable VRAM Read DMAs
 +
$80/A105 AB          PLB          ; Pull Original Data Bank Register
 +
$80/A106 6B          RTL
  
 
== $80/A127 Long Jump to Activate NMI and Auto-Joypad Read ==
 
== $80/A127 Long Jump to Activate NMI and Auto-Joypad Read ==
Line 1,320: Line 1,633:
 
  $80/A435 60          RTS
 
  $80/A435 60          RTS
  
== $80/A8F0 Calculate the Squarenumber of A ==
+
== $80/A54C Multiply $00/1 and $04/5 ==
 +
 
 +
This multiplies two 16-bit numbers in $00/1 and $04/5. This multiplication is separated in four 8bit by 8bit multiplications:
 +
 
 +
$00 * $04
 +
$00 * $05
 +
$01 * $04
 +
$01 * $05
 +
 
 +
The result will be stored $00-3.
 +
 
 +
X/Y don't get changed, $04/5 don't get changed.
 +
 
 +
$80/A54C DA          PHX          ; Buffer X on Stack
 +
$80/A54D A5 00      LDA $00      ; Load $00/1 in 16-bit A
 +
$80/A54F E2 20      SEP #$20      ; 8-bit A
 +
$80/A551 8D 02 42    STA $4202    ; Store in Multiplicand Register
 +
$80/A554 A5 04      LDA $04      ; Store $04 in second Multiplicand Register
 +
$80/A556 8D 03 42    STA $4203    ; FIRST MULTIPLICATION: $00 * $04
 +
$80/A559 64 02      STZ $02      ; Clear Result High Bytes
 +
$80/A55B 64 03      STZ $03
 +
$80/A55D A5 05      LDA $05      ; Load $05 (for second Multiplication)
 +
$80/A55F AE 16 42    LDX $4216    ; Load 1st Multiplication 16-bit Result
 +
$80/A562 8D 03 42    STA $4203    ; SECOND MULTIPLICATION: $00 * $05
 +
$80/A565 86 00      STX $00      ; Store first result in the Result Low Byte Registers
 +
$80/A567 EB          XBA          ; Exchange A and B (A contains now the byte from Original $01)
 +
$80/A568 EA          NOP
 +
$80/A569 AE 16 42    LDX $4216    ; Load 2nd Multiplication 16-bit Result
 +
$80/A56C 8D 02 42    STA $4202    ; Store Original $01 in Multiplicand Register
 +
$80/A56F A5 04      LDA $04      ; Store $04 in second Multiplicand Register
 +
$80/A571 8D 03 42    STA $4203    ; THIRD MULTIPLICATION: $01 * $04
 +
$80/A574 C2 21      REP #$21      ; 16-bit A, Clear Carry
 +
$80/A576 8A          TXA          ; Transfer 2nd Result in A
 +
$80/A577 65 01      ADC $01      ; Add it to the 1st Result...
 +
$80/A579 85 01      STA $01      ; ... and store it
 +
$80/A57B E2 20      SEP #$20      ; 8-bit A
 +
$80/A57D A5 05      LDA $05      ; Load $05 for fourth Multiplication
 +
$80/A57F AE 16 42    LDX $4216    ; Load 3rd Multiplication 16-bit Result
 +
$80/A582 8D 03 42    STA $4203    ; FOURTH MULTIPLICATION: $01 * $05
 +
$80/A585 C2 21      REP #$21      ; 16-bit A, Clear Carry
 +
$80/A587 8A          TXA          ; Transfer 3rd Result in A
 +
$80/A588 65 01      ADC $01      ; Add it to the 1st & 2nd Result...
 +
$80/A58A 85 01      STA $01      ; ... and store it
 +
$80/A58C E2 20      SEP #$20      ; 8-bit A
 +
$80/A58E 90 02      BCC $02      ; [$A592] Branch if there was no Carry from the last Addition
 +
; Code is missing here
 +
$80/A592 C2 21      REP #$21      ; 16-bit A, Clear Carry
 +
$80/A594 AD 16 42    LDA $4216    ; Load 4th Multiplication 16-bit Result
 +
$80/A597 65 02      ADC $02      ; Add it to the other Results...
 +
$80/A599 85 02      STA $02      ; ... and store it
 +
$80/A59B FA          PLX          ; Restore X from Stack
 +
$80/A59C 60          RTS
 +
 
 +
== $80/A59D Multiply $04-7 and $00-3 ==
 +
 
 +
This is executed with 16-bit A.
 +
 
 +
This subroutine multiplies two 32-bit numbers (in $00-$03 and $04-$07) and stores the result in $04-$0B.
 +
 
 +
It does so by using four times the subroutine that calculates 32-bit results from multiplications of two 16-bit values. These four multiplications of partial values are in this order:
 +
 
 +
$06/7 * $02/3
 +
$04/5 * $02/3
 +
$06/7 * $00/1
 +
$04/5 * $00/1
 +
 
 +
It begins with the highest bytes, so it can replace the values in $04-$07.
 +
 
 +
$80/A59D 8B          PHB          ; Buffer Data Bank Register on Stack
 +
$80/A59E 4B          PHK          ; Set Data Bank Register to $80
 +
$80/A59F AB          PLB
 +
$80/A5A0 DA          PHX          ; Buffer X and Y on Stack
 +
$80/A5A1 5A          PHY
 +
$80/A5A2 D4 00      PEI ($00)    ; Buffer $00/1 on Stack
 +
$80/A5A4 A6 04      LDX $04    [$00:0004]  A:0000 X:000C Y:0001 P:eNvmxdizc
 +
$80/A5A6 A4 06      LDY $06    [$00:0006]  A:0000 X:0003 Y:0001 P:envmxdizc
 +
$80/A5A8 A5 02      LDA $02    [$00:0002]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5AA 85 04      STA $04    [$00:0004]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5AC 84 00      STY $00    [$00:0000]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5AE 20 4C A5    JSR $A54C    ; Multiply $00/1 and $04/5
 +
$80/A5B1 A5 00      LDA $00    [$00:0000]  A:0000 X:0003 Y:0000 P:envmxdizc
 +
$80/A5B3 85 08      STA $08    [$00:0008]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5B5 A5 02      LDA $02    [$00:0002]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5B7 85 0A      STA $0A    [$00:000A]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5B9 86 00      STX $00    [$00:0000]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5BB 20 4C A5    JSR $A54C    ; Multiply $00/1 and $04/5
 +
$80/A5BE A5 00      LDA $00    [$00:0000]  A:0000 X:0003 Y:0000 P:envmxdizc
 +
$80/A5C0 85 06      STA $06    [$00:0006]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5C2 A5 02      LDA $02    [$00:0002]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5C4 18          CLC                    A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5C5 65 08      ADC $08    [$00:0008]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5C7 85 08      STA $08    [$00:0008]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5C9 7B          TDC                    A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5CA 65 0A      ADC $0A    [$00:000A]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5CC 85 0A      STA $0A    [$00:000A]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5CE 68          PLA                    A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5CF 85 04      STA $04    [$00:0004]  A:0009 X:0003 Y:0000 P:envmxdizc
 +
$80/A5D1 84 00      STY $00    [$00:0000]  A:0009 X:0003 Y:0000 P:envmxdizc
 +
$80/A5D3 20 4C A5    JSR $A54C    ; Multiply $00/1 and $04/5
 +
$80/A5D6 A5 00      LDA $00    [$00:0000]  A:0000 X:0003 Y:0000 P:envmxdizc
 +
$80/A5D8 18          CLC                    A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5D9 65 06      ADC $06    [$00:0006]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5DB 85 06      STA $06    [$00:0006]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5DD A5 02      LDA $02    [$00:0002]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5DF 65 08      ADC $08    [$00:0008]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5E1 85 08      STA $08    [$00:0008]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5E3 7B          TDC                    A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5E4 65 0A      ADC $0A    [$00:000A]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5E6 85 0A      STA $0A    [$00:000A]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5E8 86 00      STX $00    [$00:0000]  A:0000 X:0003 Y:0000 P:envmxdiZc
 +
$80/A5EA 20 4C A5    JSR $A54C    ; Multiply $00/1 and $04/5
 +
$80/A5ED A5 00      LDA $00    [$00:0000]  A:0000 X:0000 Y:00B4 P:envmxdiZc
 +
$80/A5EF 85 04      STA $04    [$00:0004]  A:0000 X:0000 Y:00B4 P:envmxdiZc
 +
$80/A5F1 A5 02      LDA $02    [$00:0002]  A:0000 X:0000 Y:00B4 P:envmxdiZc
 +
$80/A5F3 18          CLC                    A:0000 X:0000 Y:00B4 P:envmxdiZc
 +
$80/A5F4 65 06      ADC $06    [$00:0006]  A:0000 X:0000 Y:00B4 P:envmxdiZc
 +
$80/A5F6 85 06      STA $06    [$00:0006]  A:0654 X:0000 Y:00B4 P:envmxdizc
 +
$80/A5F8 7B          TDC                    A:0654 X:0000 Y:00B4 P:envmxdizc
 +
$80/A5F9 65 08      ADC $08    [$00:0008]  A:0000 X:0000 Y:00B4 P:envmxdiZc
 +
$80/A5FB 85 08      STA $08    [$00:0008]  A:0000 X:0000 Y:00B4 P:envmxdiZc
 +
$80/A5FD 7B          TDC                    A:0000 X:0000 Y:00B4 P:envmxdiZc
 +
$80/A5FE 65 0A      ADC $0A    [$00:000A]  A:0000 X:0000 Y:00B4 P:envmxdiZc
 +
$80/A600 85 0A      STA $0A    [$00:000A]  A:0000 X:0000 Y:00B4 P:envmxdiZc
 +
$80/A602 7A          PLY          ; Restore Original X and Y from Stack
 +
$80/A603 FA          PLX
 +
$80/A604 AB          PLB          ; Restore Data Bank Register from Stack
 +
$80/A605 60          RTS
 +
 
 +
== $80/A606 ? ==
 +
 
 +
$80/A606 8B          PHB          ; Buffer Data Bank Register on Stack
 +
$80/A607 4B          PHK          ; Set Data Bank Register to $80
 +
$80/A608 AB          PLB
 +
$80/A609 20 0E A6    JSR $A60E    ; ???
 +
$80/A60C AB          PLB          ; Restore Data Bank Register from Stack
 +
$80/A60D 6B          RTL
 +
 
 +
== $80/A60E ? ==
 +
 
 +
$80/A60E A5 08      LDA $08    [$00:0008]  A:00C0 X:000C Y:0001 P:envmxdizc
 +
$80/A610 F0 36      BEQ $36    [$A648]      A:00C0 X:000C Y:0001 P:envmxdizc
 +
$80/A612 A5 02      LDA $02    [$00:0002]  A:00C0 X:000C Y:0001 P:envmxdizc
 +
$80/A614 D0 0E      BNE $0E    [$A624]      A:0060 X:000C Y:0001 P:envmxdizc
 +
$80/A616 A5 00      LDA $00    [$00:0000]  A:0000 X:3300 Y:0014 P:envmxdiZC
 +
$80/A618 F0 38      BEQ $38    [$A652]      A:3600 X:3300 Y:0014 P:envmxdizC
 +
$80/A61A A9 01 00    LDA #$0001              A:3600 X:3300 Y:0014 P:envmxdizC
 +
$80/A61D 85 04      STA $04    [$00:0004]  A:0001 X:3300 Y:0014 P:envmxdizC
 +
$80/A61F 64 06      STZ $06    [$00:0006]  A:0001 X:3300 Y:0014 P:envmxdizC
 +
$80/A621 7B          TDC                    A:0001 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              A:0060 X:000C Y:0001 P:envmxdizc
 +
$80/A627 85 04      STA $04    [$00:0004]  A:0001 X:000C Y:0001 P:envmxdizc
 +
$80/A629 85 06      STA $06    [$00:0006]  A:0001 X:000C Y:0001 P:envmxdizc
 +
$80/A62B 7B          TDC                    A:0001 X:000C Y:0001 P:envmxdizc
 +
$80/A62C 06 02      ASL $02    [$00:0002]  A:0000 X:000C Y:0001 P:envmxdiZc
 +
$80/A62E 2A          ROL A                  A:0000 X:000C Y:0001 P:envmxdizc
 +
$80/A62F C5 08      CMP $08    [$00:0008]  A:0000 X:000C Y:0001 P:envmxdiZc
 +
$80/A631 90 02      BCC $02    [$A635]      A:0000 X:000C Y:0001 P:eNvmxdizc
 +
; Code is missing here
 +
$80/A635 26 06      ROL $06    [$00:0006]  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/A63C C5 08      CMP $08    [$00:0008]  A:00C0 X:000C Y:0001 P:envmxdizc
 +
$80/A63E 90 02      BCC $02    [$A642]      A:00C0 X:000C Y:0001 P:envmxdiZC
 +
$80/A640 E5 08      SBC $08    [$00:0008]  A:00C0 X:000C Y:0001 P:envmxdiZC
 +
$80/A642 26 04      ROL $04    [$00:0004]  A:0000 X:000C Y:0001 P:envmxdiZC
 +
$80/A644 90 F3      BCC $F3    [$A639]      A:0000 X:000C Y:0001 P:envmxdizc
 +
$80/A646 80 0F      BRA $0F    [$A657]      A:0000 X:000C Y:0001 P:eNvmxdizC
 +
; Code is missing here
 +
$80/A657 60          RTS                    A:0000 X:000C Y:0001 P:eNvmxdizC
 +
 
 +
== $80/A86F ? ==
 +
 
 +
$80/A86F 8B          PHB          ; Buffer Data Bank Register on Stack
 +
$80/A870 4B          PHK          ; Set Data Bank to $80
 +
$80/A871 AB          PLB
 +
$80/A872 DA          PHX          ; Buffer X on Stack
 +
$80/A873 D4 00      PEI ($00)    ; Buffer $00-3 on Stack
 +
$80/A875 D4 02      PEI ($02)
 +
$80/A877 20 4C A5    JSR $A54C    ; Multiply $00/1 and $04/5
 +
$80/A87A 20 0E A6    JSR $A60E  [$80:A60E]  A:0000 X:1758 Y:000A P:envmxdizc
 +
$80/A87D FA          PLX          ; Restore Buffered Values of $00-3
 +
$80/A87E 86 02      STX $02
 +
$80/A880 FA          PLX
 +
$80/A881 86 00      STX $00
 +
$80/A883 FA          PLX          ; Restore Buffered Value of X
 +
$80/A884 AB          PLB          ; Restore Data Bank
 +
$80/A885 6B          RTL
 +
 
 +
== $80/A886 ? ==
 +
 
 +
This is executed with 16-bit A.
 +
 
 +
$80/A886 A0 00 00    LDY #$0000              A:00C0 X:000C Y:000C P:envmxdizc
 +
$80/A889 A5 02      LDA $02    [$00:0002]  A:00C0 X:000C Y:0000 P:envmxdiZc
 +
$80/A88B 10 0C      BPL $0C    [$A899]      A:0000 X:000C Y:0000 P:envmxdiZc
 +
; Code is missing here
 +
$80/A899 A5 06      LDA $06    [$00:0006]  A:0000 X:000C Y:0000 P:envmxdiZc
 +
$80/A89B 10 0C      BPL $0C    [$A8A9]      A:00B8 X:000C Y:0000 P:envmxdizc
 +
; Code is missing here
 +
$80/A8A9 A5 0A      LDA $0A    [$00:000A]  A:00B8 X:000C Y:0000 P:envmxdizc
 +
$80/A8AB 10 0C      BPL $0C    [$A8B9]      A:00C0 X:000C Y:0000 P:envmxdizc
 +
; Code is missing here
 +
$80/A8B9 D4 08      PEI ($08)    ; Buffer $08-$0B
 +
$80/A8BB D4 0A      PEI ($0A)
 +
$80/A8BD 20 9D A5    JSR $A59D    ; Multiply $04-7 and $00-3
 +
$80/A8C0 A5 04      LDA $04      ; Transfer the 64-bit Multiplication Result from $04-B to $00-7
 +
$80/A8C2 85 00      STA $00
 +
$80/A8C4 A5 06      LDA $06
 +
$80/A8C6 85 02      STA $02
 +
$80/A8C8 A5 08      LDA $08
 +
$80/A8CA 85 04      STA $04
 +
$80/A8CC A5 0A      LDA $0A
 +
$80/A8CE 85 06      STA $06
 +
$80/A8D0 68          PLA          ; Restore $08-$0B
 +
$80/A8D1 85 0A      STA $0A
 +
$80/A8D3 68          PLA
 +
$80/A8D4 85 08      STA $08
 +
$80/A8D6 20 5C A6    JSR $A65C  [$80:A65C]  A:0000 X:000C Y:0000 P:envmxdiZc
 +
$80/A8D9 98          TYA                    A:FF94 X:000C Y:0000 P:envmxdizC
 +
$80/A8DA 4A          LSR A                  A:0000 X:000C Y:0000 P:envmxdiZC
 +
$80/A8DB 90 0A      BCC $0A    [$A8E7]      A:0000 X:000C Y:0000 P:envmxdiZc
 +
; Code is missing here
 +
$80/A8E7 6B          RTL                    A:0000 X:000C Y:0000 P:envmxdiZc
 +
 
 +
== $80/A8F0 Calculate the Square Number of A ==
  
 
The Result will be in A; A will contain a 16-bit result, but the Status Register Flags will be set for an 8-bit Accumulator.
 
The Result will be in A; A will contain a 16-bit result, but the Status Register Flags will be set for an 8-bit Accumulator.
Line 1,333: Line 1,872:
 
  $80/A8FE E2 20      SEP #$20      ; A = 8 bit again
 
  $80/A8FE E2 20      SEP #$20      ; A = 8 bit again
 
  $80/A900 60          RTS
 
  $80/A900 60          RTS
 +
 +
== $80/A901 Calculate the Square Number of 16-bit A ==
 +
 +
This subroutine calculates the Square Number of the 16-bit value in A. If A contains a really big value, the result could easily be outmax the 16-bit storage of A, so this subroutine does three calculations (Low Byte * Low Byte, High Byte * Low Byte * 2, High Byte * High Byte) and fits this all together to one big 32-bit number in registers $00-$03.
 +
 +
$80/A901 8B          PHB          ; Buffer Data Bank on Stack
 +
$80/A902 4B          PHK          ; Set Data Bank to $80
 +
$80/A903 AB          PLB
 +
$80/A904 DA          PHX          ; Buffer X on Stack
 +
$80/A905 E2 20      SEP #$20      ; 8-bit A
 +
$80/A907 8D 02 42    STA $4202    ; Calculate the Square Number of A's Low Byte
 +
$80/A90A 8D 03 42    STA $4203
 +
$80/A90D 64 02      STZ $02      ; Clear $02/03
 +
$80/A90F 64 03      STZ $03
 +
$80/A911 EB          XBA          ; exchange the 8-bits in A
 +
$80/A912 AE 16 42    LDX $4216    ; $00 = (A's Low Byte)²
 +
$80/A915 86 00      STX $00
 +
$80/A917 8D 03 42    STA $4203    ; Multiply the Original A High Byte with the Low byte
 +
$80/A91A AA          TAX          ; X = A's High Byte
 +
$80/A91B C2 20      REP #$20      ; 16-bit A
 +
$80/A91D AD 16 42    LDA $4216    ; Load the Result of High Byte * Low Byte
 +
$80/A920 0A          ASL A        ; Multiply it by two
 +
$80/A921 08          PHP          ; Buffer Status Register (i. e. the possibly Set Carry of the ASL A)
 +
$80/A922 18          CLC          ; Clear Carry for upcoming Addition
 +
$80/A923 65 01      ADC $01      ; Add the High Byte of the Result of (A's Low Byte)²
 +
$80/A925 85 01      STA $01      ; Store the result in $01/2
 +
$80/A927 7B          TDC          ; Clear A
 +
$80/A928 2A          ROL A        ; Clear Carry
 +
$80/A929 28          PLP          ; Restore Status Register (and possibly set carry)
 +
$80/A92A E2 20      SEP #$20      ; 8-bit A
 +
$80/A92C 69 00      ADC #$00      ; Transfer the Carry in A, if it was set
 +
$80/A92E 85 03      STA $03      ; Store it in $03
 +
$80/A930 8A          TXA          ; A = Original High Byte
 +
$80/A931 8D 02 42    STA $4202    ; (Original High Byte)²
 +
$80/A934 8D 03 42    STA $4203
 +
$80/A937 FA          PLX          ; Restore Original X
 +
$80/A938 C2 21      REP #$21      ; 16-bit A, Clear Carry
 +
$80/A93A A5 02      LDA $02      ; Load the Highest two Byte of the 32-bit Result
 +
$80/A93C 6D 16 42    ADC $4216    ; Add the Multiplication Result = (Original High Byte)²
 +
$80/A93F 85 02      STA $02      ; Store Result
 +
$80/A941 AB          PLB          ; Restore Data Bank
 +
$80/A942 6B          RTL
 +
 +
== $80/ABA9 ? ==
 +
 +
$80/ABA9 8B          PHB          ; Buffer Data Bank on Stack
 +
$80/ABAA 4B          PHK          ; Set Data Bank to $80
 +
$80/ABAB AB          PLB
 +
$80/ABAC DA          PHX          ; Buffer X and Y on Stack
 +
$80/ABAD 5A          PHY
 +
$80/ABAE D4 00      PEI ($00)    ; Buffer $00-7 on Stack
 +
$80/ABB0 D4 02      PEI ($02)
 +
$80/ABB2 D4 04      PEI ($04)
 +
$80/ABB4 D4 06      PEI ($06)
 +
$80/ABB6 C9 02 00    CMP #$0002              A:0024 X:003C Y:0000 P:eNvmxdizc
 +
$80/ABB9 90 31      BCC $31      ; [$ABEC] Branch if less than #$0002
 +
$80/ABBB 48          PHA                    A:0024 X:003C Y:0000 P:envmxdizC
 +
$80/ABBC A0 FC FF    LDY #$FFFC              A:0024 X:003C Y:0000 P:envmxdizC
 +
$80/ABBF 80 03      BRA $03    [$ABC4]      A:0024 X:003C Y:FFFC P:eNvmxdizC
 +
; Code is Missing here
 +
$80/ABC4 C9 00 01    CMP #$0100              A:0024 X:003C Y:FFFC P:eNvmxdizC
 +
$80/ABC7 B0 F8      BCS $F8    [$ABC1]      A:0024 X:003C Y:FFFC P:eNvmxdizc
 +
$80/ABC9 1A          INC A                  A:0024 X:003C Y:FFFC P:eNvmxdizc
 +
$80/ABCA 0A          ASL A                  A:0025 X:003C Y:FFFC P:envmxdizc
 +
$80/ABCB AA          TAX                    A:004A X:003C Y:FFFC P:envmxdizc
 +
$80/ABCC BD A7 A9    LDA $A9A7,x[$80:A9F1]  A:004A X:004A Y:FFFC P:envmxdizc
 +
$80/ABCF C0 00 00    CPY #$0000              A:6152 X:004A Y:FFFC P:envmxdizc
 +
$80/ABD2 F0 04      BEQ $04    [$ABD8]      A:6152 X:004A Y:FFFC P:eNvmxdizC
 +
$80/ABD4 4A          LSR A                  A:6152 X:004A Y:FFFC P:eNvmxdizC
 +
$80/ABD5 C8          INY                    A:30A9 X:004A Y:FFFC P:envmxdizc
 +
$80/ABD6 D0 FC      BNE $FC    [$ABD4]      A:30A9 X:004A Y:FFFD P:eNvmxdizc
 +
$80/ABD8 EB          XBA                    A:0615 X:004A Y:0000 P:envmxdiZc
 +
$80/ABD9 29 FF 00    AND #$00FF              A:1506 X:004A Y:0000 P:envmxdizc
 +
$80/ABDC FA          PLX                    A:0006 X:004A Y:0000 P:envmxdizc
 +
$80/ABDD 85 06      STA $06    [$00:0006]  A:0006 X:0024 Y:0000 P:envmxdizc
 +
$80/ABDF 20 0F A5    JSR $A50F  [$80:A50F]  A:0006 X:0024 Y:0000 P:envmxdizc
 +
$80/ABE2 18          CLC                    A:0006 X:0024 Y:0000 P:envmxdizc
 +
$80/ABE3 65 06      ADC $06    [$00:0006]  A:0006 X:0024 Y:0000 P:envmxdizc
 +
$80/ABE5 4A          LSR A                  A:000C X:0024 Y:0000 P:envmxdizc
 +
$80/ABE6 C5 06      CMP $06    [$00:0006]  A:0006 X:0024 Y:0000 P:envmxdizc
 +
$80/ABE8 90 F3      BCC $F3    [$ABDD]      A:0006 X:0024 Y:0000 P:envmxdiZC
 +
$80/ABEA A5 06      LDA $06    [$00:0006]  A:0006 X:0024 Y:0000 P:envmxdiZC
 +
$80/ABEC 7A          PLY          ; Restore Buffered values of $00-7
 +
$80/ABED 84 06      STY $06
 +
$80/ABEF 7A          PLY
 +
$80/ABF0 84 04      STY $04
 +
$80/ABF2 7A          PLY
 +
$80/ABF3 84 02      STY $02
 +
$80/ABF5 7A          PLY
 +
$80/ABF6 84 00      STY $00
 +
$80/ABF8 7A          PLY          ; Restore Buffered Y
 +
$80/ABF9 FA          PLX          ; Restore Buffered Y
 +
$80/ABFA AB          PLB          ; Restore Data Bank
 +
$80/ABFB 6B          RTL
 +
 +
== $80/AD39 RNG? ==
 +
 +
$80/AD39 DA          PHX                    A:0004 X:0004 Y:000A P:envMxdizc
 +
$80/AD3A 5A          PHY                    A:0004 X:0004 Y:000A P:envMxdizc
 +
$80/AD3B 08          PHP                    A:0004 X:0004 Y:000A P:envMxdizc
 +
$80/AD3C E2 11      SEP #$11                A:0004 X:0004 Y:000A P:envMxdizc
 +
$80/AD3E AE 11 12    LDX $1211  [$80:1211]  A:0004 X:0004 Y:000A P:envMXdizC
 +
$80/AD41 AC 10 12    LDY $1210  [$80:1210]  A:0004 X:0018 Y:000A P:envMXdizC
 +
$80/AD44 BD 12 12    LDA $1212,x[$80:122A]  A:0004 X:0018 Y:0030 P:envMXdizC
 +
$80/AD47 F9 12 12    SBC $1212,y[$80:1242]  A:00A4 X:0018 Y:0030 P:eNvMXdizC
 +
$80/AD4A 99 12 12    STA $1212,y[$80:1242]  A:0015 X:0018 Y:0030 P:envMXdizC
 +
$80/AD4D E8          INX                    A:0015 X:0018 Y:0030 P:envMXdizC
 +
$80/AD4E E0 37      CPX #$37                A:0015 X:0019 Y:0030 P:envMXdizC
 +
$80/AD50 D0 02      BNE $02    [$AD54]      A:0015 X:0019 Y:0030 P:eNvMXdizc
 +
$80/AD54 8E 11 12    STX $1211  [$80:1211]  A:0015 X:0019 Y:0030 P:eNvMXdizc
 +
$80/AD57 C8          INY                    A:0015 X:0019 Y:0030 P:eNvMXdizc
 +
$80/AD58 C0 37      CPY #$37                A:0015 X:0019 Y:0031 P:envMXdizc
 +
$80/AD5A D0 02      BNE $02    [$AD5E]      A:0015 X:0019 Y:0031 P:eNvMXdizc
 +
$80/AD5E 8C 10 12    STY $1210  [$80:1210]  A:0015 X:0019 Y:0031 P:eNvMXdizc
 +
$80/AD61 28          PLP                    A:0015 X:0019 Y:0031 P:eNvMXdizc
 +
$80/AD62 7A          PLY                    A:0015 X:0019 Y:0031 P:envMxdizc
 +
$80/AD63 FA          PLX                    A:0015 X:0019 Y:000A P:envMxdizc
 +
$80/AD64 60          RTS                    A:0015 X:0004 Y:000A P:envMxdizc
  
 
== $80/ADCB Calculate Address in Tilemap ==
 
== $80/ADCB Calculate Address in Tilemap ==
Line 1,395: Line 2,052:
 
OAM Update
 
OAM Update
  
  $80/AFA0 AD B0 05    LDA $05B0    ; ???
+
  $80/AFA0 AD B0 05    LDA $05B0    ; Transfer HDMA Flags
 
  $80/AFA3 8D 86 05    STA $0586
 
  $80/AFA3 8D 86 05    STA $0586
 
  $80/AFA6 9C 0C 42    STZ $420C    ; Deactivate HDMAs
 
  $80/AFA6 9C 0C 42    STZ $420C    ; Deactivate HDMAs
Line 1,419: Line 2,076:
 
  $80/AFDD 20 D8 B3    JSR $B3D8    ; CGRAM Update
 
  $80/AFDD 20 D8 B3    JSR $B3D8    ; CGRAM Update
 
  $80/AFE0 20 2B B3    JSR $B32B    ; VRAM DMA Pipeline
 
  $80/AFE0 20 2B B3    JSR $B32B    ; VRAM DMA Pipeline
  $80/AFE3 20 7B B3    JSR $B37B    ; ???
+
  $80/AFE3 20 7B B3    JSR $B37B    ; VRAM Read DMA
 
  $80/AFE6 AD 86 05    LDA $0586    ; Reactivate HDMAs
 
  $80/AFE6 AD 86 05    LDA $0586    ; Reactivate HDMAs
 
  $80/AFE9 8D 0C 42    STA $420C
 
  $80/AFE9 8D 0C 42    STA $420C
Line 1,480: Line 2,137:
 
  $80/B08A 89 01      BIT #$01                A:0003 X:00DB Y:0000 P:envMxdizc
 
  $80/B08A 89 01      BIT #$01                A:0003 X:00DB Y:0000 P:envMxdizc
 
  $80/B08C F0 04      BEQ $04    [$B092]      A:0003 X:00DB Y:0000 P:envMxdizc
 
  $80/B08C F0 04      BEQ $04    [$B092]      A:0003 X:00DB Y:0000 P:envMxdizc
  $80/B08E 22 5F 80 84 JSL $84805F[$84:805F]  A:0003 X:00DB Y:0000 P:envMxdizc
+
  $80/B08E 22 5F 80 84 JSL $84805F   ; Do the Tile/Figure Animation
Missing Code
+
$80/B092 A5 37      LDA $37    [$00:0037A:0007 X:0004 Y:001C P:eNvMxdizc
 +
$80/B094 89 02      BIT #$02                A:0003 X:0004 Y:001C P:envMxdizc
 +
$80/B096 F0 04      BEQ $04    [$B09C]      A:0003 X:0004 Y:001C P:envMxdizc
 +
$80/B098 22 00 80 85 JSL $858000[$85:8000]  A:0003 X:0004 Y:001C P:envMxdizc
 
  $80/B09C FA          PLX          ; Restore $00-$0F and $20-$2B from stack
 
  $80/B09C FA          PLX          ; Restore $00-$0F and $20-$2B from stack
 
  $80/B09D 86 2A      STX $2A
 
  $80/B09D 86 2A      STX $2A
Line 1,510: Line 2,170:
 
  $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[$8F:800C]   A:0000 X:0000 Y:000C P:envMxdiZc
+
  $80/B0C6 22 0C 80 8F JSL $8F800C  ; ??? Sound related?
 
+
  $80/B0CA C2 30      REP #$30      ; Restore everything from Stack
Missing Code
 
 
 
  $80/B0CA C2 30      REP #$30      ; Restore everything from Stack
 
 
  $80/B0CC 7A          PLY
 
  $80/B0CC 7A          PLY
 
  $80/B0CD FA          PLX
 
  $80/B0CD FA          PLX
Line 1,521: Line 2,178:
 
  $80/B0D0 68          PLA
 
  $80/B0D0 68          PLA
 
  $80/B0D1 40          RTI          ; End Interrupt Handler
 
  $80/B0D1 40          RTI          ; End Interrupt Handler
 +
 +
== $80/B0D2 ? ==
 +
 +
$80/B0D2 20 C2 B2    JSR $B2C2  [$80:B2C2]  A:0080 X:E0A4 Y:BE79 P:eNvMxdIzc
 +
$80/B0D5 AD 86 05    LDA $0586    ; Activate HDMA
 +
$80/B0D8 8D 0C 42    STA $420C
 +
$80/B0DB 20 01 B1    JSR $B101  [$80:B101]  A:0006 X:E0A4 Y:BE79 P:envMxdIzC
 +
$80/B0DE 20 6D B2    JSR $B26D    ; Update Graphic Setup Registers
 +
$80/B0E1 AD 6A 05    LDA $056A    ; Load $2100 Buffer
 +
$80/B0E4 2C 12 42    BIT $4212  [$80:4212]  A:000F X:0581 Y:0008 P:envMxdIzC
 +
$80/B0E7 70 FB      BVS $FB    [$B0E4]      A:000F X:0581 Y:0008 P:eNVMxdIzC
 +
$80/B0E9 2C 12 42    BIT $4212  [$80:4212]  A:000F X:0581 Y:0008 P:eNvMxdIzC
 +
$80/B0EC 50 FB      BVC $FB    [$B0E9]      A:000F X:0581 Y:0008 P:eNvMxdIzC
 +
$80/B0EE 8D 00 21    STA $2100    ; Turn the Screen on
 +
$80/B0F1 A5 A1      LDA $A1    [$00:00A1]  A:000F X:0581 Y:0008 P:eNVMxdIzC
 +
$80/B0F3 89 01      BIT #$01                A:0000 X:0581 Y:0008 P:enVMxdIZC
 +
$80/B0F5 F0 07      BEQ $07    [$B0FE]      A:0000 X:0581 Y:0008 P:enVMxdIZC
 +
Code is missing here
 +
$80/B0FE 4C 27 B0    JMP $B027  [$80:B027]  A:0000 X:0581 Y:0008 P:enVMxdIZC
  
 
== $80/B135 Update Graphics Settings Buffer Registers ==
 
== $80/B135 Update Graphics Settings Buffer Registers ==
Line 1,618: Line 2,294:
 
  $80/B2BF D0 EE      BNE $EE      ; [$B2AF]
 
  $80/B2BF D0 EE      BNE $EE      ; [$B2AF]
 
  $80/B2C1 60          RTS
 
  $80/B2C1 60          RTS
 +
 +
== $80/B2C2 ? ==
 +
 +
$80/B2C2 AD CA 11    LDA $11CA  [$80:11CA]  A:0080 X:0000 Y:0006 P:eNvMxdIzC
 +
$80/B2C5 CD C9 11    CMP $11C9  [$80:11C9]  A:0002 X:0000 Y:0006 P:envMxdIzC
 +
$80/B2C8 F0 60      BEQ $60      ; [$B32A] Exit
 +
$80/B2CA AD BD 05    LDA $05BD  [$80:05BD]  A:0002 X:0000 Y:0006 P:eNvMxdIzc
 +
$80/B2CD 30 14      BMI $14    [$B2E3]      A:0080 X:0000 Y:0006 P:eNvMxdIzc
 +
$80/B2CF 7B          TDC          ; Clear 16-bit A
 +
$80/B2D0 AD C7 0E    LDA $0EC7  [$80:0EC7]  A:0000 X:1758 Y:000A P:envMxdIZc
 +
$80/B2D3 C2 20      REP #$20                A:0000 X:1758 Y:000A P:envMxdIZc
 +
$80/B2D5 EB          XBA                    A:0000 X:1758 Y:000A P:envmxdIZc
 +
$80/B2D6 4A          LSR A                  A:0000 X:1758 Y:000A P:envmxdIZc
 +
$80/B2D7 4A          LSR A                  A:0000 X:1758 Y:000A P:envmxdIZc
 +
$80/B2D8 6D C5 0E    ADC $0EC5  [$80:0EC5]  A:0000 X:1758 Y:000A P:envmxdIZc
 +
$80/B2DB C9 00 05    CMP #$0500              A:0000 X:1758 Y:000A P:envmxdIZc
 +
$80/B2DE E2 20      SEP #$20                A:0000 X:1758 Y:000A P:eNvmxdIzc
 +
$80/B2E0 7B          TDC                    A:0000 X:1758 Y:000A P:eNvMxdIzc
 +
$80/B2E1 B0 47      BCS $47      ; [$B32A] Branch if A is higher or same as #$500
 +
$80/B2E3 A9 01      LDA #$01      ; DMA Transfer Settings
 +
$80/B2E5 8D 00 43    STA $4300
 +
$80/B2E8 A9 18      LDA #$18      ; DMA Destination $(21)18 - VRAM
 +
$80/B2EA 8D 01 43    STA $4301
 +
$80/B2ED A9 80      LDA #$80      ; VRAM Transfer Settings
 +
$80/B2EF 8D 15 21    STA $2115
 +
$80/B2F2 7B          TDC          ; Clear 16-bit A
 +
$80/B2F3 AD CA 11    LDA $11CA  [$80:11CA]  A:0000 X:0000 Y:0006 P:envMxdIZc
 +
$80/B2F6 0A          ASL A                  A:0002 X:0000 Y:0006 P:envMxdIzc
 +
$80/B2F7 A8          TAY                    A:0004 X:0000 Y:0006 P:envMxdIzc
 +
$80/B2F8 BE 49 0F    LDX $0F49,y[$80:0F4D]  A:0004 X:0000 Y:0004 P:envMxdIzc
 +
$80/B2FB E0 81 00    CPX #$0081              A:0004 X:0080 Y:0004 P:envMxdIzc
 +
$80/B2FE 90 02      BCC $02    [$B302]      A:0004 X:0080 Y:0004 P:eNvMxdIzc
 +
; Code is missing here
 +
$80/B302 8E 05 43    STX $4305  [$80:4305]  A:0004 X:0080 Y:0004 P:eNvMxdIzc
 +
$80/B305 BE 09 10    LDX $1009,y  ; Set Source Destination
 +
$80/B308 8E 02 43    STX $4302
 +
$80/B30B B9 8A 11    LDA $118A,y  ; Set Source Bank
 +
$80/B30E 8D 04 43    STA $4304
 +
$80/B311 BE C9 10    LDX $10C9,y  ; Set VRAM Destination
 +
$80/B314 8E 16 21    STX $2116
 +
$80/B317 A9 01      LDA #$01      ; Activate DMA
 +
$80/B319 8D 0B 42    STA $420B
 +
$80/B31C AD CA 11    LDA $11CA  [$80:11CA]  A:0001 X:07C0 Y:0004 P:envMxdIzc
 +
$80/B31F 1A          INC A                  A:0002 X:07C0 Y:0004 P:envMxdIzc
 +
$80/B320 29 1F      AND #$1F                A:0003 X:07C0 Y:0004 P:envMxdIzc
 +
$80/B322 8D CA 11    STA $11CA  [$80:11CA]  A:0003 X:07C0 Y:0004 P:envMxdIzc
 +
$80/B325 CD C9 11    CMP $11C9  [$80:11C9]  A:0003 X:07C0 Y:0004 P:envMxdIzc
 +
$80/B328 D0 CC      BNE $CC    [$B2F6]      A:0003 X:07C0 Y:0004 P:eNvMxdIzc
 +
$80/B32A 60          RTS
  
 
== $80/B32B VRAM DMA Pipeline ==
 
== $80/B32B VRAM DMA Pipeline ==
Line 1,652: Line 2,377:
 
  $80/B377 8E C5 0E    STX $0EC5    ; ???
 
  $80/B377 8E C5 0E    STX $0EC5    ; ???
 
  $80/B37A 60          RTS
 
  $80/B37A 60          RTS
 +
 +
== $80/B37B VRAM Read DMA ==
 +
 +
$80/B37B AD CE 11    LDA $11CE    ; Load Number of VRAM Read DMAs to do
 +
$80/B37E F0 57      BEQ $57      ; [$B3D7] Exit if empty
 +
$80/B380 AD CB 11    LDA $11CB    ; ???
 +
$80/B383 D0 52      BNE $52      ; [$B3D7] Exit if not empty
 +
$80/B385 A9 81      LDA #$81      ; Transfer from Bus B / Write 2 registers write once
 +
$80/B387 8D 00 43    STA $4300
 +
$80/B38A A9 39      LDA #$39      ; Source Address: $(21)39 - VRAM Read Address
 +
$80/B38C 8D 01 43    STA $4301
 +
$80/B38F A9 80      LDA #$80      ; VRAM Transfer Settings: Increment when Reading from $213A
 +
$80/B391 8D 15 21    STA $2115
 +
$80/B394 A9 7F      LDA #$7F      ; Destination Bank: $7F
 +
$80/B396 8D 04 43    STA $4304
 +
$80/B399 A2 00 FC    LDX #$FC00    ; Destination Address: $(7F/)FC00
 +
$80/B39C A0 00 00    LDY #$0000    ; Setup Loop Counter
 +
$80/B39F AD CE 11    LDA $11CE    ; Load Number of VRAM Read DMAs to do
 +
$80/B3A2 48          PHA          ; Push Number of VRAM Read DMAs to do on Stack
 +
$80/B3A3 C2 20      REP #$20      ; 16-bit A
 +
$80/B3A5 B9 F0 11    LDA $11F0,y  ; Set Number of Bytes to transfer
 +
$80/B3A8 8D 05 43    STA $4305
 +
$80/B3AB 8E 02 43    STX $4302    ; Destination Address: $(7F/)FC00
 +
$80/B3AE B9 D0 11    LDA $11D0,y  ; Set VRAM Destination
 +
$80/B3B1 8D 16 21    STA $2116
 +
$80/B3B4 E2 20      SEP #$20      ; 8-bit A
 +
$80/B3B6 F0 08      BEQ $08      ; [$B3C0] Leave out the
 +
$80/B3B8 AD 3A 21    LDA $213A    ; ???
 +
$80/B3BB A9 01      LDA #$01      ; Activate DMA
 +
$80/B3BD 8D 0B 42    STA $420B
 +
$80/B3C0 68          PLA          ; Pull Number of VRAM Read DMAs to do from Stack
 +
$80/B3C1 3A          DEC A        ; Decrement Number
 +
$80/B3C2 F0 0E      BEQ $0E      ; [$B3D2] Exit if it has reached zero
 +
$80/B3C4 48          PHA          ; If not, push Number of VRAM Read DMAs to do back on Stack
 +
$80/B3C5 C2 21      REP #$21                A:5003 X:FC00 Y:0000 P:envMxdIzc
 +
$80/B3C7 8A          TXA          ; Transfer Store Index in A
 +
$80/B3C8 79 F0 11    ADC $11F0,y  ; Add the number of transfered bytes
 +
$80/B3CB AA          TAX          ; Transfer back in X - Points now to the next empty byte
 +
$80/B3CC E2 20      SEP #$20      ; 8-bit A
 +
$80/B3CE C8          INY          ; Increment Load Index twice
 +
$80/B3CF C8          INY
 +
$80/B3D0 80 D1      BRA $D1      ; [$B3A3] Loop
 +
$80/B3D2 A9 01      LDA #$01      ; ???
 +
$80/B3D4 8D CB 11    STA $11CB    ; ??? Set flag to not do this again automatically
 +
$80/B3D7 60          RTS
  
 
== $80/B3D8 ? ==
 
== $80/B3D8 ? ==
Line 1,896: Line 2,666:
 
  $80/B617 9C 69 05    STZ $0569  [$80:0569]  A:00B8 X:0001 Y:00FF P:eNvMxdiZc
 
  $80/B617 9C 69 05    STZ $0569  [$80:0569]  A:00B8 X:0001 Y:00FF P:eNvMxdiZc
 
  $80/B61A C2 20      REP #$20                A:00B8 X:0001 Y:00FF P:eNvMxdiZc
 
  $80/B61A C2 20      REP #$20                A:00B8 X:0001 Y:00FF P:eNvMxdiZc
  $80/B61C 9C CE 11    STZ $11CE [$80:11CE]  A:00B8 X:0001 Y:00FF P:eNvmxdiZc
+
  $80/B61C 9C CE 11    STZ $11CE     ; Set number of VRAM Read DMAs to zero
 
  $80/B61F 9C 47 05    STZ $0547  [$80:0547]  A:00B8 X:0001 Y:00FF P:eNvmxdiZc
 
  $80/B61F 9C 47 05    STZ $0547  [$80:0547]  A:00B8 X:0001 Y:00FF P:eNvmxdiZc
 
  $80/B622 9C 5B 05    STZ $055B  [$80:055B]  A:00B8 X:0001 Y:00FF P:eNvmxdiZc
 
  $80/B622 9C 5B 05    STZ $055B  [$80:055B]  A:00B8 X:0001 Y:00FF P:eNvmxdiZc
Line 2,057: Line 2,827:
 
  $80/B755 8E 45 05    STX $0545
 
  $80/B755 8E 45 05    STX $0545
 
  $80/B758 60          RTS
 
  $80/B758 60          RTS
 +
 +
== $80/B9D1 Use Jump Table ==
 +
 +
$80/B9D1 86 3B      STX $3B      ; Buffer X value
 +
$80/B9D3 7B          TDC                    A:A1CA X:000C Y:0002 P:envMxdizC
 +
$80/B9D4 BD C3 08    LDA $08C3,x[$80:08CF]  A:0000 X:000C Y:0002 P:envMxdiZC
 +
$80/B9D7 0A          ASL A                  A:0003 X:000C Y:0002 P:envMxdizC
 +
$80/B9D8 A8          TAY                    A:0006 X:000C Y:0002 P:envMxdizc
 +
$80/B9D9 BE E3 B9    LDX $B9E3,y[$80:B9E9]  A:0006 X:000C Y:0006 P:envMxdizc
 +
$80/B9DC 86 00      STX $00    [$00:0000]  A:0006 X:BC4F Y:0006 P:eNvMxdizc
 +
$80/B9DE A6 3B      LDX $3B      ; Restore X value
 +
$80/B9E0 6C 00 00    JMP ($0000)[$80:BC4F]  A:0006 X:000C Y:0006 P:envMxdizc
 +
 +
== $80/B9E3 Jump Table to $80/B9D1==
 +
 +
75 BA
 +
B2 BA
 +
DB BA
 +
4F BC
 +
81 BA
 +
51 BD
 +
5C BD
 +
63 BD
 +
67 BD
 +
6E BD
 +
78 BD
 +
87 BD
 +
E0 BC
 +
21 BD
 +
94 BD
 +
89 BA
 +
BE BD
 +
FF BD
 +
1D BE
 +
89 BA
 +
89 BA
 +
50 BE
 +
63 BE
 +
6D BE
 +
76 BE
 +
8E BA
 +
A3 BE
 +
AB BE
 +
8E BE
 +
95 BE
 +
B9 BE
 +
D5 BE
 +
08 BF
 +
1C BF
 +
B9 BE
 +
D5 BE
 +
25 BF
 +
B9 BE
 +
39 BF
 +
71 BF
 +
B9 BE
 +
D5 BE
 +
82 BF
 +
13 C0
 +
DD C0
 +
0B C1
 +
89 BA
 +
97 BA
 +
9F BB
 +
44 BB
 +
99 BB
 +
78 C0
 +
AC C0
 +
D4 C0
 +
89 BA
 +
89 BA
 +
4B C1
 +
51 C1
 +
57 C1
 +
5E C1
 +
64 C1
 +
44 BD
 +
22 C0
 +
39 C0
 +
6B C0
 +
6F C0
 +
89 BA
 +
89 BA
 +
89 BA
 +
89 BA
 +
EF BF
 +
0A C0
 +
B5 BE
  
 
== $80/E009 $05C0 Jump Table ==
 
== $80/E009 $05C0 Jump Table ==
Line 2,069: Line 2,927:
  
 
== $80/E015 Jump Table for $80/E009 ==
 
== $80/E015 Jump Table for $80/E009 ==
 +
 +
1B E0  Entry #$00 - $E01B - Check Buttons in Cursor Move Mode
 +
06 E1  Entry #$01 - $E160 -
 +
56 E2  Entry #$02 - $E256 -
  
 
== $80/E01B BATTLE: Check Buttons in Cursor Move Mode ==
 
== $80/E01B BATTLE: Check Buttons in Cursor Move Mode ==
Line 2,078: Line 2,940:
 
  $80/E028 89 80      BIT #$80
 
  $80/E028 89 80      BIT #$80
 
  $80/E02A F0 1B      BEQ $1B      ; [$E047] Branch if not
 
  $80/E02A F0 1B      BEQ $1B      ; [$E047] Branch if not
 +
$80/E02C 22 42 F9 80 JSL $80F942  ; Long Jump to Which Figure is the Cursor Pointing on
 +
$80/E030 90 03      BCC $03    [$E035]      A:0032 X:0000 Y:000A P:eNvMxdizc
 
; Code is missing here
 
; Code is missing here
 +
$80/E035 BD DE 19    LDA $19DE,x  ; Check Figure's Status Effects(!?)
 +
$80/E038 89 03      BIT #$03                A:0000 X:0000 Y:000A P:envMxdiZc
 +
$80/E03A D0 0B      BNE $0B      ; [$E047] Exit this part and go on to the next button
 +
$80/E03C 20 92 FA    JSR $FA92    ; Play Sound Effect Number #$02
 +
$80/E03F 22 9F 84 9B JSL $9B849F
 +
 
  $80/E047 AD 65 05    LDA $0565    ; Was the A Button pushed?
 
  $80/E047 AD 65 05    LDA $0565    ; Was the A Button pushed?
 
  $80/E04A 89 80      BIT #$80
 
  $80/E04A 89 80      BIT #$80
Line 2,096: Line 2,966:
 
  $80/E08B 20 44 F8    JSR $F844  [$80:F844]  A:0001 X:0000 Y:000A P:envMxdizc
 
  $80/E08B 20 44 F8    JSR $F844  [$80:F844]  A:0001 X:0000 Y:000A P:envMxdizc
 
  $80/E08E 60          RTS                    A:0000 X:003E Y:0002 P:eNvMxdizc
 
  $80/E08E 60          RTS                    A:0000 X:003E Y:0002 P:eNvMxdizc
 
== $80/F3C4 BATTLE: Get the Height's Map Address of the Rhomb the Cursor points to ==
 
 
If you enter Battle, the program sets up the Height Map at $7F/D800. This is the map where the height of each Rhomb on the Battle Map is stored.
 
 
This subroutine turns the current position of the cursor into the offset for the corresponding entry on the Height Map. This is used for positioning the cursor on screen - depending on the Rhomb's height, the cursor has to be higher or lower on the screen.
 
 
The Height Map has Rows and Columns. Each Row is $20 bytes long and contains all Rhombs with the same position on the NE-SW-Axis. This is why the calculation takes the NE-SW-Axis position and multiplies it by 20.
 
 
X will contain the result in the end.
 
 
$80/F734 7B          TDC          ; Clear 16-bit A
 
$80/F735 A5 63      LDA $63      ; Load Cursor Position (NE-SW-Axis)
 
$80/F737 C2 20      REP #$20      ; A = 16-bit
 
$80/F739 EB          XBA          ; Multiply by 20
 
$80/F73A 4A          LSR A
 
$80/F73B 4A          LSR A
 
$80/F73C 4A          LSR A
 
$80/F73D E2 20      SEP #$20      ; A = 8-bit
 
$80/F73F 05 61      ORA $61      ; Add the Cursor Position on the NW-SE-Axis
 
$80/F741 AA          TAX          ; Transfer the result in X
 
$80/F742 60          RTS
 
  
 
== $80/F6DF BATTLE: Set the Cursor's Sprites to it's new position? ==
 
== $80/F6DF BATTLE: Set the Cursor's Sprites to it's new position? ==
Line 2,127: Line 2,975:
 
  $80/F6E9 85 65      STA $65      ; Store in $65 ("Cursor Height" storage)
 
  $80/F6E9 85 65      STA $65      ; Store in $65 ("Cursor Height" storage)
 
  $80/F6EB 64 66      STZ $66      ; Clear $66 (only used in 16-bit calculation with $65?)
 
  $80/F6EB 64 66      STZ $66      ; Clear $66 (only used in 16-bit calculation with $65?)
  $80/F6ED A2 3C 00    LDX #$003C             A:0006 X:002B Y:0009 P:envMxdizc
+
  $80/F6ED A2 3C 00    LDX #$003C   ; Write Index for the second last figure (Rhomb Marker)
  $80/F6F0 A0 3E 00    LDY #$003E             A:0006 X:003C Y:0009 P:envMxdizc
+
  $80/F6F0 A0 3E 00    LDY #$003E   ; Write Index for the last figure (Pointing Hand)
 
  $80/F6F3 A9 7F      LDA #$7F                A:0006 X:003C Y:003E P:envMxdizc
 
  $80/F6F3 A9 7F      LDA #$7F                A:0006 X:003C Y:003E P:envMxdizc
 
  $80/F6F5 9D 03 0A    STA $0A03,x[$80:0A3F]  A:007F X:003C Y:003E P:envMxdizc
 
  $80/F6F5 9D 03 0A    STA $0A03,x[$80:0A3F]  A:007F X:003C Y:003E P:envMxdizc
Line 2,137: Line 2,985:
 
  $80/F703 9D 83 0A    STA $0A83,x[$80:0ABF]  A:0000 X:003C Y:003E P:envMxdiZc
 
  $80/F703 9D 83 0A    STA $0A83,x[$80:0ABF]  A:0000 X:003C Y:003E P:envMxdiZc
 
  $80/F706 99 83 0A    STA $0A83,y[$80:0AC1]  A:0000 X:003C Y:003E P:envMxdiZc
 
  $80/F706 99 83 0A    STA $0A83,y[$80:0AC1]  A:0000 X:003C Y:003E P:envMxdiZc
  $80/F709 A5 61      LDA $61   [$00:0061]  A:0000 X:003C Y:003E P:envMxdiZc
+
  $80/F709 A5 61      LDA $61       ; Cursor Position - NW to SE Axis
 
  $80/F70B 9D 04 0A    STA $0A04,x[$80:0A40]  A:000B X:003C Y:003E P:envMxdizc
 
  $80/F70B 9D 04 0A    STA $0A04,x[$80:0A40]  A:000B X:003C Y:003E P:envMxdizc
 
  $80/F70E 99 04 0A    STA $0A04,y[$80:0A42]  A:000B X:003C Y:003E P:envMxdizc
 
  $80/F70E 99 04 0A    STA $0A04,y[$80:0A42]  A:000B X:003C Y:003E P:envMxdizc
 
  $80/F711 9D 43 09    STA $0943,x[$80:097F]  A:000B X:003C Y:003E P:envMxdizc
 
  $80/F711 9D 43 09    STA $0943,x[$80:097F]  A:000B X:003C Y:003E P:envMxdizc
 
  $80/F714 99 43 09    STA $0943,y[$80:0981]  A:000B X:003C Y:003E P:envMxdizc
 
  $80/F714 99 43 09    STA $0943,y[$80:0981]  A:000B X:003C Y:003E P:envMxdizc
  $80/F717 A5 63      LDA $63   [$00:0063]  A:000B X:003C Y:003E P:envMxdizc
+
  $80/F717 A5 63      LDA $63       ; Cursor Position - NE to SW Axis
 
  $80/F719 9D 44 0A    STA $0A44,x[$80:0A80]  A:0001 X:003C Y:003E P:envMxdizc
 
  $80/F719 9D 44 0A    STA $0A44,x[$80:0A80]  A:0001 X:003C Y:003E P:envMxdizc
 
  $80/F71C 99 44 0A    STA $0A44,y[$80:0A82]  A:0001 X:003C Y:003E P:envMxdizc
 
  $80/F71C 99 44 0A    STA $0A44,y[$80:0A82]  A:0001 X:003C Y:003E P:envMxdizc
 
  $80/F71F 9D 44 09    STA $0944,x[$80:0980]  A:0001 X:003C Y:003E P:envMxdizc
 
  $80/F71F 9D 44 09    STA $0944,x[$80:0980]  A:0001 X:003C Y:003E P:envMxdizc
 
  $80/F722 99 44 09    STA $0944,y[$80:0982]  A:0001 X:003C Y:003E P:envMxdizc
 
  $80/F722 99 44 09    STA $0944,y[$80:0982]  A:0001 X:003C Y:003E P:envMxdizc
  $80/F725 A5 65      LDA $65   [$00:0065]  A:0001 X:003C Y:003E P:envMxdizc
+
  $80/F725 A5 65      LDA $65       ; Cursor Height
 
  $80/F727 0A          ASL A                  A:0006 X:003C Y:003E P:envMxdizc
 
  $80/F727 0A          ASL A                  A:0006 X:003C Y:003E P:envMxdizc
 
  $80/F728 9D 84 0A    STA $0A84,x[$80:0AC0]  A:000C X:003C Y:003E P:envMxdizc
 
  $80/F728 9D 84 0A    STA $0A84,x[$80:0AC0]  A:000C X:003C Y:003E P:envMxdizc
Line 2,155: Line 3,003:
 
  $80/F733 60          RTS
 
  $80/F733 60          RTS
  
== $80/F844 BATTLE: Changing Cursor Position something something ==
+
== $80/F734 BATTLE: Get the Map Address of the Rhomb the Cursor points to ==
  
Part to F84C (including that line) is executed when Cursor is idle
+
If you enter Battle, the program sets up several Maps on Bank $7F, which are all structured the same, for example the Height Map at $7F/D800. This is the map where the height of each Rhomb on the Battle Map is stored.
The other stuff is executed when moved
 
  
$80/F844 7B          TDC                    A:0001 X:0000 Y:000A P:envMxdizc
+
This subroutine turns the current position of the cursor into the offset for the corresponding entry on any of the the Maps. This is used for example on the Height Map to position the cursor on screen - depending on the Rhomb's height, the cursor has to be higher or lower on the screen.
$80/F845 AD 68 05    LDA $0568  [$80:0568]  A:0000 X:0000 Y:000A P:envMxdiZc
 
$80/F848 29 0F      AND #$0F                A:0000 X:0000 Y:000A P:envMxdiZc
 
$80/F84A D0 03      BNE $03    [$F84F]      A:0000 X:0000 Y:000A P:envMxdiZc
 
$80/F84C 4C E4 F8    JMP $F8E4  [$80:F8E4]  A:0000 X:0000 Y:000A P:envMxdiZc
 
$80/F84F A8          TAY                    A:0008 X:0000 Y:000A P:envMxdizc
 
$80/F850 A5 63      LDA $63      ; 16-bit A contains the current cursors position after this
 
$80/F852 EB          XBA          ; High Byte: Position on the NE-SW-Axis
 
$80/F853 A5 61      LDA $61      ;  Low Byte: Position on the NW-SE-Axis
 
$80/F855 AA          TAX          ; Transfer it to X
 
$80/F856 DA          PHX          ; ... and BUFFER IT ON STACK (gets important later)
 
$80/F857 7B          TDC          ; Clear 16-bit-A
 
$80/F858 A5 48      LDA $48    [$00:0048]  A:0000 X:020B Y:0008 P:envMxdiZc
 
$80/F85A 29 03      AND #$03                A:0001 X:020B Y:0008 P:envMxdizc
 
$80/F85C 0A          ASL A                  A:0001 X:020B Y:0008 P:envMxdizc
 
$80/F85D AA          TAX                    A:0002 X:020B Y:0008 P:envMxdizc
 
$80/F85E 7C 61 F8    JMP ($F861,x)[$80:F869] A:0002 X:0002 Y:0008 P:envMxdizc
 
  
== $80/F861 BATTLE: Jump Table for $80/F844 ==
+
These Maps have Rows and Columns. Each Row is $20 bytes long and contains all Rhombs with the same position on the NE-SW-Axis. This is why the calculation takes the NE-SW-Axis position and multiplies it by 20.
  
99 F8 - Entry #$00 - $F899
+
X will contain the result in the end.
69 F8 - Entry #$01 - $F869
 
6F F8 - Entry #$02 - $F86F
 
75 F8 - Entry #$03 - $F875
 
  
== $80/F869 BATTLE: Changing Cursor Position something something ==
+
$80/F734 7B          TDC          ; Clear 16-bit A
 +
$80/F735 A5 63      LDA $63      ; Load Cursor Position (NE-SW-Axis)
 +
$80/F737 C2 20      REP #$20      ; A = 16-bit
 +
$80/F739 EB          XBA          ; Multiply by 20
 +
$80/F73A 4A          LSR A
 +
$80/F73B 4A          LSR A
 +
$80/F73C 4A          LSR A
 +
$80/F73D E2 20      SEP #$20      ; A = 8-bit
 +
$80/F73F 05 61      ORA $61      ; Add the Cursor Position on the NW-SE-Axis
 +
$80/F741 AA          TAX          ; Transfer the result in X
 +
$80/F742 60          RTS
 +
 
 +
== $80/F844 BATTLE: Changing Cursor Position something something ==
 +
 
 +
Part to F84C (including that line) is executed when Cursor is idle
 +
 
 +
The other stuff is executed when moved
 +
 
 +
$80/F844 7B          TDC          ; Clear 16-bit A
 +
$80/F845 AD 68 05    LDA $0568    ; Load High Byte of Inputs that are actually worked off
 +
$80/F848 29 0F      AND #$0F      ; Exempt the D-Pad Inputs
 +
$80/F84A D0 03      BNE $03      ; [$F84F] Branch if there ARE directional inputs
 +
$80/F84C 4C E4 F8    JMP $F8E4    ; Jump to the last part of this subroutine (consider this as a long branch)
 +
$80/F84F A8          TAY          ; Transfer the Directional Inputs in Y
 +
$80/F850 A5 63      LDA $63      ; 16-bit A contains the current cursors position after this
 +
$80/F852 EB          XBA          ; High Byte: Position on the NE-SW-Axis
 +
$80/F853 A5 61      LDA $61      ;  Low Byte: Position on the NW-SE-Axis
 +
$80/F855 AA          TAX          ; Transfer it to X
 +
$80/F856 DA          PHX          ; ... and BUFFER IT ON STACK (gets important later)
 +
$80/F857 7B          TDC          ; Clear 16-bit-A
 +
$80/F858 A5 48      LDA $48      ; Load Cursor Move Type
 +
$80/F85A 29 03      AND #$03      ; Exempt the Bits for the Cursor Move Type
 +
$80/F85C 0A          ASL A        ; Use it as Index for the Jump Table beneath
 +
$80/F85D AA          TAX
 +
$80/F85E 7C 61 F8    JMP ($F861,x) ; Jump to the Handler of the Input corresponding to the Cursor Move Type
 +
 
 +
== $80/F861 BATTLE: Jump Table for $80/F844 ==
 +
 
 +
99 F8 - Entry #$00 - $F899 - Cursor Move Type C Input Handler (No changes to the value in Y)
 +
69 F8 - Entry #$01 - $F869 - Cursor Move Type A Input Handler
 +
6F F8 - Entry #$02 - $F86F - Cursor Move Type B Input Handler
 +
75 F8 - Entry #$03 - $F875 - Cursor Move Type D Input Handler
 +
 
 +
== $80/F869 BATTLE: Turn Input from Cursor Move Type A to Type C ==
 +
 
 +
This turns the value in Y into another value; the Original value in Y is standard Input Data; the table at $F912 turn it around according to the Type A Cursor Setting.
 +
 
 +
$80/F869 B9 12 F9    LDA $F912,y  ; Load Value
 +
$80/F86C A8          TAY          ; Transfer to Y
 +
$80/F86D 80 2A      BRA $2A      ; [$F899]
 +
 
 +
== $80/F86F BATTLE: Turn Input from Cursor Move Type B to Type C ==
 +
 
 +
This turns the value in Y into another value; the Original value in Y is standard Input Data; the table at $F922 turn it around according to the Type A Cursor Setting.
  
  $80/F869 B9 12 F9    LDA $F912,y[$80:F91A]   A:0002 X:0002 Y:0008 P:envMxdizc
+
  $80/F86F B9 22 F9    LDA $F922,y  ; Load Value
  $80/F86C A8          TAY                     A:0009 X:0002 Y:0008 P:envMxdizc
+
  $80/F872 A8          TAY           ; Transfer to Y
  $80/F86D 80 2A       BRA $2A    [$F899]     A:0009 X:0002 Y:0009 P:envMxdizc
+
  $80/F873 80 24       BRA $24      ; [$F899]
;Code is missing here
 
  
 
== $80/F899 BATTLE: Changing Cursor Position something something ==
 
== $80/F899 BATTLE: Changing Cursor Position something something ==
  $80/F899 84 00      STY $00   [$00:0000]  A:0009 X:0002 Y:0009 P:envMxdizc
+
  $80/F899 84 00      STY $00       ; Buffer Joypad Input
  $80/F89B A4 00      LDY $00   [$00:0000]  A:0009 X:0002 Y:0009 P:envMxdizc
+
  $80/F89B A4 00      LDY $00       ; Load Joypad Input (this line could be removed?)
  $80/F89D B9 F2 F8    LDA $F8F2,y[$80:F8FB]   A:0009 X:0002 Y:0009 P:envMxdizc
+
  $80/F89D B9 F2 F8    LDA $F8F2,y  ; Load the +1/-1 for the new NW-SE-Axis-position
  $80/F8A0 18          CLC                     A:0000 X:0002 Y:0009 P:envMxdiZc
+
  $80/F8A0 18          CLC
  $80/F8A1 65 61      ADC $61   [$00:0061]  A:0000 X:0002 Y:0009 P:envMxdiZc
+
  $80/F8A1 65 61      ADC $61       ; Add current NW-SE-Axis-position
  $80/F8A3 F0 07      BEQ $07   [$F8AC]     A:000B X:0002 Y:0009 P:envMxdizc
+
  $80/F8A3 F0 07      BEQ $07       ; [$F8AC] Branch (skip Position Update) if new position would be off-border (too low)
 
  $80/F8A5 CD C8 16    CMP $16C8    ; Compare to the NW-SE-Width of the Map
 
  $80/F8A5 CD C8 16    CMP $16C8    ; Compare to the NW-SE-Width of the Map
  $80/F8A8 B0 02      BCS $02      ; [$F8AC] Don't replace the Cursor Position if the new Position is offlimits
+
  $80/F8A8 B0 02      BCS $02      ; [$F8AC] Branch (skip Position Update) if new position would be off-border (too high)
 
  $80/F8AA 85 61      STA $61      ; Update Position on the NW-SE-Axis
 
  $80/F8AA 85 61      STA $61      ; Update Position on the NW-SE-Axis
  $80/F8AC B9 02 F9    LDA $F902,y[$80:F90B]   A:000B X:0002 Y:0009 P:eNvMxdizc
+
  $80/F8AC B9 02 F9    LDA $F902,y  ; Load the +1/-1 for the new NE-SW-Axis-position
  $80/F8AF 18          CLC                     A:00FF X:0002 Y:0009 P:eNvMxdizc
+
  $80/F8AF 18          CLC
  $80/F8B0 65 63      ADC $63   [$00:0063]  A:00FF X:0002 Y:0009 P:eNvMxdizc
+
  $80/F8B0 65 63      ADC $63       ; Add current NW-SE-Axis-position
  $80/F8B2 F0 07      BEQ $07   [$F8BB]     A:0001 X:0002 Y:0009 P:envMxdizC
+
  $80/F8B2 F0 07      BEQ $07       ; [$F8BB] Branch (skip Position Update) if new position would be off-border (too low)
  $80/F8B4 CD CA 16    CMP $16CA [$80:16CA]  A:0001 X:0002 Y:0009 P:envMxdizC
+
  $80/F8B4 CD CA 16    CMP $16CA     ; Width of the Map on the NE-SW-Axis
  $80/F8B7 B0 02      BCS $02   [$F8BB]     A:0001 X:0002 Y:0009 P:eNvMxdizc
+
  $80/F8B7 B0 02      BCS $02       ; [$F8BB] Branch (skip Position Update) if new position would be off-border (too high)
  $80/F8B9 85 63      STA $63   [$00:0063]  A:0001 X:0002 Y:0009 P:eNvMxdizc
+
  $80/F8B9 85 63      STA $63       ; Update Position on the NE-SW-Axis
 
  $80/F8BB 20 DF F6    JSR $F6DF  [$80:F6DF]  A:0001 X:0002 Y:0009 P:eNvMxdizc
 
  $80/F8BB 20 DF F6    JSR $F6DF  [$80:F6DF]  A:0001 X:0002 Y:0009 P:eNvMxdizc
 
  $80/F8BE FA          PLX          ; Pull the old Cursor Position from Stack (see $80/F850)
 
  $80/F8BE FA          PLX          ; Pull the old Cursor Position from Stack (see $80/F850)
Line 2,218: Line 3,098:
 
  $80/F8C7 E4 00      CPX $00      ; Compare Old and New Position
 
  $80/F8C7 E4 00      CPX $00      ; Compare Old and New Position
 
  $80/F8C9 F0 19      BEQ $19      ; [$F8E4] ? Branch if they're the same
 
  $80/F8C9 F0 19      BEQ $19      ; [$F8E4] ? Branch if they're the same
  $80/F8CB A5 47      LDA $47   [$00:0047]  A:010B X:010B Y:003E P:eNvMxdizc
+
  $80/F8CB A5 47      LDA $47       ; Load Constant Menu Display Flag - clear if deactivated
 
  $80/F8CD 0D F4 16    ORA $16F4  [$80:16F4]  A:0100 X:010B Y:003E P:envMxdiZc
 
  $80/F8CD 0D F4 16    ORA $16F4  [$80:16F4]  A:0100 X:010B Y:003E P:envMxdiZc
 
  $80/F8D0 F0 12      BEQ $12    [$F8E4]      A:0100 X:010B Y:003E P:envMxdiZc
 
  $80/F8D0 F0 12      BEQ $12    [$F8E4]      A:0100 X:010B Y:003E P:envMxdiZc
Line 2,228: Line 3,108:
 
  $80/F8F1 60          RTS                    A:0000 X:003E Y:0002 P:eNvMxdizc
 
  $80/F8F1 60          RTS                    A:0000 X:003E Y:0002 P:eNvMxdizc
  
== $80/F8F2 Table 1 for $80/F869 ==
+
== $80/F8F2 Table of Values added to the NW to SE Axis Value ==
 +
 
 +
00 --- Entry #$00 - No Direction (should be never executed)
 +
01 --- Entry #$01 - Move RIGHT
 +
FF --- Entry #$02 - Move LEFT
 +
00 --- Entry #$03 - Move LEFT RIGHT        (never possible on actual hardware)
 +
01 --- Entry #$04 - Move DOWN
 +
01 --- Entry #$05 - Move DOWN RIGHT
 +
00 --- Entry #$06 - Move DOWN LEFT
 +
00 --- Entry #$07 - Move DOWN LEFT RIGHT    (never possible on actual hardware)
 +
FF --- Entry #$08 - Move UP
 +
00 --- Entry #$09 - Move UP RIGHT
 +
FF --- Entry #$0A - Move UP LEFT
 +
00 --- Entry #$0B - Move UP LEFT RIGHT      (never possible on actual hardware)
 +
00 --- Entry #$0C - Move UP DOWN            (never possible on actual hardware)
 +
00 --- Entry #$0D - Move UP DOWN RIGHT      (never possible on actual hardware)
 +
00 --- Entry #$0E - Move UP DOWN LEFT      (never possible on actual hardware)
 +
00 --- Entry #$0F - Move UP DOWN LEFT RIGHT (never possible on actual hardware)
 +
 
 +
== $80/F902 Table of Values added to the NE to WE Axis Value ==
 +
 
 +
00 --- Entry #$00 - No Direction (should be never executed)
 +
FF --- Entry #$01 - Move RIGHT
 +
01 --- Entry #$02 - Move LEFT
 +
00 --- Entry #$03 - Move LEFT RIGHT        (never possible on actual hardware)
 +
01 --- Entry #$04 - Move DOWN
 +
00 --- Entry #$05 - Move DOWN RIGHT
 +
01 --- Entry #$06 - Move DOWN LEFT
 +
00 --- Entry #$07 - Move DOWN LEFT RIGHT    (never possible on actual hardware)
 +
FF --- Entry #$08 - Move UP
 +
FF --- Entry #$09 - Move UP RIGHT
 +
00 --- Entry #$0A - Move UP LEFT
 +
00 --- Entry #$0B - Move UP LEFT RIGHT      (never possible on actual hardware)
 +
00 --- Entry #$0C - Move UP DOWN            (never possible on actual hardware)
 +
00 --- Entry #$0D - Move UP DOWN RIGHT      (never possible on actual hardware)
 +
00 --- Entry #$0E - Move UP DOWN LEFT      (never possible on actual hardware)
 +
00 --- Entry #$0F - Move UP DOWN LEFT RIGHT (never possible on actual hardware)
 +
 
 +
== $80/F912 Cursor Move Type A Table for $80/F869 ==
 +
 
 +
00 --- Entry #$00 - %0000.0000 - No input (should be never executed)
 +
05 --- Entry #$01 - %0000.0011 - Input RIGHT
 +
0A --- Entry #$02 - %0000.1010 - Input LEFT
 +
00 --- Entry #$03 - %0000.0000 - Input LEFT RIGHT        (never possible on actual hardware)
 +
06 --- Entry #$04 - %0000.0110 - Input DOWN
 +
04 --- Entry #$05 - %0000.0100 - Input DOWN RIGHT
 +
02 --- Entry #$06 - %0000.0010 - Input DOWN LEFT
 +
00 --- Entry #$07 - %0000.0000 - Input DOWN LEFT RIGHT    (never possible on actual hardware)
 +
09 --- Entry #$08 - %0000.1001 - Input UP
 +
01 --- Entry #$09 - %0000.0001 - Input UP RIGHT
 +
08 --- Entry #$0A - %0000.1000 - Input UP LEFT
 +
00 --- Entry #$0B - %0000.0000 - Input UP LEFT RIGHT      (never possible on actual hardware)
 +
00 --- Entry #$0C - %0000.0000 - Input UP DOWN            (never possible on actual hardware)
 +
00 --- Entry #$0D - %0000.0000 - Input UP DOWN RIGHT      (never possible on actual hardware)
 +
00 --- Entry #$0E - %0000.0000 - Input UP DOWN LEFT      (never possible on actual hardware)
 +
00 --- Entry #$0F - %0000.0000 - Input UP DOWN LEFT RIGHT (never possible on actual hardware)
 +
 
 +
== $80/F922 Cursor Move Type B Table for $80/F869 ==
 +
 
 +
00 --- Entry #$00 - %0000.0000 - No input (should be never executed)
 +
09 --- Entry #$01 - %0000.1001 - Input RIGHT
 +
06 --- Entry #$02 - %0000.0110 - Input LEFT
 +
00 --- Entry #$03 - %0000.0000 - Input LEFT RIGHT        (never possible on actual hardware)
 +
05 --- Entry #$04 - %0000.0011 - Input DOWN
 +
01 --- Entry #$05 - %0000.0001 - Input DOWN RIGHT
 +
04 --- Entry #$06 - %0000.0100 - Input DOWN LEFT
 +
00 --- Entry #$07 - %0000.0000 - Input DOWN LEFT RIGHT    (never possible on actual hardware)
 +
0A --- Entry #$08 - %0000.1010 - Input UP
 +
08 --- Entry #$09 - %0000.1000 - Input UP RIGHT
 +
02 --- Entry #$0A - %0000.0010 - Input UP LEFT
 +
00 --- Entry #$0B - %0000.0000 - Input UP LEFT RIGHT      (never possible on actual hardware)
 +
00 --- Entry #$0C - %0000.0000 - Input UP DOWN            (never possible on actual hardware)
 +
00 --- Entry #$0D - %0000.0000 - Input UP DOWN RIGHT      (never possible on actual hardware)
 +
00 --- Entry #$0E - %0000.0000 - Input UP DOWN LEFT      (never possible on actual hardware)
 +
00 --- Entry #$0F - %0000.0000 - Input UP DOWN LEFT RIGHT (never possible on actual hardware)
 +
 
 +
== $80/F932 Table 5 for $80/F869 ==
  
 
  00 --- Entry #$00
 
  00 --- Entry #$00
 
  01 --- Entry #$01
 
  01 --- Entry #$01
  FF --- Entry #$02
+
  02 --- Entry #$02
 
  00 --- Entry #$03
 
  00 --- Entry #$03
  01 --- Entry #$04
+
  04 --- Entry #$04
  01 --- Entry #$05
+
  00 --- Entry #$05
 
  00 --- Entry #$06
 
  00 --- Entry #$06
 
  00 --- Entry #$07
 
  00 --- Entry #$07
  FF --- Entry #$08
+
  08 --- Entry #$08
 
  00 --- Entry #$09
 
  00 --- Entry #$09
  FF --- Entry #$0A
+
  00 --- Entry #$0A
 
  00 --- Entry #$0B
 
  00 --- Entry #$0B
 
  00 --- Entry #$0C
 
  00 --- Entry #$0C
Line 2,247: Line 3,203:
 
  00 --- Entry #$0F
 
  00 --- Entry #$0F
  
== $80/F902 Table 2 for $80/F869 ==
+
== $80/F942 Long Jump to Which Figure is the Cursor Pointing on ==
  
  00 --- Entry #$00
+
  $80/F942 8B          PHB          ; Preserve Data Bank
  FF --- Entry #$01
+
  $80/F943 4B          PHK          ; Set Data Bank to $80
01 --- Entry #$02
+
  $80/F944 AB          PLB
00 --- Entry #$03
+
  $80/F945 20 4A F9    JSR $F94A    ; Which Figure is the Cursor Pointing on
  01 --- Entry #$04
+
  $80/F948 AB          PLB          ; Restore Buffered Data Bank
  00 --- Entry #$05
+
  $80/F949 6B          RTL
01 --- Entry #$06
+
 
00 --- Entry #$07
+
== $80/F94A Which Figure is the Cursor Pointing on ==
  FF --- Entry #$08
+
 
  FF --- Entry #$09
+
$39 contains the number of the Figure after this.
00 --- Entry #$0A
+
 
00 --- Entry #$0B
+
A will contain the Graphic Set number of that Figure
00 --- Entry #$0C
 
00 --- Entry #$0D
 
00 --- Entry #$0E
 
00 --- Entry #$0F
 
  
== $80/F912 Table 3 for $80/F869 ==
+
$80/F94A 20 34 F7    JSR $F734    ; Get the Map Address of the Rhomb the Cursor points to
 +
$80/F94D 7B          TDC          ; Clear 16-bit A --- Map Address is in X, too
 +
$80/F94E BF 00 DC 7F LDA $7FDC00,x ; Load the Number of the Figure the Cursor points on
 +
$80/F952 30 0C      BMI $0C      ; [$F960] Branch if #$FF (Pointing on no figure)
 +
$80/F954 AA          TAX          ; Transfer the Map Value in X
 +
$80/F955 86 39      STX $39      ; Buffer Figure Number in $39
 +
$80/F957 BD AE 17    LDA $17AE,x  ; Load Graphic Set Number of this Figure
 +
$80/F95A C9 F0      CMP #$F0      ; ???
 +
$80/F95C B0 07      BCS $07      ; [$F965] Branch if #$F0 or higher
 +
$80/F95E 18          CLC          ; ???
 +
$80/F95F 60          RTS
  
00 --- Entry #$00
+
== $80/FA92 Play Sound Effect #$02 ==
05 --- Entry #$01
 
0A --- Entry #$02
 
00 --- Entry #$03
 
06 --- Entry #$04
 
04 --- Entry #$05
 
02 --- Entry #$06
 
00 --- Entry #$07
 
09 --- Entry #$08
 
01 --- Entry #$09
 
08 --- Entry #$0A
 
00 --- Entry #$0B
 
00 --- Entry #$0C
 
00 --- Entry #$0D
 
00 --- Entry #$0E
 
00 --- Entry #$0F
 
  
== $80/F922 Table 4 for $80/F869 ==
+
$80/FA92 A9 02      LDA #$02      ; Sound Effect #$02
 +
$80/FA94 4C B1 FA    JMP $FAB1    ; Play Sound Effect
  
00 --- Entry #$00
+
== $80/FAB1 Play Sound Effect ==
09 --- Entry #$01
 
06 --- Entry #$02
 
00 --- Entry #$03
 
05 --- Entry #$04
 
01 --- Entry #$05
 
04 --- Entry #$06
 
00 --- Entry #$07
 
0A --- Entry #$08
 
08 --- Entry #$09
 
02 --- Entry #$0A
 
00 --- Entry #$0B
 
00 --- Entry #$0C
 
00 --- Entry #$0D
 
00 --- Entry #$0E
 
00 --- Entry #$0F
 
  
== $80/F932 Table 5 for $80/F869 ==
+
A contains the number of the Sound Effect that is to be played.
  
  00 --- Entry #$00
+
  $80/FAB1 48          PHA          ; Buffer Number of the Sound Effect to play
  01 --- Entry #$01
+
  $80/FAB2 A5 57      LDA $57      ; Check if Sound Effects are turned off
02 --- Entry #$02
+
  $80/FAB4 F0 04       BEQ $04       ; [$FABA] Branch if Sound Effects are turned off ($57 = #$00)
  00 --- Entry #$03
+
  $80/FAB6 68          PLA          ; Pull Number of Sound Effect to play
04 --- Entry #$04
+
  $80/FAB7 85 F6      STA $F6      ; Transfer to $2141 - Play Sound Effect
00 --- Entry #$05
+
  $80/FAB9 60          RTS
00 --- Entry #$06
 
00 --- Entry #$07
 
08 --- Entry #$08
 
00 --- Entry #$09
 
  00 --- Entry #$0A
 
  00 --- Entry #$0B
 
00 --- Entry #$0C
 
00 --- Entry #$0D
 
00 --- Entry #$0E
 
  00 --- Entry #$0F
 
  
 
= Bank $81 =
 
= Bank $81 =
 
== $81/EF8F ? ==
 
== $81/EF8F ? ==
  
  $81/EF8F 8B          PHB                     A:0099 X:905E Y:000D P:eNvMxdizc
+
A contains the Data Bank for this subroutine
  $81/EF90 48          PHA                     A:0099 X:905E Y:000D P:eNvMxdizc
+
 
  $81/EF91 AB          PLB                     A:0099 X:905E Y:000D P:eNvMxdizc
+
  $81/EF8F 8B          PHB           ; Preserve Data Bank
 +
  $81/EF90 48          PHA           ; Set Data Bank to what is in A
 +
  $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:0099 X:905E Y:000D P:eNvMxdizc
 
  $81/EF94 98          TYA                    A:0099 X:905E Y:000D P:eNvmxdizc
 
  $81/EF94 98          TYA                    A:0099 X:905E Y:000D P:eNvmxdizc
Line 2,384: Line 3,309:
 
X and A contain a 24-bit address; this is an address to the compressed data.
 
X and A contain a 24-bit address; this is an address to the compressed data.
  
  $81/F9E5 8B          PHB          ; Preserve Program Bank
+
  $81/F9E5 8B          PHB          ; Preserve Data Bank
 
  $81/F9E6 85 25      STA $25      ; Store the brought-in bank to the where-to-read address buffer
 
  $81/F9E6 85 25      STA $25      ; Store the brought-in bank to the where-to-read address buffer
 
  $81/F9E8 A5 22      LDA $22      ; For the MVN-command, load the Destination bank and set it up in WRAM
 
  $81/F9E8 A5 22      LDA $22      ; For the MVN-command, load the Destination bank and set it up in WRAM
Line 2,513: Line 3,438:
  
 
= Bank $82 =
 
= Bank $82 =
== $82/89B0 Set $7F/DC00 to $7F/DFFF to "$FFFF" ==
+
== $82/89B0 Clear Map that shows which Figure Stands where ==
 +
 
 +
The Map at $7F/DC00 is structured as the others at the upper end of Bank $7F (the whole NE-SW-/NW-SE-Axis stuff); this maps shows where each figure stands. Either the entry for corresponding rhomb on this map contains a figure's number (#$00, #$02... #$24 or #$26), or #$FF to mark that there is no figure on that rhomb.
 +
 
 +
This subroutine creates a new, clear map of this kind - it sets every entry on this Map/Table to #$FF.
  
 
  $82/89B0 8B          PHB          ; Buffer Data Bank on Stack
 
  $82/89B0 8B          PHB          ; Buffer Data Bank on Stack
Line 2,544: Line 3,473:
 
  $82/89DC 6B          RTL
 
  $82/89DC 6B          RTL
  
== $82/89DD ? Set Every third byte at $7F/F800 to "$FF" ==
+
== $82/8A3C ? ==
 +
 
 +
X contains the Number of the Figure whose possible movement is about to be calculated.
 +
 
 +
$82/8A3C 5A          PHY          ; Push Y on Stack
 +
$82/8A3D 9B          TXY          ; Transfer Figure Number in Y
 +
$82/8A3E 7B          TDC          ; Clear 16-bit A
 +
$82/8A3F B9 D7 1C    LDA $1CD7,y  ; Load Position from where the possible Movement is calculated - NE-SW-Axis
 +
$82/8A42 C2 20      REP #$20      ; 16-bit A
 +
$82/8A44 EB          XBA          ; Multiply NE-SW-Axis-Value by #$20
 +
$82/8A45 4A          LSR A
 +
$82/8A46 4A          LSR A
 +
$82/8A47 4A          LSR A
 +
$82/8A48 E2 20      SEP #$20      ; 8-bit A
 +
$82/8A4A 19 D6 1C    ORA $1CD6,y  ; Add Position from where the possible Movement is calculated - NW-SE-Axis
 +
$82/8A4D AA          TAX          ; Transfer Result in X as Load/Store-Index
 +
$82/8A4E 98          TYA          ; Transfer Figure Number in A
 +
$82/8A4F DF 00 DC 7F CMP $7FDC00,x ; Is this Figure actually standing on this Rhomb?
 +
$82/8A53 F0 24      BEQ $24      ; [$8A79] Branch if it does
 +
; Code is missing here
 +
$82/8A79 DA          PHX          ; Buffer Map Index on Stack
 +
$82/8A7A A2 00 00    LDX #$0000              A:0108 X:0104 Y:0008 P:envMxdiZC
 +
$82/8A7D BF 00 F8 7F LDA $7FF800,x[$7F:F800] A:0108 X:0000 Y:0008 P:envMxdiZC
 +
$82/8A81 30 21      BMI $21    [$8AA4]      A:01FF X:0000 Y:0008 P:eNvMxdizC
 +
; Code is missing here
 +
$82/8AA4 E8          INX          ; Increment the Load Index thrice (3 bytes per entry)
 +
$82/8AA5 E8          INX
 +
$82/8AA6 E8          INX
 +
$82/8AA7 E0 39 00    CPX #$0039    ; Repeat this until Load Index reached #$39
 +
$82/8AAA 90 D1      BCC $D1      ; [$8A7D] Loop
 +
$82/8AAC FA          PLX          ; Restore Map Index
 +
$82/8AAD A9 FF      LDA #$FF      ; Remove this Figure from the Map which Figure Stands where
 +
$82/8AAF 9F 00 DC 7F STA $7FDC00,x
 +
$82/8AB3 BB          TYX          ; Transfer Figure Number back in X
 +
$82/8AB4 7A          PLY          ; Restore Y
 +
$82/8AB5 6B          RTL
 +
 
 +
== $82/89DD ? Set Every third byte at $7F/F800 to "$FF" ==
  
 
  $82/89DD 8B          PHB          ; Buffer Data Bank on Stack
 
  $82/89DD 8B          PHB          ; Buffer Data Bank on Stack
Line 3,099: Line 4,065:
 
  $82/E0F4 60          RTS          ; THE FINAL EXIT
 
  $82/E0F4 60          RTS          ; THE FINAL EXIT
  
== $82/F810 ? Big Map Stuff ==
+
== $82/E0F6 ? Big Map Stuff ==
 +
 
 +
X contains a Position (NW-SE-Axis)
 +
 
 +
Y contains a Position (NE-SW-Axis)
 +
 
 +
$00 contains the Original X value - Low Byte
 +
$01 contains the Original X value - High Byte
 +
 
 +
$09 entry of the $7F/C800 table
 +
$0A contains the Original X value
 +
$0B contains the Original Y value
  
  $82/E0F6 86 00      STX $00      ; Buffer brought-in X in $00
+
$0E contains the Offset of the Rhomb that this subroutine is aimed at (X/Y Original Contents)
 +
 
 +
  $82/E0F6 86 00      STX $00      ; Buffer brought-in X in $00/1
 
  $82/E0F8 BA          TSX          ; Store current Stack pointer in $05F6
 
  $82/E0F8 BA          TSX          ; Store current Stack pointer in $05F6
 
  $82/E0F9 8E F6 05    STX $05F6
 
  $82/E0F9 8E F6 05    STX $05F6
 
  $82/E0FC A6 00      LDX $00      ; Restore Original X
 
  $82/E0FC A6 00      LDX $00      ; Restore Original X
  $82/E0FE A9 20      LDA #$20               A:0280 X:0001 Y:0001 P:enVMxdizc
+
  $82/E0FE A9 20      LDA #$20     ; Multiply Original Y value by 20 (Position (NE-SW-Axis)
  $82/E100 8D 02 42    STA $4202 [$82:4202]  A:0220 X:0001 Y:0001 P:enVMxdizc
+
  $82/E100 8D 02 42    STA $4202
  $82/E103 98          TYA                     A:0220 X:0001 Y:0001 P:enVMxdizc
+
  $82/E103 98          TYA
  $82/E104 85 0B      STA $0B   [$00:000B]  A:0201 X:0001 Y:0001 P:enVMxdizc
+
  $82/E104 85 0B      STA $0B       ; Buffer Original Y in $0B
  $82/E106 8D 03 42    STA $4203 [$82:4203]  A:0201 X:0001 Y:0001 P:enVMxdizc
+
  $82/E106 8D 03 42    STA $4203
  $82/E109 8A          TXA                     A:0201 X:0001 Y:0001 P:enVMxdizc
+
  $82/E109 8A          TXA
  $82/E10A 85 0A      STA $0A   [$00:000A]  A:0201 X:0001 Y:0001 P:enVMxdizc
+
  $82/E10A 85 0A      STA $0A       ; Buffer Original X in $0C
  $82/E10C C2 21      REP #$21               A:0201 X:0001 Y:0001 P:enVMxdizc
+
  $82/E10C C2 21      REP #$21     ; 16 bit A, Clear Carry
  $82/E10E 8A          TXA                     A:0201 X:0001 Y:0001 P:enVmxdizc
+
  $82/E10E 8A          TXA           ; A = Orig. X + Orig. Y * #$20
  $82/E10F 6D 16 42    ADC $4216 [$82:4216]  A:0001 X:0001 Y:0001 P:enVmxdizc
+
  $82/E10F 6D 16 42    ADC $4216
  $82/E112 AA          TAX                     A:0021 X:0001 Y:0001 P:envmxdizc
+
  $82/E112 AA          TAX           ; Transfer it in X, to use it as Load Index
  $82/E113 E2 20      SEP #$20               A:0021 X:0021 Y:0001 P:envmxdizc
+
  $82/E113 E2 20      SEP #$20     ; Turn A to 8 bit again
  $82/E115 86 0E      STX $0E   [$00:000E]  A:0021 X:0021 Y:0001 P:envMxdizc
+
  $82/E115 86 0E      STX $0E       ; Store the Load Index in $0E/F
  $82/E117 BF 00 C8 7F LDA $7FC800,x[$7F:C821] A:0021 X:0021 Y:0001 P:envMxdizc
+
  $82/E117 BF 00 C8 7F LDA $7FC800,x ; Load Step Number(?) of the Rhomb
  $82/E11B 85 09      STA $09   [$00:0009]  A:001F X:0021 Y:0001 P:envMxdizc
+
  $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  [$82:E350]  A:001F X:0021 Y:0001 P:envMxdizc
 
  $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
 +
; Code is missing here
 
  $82/E125 84 20      STY $20    [$00:0020]  A:0000 X:0021 Y:009E P:envMxdiZc
 
  $82/E125 84 20      STY $20    [$00:0020]  A:0000 X:0021 Y:009E P:envMxdiZc
 
  $82/E127 A9 01      LDA #$01                A:0000 X:0021 Y:009E P:envMxdiZc
 
  $82/E127 A9 01      LDA #$01                A:0000 X:0021 Y:009E P:envMxdiZc
Line 3,135: Line 4,115:
 
  $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[$7F:D041] A:001F X:0021 Y:009E P:envMxdizc
 
  $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
 
  $82/E14B 4A          LSR A                  A:0011 X:0021 Y:009E P:envMxdizc
 
  $82/E14B 4A          LSR A                  A:0011 X:0021 Y:009E P:envMxdizc
 
  $82/E14C 4A          LSR A                  A:0008 X:0021 Y:009E P:envMxdizC
 
  $82/E14C 4A          LSR A                  A:0008 X:0021 Y:009E P:envMxdizC
Line 3,147: Line 4,128:
 
  $82/E15A 85 12      STA $12    [$00:0012]  A:001F X:0021 Y:009E P:envMxdizC
 
  $82/E15A 85 12      STA $12    [$00:0012]  A:001F X:0021 Y:009E P:envMxdizC
 
  $82/E15C A5 09      LDA $09    [$00:0009]  A:001F X:0021 Y:009E P:envMxdizC
 
  $82/E15C A5 09      LDA $09    [$00:0009]  A:001F X:0021 Y:009E P:envMxdizC
  $82/E15E F0 03      BEQ $03   [$E163]     A:001F X:0021 Y:009E P:envMxdizC
+
  $82/E15E F0 03      BEQ $03       ; [$E163]
 
  $82/E160 4C 4F E2    JMP $E24F  [$82:E24F]  A:001F X:0021 Y:009E P:envMxdizC
 
  $82/E160 4C 4F E2    JMP $E24F  [$82:E24F]  A:001F X:0021 Y:009E P:envMxdizC
 
  $82/E163 E6 12      INC $12    [$00:0012]  A:0000 X:013C Y:0024 P:envMxdiZc
 
  $82/E163 E6 12      INC $12    [$00:0012]  A:0000 X:013C Y:0024 P:envMxdiZc
Line 3,189: Line 4,170:
 
  $82/E1BC 80 04      BRA $04    [$E1C2]      A:011C X:0042 Y:007E P:envMxdizc
 
  $82/E1BC 80 04      BRA $04    [$E1C2]      A:011C X:0042 Y:007E P:envMxdizc
 
  $82/E1BE BF 01 C8 7F LDA $7FC801,x[$7F:C842] A:0001 X:0041 Y:0024 P:envMxdizc
 
  $82/E1BE BF 01 C8 7F LDA $7FC801,x[$7F:C842] A:0001 X:0041 Y:0024 P:envMxdizc
  $82/E1C2 10 01      BPL $01    [$E1C5]      A:001F X:0041 Y:0024 P:envMxdizc  
+
  $82/E1C2 10 01      BPL $01    [$E1C5]      A:001F X:0041 Y:0024 P:envMxdizc
 +
; Code is missing here
 
  $82/E1C5 85 0D      STA $0D    [$00:000D]  A:001F X:0041 Y:0024 P:envMxdizc
 
  $82/E1C5 85 0D      STA $0D    [$00:000D]  A:001F X:0041 Y:0024 P:envMxdizc
 
  $82/E1C7 A5 09      LDA $09    [$00:0009]  A:001F X:0041 Y:0024 P:envMxdizc
 
  $82/E1C7 A5 09      LDA $09    [$00:0009]  A:001F X:0041 Y:0024 P:envMxdizc
Line 3,252: Line 4,234:
 
  $82/E297 D0 08      BNE $08    [$E2A1]      A:1600 X:03DE Y:165E P:envMxdiZc
 
  $82/E297 D0 08      BNE $08    [$E2A1]      A:1600 X:03DE Y:165E P:envMxdiZc
 
  $82/E299 80 17      BRA $17    [$E2B2]      A:1600 X:03DE Y:165E P:envMxdiZc
 
  $82/E299 80 17      BRA $17    [$E2B2]      A:1600 X:03DE Y:165E P:envMxdiZc
  $82/E29B BF 00 D8 7F LDA $7FD800,x[$7F:D861] A:0000 X:0061 Y:00DD P:envMxdizc
+
  $82/E29B BF 00 D8 7F LDA $7FD800,x ; Load Entry from Height Map
  $82/E29F 85 00      STA $00   [$00:0000]  A:001C X:0061 Y:00DD P:envMxdizc
+
  $82/E29F 85 00      STA $00       ; Buffer Height Map Entry
  $82/E2A1 E8          INX                     A:001C X:0061 Y:00DD P:envMxdizc
+
  $82/E2A1 E8          INX           ; Increment Load Index
  $82/E2A2 BF 00 C8 7F LDA $7FC800,x[$7F:C862] A:001C X:0062 Y:00DD P:envMxdizc
+
  $82/E2A2 BF 00 C8 7F LDA $7FC800,x ; Load next Entry from the Step Map
  $82/E2A6 30 42      BMI $42   [$E2EA]     A:001C X:0062 Y:00DD P:envMxdizc
+
  $82/E2A6 30 42      BMI $42       ; [$E2EA] ??? Branch if negative
  $82/E2A8 D0 1D      BNE $1D   [$E2C7]     A:001C X:0062 Y:00DD P:envMxdizc
+
  $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[$7F:D983] A:0300 X:0183 Y:0395 P:envMxdizc
Line 3,273: Line 4,255:
 
  $82/E2C7 C5 00      CMP $00    [$00:0000]  A:001C X:0062 Y:00DD P:envMxdizc
 
  $82/E2C7 C5 00      CMP $00    [$00:0000]  A:001C X:0062 Y:00DD P:envMxdizc
 
  $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
 
  $82/E2CD A5 03      LDA $03    [$00:0003]  A:001C X:0062 Y:00DD P:envMxdiZC
 
  $82/E2CD A5 03      LDA $03    [$00:0003]  A:001C X:0062 Y:00DD P:envMxdiZC
 
  $82/E2CF 18          CLC                    A:0002 X:0062 Y:00DD P:envMxdizC
 
  $82/E2CF 18          CLC                    A:0002 X:0062 Y:00DD P:envMxdizC
Line 3,323: Line 4,306:
  
 
== $82/E350 ? ==
 
== $82/E350 ? ==
 +
 +
$09 entry of the $7F/C800 table
 +
$0A contains the Original X 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                A:001F X:0021 Y:0001 P:envMxdizc
Line 3,401: Line 4,388:
 
  $82/E45A AA          TAX                    A:0002 X:009E Y:009E P:envMxdizc
 
  $82/E45A AA          TAX                    A:0002 X:009E Y:009E P:envMxdizc
 
  $82/E45B 7C 5E E4    JMP ($E45E,x)[$82:E47F] A:0002 X:0002 Y:009E P:envMxdizc
 
  $82/E45B 7C 5E E4    JMP ($E45E,x)[$82:E47F] A:0002 X:0002 Y:009E P:envMxdizc
 +
 +
== $82/E45E ? Jump Table for $82/E453 ==
 +
 +
78 E4  Entry #$00 -
 +
7F E4  Entry #$01 -
 +
8C E4  Entry #$02 -
 +
99 E4  Entry #$03 -
 +
A6 E4  Entry #$04 -
 +
CD E4  Entry #$05 -
 +
DF E4  Entry #$06 -
 +
B3 E4  Entry #$07 -
 +
C0 E4  Entry #$08 -
 +
F1 E4  Entry #$09 -
 +
08 E5  Entry #$0A -
 +
1F E5  Entry #$0B -
 +
46 E5  Entry #$0C -
  
 
== $82/E47F ? Jump Table Entry #$01 ==
 
== $82/E47F ? Jump Table Entry #$01 ==
Line 3,468: Line 4,471:
 
  $82/E581 60          RTS                    A:1020 X:00A4 Y:0024 P:eNvmxdizc
 
  $82/E581 60          RTS                    A:1020 X:00A4 Y:0024 P:eNvmxdizc
  
== $82/F810 ? ==
+
== $82/EB6B Set BG1/2 Scroll Registers ==
  
From the Game Intro - "Quest presents" stuff
+
$82/EB6B AE B1 05    LDX $05B1    ; Update BG1 H-Scroll Register Buffer
 +
$82/EB6E 8E 91 05    STX $0591
 +
$82/EB71 AE B3 05    LDX $05B3    ; Update BG1 V-Scroll Register Buffer
 +
$82/EB74 8E 93 05    STX $0593
 +
$82/EB77 AE B5 05    LDX $05B5    ; Update BG2 H-Scroll Register Buffer
 +
$82/EB7A 8E 95 05    STX $0595
 +
$82/EB7D AE B7 05    LDX $05B7    ; Update BG2 V-Scroll Register Buffer
 +
$82/EB80 8E 97 05    STX $0597
 +
$82/EB83 60          RTS
  
$82/F810 29 FF 00    AND #$00FF              A:041C X:0400 Y:0B44 P:envmxdizc
+
== $82/F0FC ? ==
$82/F813 F0 45      BEQ $45    [$F85A]      A:001C X:0400 Y:0B44 P:envmxdizc
 
$82/F815 0A          ASL A                  A:001C X:0400 Y:0B44 P:envmxdizc
 
$82/F816 85 0C      STA $0C    [$00:000C]  A:0038 X:0400 Y:0B44 P:envmxdizc
 
$82/F818 18          CLC                    A:0038 X:0400 Y:0B44 P:envmxdizc
 
$82/F819 6D C5 0E    ADC $0EC5  [$82:0EC5]  A:0038 X:0400 Y:0B44 P:envmxdizc
 
$82/F81C AA          TAX                    A:0038 X:0400 Y:0B44 P:envmxdizc
 
$82/F81D E2 20      SEP #$20                A:0038 X:0038 Y:0B44 P:envmxdizc
 
$82/F81F AD C7 0E    LDA $0EC7  [$82:0EC7]  A:0038 X:0038 Y:0B44 P:envMxdizc
 
$82/F822 1A          INC A                  A:0000 X:0038 Y:0B44 P:envMxdiZc
 
$82/F823 22 CB AD 80 JSL $80ADCB  ; Calculate Offset: A * #$40 + X
 
$82/F827 E0 00 12    CPX #$1200    ; ??? Maybe check if the result is too big?
 
$82/F82A 90 0C      BCC $0C      ; [$F838] ??? Taken if smaller
 
  
Code is missing here
+
$82/F0FC 8B          PHB          ; Buffer Program Bank
 +
$82/F0FD 4B          PHK          ; Set Program Bank to $82
 +
$82/F0FE AB          PLB
 +
$82/F0FF 20 04 F1    JSR $F104  [$82:F104]  A:0003 X:00DF Y:0060 P:eNvMxdizC
 +
$82/F102 AB          PLB          ; Restore Program Bank
 +
$82/F103 6B          RTL
  
$82/F838 C2 21      REP #$21      ; 16-bit A + Clear Carry
+
== $82/F104 ? ==
$82/F83A A5 0A      LDA $0A      ; ???
 
$82/F83C 69 00 78    ADC #$7800    ; ???
 
$82/F83F A8          TAY          ; VRAM Destination Address
 
$82/F840 AD D8 16    LDA $16D8    ; ???
 
$82/F843 18          CLC          ; ???
 
$82/F844 69 00 EC    ADC #$EC00    ; ???
 
$82/F847 AA          TAX          ; DMA Source Address
 
$82/F848 E2 20      SEP #$20
 
$82/F84A A9 7F      LDA #$7F      ; VRAM DMA Source Bank
 
$82/F84C 22 24 9F 80 JSL $809F24  ; VRAM DMA Setup Execution
 
$82/F850 C2 21      REP #$21                A:1801 X:0038 Y:7EC4 P:eNvMxdizc
 
$82/F852 A5 0C      LDA $0C    [$00:000C]  A:1801 X:0038 Y:7EC4 P:eNvmxdizc
 
$82/F854 6D D8 16    ADC $16D8  [$82:16D8]  A:0038 X:0038 Y:7EC4 P:envmxdizc
 
$82/F857 8D D8 16    STA $16D8  [$82:16D8]  A:0038 X:0038 Y:7EC4 P:envmxdizc
 
$82/F85A 60          RTS                    A:0038 X:0038 Y:7EC4 P:envmxdizc
 
  
== $82/FAAC ? ==
+
$82/F104 48          PHA                    A:0003 X:00DF Y:0060 P:eNvMxdizC
 +
$82/F105 A5 00      LDA $00    [$00:0000]  A:0003 X:00DF Y:0060 P:eNvMxdizC
 +
$82/F107 C5 02      CMP $02    [$00:0002]  A:0001 X:00DF Y:0060 P:envMxdizC
 +
$82/F109 68          PLA                    A:0001 X:00DF Y:0060 P:eNvMxdizc
 +
$82/F10A 90 05      BCC $05    [$F111]      A:0003 X:00DF Y:0060 P:envMxdizc
 +
; Code is missing here
 +
$82/F10F 80 03      BRA $03      ; [$F114] Exit
 +
$82/F111 20 AD F2    JSR $F2AD  [$82:F2AD]  A:0003 X:00DF Y:0060 P:envMxdizc
 +
$82/F114 60          RTS                    A:0038 X:0006 Y:781B P:envMxdiZc
 +
 
 +
== $82/F115 ? ==
 +
 
 +
$82/F115 64 01      STZ $01    [$00:0001]  A:1003 X:01A0 Y:0110 P:envMxdizC
 +
$82/F117 64 03      STZ $03    [$00:0003]  A:1003 X:01A0 Y:0110 P:envMxdizC
 +
$82/F119 85 0F      STA $0F    [$00:000F]  A:1003 X:01A0 Y:0110 P:envMxdizC
 +
$82/F11B A9 80      LDA #$80                A:1003 X:01A0 Y:0110 P:envMxdizC
 +
$82/F11D 85 0E      STA $0E    [$00:000E]  A:1080 X:01A0 Y:0110 P:eNvMxdizC
 +
$82/F11F C2 20      REP #$20                A:1080 X:01A0 Y:0110 P:eNvMxdizC
 +
$82/F121 A5 06      LDA $06    [$00:0006]  A:1080 X:01A0 Y:0110 P:eNvmxdizC
 +
$82/F123 29 F8 FF    AND #$FFF8              A:0110 X:01A0 Y:0110 P:envmxdizC
 +
$82/F126 0A          ASL A                  A:0110 X:01A0 Y:0110 P:envmxdizC
 +
$82/F127 0A          ASL A                  A:0220 X:01A0 Y:0110 P:envmxdizc
 +
$82/F128 0A          ASL A                  A:0440 X:01A0 Y:0110 P:envmxdizc
 +
$82/F129 0A          ASL A                  A:0880 X:01A0 Y:0110 P:envmxdizc
 +
$82/F12A 85 06      STA $06    [$00:0006]  A:1100 X:01A0 Y:0110 P:envmxdizc
 +
$82/F12C A5 04      LDA $04    [$00:0004]  A:1100 X:01A0 Y:0110 P:envmxdizc
 +
$82/F12E 4A          LSR A                  A:01A0 X:01A0 Y:0110 P:envmxdizc
 +
$82/F12F 4A          LSR A                  A:00D0 X:01A0 Y:0110 P:envmxdizc
 +
$82/F130 4A          LSR A                  A:0068 X:01A0 Y:0110 P:envmxdizc
 +
$82/F131 85 04      STA $04    [$00:0004]  A:0034 X:01A0 Y:0110 P:envmxdizc
 +
$82/F133 E2 20      SEP #$20                A:0034 X:01A0 Y:0110 P:envmxdizc
 +
$82/F135 29 1F      AND #$1F                A:0034 X:01A0 Y:0110 P:envMxdizc
 +
$82/F137 18          CLC                    A:0014 X:01A0 Y:0110 P:envMxdizc
 +
$82/F138 65 00      ADC $00    [$00:0000]  A:0014 X:01A0 Y:0110 P:envMxdizc
 +
$82/F13A C9 21      CMP #$21                A:0034 X:01A0 Y:0110 P:envMxdizc
 +
$82/F13C 90 0C      BCC $0C    [$F14A]      A:0034 X:01A0 Y:0110 P:envMxdizC
 +
$82/F13E E9 20      SBC #$20                A:0034 X:01A0 Y:0110 P:envMxdizC
 +
$82/F140 85 09      STA $09    [$00:0009]  A:0014 X:01A0 Y:0110 P:envMxdizC
 +
$82/F142 A5 00      LDA $00    [$00:0000]  A:0014 X:01A0 Y:0110 P:envMxdizC
 +
$82/F144 E5 09      SBC $09    [$00:0009]  A:0020 X:01A0 Y:0110 P:envMxdizC
 +
$82/F146 85 08      STA $08    [$00:0008]  A:000C X:01A0 Y:0110 P:envMxdizC
 +
$82/F148 80 06      BRA $06    [$F150]      A:000C X:01A0 Y:0110 P:envMxdizC
 +
$82/F150 A5 0F      LDA $0F    [$00:000F]  A:000C X:01A0 Y:0110 P:envMxdizC
 +
$82/F152 89 01      BIT #$01                A:0003 X:01A0 Y:0110 P:envMxdizC
 +
$82/F154 D0 03      BNE $03    [$F159]      A:0003 X:01A0 Y:0110 P:envMxdizC
 +
$82/F159 A9 7F      LDA #$7F      ; Set up $7F/2000 in $20-2
 +
$82/F15B 85 22      STA $22
 +
$82/F15D A2 00 20    LDX #$2000
 +
$82/F160 86 20      STX $20
 +
$82/F162 C2 20      REP #$20                A:007F X:2000 Y:0110 P:envMxdizC
 +
$82/F164 D4 02      PEI ($02)        [$001C]      A:007F X:2000 Y:0110 P:envmxdizC
 +
$82/F166 D4 06      PEI ($06)        [$1100]      A:007F X:2000 Y:0110 P:envmxdizC
 +
$82/F168 AE D6 16    LDX $16D6  [$82:16D6]  A:007F X:2000 Y:0110 P:envmxdizC
 +
$82/F16B A5 06      LDA $06    [$00:0006]  A:007F X:0000 Y:0110 P:envmxdiZC
 +
$82/F16D C9 00 30    CMP #$3000              A:1100 X:0000 Y:0110 P:envmxdizC
 +
$82/F170 90 07      BCC $07    [$F179]      A:1100 X:0000 Y:0110 P:eNvmxdizc
 +
$82/F179 A5 04      LDA $04    [$00:0004]  A:1100 X:0000 Y:0110 P:eNvmxdizc
 +
$82/F17B C9 80 00    CMP #$0080              A:0034 X:0000 Y:0110 P:envmxdizc
 +
$82/F17E B0 0A      BCS $0A    [$F18A]      A:0034 X:0000 Y:0110 P:eNvmxdizc
 +
$82/F180 05 06      ORA $06    [$00:0006]  A:0034 X:0000 Y:0110 P:eNvmxdizc
 +
$82/F182 A8          TAY                    A:1134 X:0000 Y:0110 P:envmxdizc
 +
$82/F183 A5 08      LDA $08    [$00:0008]  A:1134 X:0000 Y:1134 P:envmxdizc
 +
$82/F185 20 CB F6    JSR $F6CB    ; Build BG1 Tilemap in Buffer
 +
$82/F188 80 09      BRA $09    [$F193]      A:0281 X:0018 Y:1140 P:envmxdiZc
 +
$82/F193 A5 09      LDA $09    [$00:0009]  A:0281 X:0018 Y:1140 P:envmxdiZc
 +
$82/F195 29 FF 00    AND #$00FF              A:0014 X:0018 Y:1140 P:envmxdizc
 +
$82/F198 F0 21      BEQ $21    [$F1BB]      A:0014 X:0018 Y:1140 P:envmxdizc
 +
$82/F19A A5 04      LDA $04    [$00:0004]  A:0014 X:0018 Y:1140 P:envmxdizc
 +
$82/F19C 18          CLC                    A:0034 X:0018 Y:1140 P:envmxdizc
 +
$82/F19D 69 20 00    ADC #$0020              A:0034 X:0018 Y:1140 P:envmxdizc
 +
$82/F1A0 29 E0 1F    AND #$1FE0              A:0054 X:0018 Y:1140 P:envmxdizc
 +
$82/F1A3 C9 80 00    CMP #$0080              A:0040 X:0018 Y:1140 P:envmxdizc
 +
$82/F1A6 B0 0A      BCS $0A    [$F1B2]      A:0040 X:0018 Y:1140 P:eNvmxdizc
 +
$82/F1A8 05 06      ORA $06    [$00:0006]  A:0040 X:0018 Y:1140 P:eNvmxdizc
 +
$82/F1AA A8          TAY                    A:1140 X:0018 Y:1140 P:envmxdizc
 +
$82/F1AB A5 09      LDA $09    [$00:0009]  A:1140 X:0018 Y:1140 P:envmxdizc
 +
$82/F1AD 20 CB F6    JSR $F6CB    ; Build BG1 Tilemap in Buffer
 +
$82/F1B0 80 09      BRA $09    [$F1BB]      A:0281 X:0040 Y:1154 P:envmxdiZc
 +
$82/F1BB A2 00 00    LDX #$0000              A:0281 X:0040 Y:1154 P:envmxdiZc
 +
$82/F1BE A5 04      LDA $04    [$00:0004]  A:0281 X:0000 Y:1154 P:envmxdiZc
 +
$82/F1C0 89 20 00    BIT #$0020              A:0034 X:0000 Y:1154 P:envmxdizc
 +
$82/F1C3 F0 03      BEQ $03    [$F1C8]      A:0034 X:0000 Y:1154 P:envmxdizc
 +
$82/F1C5 A2 00 04    LDX #$0400              A:0034 X:0000 Y:1154 P:envmxdizc
 +
$82/F1C8 86 0A      STX $0A    [$00:000A]  A:0034 X:0400 Y:1154 P:envmxdizc
 +
$82/F1CA 29 1F 00    AND #$001F              A:0034 X:0400 Y:1154 P:envmxdizc
 +
$82/F1CD 04 0A      TSB $0A    [$00:000A]  A:0014 X:0400 Y:1154 P:envmxdizc
 +
$82/F1CF A5 06      LDA $06    [$00:0006]  A:0014 X:0400 Y:1154 P:envmxdiZc
 +
$82/F1D1 4A          LSR A                  A:1100 X:0400 Y:1154 P:envmxdizc
 +
$82/F1D2 4A          LSR A                  A:0880 X:0400 Y:1154 P:envmxdizc
 +
$82/F1D3 29 E0 03    AND #$03E0              A:0440 X:0400 Y:1154 P:envmxdizc
 +
$82/F1D6 04 0A      TSB $0A    [$00:000A]  A:0040 X:0400 Y:1154 P:envmxdizc
 +
$82/F1D8 A5 08      LDA $08    [$00:0008]  A:0040 X:0400 Y:1154 P:envmxdiZc
 +
$82/F1DA 20 C5 F7    JSR $F7C5  [$82:F7C5]  A:140C X:0400 Y:1154 P:envmxdizc
 +
$82/F1DD A5 0A      LDA $0A    [$00:000A]  A:0018 X:0018 Y:7454 P:envmxdizc
 +
$82/F1DF 29 E0 07    AND #$07E0              A:0454 X:0018 Y:7454 P:envmxdizc
 +
$82/F1E2 49 00 04    EOR #$0400              A:0440 X:0018 Y:7454 P:envmxdizc
 +
$82/F1E5 85 0A      STA $0A    [$00:000A]  A:0040 X:0018 Y:7454 P:envmxdizc
 +
$82/F1E7 A5 09      LDA $09    [$00:0009]  A:0040 X:0018 Y:7454 P:envmxdizc
 +
$82/F1E9 20 C5 F7    JSR $F7C5  [$82:F7C5]  A:4014 X:0018 Y:7454 P:envmxdizc
 +
$82/F1EC C6 02      DEC $02    [$00:0002]  A:0040 X:0028 Y:7040 P:envmxdizc
 +
$82/F1EE F0 0B      BEQ $0B    [$F1FB]      A:0040 X:0028 Y:7040 P:envmxdizc
 +
$82/F1F0 A5 06      LDA $06    [$00:0006]  A:0040 X:0028 Y:7040 P:envmxdizc
 +
$82/F1F2 18          CLC                    A:1100 X:0028 Y:7040 P:envmxdizc
 +
$82/F1F3 69 80 00    ADC #$0080              A:1100 X:0028 Y:7040 P:envmxdizc
 +
$82/F1F6 85 06      STA $06    [$00:0006]  A:1180 X:0028 Y:7040 P:envmxdizc
 +
$82/F1F8 4C 68 F1    JMP $F168  [$82:F168]  A:1180 X:0028 Y:7040 P:envmxdizc
 +
$82/F1FB FA          PLX                    A:0700 X:0028 Y:73A0 P:envmxdiZc
 +
$82/F1FC 86 06      STX $06    [$00:0006]  A:0700 X:1100 Y:73A0 P:envmxdizc
 +
$82/F1FE FA          PLX                    A:0700 X:1100 Y:73A0 P:envmxdizc
 +
$82/F1FF 86 02      STX $02    [$00:0002]  A:0700 X:001C Y:73A0 P:envmxdizc
 +
$82/F201 E2 20      SEP #$20                A:0700 X:001C Y:73A0 P:envmxdizc
 +
$82/F203 A5 0F      LDA $0F    [$00:000F]  A:0700 X:001C Y:73A0 P:envMxdizc
 +
$82/F205 89 02      BIT #$02                A:0703 X:001C Y:73A0 P:envMxdizc
 +
$82/F207 D0 03      BNE $03    [$F20C]      A:0703 X:001C Y:73A0 P:envMxdizc
 +
$82/F20C A9 7F      LDA #$7F                A:0703 X:001C Y:73A0 P:envMxdizc
 +
$82/F20E 85 22      STA $22    [$00:0022]  A:077F X:001C Y:73A0 P:envMxdizc
 +
$82/F210 A2 00 50    LDX #$5000              A:077F X:001C Y:73A0 P:envMxdizc
 +
$82/F213 86 20      STX $20    [$00:0020]  A:077F X:5000 Y:73A0 P:envMxdizc
 +
$82/F215 C2 20      REP #$20                A:077F X:5000 Y:73A0 P:envMxdizc
 +
$82/F217 AE D8 16    LDX $16D8  [$82:16D8]  A:077F X:5000 Y:73A0 P:envmxdizc
 +
$82/F21A A5 06      LDA $06    [$00:0006]  A:077F X:0000 Y:73A0 P:envmxdiZc
 +
$82/F21C C9 00 30    CMP #$3000              A:1100 X:0000 Y:73A0 P:envmxdizc
 +
$82/F21F 90 07      BCC $07    [$F228]      A:1100 X:0000 Y:73A0 P:eNvmxdizc
 +
$82/F228 A5 04      LDA $04    [$00:0004]  A:1100 X:0000 Y:73A0 P:eNvmxdizc
 +
$82/F22A C9 80 00    CMP #$0080              A:0034 X:0000 Y:73A0 P:envmxdizc
 +
$82/F22D B0 0A      BCS $0A    [$F239]      A:0034 X:0000 Y:73A0 P:eNvmxdizc
 +
$82/F22F 05 06      ORA $06    [$00:0006]  A:0034 X:0000 Y:73A0 P:eNvmxdizc
 +
$82/F231 A8          TAY                    A:1134 X:0000 Y:73A0 P:envmxdizc
 +
$82/F232 A5 08      LDA $08    [$00:0008]  A:1134 X:0000 Y:1134 P:envmxdizc
 +
$82/F234 20 14 F7    JSR $F714    ; Build BG2 Tilemap in Buffer
 +
$82/F237 80 09      BRA $09    [$F242]      A:1131 X:0018 Y:1140 P:envmxdiZc
 +
; code is missing here
 +
$82/F242 A5 09      LDA $09    [$00:0009]  A:1131 X:0018 Y:1140 P:envmxdiZc
 +
$82/F244 29 FF 00    AND #$00FF              A:0014 X:0018 Y:1140 P:envmxdizc
 +
$82/F247 F0 21      BEQ $21    [$F26A]      A:0014 X:0018 Y:1140 P:envmxdizc
 +
$82/F249 A5 04      LDA $04    [$00:0004]  A:0014 X:0018 Y:1140 P:envmxdizc
 +
$82/F24B 18          CLC                    A:0034 X:0018 Y:1140 P:envmxdizc
 +
$82/F24C 69 20 00    ADC #$0020              A:0034 X:0018 Y:1140 P:envmxdizc
 +
$82/F24F 29 E0 1F    AND #$1FE0              A:0054 X:0018 Y:1140 P:envmxdizc
 +
$82/F252 C9 80 00    CMP #$0080              A:0040 X:0018 Y:1140 P:envmxdizc
 +
$82/F255 B0 0A      BCS $0A    [$F261]      A:0040 X:0018 Y:1140 P:eNvmxdizc
 +
$82/F257 05 06      ORA $06    [$00:0006]  A:0040 X:0018 Y:1140 P:eNvmxdizc
 +
$82/F259 A8          TAY                    A:1140 X:0018 Y:1140 P:envmxdizc
 +
$82/F25A A5 09      LDA $09    [$00:0009]  A:1140 X:0018 Y:1140 P:envmxdizc
 +
$82/F25C 20 14 F7    JSR $F714    ; Build BG2 Tilemap in Buffer
 +
$82/F25F 80 09      BRA $09    [$F26A]      A:103B X:0040 Y:1154 P:envmxdiZc
 +
$82/F26A A2 00 00    LDX #$0000              A:103B X:0040 Y:1154 P:envmxdiZc
 +
$82/F26D A5 04      LDA $04    [$00:0004]  A:103B X:0000 Y:1154 P:envmxdiZc
 +
$82/F26F 89 20 00    BIT #$0020              A:0034 X:0000 Y:1154 P:envmxdizc
 +
$82/F272 F0 03      BEQ $03    [$F277]      A:0034 X:0000 Y:1154 P:envmxdizc
 +
$82/F274 A2 00 04    LDX #$0400              A:0034 X:0000 Y:1154 P:envmxdizc
 +
$82/F277 86 0A      STX $0A    [$00:000A]  A:0034 X:0400 Y:1154 P:envmxdizc
 +
$82/F279 29 1F 00    AND #$001F              A:0034 X:0400 Y:1154 P:envmxdizc
 +
$82/F27C 04 0A      TSB $0A    [$00:000A]  A:0014 X:0400 Y:1154 P:envmxdizc
 +
$82/F27E A5 06      LDA $06    [$00:0006]  A:0014 X:0400 Y:1154 P:envmxdiZc
 +
$82/F280 4A          LSR A                  A:1100 X:0400 Y:1154 P:envmxdizc
 +
$82/F281 4A          LSR A                  A:0880 X:0400 Y:1154 P:envmxdizc
 +
$82/F282 29 E0 03    AND #$03E0              A:0440 X:0400 Y:1154 P:envmxdizc
 +
$82/F285 04 0A      TSB $0A    [$00:000A]  A:0040 X:0400 Y:1154 P:envmxdizc
 +
$82/F287 A5 08      LDA $08    [$00:0008]  A:0040 X:0400 Y:1154 P:envmxdiZc
 +
$82/F289 20 10 F8    JSR $F810  [$82:F810]  A:140C X:0400 Y:1154 P:envmxdizc
 +
$82/F28C A5 0A      LDA $0A    [$00:000A]  A:0018 X:0018 Y:7C54 P:envmxdizc
 +
$82/F28E 29 E0 07    AND #$07E0              A:0454 X:0018 Y:7C54 P:envmxdizc
 +
$82/F291 49 00 04    EOR #$0400              A:0440 X:0018 Y:7C54 P:envmxdizc
 +
$82/F294 85 0A      STA $0A    [$00:000A]  A:0040 X:0018 Y:7C54 P:envmxdizc
 +
$82/F296 A5 09      LDA $09    [$00:0009]  A:0040 X:0018 Y:7C54 P:envmxdizc
 +
$82/F298 20 10 F8    JSR $F810  [$82:F810]  A:4014 X:0018 Y:7C54 P:envmxdizc
 +
$82/F29B C6 02      DEC $02    [$00:0002]  A:0040 X:0028 Y:7840 P:envmxdizc
 +
$82/F29D F0 0B      BEQ $0B    [$F2AA]      A:0040 X:0028 Y:7840 P:envmxdizc
 +
$82/F29F A5 06      LDA $06    [$00:0006]  A:0040 X:0028 Y:7840 P:envmxdizc
 +
$82/F2A1 18          CLC                    A:1100 X:0028 Y:7840 P:envmxdizc
 +
$82/F2A2 69 80 00    ADC #$0080              A:1100 X:0028 Y:7840 P:envmxdizc
 +
$82/F2A5 85 06      STA $06    [$00:0006]  A:1180 X:0028 Y:7840 P:envmxdizc
 +
$82/F2A7 4C 17 F2    JMP $F217  [$82:F217]  A:1180 X:0028 Y:7840 P:envmxdizc
 +
$82/F2AA E2 20      SEP #$20                A:0700 X:0028 Y:7BA0 P:envmxdiZc
 +
$82/F2AC 60          RTS                    A:0700 X:0028 Y:7BA0 P:envMxdiZc
 +
 
 +
== $82/F2AD ? ==
 +
 
 +
When this subroutine is called, $04/5 contain a copy of the BG1 H-Scroll value and $06/7 contain a copy of the BG1 V-Scroll value.
 +
 
 +
$82/F2AD 64 01      STZ $01    [$00:0001]  A:0003 X:00DF Y:0060 P:envMxdizc
 +
$82/F2AF 64 03      STZ $03      ; ???
 +
$82/F2B1 85 0F      STA $0F      ; Buffer Original A in $0F
 +
$82/F2B3 A9 81      LDA #$81                A:0003 X:00DF Y:0060 P:envMxdizc
 +
$82/F2B5 85 0E      STA $0E    [$00:000E]  A:0081 X:00DF Y:0060 P:eNvMxdizc
 +
$82/F2B7 C2 20      REP #$20                A:0081 X:00DF Y:0060 P:eNvMxdizc
 +
$82/F2B9 A5 04      LDA $04      ; Load BG1-H-Scroll Value Copy
 +
$82/F2BB 4A          LSR A        ; Divide it by 8
 +
$82/F2BC 4A          LSR A
 +
$82/F2BD 4A          LSR A
 +
$82/F2BE 85 04      STA $04      ; Store it back
 +
$82/F2C0 A5 06      LDA $06      ; Load BG1-V-Scroll Value Copy
 +
$82/F2C2 A8          TAY          ; Transfer it as it is in Y
 +
$82/F2C3 29 F8 FF    AND #$FFF8    ; Remove the lowest three bits
 +
$82/F2C6 0A          ASL A        ; Multiply it by #$10
 +
$82/F2C7 0A          ASL A
 +
$82/F2C8 0A          ASL A
 +
$82/F2C9 0A          ASL A
 +
$82/F2CA 85 06      STA $06      ; Store it back in $06/7
 +
$82/F2CC E2 20      SEP #$20      ; 8-bit A
 +
$82/F2CE 98          TYA          ; Transfer the Low Byte of BG1-V-Scroll Value Copy in A
 +
$82/F2CF 4A          LSR A        ; Divide it by 8
 +
$82/F2D0 4A          LSR A
 +
$82/F2D1 4A          LSR A
 +
$82/F2D2 29 1F      AND #$1F      ; ??? Unnecessary?
 +
$82/F2D4 18          CLC                    A:060C X:00DF Y:0060 P:envMxdizc
 +
$82/F2D5 65 02      ADC $02    [$00:0002]  A:060C X:00DF Y:0060 P:envMxdizc
 +
$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/F2DB E9 20      SBC #$20                A:0628 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/F2E1 E5 09      SBC $09    [$00:0009]  A:061C X:00DF Y:0060 P:envMxdizC
 +
$82/F2E3 85 08      STA $08    [$00:0008]  A:0614 X:00DF Y:0060 P:envMxdizC
 +
$82/F2E5 80 06      BRA $06    [$F2ED]      A:0614 X:00DF Y:0060 P:envMxdizC
 +
; Code is missing here
 +
$82/F2ED A5 0F      LDA $0F    [$00:000F]  A:0614 X:00DF Y:0060 P:envMxdizC
 +
$82/F2EF 89 01      BIT #$01                A:0603 X:00DF Y:0060 P:envMxdizC
 +
$82/F2F1 D0 03      BNE $03    [$F2F6]      A:0603 X:00DF Y:0060 P:envMxdizC
 +
; Code is missing here
 +
$82/F2F6 A9 7F      LDA #$7F      ; Set up $7F/2000 in $20-22 (Address of the BG1 Tilemap)
 +
$82/F2F8 85 22      STA $22
 +
$82/F2FA A2 00 20    LDX #$2000
 +
$82/F2FD 86 20      STX $20
 +
$82/F2FF C2 20      REP #$20      ; 16-bit A
 +
$82/F301 D4 00      PEI ($00)    ; Buffer $00/1/4/5 on Stack
 +
$82/F303 D4 04      PEI ($04)
 +
$82/F305 AE D6 16    LDX $16D6  [$82:16D6]  A:067F X:2000 Y:0060 P:envmxdizC
 +
$82/F308 A5 04      LDA $04    [$00:0004]  A:067F X:0000 Y:0060 P:envmxdiZC
 +
$82/F30A C9 80 00    CMP #$0080              A:001B X:0000 Y:0060 P:envmxdizC
 +
$82/F30D 90 08      BCC $08    [$F317]      A:001B X:0000 Y:0060 P:eNvmxdizc
 +
$82/F317 A5 06      LDA $06    [$00:0006]  A:001B X:0000 Y:0060 P:eNvmxdizc
 +
$82/F319 C9 00 30    CMP #$3000              A:0600 X:0000 Y:0060 P:envmxdizc
 +
$82/F31C B0 0A      BCS $0A    [$F328]      A:0600 X:0000 Y:0060 P:eNvmxdizc
 +
$82/F31E 05 04      ORA $04    [$00:0004]  A:0600 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/F323 20 5D F7    JSR $F75D    ; Update BG1 Tilemap from Scrolling?
 +
$82/F326 80 09      BRA $09    [$F331]      A:101A X:0028 Y:101A P:envmxdiZc
 +
; Code is missing here
 +
$82/F331 A5 09      LDA $09    [$00:0009]  A:101A X:0028 Y:101A P:envmxdiZc
 +
$82/F333 29 FF 00    AND #$00FF              A:0008 X:0028 Y:101A P:envmxdizc
 +
$82/F336 F0 21      BEQ $21    [$F359]      A:0008 X:0028 Y:101A P:envmxdizc
 +
$82/F338 A5 06      LDA $06    [$00:0006]  A:0008 X:0028 Y:101A P:envmxdizc
 +
$82/F33A 29 00 F0    AND #$F000              A:0600 X:0028 Y:101A P:envmxdizc
 +
$82/F33D 18          CLC                    A:0000 X:0028 Y:101A P:envmxdiZc
 +
$82/F33E 69 00 10    ADC #$1000              A:0000 X:0028 Y:101A P:envmxdiZc
 +
$82/F341 C9 00 30    CMP #$3000              A:1000 X:0028 Y:101A P:envmxdizc
 +
$82/F344 B0 0A      BCS $0A    [$F350]      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/F349 A5 09      LDA $09    [$00:0009]  A:101B X:0028 Y:101B P:envmxdizc
 +
$82/F34B 20 5D F7    JSR $F75D    ; Update BG1 Tilemap from Scrolling?
 +
$82/F34E 80 09      BRA $09    [$F359]      A:141A X:0038 Y:141A P:envmxdiZc
 +
;Code is missing here
 +
$82/F359 A2 00 00    LDX #$0000              A:141A X:0038 Y:141A P:envmxdiZc
 +
$82/F35C A5 04      LDA $04    [$00:0004]  A:141A X:0000 Y:141A P:envmxdiZc
 +
$82/F35E 89 20 00    BIT #$0020              A:001B X:0000 Y:141A P:envmxdizc
 +
$82/F361 F0 03      BEQ $03    [$F366]      A:001B X:0000 Y:141A P:envmxdiZc
 +
$82/F366 86 0A      STX $0A    [$00:000A]  A:001B X:0000 Y:141A P:envmxdiZc
 +
$82/F368 29 1F 00    AND #$001F              A:001B X:0000 Y:141A P:envmxdiZc
 +
$82/F36B 04 0A      TSB $0A    [$00:000A]  A:001B X:0000 Y:141A P:envmxdizc
 +
$82/F36D A5 06      LDA $06    [$00:0006]  A:001B X:0000 Y:141A P:envmxdiZc
 +
$82/F36F 4A          LSR A                  A:0600 X:0000 Y:141A P:envmxdizc
 +
$82/F370 4A          LSR A                  A:0300 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/F376 A5 08      LDA $08    [$00:0008]  A:0180 X:0000 Y:141A P:envmxdiZc
 +
$82/F378 20 C5 F7    JSR $F7C5  [$82:F7C5]  A:0814 X:0000 Y:141A P:envmxdizc
 +
$82/F37B A5 0A      LDA $0A    [$00:000A]  A:0028 X:0000 Y:719B P:envmxdizc
 +
$82/F37D 29 1F 04    AND #$041F              A:019B X:0000 Y:719B P:envmxdizc
 +
$82/F380 85 0A      STA $0A    [$00:000A]  A:001B X:0000 Y:719B P:envmxdizc
 +
$82/F382 A5 09      LDA $09    [$00:0009]  A:001B X:0000 Y:719B P:envmxdizc
 +
$82/F384 20 C5 F7    JSR $F7C5  [$82:F7C5]  A:1B08 X:0000 Y:719B P:envmxdizc
 +
$82/F387 C6 00      DEC $00    [$00:0000]  A:0038 X:0002 Y:701B P:envmxdizc
 +
$82/F389 F0 0B      BEQ $0B    [$F396]      A:0038 X:0002 Y:701B P:envmxdiZc
 +
;Code is missing here
 +
$82/F396 FA          PLX                    A:0038 X:0002 Y:701B P:envmxdiZc
 +
$82/F397 86 04      STX $04    [$00:0004]  A:0038 X:001B Y:701B P:envmxdizc
 +
$82/F399 FA          PLX                    A:0038 X:001B Y:701B P:envmxdizc
 +
$82/F39A 86 00      STX $00    [$00:0000]  A:0038 X:0001 Y:701B P:envmxdizc
 +
$82/F39C E2 20      SEP #$20                A:0038 X:0001 Y:701B P:envmxdizc
 +
$82/F39E A5 0F      LDA $0F    [$00:000F]  A:0038 X:0001 Y:701B P:envMxdizc
 +
$82/F3A0 89 02      BIT #$02                A:0003 X:0001 Y:701B P:envMxdizc
 +
$82/F3A2 D0 03      BNE $03    [$F3A7]      A:0003 X:0001 Y:701B P:envMxdizc
 +
;Code is missing here
 +
$82/F3A7 A9 7F      LDA #$7F      ; Set up $7F/5000 in $20-22 (Address of the BG2 Tilemap)
 +
$82/F3A9 85 22      STA $22
 +
$82/F3AB A2 00 50    LDX #$5000
 +
$82/F3AE 86 20      STX $20
 +
$82/F3B0 C2 20      REP #$20                A:007F X:5000 Y:701B P:envMxdizc
 +
$82/F3B2 AE D8 16    LDX $16D8  [$82:16D8]  A:007F X:5000 Y:701B P:envmxdizc
 +
$82/F3B5 A5 04      LDA $04    [$00:0004]  A:007F X:0000 Y:701B P:envmxdiZc
 +
$82/F3B7 C9 80 00    CMP #$0080              A:001B X:0000 Y:701B P:envmxdizc
 +
$82/F3BA 90 08      BCC $08    [$F3C4]      A:001B X:0000 Y:701B P:eNvmxdizc
 +
;Code is missing here
 +
$82/F3C4 A5 06      LDA $06    [$00:0006]  A:001B X:0000 Y:701B P:eNvmxdizc
 +
$82/F3C6 C9 00 30    CMP #$3000              A:0600 X:0000 Y:701B P:envmxdizc
 +
$82/F3C9 B0 0A      BCS $0A    [$F3D5]      A:0600 X:0000 Y:701B P:eNvmxdizc
 +
$82/F3CB 05 04      ORA $04    [$00:0004]  A:0600 X:0000 Y:701B P:eNvmxdizc
 +
$82/F3CD A8          TAY                    A:061B X:0000 Y:701B P:envmxdizc
 +
$82/F3CE A5 08      LDA $08    [$00:0008]  A:061B X:0000 Y:061B P:envmxdizc
 +
$82/F3D0 20 91 F7    JSR $F791    ; Update BG2 Tilemap from Scrolling?
 +
$82/F3D3 80 09      BRA $09    [$F3DE]      A:101A X:0028 Y:101A P:envmxdiZc
 +
;Code is missing here
 +
$82/F3DE A5 09      LDA $09    [$00:0009]  A:101A X:0028 Y:101A P:envmxdiZc
 +
$82/F3E0 29 FF 00    AND #$00FF              A:0008 X:0028 Y:101A P:envmxdizc
 +
$82/F3E3 F0 21      BEQ $21    [$F406]      A:0008 X:0028 Y:101A P:envmxdizc
 +
$82/F3E5 A5 06      LDA $06    [$00:0006]  A:0008 X:0028 Y:101A P:envmxdizc
 +
$82/F3E7 29 00 F0    AND #$F000              A:0600 X:0028 Y:101A P:envmxdizc
 +
$82/F3EA 18          CLC                    A:0000 X:0028 Y:101A P:envmxdiZc
 +
$82/F3EB 69 00 10    ADC #$1000              A:0000 X:0028 Y:101A P:envmxdiZc
 +
$82/F3EE C9 00 30    CMP #$3000              A:1000 X:0028 Y:101A P:envmxdizc
 +
$82/F3F1 B0 0A      BCS $0A    [$F3FD]      A:1000 X:0028 Y:101A P:eNvmxdizc
 +
$82/F3F3 05 04      ORA $04    [$00:0004]  A:1000 X:0028 Y:101A P:eNvmxdizc
 +
$82/F3F5 A8          TAY                    A:101B X:0028 Y:101A P:envmxdizc
 +
$82/F3F6 A5 09      LDA $09    [$00:0009]  A:101B X:0028 Y:101B P:envmxdizc
 +
$82/F3F8 20 91 F7    JSR $F791    ; Update BG2 Tilemap from Scrolling?
 +
$82/F3FB 80 09      BRA $09    [$F406]      A:141A X:0038 Y:141A P:envmxdiZc
 +
;Code is missing here
 +
$82/F406 A2 00 00    LDX #$0000              A:141A X:0038 Y:141A P:envmxdiZc
 +
$82/F409 A5 04      LDA $04    [$00:0004]  A:141A X:0000 Y:141A P:envmxdiZc
 +
$82/F40B 89 20 00    BIT #$0020              A:001B X:0000 Y:141A P:envmxdizc
 +
$82/F40E F0 03      BEQ $03    [$F413]      A:001B X:0000 Y:141A P:envmxdiZc
 +
$82/F413 86 0A      STX $0A    [$00:000A]  A:001B X:0000 Y:141A P:envmxdiZc
 +
$82/F415 29 1F 00    AND #$001F              A:001B X:0000 Y:141A P:envmxdiZc
 +
$82/F418 04 0A      TSB $0A    [$00:000A]  A:001B X:0000 Y:141A P:envmxdizc
 +
$82/F41A A5 06      LDA $06    [$00:0006]  A:001B X:0000 Y:141A P:envmxdiZc
 +
$82/F41C 4A          LSR A                  A:0600 X:0000 Y:141A P:envmxdizc
 +
$82/F41D 4A          LSR A                  A:0300 X:0000 Y:141A P:envmxdizc
 +
$82/F41E 29 E0 03    AND #$03E0              A:0180 X:0000 Y:141A P:envmxdizc
 +
$82/F421 04 0A      TSB $0A    [$00:000A]  A:0180 X:0000 Y:141A P:envmxdizc
 +
$82/F423 A5 08      LDA $08    [$00:0008]  A:0180 X:0000 Y:141A P:envmxdiZc
 +
$82/F425 20 10 F8    JSR $F810  [$82:F810]  A:0814 X:0000 Y:141A P:envmxdizc
 +
$82/F428 A5 0A      LDA $0A    [$00:000A]  A:0028 X:0004 Y:799B P:envmxdizc
 +
$82/F42A 29 1F 04    AND #$041F              A:019B X:0004 Y:799B P:envmxdizc
 +
$82/F42D 85 0A      STA $0A    [$00:000A]  A:001B X:0004 Y:799B P:envmxdizc
 +
$82/F42F A5 09      LDA $09    [$00:0009]  A:001B X:0004 Y:799B P:envmxdizc
 +
$82/F431 20 10 F8    JSR $F810  [$82:F810]  A:1B08 X:0004 Y:799B P:envmxdizc
 +
$82/F434 C6 00      DEC $00    [$00:0000]  A:0038 X:0006 Y:781B P:envmxdizc
 +
$82/F436 F0 0B      BEQ $0B    [$F443]      A:0038 X:0006 Y:781B P:envmxdiZc
 +
$82/F443 E2 20      SEP #$20                A:0038 X:0006 Y:781B P:envmxdiZc
 +
$82/F445 60          RTS                    A:0038 X:0006 Y:781B P:envMxdiZc
 +
 
 +
== $82/F6CB Build BG1 Tilemap in Buffer ==
 +
 
 +
This subroutine is entered with 16-bit A
 +
 
 +
$82/F6CB 29 FF 00    AND #$00FF    ; Remove High Byte
 +
$82/F6CE F0 43      BEQ $43      ; [$F713] Exit if Low Byte was empty
 +
$82/F6D0 4A          LSR A        ; Divide Value of A by 2
 +
$82/F6D1 85 0A      STA $0A      ; Store it as Loop Counter
 +
$82/F6D3 B0 08      BCS $08      ; [$F6DD] Branch if LSB in Original A was set
 +
$82/F6D5 98          TYA          ; Check if the LSB in Y was set
 +
$82/F6D6 4A          LSR A
 +
$82/F6D7 90 17      BCC $17      ; [$F6F0] Branch if it was clear
 +
; Code is missing here
 +
$82/F6F0 A5 0A      LDA $0A      ; Load the Loop counter value
 +
$82/F6F2 F0 15      BEQ $15      ; [$F709] Branch if it was empty
 +
$82/F6F4 B7 20      LDA [$20],y  ; Load Byte from the whole BG1 Map
 +
$82/F6F6 9F 00 E0 7F STA $7FE000,x ; Store in BG1 Tilemap Buffer
 +
$82/F6FA C8          INY          ; Increment Load Index twice
 +
$82/F6FB C8          INY
 +
$82/F6FC E8          INX          ; Increment Store Index twice
 +
$82/F6FD E8          INX
 +
$82/F6FE 1A          INC A        ; Increment Tilemap Entry for the right Half of the Rhomb's Edge
 +
$82/F6FF 9F 00 E0 7F STA $7FE000,x ; Store in BG1 Tilemap Buffer
 +
$82/F703 E8          INX          ; Increment Store Index twice
 +
$82/F704 E8          INX
 +
$82/F705 C6 0A      DEC $0A      ; Decrement Loop Counter
 +
$82/F707 D0 EB      BNE $EB      ; [$F6F4] Loop
 +
$82/F709 90 08      BCC $08      ; [$F713] ??? Exit
 +
; Code is missing here
 +
$82/F713 60          RTS
  
The second part of this subroutine transfers the data from $164B onwards into the CGRAM buffer and builds actual palettes from it - the data at $164B only contains fourteen colors per planned palette.
+
== $82/F714 Build BG2 Tilemap in Buffer ==
  
The palettes are built the following way:
+
This subroutine is entered with 16-bit A
  
  ($FAD2 to $FAD9) The first color is $0000
+
  $82/F714 29 FF 00    AND #$00FF    ; Remove High Byte
  ($FADA to $FAE9) The next #$0D (thirteen) colors are copied from [$20] = $00/164B + x
+
$82/F717 F0 43      BEQ $43      ; [$F75C] Exit if Low Byte was empty
  ($FAEA to $FAEB) The fourteenth color gets left out
+
$82/F719 4A          LSR A        ; Divide Value of A by 2
  ($FAEC to $FAF7) The fifteenth and last color gets copied from [$20] = $00/164B + x
+
$82/F71A 85 0A      STA $0A      ; Store it as Loop Counter
 +
$82/F71C B0 08      BCS $08      ; [$F726] Branch if LSB in Original A was set
 +
$82/F71E 98          TYA          ; Check if the LSB in Y was set
 +
$82/F71F 4A          LSR A
 +
$82/F720 90 17      BCC $17      ; [$F739] Branch if it was clear
 +
; Code is missing here
 +
$82/F739 A5 0A      LDA $0A      ; Load the Loop counter value
 +
  $82/F73B F0 15      BEQ $15      ; [$F752] Branch if it was empty
 +
$82/F73D B7 20      LDA [$20],y  ; Load Byte from the whole BG2 Map
 +
$82/F73F 9F 00 EC 7F STA $7FEC00,x ; Store in BG2 Tilemap Buffer
 +
$82/F743 C8          INY          ; Increment Load Index twice
 +
$82/F744 C8          INY
 +
$82/F745 E8          INX          ; Increment Store Index twice
 +
$82/F746 E8          INX
 +
$82/F747 1A          INC A        ; Increment Tilemap Entry for the right Half of the Rhomb's Edge
 +
$82/F748 9F 00 EC 7F STA $7FEC00,x ; Store in BG2 Tilemap Buffer
 +
$82/F74C E8          INX          ; Increment Store Index twice
 +
$82/F74D E8          INX
 +
$82/F74E C6 0A      DEC $0A      ; Decrement Loop Counter
 +
  $82/F750 D0 EB      BNE $EB      ; [$F73D] Loop
 +
  $82/F752 90 08      BCC $08      ; [$F75C] ??? Exit
 +
$82/F75C 60          RTS
  
$82/FAAC 8B          PHB          ; Preserve Data Bank
+
== $82/F75D Update BG1 Tilemap from Scrolling? ==
$82/FAAD 4B          PHK          ; Change Data Bank to this
 
$82/FAAE AB          PLB
 
$82/FAAF A2 4B 16    LDX #$164B    ; Setup 24-bit Address in $20-22 to $00/164B (=$7E/164B)
 
$82/FAB2 86 20      STX $20
 
$82/FAB4 A9 00      LDA #$00
 
$82/FAB6 85 22      STA $22
 
$82/FAB8 22 0F FB 82 JSL $82FB0F  ; ???
 
$82/FABC D4 00      PEI ($00)    ; Preserve $00-3 on Stack
 
$82/FABE D4 02      PEI ($02)
 
$82/FAC0 C2 20      REP #$20
 
$82/FAC2 A2 80 00    LDX #$0080    ; Store Index - where to begin to store in $124B and $144B
 
$82/FAC5 A0 00 00    LDY #$0000    ; Load Index
 
$82/FAC8 A9 04 00    LDA #$0004    ; Setup Palette Counter - how many palettes to do
 
$82/FACB 85 00      STA $00
 
$82/FACD A9 0D 00    LDA #$000D    ; Setup Color counter - counter for the thirteen colors
 
$82/FAD0 85 02      STA $02   
 
$82/FAD2 9E 4B 12    STZ $124B,x  ; Clear the first two bytes in the palette (making it pitch-black)
 
$82/FAD5 9E 4B 14    STZ $144B,x  ; Do the same in the second CGRAM buffer
 
$82/FAD8 E8          INX          ; Increment Store Index so it points to the next color
 
$82/FAD9 E8          INX
 
$82/FADA B7 20      LDA [$20],y  ; Load color from around $164B
 
$82/FADC 9D 4B 12    STA $124B,x  ; Store it in CGRAM buffer
 
$82/FADF 9D 4B 14    STA $144B,x  ; Do the same in the second CGRAM buffer
 
$82/FAE2 C8          INY          ; Increment Load Index so it points to the next color
 
$82/FAE3 C8          INY
 
$82/FAE4 E8          INX          ; Increment Store Index so it points to the next color
 
$82/FAE5 E8          INX
 
$82/FAE6 C6 02      DEC $02      ; Decrement color counter
 
$82/FAE8 D0 F0      BNE $F0      ; [$FADA] Loop until all thirteen colors are done
 
$82/FAEA E8          INX          ; Increment X twice - leave the fourteenth color out
 
$82/FAEB E8          INX
 
$82/FAEC B7 20      LDA [$20],y  ; Load color from around $164B
 
$82/FAEE 9D 4B 12    STA $124B,x  ; Store it in CGRAM buffer
 
$82/FAF1 9D 4B 14    STA $144B,x  ; Do the same in the second CGRAM buffer
 
$82/FAF4 C8          INY          ; Increment Load Index so it points to the next color
 
$82/FAF5 C8          INY
 
$82/FAF6 E8          INX          ; Increment Store Index so it points to the next color
 
$82/FAF7 E8          INX
 
$82/FAF8 C6 00      DEC $00      ; Decrement Palette Counter
 
$82/FAFA D0 D1      BNE $D1      ; [$FACD] Loop until all four palettes are done
 
$82/FAFC E2 20      SEP #$20
 
$82/FAFE A9 40      LDA #$40      ; CGRAM Destination
 
$82/FB00 A0 80 00    LDY #$0080    ; Number of Bytes
 
$82/FB03 22 B5 9E 80 JSL $809EB5  ; Transfer these four palettes from CGRAM buffer to CGRAM
 
$82/FB07 7A          PLY          ; Restore $00-$03 and exit
 
$82/FB08 84 02      STY $02
 
$82/FB0A 7A          PLY
 
$82/FB0B 84 00      STY $00
 
$82/FB0D AB          PLB
 
$82/FB0E 6B          RTL
 
  
= Bank $83 =
+
A contains number of double-bytes to transfer - A is 16 bit, but the value may not exceed #$FF.
== $83/A990 ? ==
 
  
This is about some color calculation. $20-22 and $23-25 both contain 24-addresses to colors.
+
$82/F75D 29 FF 00    AND #$00FF    ; Remove Upper Byte
 +
$82/F760 F0 2E      BEQ $2E      ; [$F790] Exit if empty
 +
$82/F762 85 0A      STA $0A      ; Buffer Number of Double-Bytes to transfer
 +
$82/F764 98          TYA                    A:0014 X:0000 Y:061B P:envmxdizc
 +
$82/F765 4A          LSR A                  A:061B X:0000 Y:061B P:envmxdizc
 +
$82/F766 B0 14      BCS $14    [$F77C]      A:030D X:0000 Y:061B P:envmxdizC
 +
;Code is missing here
 +
$82/F77C 88          DEY                    A:030D X:0000 Y:061B P:envmxdizC
 +
$82/F77D B7 20      LDA [$20],y[$7F:261A]  A:030D X:0000 Y:061A P:envmxdizC
 +
$82/F77F 1A          INC A                  A:0280 X:0000 Y:061A P:envmxdizC
 +
$82/F780 9F 00 E0 7F STA $7FE000,x[$7F:E000] A:0281 X:0000 Y:061A P:envmxdizC
 +
$82/F784 98          TYA          ; Transfer Load Index to A
 +
$82/F785 18          CLC          ; Add #$80
 +
$82/F786 69 80 00    ADC #$0080
 +
$82/F789 A8          TAY          ; Transfer back to Y
 +
$82/F78A E8          INX          ; Increment Store Index twice
 +
$82/F78B E8          INX
 +
$82/F78C C6 0A      DEC $0A      ; Decrement Loop Counter
 +
$82/F78E D0 ED      BNE $ED      ; [$F77D] Loop til the end
 +
$82/F790 60          RTS
  
$83/A990 7B          TDC          ; Clear 16-bit A
+
== $82/F791 Update BG2 Tilemap from Scrolling? ==
$83/A991 AD A6 17    LDA $17A6  [$83:17A6]  A:0000 X:DCD4 Y:9E53 P:envMxdiZC
 
$83/A994 AA          TAX                    A:0010 X:DCD4 Y:9E53 P:envMxdizC
 
$83/A995 86 06      STX $06    [$00:0006]  A:0010 X:0010 Y:9E53 P:envMxdizC
 
$83/A997 AD A7 17    LDA $17A7  [$83:17A7]  A:0010 X:0010 Y:9E53 P:envMxdizC
 
$83/A99A C2 20      REP #$20                A:0000 X:0010 Y:9E53 P:envMxdiZC
 
$83/A99C 0A          ASL A                  A:0000 X:0010 Y:9E53 P:envmxdiZC
 
$83/A99D A8          TAY                    A:0000 X:0010 Y:9E53 P:envmxdiZc
 
$83/A99E A2 00 00    LDX #$0000              A:0000 X:0010 Y:0000 P:envmxdiZc
 
$83/A9A1 C2 20      REP #$20                A:0000 X:0000 Y:0000 P:envmxdiZc
 
$83/A9A3 B7 23      LDA [$23],y[$9C:DCD4]  A:0000 X:0000 Y:0000 P:envmxdiZc
 
$83/A9A5 85 02      STA $02    [$00:0002]  A:0042 X:0000 Y:0000 P:envmxdizc
 
  
  $83/A9A7 B7 20      LDA [$20],y[$00:124B]   A:0042 X:0000 Y:0000 P:envmxdizc
+
  $82/F791 29 FF 00    AND #$00FF    ; Remove Upper Byte
  $83/A9A9 85 00       STA $00   [$00:0000]  A:0000 X:0000 Y:0000 P:envmxdiZc
+
$82/F794 F0 2E      BEQ $2E      ; [$F7C4] Exit if empty
buffer color
+
$82/F796 85 0A      STA $0A      ; Buffer Number of Double-Bytes to transfer
  $83/A9AB E2 20      SEP #$20                A:0000 X:0000 Y:0000 P:envmxdiZc
+
$82/F798 98          TYA                    A:0014 X:0000 Y:061B P:envmxdizc
  $83/A9AD 29 1F       AND #$1F               A:0000 X:0000 Y:0000 P:envMxdiZc
+
$82/F799 4A          LSR A                  A:061B X:0000 Y:061B P:envmxdizc
  $83/A9AF 85 04       STA $04   [$00:0004]  A:0000 X:0000 Y:0000 P:envMxdiZc
+
$82/F79A B0 14      BCS $14    [$F7B0]      A:030D X:0000 Y:061B P:envmxdizC
exempt color
+
;Code is missing here
  $83/A9B1 0A         ASL A                   A:0000 X:0000 Y:0000 P:envMxdiZc
+
$82/F7B0 88          DEY                    A:030D X:0000 Y:061B P:envmxdizC
  $83/A9B2 0A         ASL A                   A:0000 X:0000 Y:0000 P:envMxdiZc
+
$82/F7B1 B7 20      LDA [$20],y[$7F:561A]  A:030D X:0000 Y:061A P:envmxdizC
  $83/A9B3 0A          ASL A                  A:0000 X:0000 Y:0000 P:envMxdiZc
+
$82/F7B3 1A          INC A                  A:19B4 X:0000 Y:061A P:envmxdizC
  $83/A9B4 9F 41 B1 7E STA $7EB141,x[$7E:B141] A:0000 X:0000 Y:0000 P:envMxdiZc
+
$82/F7B4 9F 00 EC 7F STA $7FEC00,x[$7F:EC00] A:19B5 X:0000 Y:061A P:envmxdizC
 +
$82/F7B8 98          TYA          ; Transfer Load Index to A
 +
$82/F7B9 18          CLC          ; Add #$80
 +
$82/F7BA 69 80 00    ADC #$0080              A:061A X:0000 Y:061A P:envmxdizc
 +
$82/F7BD A8          TAY          ; Transfer back to Y
 +
$82/F7BE E8          INX          ; Increment Store Index twice
 +
$82/F7BF E8          INX
 +
$82/F7C0 C6 0A      DEC $0A      ; Decrement Loop Counter
 +
$82/F7C2 D0 ED      BNE $ED      ; [$F7B1] Loop til the end
 +
$82/F7C4 60          RTS
 +
 
 +
== $82/F7C5 ? ==
 +
 
 +
$82/F7C5 29 FF 00    AND #$00FF    ; Remove Upper Byte
 +
$82/F7C8 F0 45      BEQ $45      ; [$F80F] Exit if empty
 +
$82/F7CA 0A          ASL A                  A:0014 X:0000 Y:141A P:envmxdizc
 +
  $82/F7CB 85 0C       STA $0C   [$00:000C]  A:0028 X:0000 Y:141A P:envmxdizc
 +
$82/F7CD 18          CLC                    A:0028 X:0000 Y:141A P:envmxdizc
 +
$82/F7CE 6D C5 0E    ADC $0EC5  [$82:0EC5]  A:0028 X:0000 Y:141A P:envmxdizc
 +
$82/F7D1 AA          TAX                    A:0028 X:0000 Y:141A P:envmxdizc
 +
  $82/F7D2 E2 20      SEP #$20                A:0028 X:0028 Y:141A P:envmxdizc
 +
$82/F7D4 AD C7 0E    LDA $0EC7  [$82:0EC7]  A:0028 X:0028 Y:141A P:envMxdizc
 +
$82/F7D7 1A          INC A                  A:0000 X:0028 Y:141A P:envMxdiZc
 +
$82/F7D8 22 CB AD 80 JSL $80ADCB  ; Calculate Address in Tilemap
 +
$82/F7DC E0 00 12    CPX #$1200    ; ??? (Check if the calculated address outmaxes the limit?)
 +
$82/F7DF 90 0C      BCC $0C      ; [$F7ED] Branch if lower
 +
; Code is missing here
 +
  $82/F7ED C2 21       REP #$21               A:0068 X:0068 Y:141A P:eNvMxdizc
 +
  $82/F7EF A5 0A       LDA $0A   [$00:000A]  A:0068 X:0068 Y:141A P:eNvmxdizc
 +
$82/F7F1 69 00 70    ADC #$7000    ; VRAM-Offset of the BG1 Tilemap
 +
  $82/F7F4 A8         TAY          ; Transfer it in Y as VRAM Destination
 +
$82/F7F5 AD D6 16    LDA $16D6  [$82:16D6]  A:719B X:0068 Y:719B P:envmxdizc
 +
$82/F7F8 18          CLC                    A:0000 X:0068 Y:719B P:envmxdiZc
 +
$82/F7F9 69 00 E0    ADC #$E000    ; Add Offset of the BG1 Tilemap Buffer
 +
  $82/F7FC AA         TAX          ; Transfer it in X as DMA Source Address
 +
$82/F7FD E2 20      SEP #$20
 +
$82/F7FF A9 7F      LDA #$7F      ; DMA Source Bank
 +
$82/F801 22 24 9F 80 JSL $809F24  ; Long Jump to VRAM DMA
 +
$82/F805 C2 21      REP #$21                A:E081 X:0000 Y:719B P:eNvMxdizc
 +
$82/F807 A5 0C      LDA $0C    [$00:000C]  A:E081 X:0000 Y:719B P:eNvmxdizc
 +
  $82/F809 6D D6 16    ADC $16D6  [$82:16D6]  A:0028 X:0000 Y:719B P:envmxdizc
 +
  $82/F80C 8D D6 16    STA $16D6  [$82:16D6]   A:0028 X:0000 Y:719B P:envmxdizc
 +
$82/F80F 60          RTS                    A:0028 X:0000 Y:719B P:envmxdizc
 +
 
 +
== $82/F810 ? ==
  
$83/A9B8 A5 02      LDA $02    [$00:0002]  A:0000 X:0000 Y:0000 P:envMxdiZc
+
From the Game Intro - "Quest presents" stuff
$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/A9BD E5 04      SBC $04    [$00:0004]  A:0002 X:0000 Y:0000 P:envMxdizC
 
$83/A9BF 9F 40 B1 7E STA $7EB140,x[$7E:B140] A:0002 X:0000 Y:0000 P:envMxdizC
 
  
  $83/A9C3 C2 20      REP #$20                A:0002 X:0000 Y:0000 P:envMxdizC
+
  $82/F810 29 FF 00    AND #$00FF             A:041C X:0400 Y:0B44 P:envmxdizc
$83/A9C5 A5 00      LDA $00   [$00:0000]  A:0002 X:0000 Y:0000 P:envmxdizC
+
  $82/F813 F0 45       BEQ $45   [$F85A]     A:001C X:0400 Y:0B44 P:envmxdizc
$83/A9C7 29 E0 03   AND #$03E0             A:0000 X:0000 Y:0000 P:envmxdiZC
+
  $82/F815 0A         ASL A                  A:001C X:0400 Y:0B44 P:envmxdizc
  $83/A9CA 85 04       STA $04   [$00:0004]   A:0000 X:0000 Y:0000 P:envmxdiZC
+
  $82/F816 85 0C       STA $0C   [$00:000C]  A:0038 X:0400 Y:0B44 P:envmxdizc
  $83/A9CC 4A         LSR A                  A:0000 X:0000 Y:0000 P:envmxdiZC
+
  $82/F818 18         CLC                     A:0038 X:0400 Y:0B44 P:envmxdizc
  $83/A9CD 4A          LSR A                  A:0000 X:0000 Y:0000 P:envmxdiZc
+
  $82/F819 6D C5 0E    ADC $0EC5  [$82:0EC5]  A:0038 X:0400 Y:0B44 P:envmxdizc
$83/A9CE E2 20       SEP #$20                A:0000 X:0000 Y:0000 P:envmxdiZc
+
  $82/F81C AA         TAX                    A:0038 X:0400 Y:0B44 P:envmxdizc
$83/A9D0 9F 81 B1 7E STA $7EB181,x[$7E:B181] A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $82/F81D E2 20      SEP #$20                A:0038 X:0038 Y:0B44 P:envmxdizc
$83/A9D4 C2 20      REP #$20                A:0000 X:0000 Y:0000 P:envMxdiZc
+
  $82/F81F AD C7 0E    LDA $0EC7 [$82:0EC7]  A:0038 X:0038 Y:0B44 P:envMxdizc
$83/A9D6 A5 02      LDA $02   [$00:0002]  A:0000 X:0000 Y:0000 P:envmxdiZc
+
  $82/F822 1A         INC A                  A:0000 X:0038 Y:0B44 P:envMxdiZc
$83/A9D8 29 E0 03    AND #$03E0              A:0042 X:0000 Y:0000 P:envmxdizc
+
  $82/F823 22 CB AD 80 JSL $80ADCB  ; Calculate Offset: A * #$40 + X
  $83/A9DB 38         SEC                     A:0040 X:0000 Y:0000 P:envmxdizc
+
  $82/F827 E0 00 12   CPX #$1200   ; ??? Maybe check if the result is too big?
  $83/A9DC E5 04      SBC $04    [$00:0004]  A:0040 X:0000 Y:0000 P:envmxdizC
+
  $82/F82A 90 0C       BCC $0C       ; [$F838] ??? Taken if smaller
$83/A9DE 4A          LSR A                  A:0040 X:0000 Y:0000 P:envmxdizC
 
$83/A9DF 4A          LSR A                  A:0020 X:0000 Y:0000 P:envmxdizc
 
  $83/A9E0 4A         LSR A                  A:0010 X:0000 Y:0000 P:envmxdizc
 
$83/A9E1 4A          LSR A                  A:0008 X:0000 Y:0000 P:envmxdizc
 
$83/A9E2 4A          LSR A                  A:0004 X:0000 Y:0000 P:envmxdizc
 
  $83/A9E3 E2 20      SEP #$20                A:0002 X:0000 Y:0000 P:envmxdizc
 
  $83/A9E5 9F 80 B1 7E STA $7EB180,x[$7E:B180] A:0002 X:0000 Y:0000 P:envMxdizc
 
  $83/A9E9 A5 01      LDA $01    [$00:0001]  A:0002 X:0000 Y:0000 P:envMxdizc
 
  $83/A9EB 29 7C      AND #$7C                A:0000 X:0000 Y:0000 P:envMxdiZc
 
$83/A9ED 85 04      STA $04    [$00:0004]  A:0000 X:0000 Y:0000 P:envMxdiZc
 
$83/A9EF 0A         ASL A                  A:0000 X:0000 Y:0000 P:envMxdiZc
 
  $83/A9F0 9F 61 B1 7E STA $7EB161,x[$7E:B161] A:0000 X:0000 Y:0000 P:envMxdiZc
 
$83/A9F4 A5 03      LDA $03    [$00:0003]  A:0000 X:0000 Y:0000 P:envMxdiZc
 
$83/A9F6 29 7C      AND #$7C                A:0000 X:0000 Y:0000 P:envMxdiZc
 
  $83/A9F8 38          SEC                    A:0000 X:0000 Y:0000 P:envMxdiZc
 
$83/A9F9 E5 04      SBC $04    [$00:0004]  A:0000 X:0000 Y:0000 P:envMxdiZC
 
$83/A9FB 10 06      BPL $06   [$AA03]      A:0000 X:0000 Y:0000 P:envMxdiZC
 
$83/AA03 4A          LSR A                  A:0000 X:0000 Y:0000 P:envMxdiZC
 
$83/AA04 4A          LSR A                  A:0000 X:0000 Y:0000 P:envMxdiZc
 
$83/AA05 9F 60 B1 7E STA $7EB160,x[$7E:B160] A:0000 X:0000 Y:0000 P:envMxdiZc
 
$83/AA09 C8          INY                    A:0000 X:0000 Y:0000 P:envMxdiZc
 
$83/AA0A C8          INY                    A:0000 X:0000 Y:0001 P:envMxdizc
 
$83/AA0B E8          INX                    A:0000 X:0000 Y:0002 P:envMxdizc
 
$83/AA0C E8          INX                    A:0000 X:0001 Y:0002 P:envMxdizc
 
$83/AA0D A5 00      LDA $00   [$00:0000]  A:0000 X:0002 Y:0002 P:envMxdizc
 
  $83/AA0F C6 06       DEC $06    [$00:0006]  A:0000 X:0002 Y:0002 P:envMxdiZc
 
$83/AA11 D0 8E       BNE $8E    [$A9A1]     A:0000 X:0002 Y:0002 P:envMxdizc
 
$83/AA13 60          RTS                    A:0000 X:0020 Y:0020 P:envMxdiZc
 
  
= Bank $84 =
+
Code is missing here
== $84/805F ? ==
 
  
  $84/805F 8B          PHB          ; Preserve Data Bank on Stack
+
  $82/F838 C2 21       REP #$21     ; 16-bit A + Clear Carry
$84/8060 4B          PHK          ; Change Data Bank to $84
+
  $82/F83A A5 0A       LDA $0A       ; ???
$84/8061 AB          PLB
+
  $82/F83C 69 00 78   ADC #$7800   ; Add Offset for the BG2 Tilemap
$84/8062 AD C9 11    LDA $11C9  [$84:11C9]  A:0000 X:0040 Y:0000 P:eNvMxdizC
+
  $82/F83F A8          TAY           ; VRAM Destination Address
$84/8065 CD CA 11    CMP $11CA  [$84:11CA]  A:0000 X:0040 Y:0000 P:envMxdiZC
+
  $82/F840 AD D8 16   LDA $16D8    ; ???
$84/8068 F0 03       BEQ $03    [$806D]     A:0000 X:0040 Y:0000 P:envMxdiZC
+
  $82/F843 18          CLC          ; ???
Code is missing here
+
  $82/F844 69 00 EC    ADC #$EC00    ; Add Offset for the BG2 Tilemap Buffer
$84/806D D4 39      PEI ($39)    ; Push $39-$3C on Stack
+
  $82/F847 AA          TAX          ; DMA Source Address
  $84/806F D4 3B       PEI ($3B)
+
  $82/F848 E2 20       SEP #$20
$84/8071 7B          TDC                    A:0000 X:0040 Y:0000 P:envMxdiZC
+
  $82/F84A A9 7F       LDA #$7F     ; VRAM DMA Source Bank
$84/8072 AD F4 05    LDA $05F4  [$84:05F4]  A:0000 X:0040 Y:0000 P:envMxdiZC
+
  $82/F84C 22 24 9F 80 JSL $809F24   ; VRAM DMA Setup Execution
$84/8075 0A         ASL A                  A:0000 X:0040 Y:0000 P:envMxdiZC
+
  $82/F850 C2 21       REP #$21               A:1801 X:0038 Y:7EC4 P:eNvMxdizc
$84/8076 0A          ASL A                  A:0000 X:0040 Y:0000 P:envMxdiZc
+
  $82/F852 A5 0C       LDA $0C   [$00:000C]  A:1801 X:0038 Y:7EC4 P:eNvmxdizc
$84/8077 A8          TAY                    A:0000 X:0040 Y:0000 P:envMxdiZc
+
  $82/F854 6D D8 16   ADC $16D8 [$82:16D8]  A:0038 X:0038 Y:7EC4 P:envmxdizc
$84/8078 7B          TDC                    A:0000 X:0040 Y:0000 P:envMxdiZc
+
  $82/F857 8D D8 16   STA $16D8 [$82:16D8]  A:0038 X:0038 Y:7EC4 P:envmxdizc
$84/8079 B9 7A 83    LDA $837A,y[$84:837A]  A:0000 X:0040 Y:0000 P:envMxdiZc
+
  $82/F85A 60         RTS                     A:0038 X:0038 Y:7EC4 P:envmxdizc
  $84/807C 10 09      BPL $09   [$8087]      A:0080 X:0040 Y:0000 P:eNvMxdizc
 
$84/807E C9 FF      CMP #$FF                A:0080 X:0040 Y:0000 P:eNvMxdizc
 
$84/8080 F0 39      BEQ $39   [$80BB]      A:0080 X:0040 Y:0000 P:eNvMxdizc
 
  $84/8082 20 2E E7    JSR $E72E  [$84:E72E]  A:0080 X:0040 Y:0000 P:eNvMxdizc
 
$84/8085 80 34      BRA $34    [$80BB]      A:0040 X:EE21 Y:12C0 P:envMxdizc
 
$84/8087 5A          PHY                    A:0000 X:0026 Y:0008 P:envMxdiZc
 
$84/8088 A8          TAY                     A:0000 X:0026 Y:0008 P:envMxdiZc
 
  $84/8089 B9 AE 17   LDA $17AE,y[$84:17AE]  A:0000 X:0026 Y:0000 P:envMxdiZc
 
  $84/808C F0 26      BEQ $26    [$80B4]      A:0001 X:0026 Y:0000 P:envMxdizc
 
  $84/808E C9 F0      CMP #$F0                A:0001 X:0026 Y:0000 P:envMxdizc
 
  $84/8090 B0 04      BCS $04    [$8096]      A:0001 X:0026 Y:0000 P:envMxdizc
 
  $84/8092 C9 DC       CMP #$DC                A:0001 X:0026 Y:0000 P:envMxdizc
 
  $84/8094 B0 1E       BCS $1E    [$80B4]      A:0001 X:0026 Y:0000 P:envMxdizc
 
$84/8096 BE 3E 1E    LDX $1E3E,y[$84:1E3E]  A:0001 X:0026 Y:0000 P:envMxdizc
 
$84/8099 BD 03 06    LDA $0603,x[$84:0603]  A:0001 X:0000 Y:0000 P:envMxdiZc
 
$84/809C F0 16      BEQ $16    [$80B4]     A:0001 X:0000 Y:0000 P:envMxdizc
 
  $84/809E B9 DF 19    LDA $19DF,y[$84:19DF]   A:0001 X:0000 Y:0000 P:envMxdizc
 
  $84/80A1 89 40       BIT #$40               A:0000 X:0000 Y:0000 P:envMxdiZc
 
  $84/80A3 D0 0F       BNE $0F   [$80B4]      A:0000 X:0000 Y:0000 P:envMxdiZc
 
$84/80A5 B9 DE 19    LDA $19DE,y[$84:19DE]  A:0000 X:0000 Y:0000 P:envMxdiZc
 
  $84/80A8 89 02      BIT #$02                A:0000 X:0000 Y:0000 P:envMxdiZc
 
$84/80AA D0 08      BNE $08   [$80B4]      A:0000 X:0000 Y:0000 P:envMxdiZc
 
  $84/80AC BD C3 06    LDA $06C3,x[$84:06C3]  A:0000 X:0000 Y:0000 P:envMxdiZc
 
  $84/80AF F0 03      BEQ $03   [$80B4]      A:0008 X:0000 Y:0000 P:envMxdizc
 
$84/80B1 20 CC 80    JSR $80CC [$84:80CC]  A:0008 X:0000 Y:0000 P:envMxdizc
 
$84/80B4 7A          PLY                    A:00FF X:0040 Y:89D3 P:envMxdiZC
 
  $84/80B5 C8         INY                     A:00FF X:0040 Y:0008 P:envMxdizC
 
$84/80B6 98          TYA                    A:00FF X:0040 Y:0009 P:envMxdizC
 
$84/80B7 89 03      BIT #$03                A:0009 X:0040 Y:0009 P:envMxdizC
 
$84/80B9 D0 BD      BNE $BD    [$8078]      A:0009 X:0040 Y:0009 P:envMxdizC
 
$84/80BB AD F4 05    LDA $05F4  [$84:05F4]  A:0040 X:EE21 Y:12C0 P:envMxdizc
 
$84/80BE 1A          INC A                  A:0000 X:EE21 Y:12C0 P:envMxdiZc
 
$84/80BF 29 07      AND #$07                A:0001 X:EE21 Y:12C0 P:envMxdizc
 
$84/80C1 8D F4 05    STA $05F4  [$84:05F4]  A:0001 X:EE21 Y:12C0 P:envMxdizc
 
$84/80C4 FA          PLX          ; Restore $39-$3B from Stack
 
$84/80C5 86 3B      STX $3B
 
$84/80C7 FA          PLX
 
$84/80C8 86 39      STX $39
 
$84/80CA AB          PLB          ; Restore Data Bank
 
$84/80CB 6B          RTL
 
  
== $84/821A Use Jump Table ==
+
== $82/F85B ? ==
  
  $84/821A 0A         ASL A                  A:0081 X:0000 Y:89C4 P:eNvMxdizc
+
  $82/F85B 8B          PHB          ; Preserve Data Bank
  $84/821B AA          TAX                    A:0002 X:0000 Y:89C4 P:envMxdizC
+
$82/F85C 4B          PHK          ; Set Data Bank to $82
  $84/821C 7C 1F 82    JMP ($821F,x)[$84:8254] A:0002 X:0002 Y:89C4 P:envMxdizC
+
$82/F85D AB          PLB
 +
$82/F85E 48          PHA          ; ???
 +
$82/F85F 20 4E EB    JSR $EB4E  [$82:EB4E]  A:3700 X:0200 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/F869 8E 91 05    STX $0591    ; Set back BG1 H-Scroll
 +
$82/F86C 8E 93 05    STX $0593    ; Set back BG1 V-Scroll
 +
$82/F86F 8E 95 05    STX $0595    ; Set back BG2 H-Scroll
 +
$82/F872 8E 97 05    STX $0597    ; Set back BG2 V-Scroll
 +
$82/F875 22 8A A1 80 JSL $80A18A  ; ??? Wait for NMI?
 +
$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/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/F883 DA          PHX                    A:0700 X:0000 Y:FFFF P:envMxdiZc
 +
$82/F884 C2 20      REP #$20                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/F88B E2 20      SEP #$20                A:004B X:004B Y:FFFF P:envmxdizc
 +
$82/F88D BF 00 CC 7F LDA $7FCC00,x[$7F:CC4B] A:004B 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/F895 F0 06      BEQ $06    [$F89D]      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/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/F8A4 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/F8A7 E2 20      SEP #$20                A:0000 X:004B Y:004B P:envmxdiZc
 +
$82/F8A9 1F 00 D4 7F ORA $7FD400,x[$7F:D44B] A:0000 X:004B Y:004B P:envMxdiZc
 +
  $82/F8AD AA          TAX                     A:0002 X:004B Y:004B P:envMxdizc
 +
$82/F8AE 7B          TDC                    A:0002 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/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/F8B8 E8          INX                     A:0002 X:0000 Y:005C P:envMxdiZc
 +
  $82/F8B9 E8          INX                    A:0002 X:0001 Y:005C P:envMxdizc
 +
$82/F8BA EC EC 16   CPX $16EC  [$82:16EC]  A:0002 X:0002 Y:005C P:envMxdizc
 +
$82/F8BD 90 C4      BCC $C4    [$F883]     A:0002 X:0002 Y:005C 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/F8C4 8D 8B 05    STA $058B
 +
$82/F8C7 A9 79      LDA #$79      ; BG2 Tilemap at $7800
 +
$82/F8C9 8D 8C 05    STA $058C
 +
$82/F8CC 20 6B EB    JSR $EB6B    ; Set BG1/2 Scroll Registers
 +
$82/F8CF AB          PLB          ; Restore Data Bank
 +
$82/F8D0 6B          RTL
  
== $84/821F Jump Table for $84/821A ==
+
== $82/FAAC ? ==
  
2F 82 - $822F - Entry #$00
+
The second part of this subroutine transfers the data from $164B onwards into the CGRAM buffer and builds actual palettes from it - the data at $164B only contains fourteen colors per planned palette.
54 82 - $8254 - Entry #$01
 
3E 82 - $823E - Entry #$02
 
54 82 - $8254 - Entry #$03
 
A4 82 - $82A4 - Entry #$04
 
E4 82 - $82E4 - Entry #$05
 
CD 82 - $82CD - Entry #$06
 
4D 83 - $834D - Entry #$07
 
  
== $84/82A4 ? ==
+
The palettes are built the following way:
  
  $84/82A4 7B          TDC                    A:0008 X:0008 Y:8C90 P:envMxdizC
+
  ($FAD2 to $FAD9) The first color is $0000
$84/82A5 B9 01 00    LDA $0001,y[$84:8C91]  A:0000 X:0008 Y:8C90 P:envMxdiZC
+
  ($FADA to $FAE9) The next #$0D (thirteen) colors are copied from [$20] = $00/164B + x
  $84/82A8 C2 20      REP #$20                A:0002 X:0008 Y:8C90 P:envMxdizC
+
  ($FAEA to $FAEB) The fourteenth color gets left out
$84/82AA EB          XBA                    A:0002 X:0008 Y:8C90 P:envmxdizC
+
  ($FAEC to $FAF7) The fifteenth and last color gets copied from [$20] = $00/164B + x
$84/82AB 4A          LSR A                  A:0200 X:0008 Y:8C90 P:envmxdiZC
 
$84/82AC 4A          LSR A                  A:0100 X:0008 Y:8C90 P:envmxdizc
 
$84/82AD 4A          LSR A                  A:0080 X:0008 Y:8C90 P:envmxdizc
 
$84/82AE 85 0C      STA $0C    [$00:000C]   A:0040 X:0008 Y:8C90 P:envmxdizc
 
$84/82B0 E2 20      SEP #$20                A:0040 X:0008 Y:8C90 P:envmxdizc
 
$84/82B2 C8          INY                    A:0040 X:0008 Y:8C90 P:envMxdizc
 
$84/82B3 C8          INY                    A:0040 X:0008 Y:8C91 P:eNvMxdizc
 
$84/82B4 5A          PHY                    A:0040 X:0008 Y:8C92 P:eNvMxdizc
 
$84/82B5 A4 04      LDY $04    [$00:0004]  A:0040 X:0008 Y:8C92 P:eNvMxdizc
 
$84/82B7 A2 15 B8    LDX #$B815              A:0040 X:0008 Y:4740 P:envMxdizc
 
  $84/82BA A9 84      LDA #$84                A:0040 X:B815 Y:4740 P:eNvMxdizc
 
  $84/82BC 22 B7 9F 80 JSL $809FB7[$80:9FB7]  A:0084 X:B815 Y:4740 P:eNvMxdizc
 
$84/82C0 7A          PLY                    A:1800 X:0040 Y:4740 P:eNvMxdizc
 
$84/82C1 C2 20      REP #$20               A:1800 X:0040 Y:8C92 P:eNvMxdizc
 
$84/82C3 A5 0C      LDA $0C    [$00:000C]  A:1800 X:0040 Y:8C92 P:eNvmxdizc
 
$84/82C5 4A          LSR A                  A:0040 X:0040 Y:8C92 P:envmxdizc
 
$84/82C6 65 04      ADC $04    [$00:0004]   A:0020 X:0040 Y:8C92 P:envmxdizc
 
$84/82C8 85 04      STA $04    [$00:0004]  A:4760 X:0040 Y:8C92 P:envmxdizc
 
$84/82CA E2 20      SEP #$20                A:4760 X:0040 Y:8C92 P:envmxdizc
 
$84/82CC 60          RTS                    A:4760 X:0040 Y:8C92 P:envMxdizc
 
  
== $86/9654 ? ==
+
  $82/FAAC 8B          PHB          ; Preserve Data Bank
 
+
  $82/FAAD 4B          PHK          ; Change Data Bank to this
  $84/964C 8B          PHB          ; Preserve Data Bank on Stack
+
  $82/FAAE AB          PLB
  $84/964D 4B          PHK          ; Change Data Bank to $84
+
  $82/FAAF A2 4B 16    LDX #$164B    ; Setup 24-bit Address in $20-22 to $00/164B (=$7E/164B)
  $84/964E AB          PLB
+
  $82/FAB2 86 20      STX $20
  $84/964F 20 54 96    JSR $9654  [$84:9654]  A:0000 X:003E Y:000A P:eNvMxdizc
+
  $82/FAB4 A9 00      LDA #$00
  $84/9652 AB          PLB          ; Restore old bank
+
$82/FAB6 85 22      STA $22
  $84/9653 6B          RTL
+
  $82/FAB8 22 0F FB 82 JSL $82FB0F  ; ???
 
+
  $82/FABC D4 00       PEI ($00)    ; Preserve $00-3 on Stack
== $86/9654 ? ==
+
  $82/FABE D4 02      PEI ($02)
 
+
  $82/FAC0 C2 20       REP #$20
  $84/9654 08          PHP          ; Push Status Register
+
  $82/FAC2 A2 80 00    LDX #$0080    ; Store Index - where to begin to store in $124B and $144B
  $84/9655 C2 10       REP #$10      ; X/Y = 16 bit
+
$82/FAC5 A0 00 00   LDY #$0000   ; Load Index
  $84/9657 BD 04 07    LDA $0704,x[$84:0742]  A:0000 X:003E Y:000A P:eNvMxdizc
+
  $82/FAC8 A9 04 00   LDA #$0004    ; Setup Palette Counter - how many palettes to do
  $84/965A 89 04       BIT #$04                A:0000 X:003E Y:000A P:envMxdiZc
+
  $82/FACB 85 00       STA $00
  $84/965C F0 07      BEQ $07   [$9665]      A:0000 X:003E Y:000A P:envMxdiZc
+
  $82/FACD A9 0D 00    LDA #$000D    ; Setup Color counter - counter for the thirteen colors
;Code is missing here
+
  $82/FAD0 85 02       STA $02    
  $84/9665 BD 84 06   LDA $0684,x[$84:06C2]  A:0000 X:003E Y:000A P:envMxdiZc
+
  $82/FAD2 9E 4B 12   STZ $124B,x  ; Clear the first two bytes in the palette (making it pitch-black)
  $84/9668 F0 0B       BEQ $0B    [$9675]      A:0005 X:003E Y:000A P:envMxdizc
+
  $82/FAD5 9E 4B 14   STZ $144B,x  ; Do the same in the second CGRAM buffer
  $84/966A C9 FF      CMP #$FF                A:0005 X:003E Y:000A P:envMxdizc
+
  $82/FAD8 E8         INX           ; Increment Store Index so it points to the next color
  $84/966C F0 05       BEQ $05   [$9673]      A:0005 X:003E Y:000A P:envMxdizc
+
  $82/FAD9 E8         INX
  $84/966E DE 84 06   DEC $0684,x[$84:06C2]   A:0005 X:003E Y:000A P:envMxdizc
+
  $82/FADA B7 20      LDA [$20],y  ; Load color from around $164B
  $84/9671 F0 02      BEQ $02   [$9675]      A:0005 X:003E Y:000A P:envMxdizc
+
  $82/FADC 9D 4B 12    STA $124B,x  ; Store it in CGRAM buffer
  $84/9673 28         PLP           ; Restore Status Register
+
  $82/FADF 9D 4B 14    STA $144B,x  ; Do the same in the second CGRAM buffer
  $84/9674 60         RTS
+
  $82/FAE2 C8         INY          ; Increment Load Index so it points to the next color
   
+
  $82/FAE3 C8         INY
  $84/9675 8B          PHB                    A:0001 X:003E Y:000A P:envMxdiZc
+
  $82/FAE4 E8         INX          ; Increment Store Index so it points to the next color
  $84/9676 A9 8A      LDA #$8A                A:0001 X:003E Y:000A P:envMxdiZc
+
  $82/FAE5 E8          INX
  $84/9678 48         PHA                    A:008A X:003E Y:000A P:eNvMxdizc
+
  $82/FAE6 C6 02       DEC $02      ; Decrement color counter
  $84/9679 AB         PLB                    A:008A X:003E Y:000A P:eNvMxdizc
+
  $82/FAE8 D0 F0      BNE $F0      ; [$FADA] Loop until all thirteen colors are done
  $84/967A 7B         TDC                    A:008A X:003E Y:000A P:eNvMxdizc
+
  $82/FAEA E8         INX          ; Increment X twice - leave the fourteenth color out
  $84/967B BD 03 06    LDA $0603,x[$8A:0641]  A:0000 X:003E Y:000A P:envMxdiZc
+
  $82/FAEB E8         INX
  $84/967E F0 35       BEQ $35    [$96B5]      A:00C9 X:003E Y:000A P:eNvMxdizc
+
  $82/FAEC B7 20      LDA [$20],y   ; Load color from around $164B
  $84/9680 BD 43 06    LDA $0643,x[$8A:0681]   A:00C9 X:003E Y:000A P:eNvMxdizc
+
  $82/FAEE 9D 4B 12    STA $124B,x   ; Store it in CGRAM buffer
$84/9683 C2 20      REP #$20                A:00C9 X:003E Y:000A P:eNvMxdizc
+
  $82/FAF1 9D 4B 14    STA $144B,x  ; Do the same in the second CGRAM buffer
  $84/9685 0A         ASL A                  A:00C9 X:003E Y:000A P:eNvmxdizc
+
  $82/FAF4 C8         INY          ; Increment Load Index so it points to the next color
  $84/9686 A8         TAY                    A:0192 X:003E Y:000A P:envmxdizc
+
  $82/FAF5 C8          INY
  $84/9687 B9 7A ED    LDA $ED7A,y[$8A:EF0C]  A:0192 X:003E Y:0192 P:envmxdizc
+
  $82/FAF6 E8         INX          ; Increment Store Index so it points to the next color
  $84/968A 85 20      STA $20    [$00:0020]   A:F131 X:003E Y:0192 P:eNvmxdizc
+
  $82/FAF7 E8         INX
  $84/968C E2 20      SEP #$20                A:F131 X:003E Y:0192 P:eNvmxdizc
+
  $82/FAF8 C6 00       DEC $00      ; Decrement Palette Counter
  $84/968E 7B         TDC                    A:F131 X:003E Y:0192 P:eNvMxdizc
+
  $82/FAFA D0 D1       BNE $D1       ; [$FACD] Loop until all four palettes are done
  $84/968F BD 44 06    LDA $0644,x[$8A:0682]  A:0000 X:003E Y:0192 P:envMxdiZc
+
  $82/FAFC E2 20      SEP #$20
  $84/9692 0A         ASL A                  A:0000 X:003E Y:0192 P:envMxdiZc
+
  $82/FAFE A9 40      LDA #$40      ; CGRAM Destination
  $84/9693 A8         TAY                    A:0000 X:003E Y:0192 P:envMxdiZc
+
  $82/FB00 A0 80 00    LDY #$0080   ; Number of Bytes
  $84/9694 C2 20       REP #$20                A:0000 X:003E Y:0000 P:envMxdiZc
+
$82/FB03 22 B5 9E 80 JSL $809EB5   ; Transfer these four palettes from CGRAM buffer to CGRAM
  $84/9696 B1 20       LDA ($20),y[$8A:F131]  A:0000 X:003E Y:0000 P:envmxdiZc
+
  $82/FB07 7A         PLY          ; Restore $00-$03 and exit
$84/9698 85 29       STA $29    [$00:0029]   A:F13D X:003E Y:0000 P:eNvmxdizc
+
  $82/FB08 84 02       STY $02
  $84/969A E2 20      SEP #$20               A:F13D X:003E Y:0000 P:eNvmxdizc
+
  $82/FB0A 7A         PLY
  $84/969C 7B          TDC                    A:F13D X:003E Y:0000 P:eNvMxdizc
+
  $82/FB0B 84 00       STY $00
  $84/969D BD 83 06   LDA $0683,x[$8A:06C1]   A:0000 X:003E Y:0000 P:envMxdiZc
+
  $82/FB0D AB          PLB
  $84/96A0 A8         TAY                    A:0002 X:003E Y:0000 P:envMxdizc
+
$82/FB0E 6B          RTL
  $84/96A1 B1 29       LDA ($29),y[$8A:F13F]  A:0002 X:003E Y:0002 P:envMxdizc
+
 
  $84/96A3 C8         INY                    A:0003 X:003E Y:0002 P:envMxdizc
+
= Bank $83 =
  $84/96A4 C9 C0       CMP #$C0                A:0003 X:003E Y:0003 P:envMxdizc
+
== $83/A990 ? ==
  $84/96A6 B0 12      BCS $12    [$96BA]      A:0003 X:003E Y:0003 P:envMxdizc
+
 
$84/96A8 9D 04 06    STA $0604,x[$8A:0642]  A:0003 X:003E Y:0003 P:envMxdizc
+
This is about some color calculation. $20-22 and $23-25 both contain 24-addresses to colors.
  $84/96AB B1 29      LDA ($29),y[$8A:F140]  A:0003 X:003E Y:0003 P:envMxdizc
+
 
  $84/96AD 9D 84 06   STA $0684,x[$8A:06C2]  A:0003 X:003E Y:0003 P:envMxdizc
+
  $83/A990 7B          TDC          ; Clear 16-bit A
  $84/96B0 C8         INY                     A:0003 X:003E Y:0003 P:envMxdizc
+
  $83/A991 AD A6 17   LDA $17A6  [$83:17A6]  A:0000 X:DCD4 Y:9E53 P:envMxdiZC
  $84/96B1 98          TYA                    A:0003 X:003E Y:0004 P:envMxdizc
+
  $83/A994 AA         TAX                     A:0010 X:DCD4 Y:9E53 P:envMxdizC
$84/96B2 9D 83 06    STA $0683,x[$8A:06C1]  A:0004 X:003E Y:0004 P:envMxdizc
+
  $83/A995 86 06      STX $06    [$00:0006]  A:0010 X:0010 Y:9E53 P:envMxdizC
  $84/96B5 A6 3B      LDX $3B    [$00:003B]  A:0004 X:003E Y:0004 P:envMxdizc
+
  $83/A997 AD A7 17    LDA $17A7  [$83:17A7]  A:0010 X:0010 Y:9E53 P:envMxdizC
  $84/96B7 AB          PLB                    A:0004 X:003E Y:0004 P:envMxdizc
+
  $83/A99A C2 20       REP #$20               A:0000 X:0010 Y:9E53 P:envMxdiZC
$84/96B8 28          PLP                    A:0004 X:003E Y:0004 P:eNvMxdizc
+
  $83/A99C 0A          ASL A                  A:0000 X:0010 Y:9E53 P:envmxdiZC
$84/96B9 60          RTS
+
  $83/A99D A8         TAY                     A:0000 X:0010 Y:9E53 P:envmxdiZc
+
  $83/A99E A2 00 00    LDX #$0000             A:0000 X:0010 Y:0000 P:envmxdiZc
$84/96BA 49 FF       EOR #$FF               A:00FD X:003E Y:0013 P:envMxdizC
+
  $83/A9A1 C2 20      REP #$20                A:0000 X:0000 Y:0000 P:envmxdiZc
  $84/96BC 0A          ASL A                  A:0002 X:003E Y:0013 P:envMxdizC
+
  $83/A9A3 B7 23       LDA [$23],y[$9C:DCD4]  A:0000 X:0000 Y:0000 P:envmxdiZc
  $84/96BD AA         TAX                     A:0004 X:003E Y:0013 P:envMxdizc
+
  $83/A9A5 85 02      STA $02   [$00:0002]  A:0042 X:0000 Y:0000 P:envmxdizc
  $84/96BE C2 20      REP #$20                A:0004 X:0004 Y:0013 P:envMxdizc
 
$84/96C0 BF CD 96 84 LDA $8496CD,x[$84:96D1] A:0004 X:0004 Y:0013 P:envmxdizc
 
$84/96C4 85 00       STA $00    [$00:0000]  A:97A0 X:0004 Y:0013 P:eNvmxdizc
 
  $84/96C6 E2 20      SEP #$20                A:97A0 X:0004 Y:0013 P:eNvmxdizc
 
  $84/96C8 A6 3B       LDX $3B    [$00:003B]   A:97A0 X:0004 Y:0013 P:eNvMxdizc
 
$84/96CA 6C 00 00    JMP ($0000)[$84:97A0]  A:97A0 X:003E Y:0013 P:envMxdizc
 
 
  $84/97A0 9E 83 06    STZ $0683,x[$8A:06C1]  A:97A0 X:003E Y:0013 P:envMxdizc
 
$84/97A3 4C 9C 96   JMP $969C  [$84:969C]  A:97A0 X:003E Y:0013 P:envMxdizc
 
  
== $84/B98A Battle figure moving animation? ==
+
$83/A9A7 B7 20      LDA [$20],y[$00:124B]  A:0042 X:0000 Y:0000 P:envmxdizc
 +
$83/A9A9 85 00      STA $00    [$00:0000]  A:0000 X:0000 Y:0000 P:envmxdiZc
 +
buffer color
 +
$83/A9AB E2 20      SEP #$20                A:0000 X:0000 Y:0000 P:envmxdiZc
 +
$83/A9AD 29 1F      AND #$1F                A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$83/A9AF 85 04      STA $04    [$00:0004]  A:0000 X:0000 Y:0000 P:envMxdiZc
 +
exempt color
 +
$83/A9B1 0A          ASL A                  A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$83/A9B2 0A          ASL A                  A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$83/A9B3 0A          ASL A                  A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$83/A9B4 9F 41 B1 7E STA $7EB141,x[$7E:B141] A:0000 X:0000 Y:0000 P:envMxdiZc
  
This is executed in the title screen demo, when the soldier jumps over the gap and beats the archeress(?)
+
$83/A9B8 A5 02      LDA $02    [$00:0002]  A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$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/A9BD E5 04      SBC $04    [$00:0004]  A:0002 X:0000 Y:0000 P:envMxdizC
 +
$83/A9BF 9F 40 B1 7E STA $7EB140,x[$7E:B140] A:0002 X:0000 Y:0000 P:envMxdizC
  
This executes an VRAM DMA - I can imagine this is the graphics update for a marching game figure animation.
+
$83/A9C3 C2 20      REP #$20                A:0002 X:0000 Y:0000 P:envMxdizC
 
+
$83/A9C5 A5 00      LDA $00    [$00:0000]  A:0002 X:0000 Y:0000 P:envmxdizC
There are some values to this subroutine carried in before it is called:
+
$83/A9C7 29 E0 03    AND #$03E0              A:0000 X:0000 Y:0000 P:envmxdiZC
 +
$83/A9CA 85 04      STA $04    [$00:0004]  A:0000 X:0000 Y:0000 P:envmxdiZC
 +
$83/A9CC 4A          LSR A                  A:0000 X:0000 Y:0000 P:envmxdiZC
 +
$83/A9CD 4A          LSR A                  A:0000 X:0000 Y:0000 P:envmxdiZc
 +
$83/A9CE E2 20      SEP #$20                A:0000 X:0000 Y:0000 P:envmxdiZc
 +
$83/A9D0 9F 81 B1 7E STA $7EB181,x[$7E:B181] A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$83/A9D4 C2 20      REP #$20                A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$83/A9D6 A5 02      LDA $02    [$00:0002]  A:0000 X:0000 Y:0000 P:envmxdiZc
 +
$83/A9D8 29 E0 03    AND #$03E0              A:0042 X:0000 Y:0000 P:envmxdizc
 +
$83/A9DB 38          SEC                    A:0040 X:0000 Y:0000 P:envmxdizc
 +
$83/A9DC E5 04      SBC $04    [$00:0004]  A:0040 X:0000 Y:0000 P:envmxdizC
 +
$83/A9DE 4A          LSR A                  A:0040 X:0000 Y:0000 P:envmxdizC
 +
$83/A9DF 4A          LSR A                  A:0020 X:0000 Y:0000 P:envmxdizc
 +
$83/A9E0 4A          LSR A                  A:0010 X:0000 Y:0000 P:envmxdizc
 +
$83/A9E1 4A          LSR A                  A:0008 X:0000 Y:0000 P:envmxdizc
 +
$83/A9E2 4A          LSR A                  A:0004 X:0000 Y:0000 P:envmxdizc
 +
$83/A9E3 E2 20      SEP #$20                A:0002 X:0000 Y:0000 P:envmxdizc
 +
$83/A9E5 9F 80 B1 7E STA $7EB180,x[$7E:B180] A:0002 X:0000 Y:0000 P:envMxdizc
 +
$83/A9E9 A5 01      LDA $01    [$00:0001]  A:0002 X:0000 Y:0000 P:envMxdizc
 +
$83/A9EB 29 7C      AND #$7C                A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$83/A9ED 85 04      STA $04    [$00:0004]  A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$83/A9EF 0A          ASL A                  A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$83/A9F0 9F 61 B1 7E STA $7EB161,x[$7E:B161] A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$83/A9F4 A5 03      LDA $03    [$00:0003]  A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$83/A9F6 29 7C      AND #$7C                A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$83/A9F8 38          SEC                    A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$83/A9F9 E5 04      SBC $04    [$00:0004]  A:0000 X:0000 Y:0000 P:envMxdiZC
 +
$83/A9FB 10 06      BPL $06    [$AA03]      A:0000 X:0000 Y:0000 P:envMxdiZC
 +
$83/AA03 4A          LSR A                  A:0000 X:0000 Y:0000 P:envMxdiZC
 +
$83/AA04 4A          LSR A                  A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$83/AA05 9F 60 B1 7E STA $7EB160,x[$7E:B160] A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$83/AA09 C8          INY                    A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$83/AA0A C8          INY                    A:0000 X:0000 Y:0001 P:envMxdizc
 +
$83/AA0B E8          INX                    A:0000 X:0000 Y:0002 P:envMxdizc
 +
$83/AA0C E8          INX                    A:0000 X:0001 Y:0002 P:envMxdizc
 +
$83/AA0D A5 00      LDA $00    [$00:0000]  A:0000 X:0002 Y:0002 P:envMxdizc
 +
$83/AA0F C6 06      DEC $06    [$00:0006]  A:0000 X:0002 Y:0002 P:envMxdiZc
 +
$83/AA11 D0 8E      BNE $8E    [$A9A1]      A:0000 X:0002 Y:0002 P:envMxdizc
 +
$83/AA13 60          RTS                    A:0000 X:0020 Y:0020 P:envMxdiZc
  
A contains some Index for a table at $84/BA03 ($0002:3A03)
+
= Bank $84 =
 +
== $84/805F Do the Tile/Figure Animation ==
  
Y contains the VRAM destination address
+
$05F4 is the General Animation Counter. It counts each frame from #$00 to #$07 and then gets reset. In the frames when the counter is $#00 or $01, this subroutine does the Tile Animation, like the movement of the water in the Opening Battle - it replaces the Tile graphics in VRAM via DMA. The other 6 counter steps/frames, this subroutine changes the Tile Graphics for two or four Figures.
  
$20 to $22 contains an offset for the DMA Source Address
+
  $84/805F 8B          PHB          ; Preserve Data Bank on Stack
 
+
  $84/8060 4B          PHK          ; Change Data Bank to $84
  $84/B98A 8B          PHB          ; Preserve Data Bank on Stack
+
  $84/8061 AB          PLB
  $84/B98B 4B          PHK          ; Change Data Bank to $84
+
  $84/8062 AD C9 11    LDA $11C9 [$84:11C9]   A:0000 X:0040 Y:0000 P:eNvMxdizC
  $84/B98C AB          PLB
+
  $84/8065 CD CA 11    CMP $11CA [$84:11CA]  A:0000 X:0040 Y:0000 P:envMxdiZC
  $84/B98D D4 00      PEI ($00)    ; Push current content of $00 on stack
+
  $84/8068 F0 03      BEQ $03    [$806D]      A:0000 X:0040 Y:0000 P:envMxdiZC
$84/B98F D4 02      PEI ($02)    ; Push current content of $02 on stack
 
$84/B991 D4 0C      PEI ($0C)    ; Push current content of $0C on stack
 
$84/B993 D4 0E      PEI ($0E)    ; Push current content of $0E on stack
 
  $84/B995 09 00      ORA #$00      ; Set the "focus" of the flag register back on the Accumulator???
 
$84/B997 10 0A      BPL $0A      ; [$B9A3] Branch if A value is between #$00 and #$7F
 
  $84/B999 29 7F      AND #$7F      ; If not, remove the MSB anyways
 
  $84/B99B 85 00      STA $00      ; Store Original A minus MSB in $00
 
$84/B99D A9 02      LDA #$02      ; Set up a counter for left/right side of the  graphic
 
$84/B99F 85 01      STA $01      ; Yeah, I wouldn't understand that comment, too
 
$84/B9A1 80 04      BRA $04      ; [$B9A7]
 
Code is missing here
 
$84/B9A7 84 02      STY $02      ; Buffer VRAM destination in $02
 
$84/B9A9 A2 40 00    LDX #$0040   ; Number of Bytes to transfer
 
$84/B9AC 86 0C      STX $0C
 
$84/B9AE A9 80      LDA #$80      ; VRAM settings for the DMA (for $2115)
 
$84/B9B0 85 0E      STA $0E
 
$84/B9B2 7B          TDC          ; Clear 16-bit A
 
$84/B9B3 A5 00      LDA $00      ; Load Original A value
 
$84/B9B5 0A          ASL A        ; Multiply by 4 (4 byte sized table entries?)
 
$84/B9B6 0A          ASL A
 
$84/B9B7 A8          TAY          ; Transfer in Y
 
  $84/B9B8 7B          TDC          ; Clear 16-bit A
 
$84/B9B9 B9 03 BA    LDA $BA03,y  ; Load Table entry
 
$84/B9BC C9 FF      CMP #$FF      ; ???
 
$84/B9BE F0 0F       BEQ $0F      ; [$B9CF] ???
 
$84/B9C0 C2 20      REP #$20     ; Multiply loaded byte by #$20 (thirty-two)
 
$84/B9C2 EB          XBA
 
$84/B9C3 4A          LSR A
 
$84/B9C4 4A          LSR A
 
$84/B9C5 4A          LSR A
 
$84/B9C6 65 20      ADC $20      ; Add some DMA Source Address Offset that was set up before this subroutine
 
$84/B9C8 AA          TAX          ; Transfer in X as DMA Source Address
 
$84/B9C9 E2 20      SEP #$20
 
$84/B9CB A5 22      LDA $22      ; Load $22 in A as DMA SOurce Bank
 
$84/B9CD 80 05      BRA $05      ; [$B9D4] Branch
 
 
Code is missing here
 
Code is missing here
  $84/B9D4 5A          PHY          ; Push Y on stack - it's the Load Index for the table at $BA03
+
  $84/806D D4 39      PEI ($39)    ; Push $39-$3C on Stack
  $84/B9D5 A4 02       LDY $02      ; Load VRAM destination address in Y
+
  $84/806F D4 3B       PEI ($3B)
  $84/B9D7 22 24 9F 80 JSL $809F24  ; VRAM DMA
+
$84/8071 7B          TDC          ; Clear 16-bit A
  $84/B9DB 7A         PLY          ; Restore the Load Index for the table at $BA03
+
  $84/8072 AD F4 05    LDA $05F4    ; Load the General Animation Counter
  $84/B9DC C8         INY           ; Increment it
+
  $84/8075 0A         ASL A        ; Use it as a Load Index for the Table at $84/837A - each entry is...
  $84/B9DD 98         TYA           ; Copy it to A
+
$84/8076 0A          ASL A        ; ... 4 bytes in size, so multiply Value by 4 and...
  $84/B9DE 29 03       AND #$03     ; Look if it has done 4 graphics; 4 sprite graphics per Unit
+
  $84/8077 A8         TAY           ; Transfer it in Y
  $84/B9E0 F0 13       BEQ $13       ; [$B9F5] If so, exit
+
  $84/8078 7B         TDC           ; Clear 16-bit A
  $84/B9E2 7B         TDC           ; Clear 16-bit A
+
  $84/8079 B9 7A 83    LDA $837A,y  ; Load first byte
  $84/B9E3 A9 20      LDA #$20      ; ??? This has something to do with the positioning of sprites in VRAM
+
$84/807C 10 09      BPL $09      ; [$8087] Branch if positive - that means: Animate a Figure!
  $84/B9E5 C6 01       DEC $01       ; ??? The right sprite is $20 away from the left, the one below $100 ($20+$E0)
+
$84/807E C9 FF       CMP #$FF     ; (This can happen when there are only two figures to do per Frame)
  $84/B9E7 D0 02       BNE $02       ; [$B9EB] ??? $01 is a counter for this, whether it should add...
+
  $84/8080 F0 39       BEQ $39       ; [$80BB] Increment General Animation Counter and exit
  $84/B9E9 A9 E0       LDA #$E0     ; ??? $20 or $E0 to get to the VRAM address to reach the next graphic
+
$84/8082 20 2E E7    JSR $E72E    ; Do the Tile Animation
  $84/B9EB C2 21       REP #$21     ; Add this $20 or $E0 to the VRAM address, store it in it's buffer...
+
$84/8085 80 34      BRA $34      ; [$80BB] Increment General Animation Counter and exit
  $84/B9ED 65 02      ADC $02
+
  $84/8087 5A          PHY          ; Buffer Load Index on Stack
  $84/B9EF 85 02       STA $02
+
$84/8088 A8         TAY           ; Transfer it in Y - it's a Figure Number, use it as Load Index
  $84/B9F1 E2 20       SEP #$20
+
  $84/8089 B9 AE 17    LDA $17AE,y  ; Load Graphic Set of this Figure
  $84/B9F3 80 C3      BRA $C3      ; [$B9B8] ... and loop
+
  $84/808C F0 26       BEQ $26       ; [$80B4] Leave this figure out if it has no Graphic Set = isn't activated
  $84/B9F5 FA         PLX           ; Restore the old values of $0E, $0C, $02 and $00
+
$84/808E C9 F0      CMP #$F0                A:0001 X:0026 Y:0000 P:envMxdizc
  $84/B9F6 86 0E      STX $0E
+
$84/8090 B0 04      BCS $04    [$8096]      A:0001 X:0026 Y:0000 P:envMxdizc
  $84/B9F8 FA         PLX
+
  $84/8092 C9 DC       CMP #$DC                A:0001 X:0026 Y:0000 P:envMxdizc
  $84/B9F9 86 0C       STX $0C
+
$84/8094 B0 1E       BCS $1E    [$80B4]      A:0001 X:0026 Y:0000 P:envMxdizc
  $84/B9FB FA          PLX
+
$84/8096 BE 3E 1E    LDX $1E3E,y[$84:1E3E]   A:0001 X:0026 Y:0000 P:envMxdizc
  $84/B9FC 86 02       STX $02
+
$84/8099 BD 03 06    LDA $0603,x[$84:0603]  A:0001 X:0000 Y:0000 P:envMxdiZc
  $84/B9FE FA          PLX
+
  $84/809C F0 16       BEQ $16    [$80B4]     A:0001 X:0000 Y:0000 P:envMxdizc
  $84/B9FF 86 00       STX $00
+
$84/809E B9 DF 19    LDA $19DF,y[$84:19DF]  A:0001 X:0000 Y:0000 P:envMxdizc
  $84/BA01 AB          PLB          ; Restore old bank
+
  $84/80A1 89 40       BIT #$40                A:0000 X:0000 Y:0000 P:envMxdiZc
  $84/BA02 6B          RTL
+
$84/80A3 D0 0F      BNE $0F    [$80B4]     A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$84/80A5 B9 DE 19    LDA $19DE,y[$84:19DE]  A:0000 X:0000 Y:0000 P:envMxdiZc
 +
  $84/80A8 89 02      BIT #$02               A:0000 X:0000 Y:0000 P:envMxdiZc
 +
  $84/80AA D0 08       BNE $08    [$80B4]      A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$84/80AC BD C3 06    LDA $06C3,x[$84:06C3]  A:0000 X:0000 Y:0000 P:envMxdiZc
 +
  $84/80AF F0 03       BEQ $03    [$80B4]      A:0008 X:0000 Y:0000 P:envMxdizc
 +
  $84/80B1 20 CC 80   JSR $80CC  [$84:80CC]   A:0008 X:0000 Y:0000 P:envMxdizc
 +
  $84/80B4 7A         PLY           ; Restore Load Index
 +
$84/80B5 C8          INY          ; Increment it
 +
$84/80B6 98          TYA          ; These two lines check if it was the fourth time it was incremented...
 +
$84/80B7 89 03      BIT #$03
 +
$84/80B9 D0 BD      BNE $BD      ; [$8078] Loop if it wasn't, else go on - inc General Anim Counter and exit
 +
  $84/80BB AD F4 05    LDA $05F4    ; Load the General Animation Counter
 +
  $84/80BE 1A         INC A        ; Increment it
 +
  $84/80BF 29 07       AND #$07      ; Jump back to #$00 if it was #$07 before
 +
$84/80C1 8D F4 05    STA $05F4    ; Store General Animation Counter back
 +
  $84/80C4 FA          PLX           ; Restore $39-$3B from Stack
 +
  $84/80C5 86 3B       STX $3B
 +
  $84/80C7 FA          PLX
 +
  $84/80C8 86 39       STX $39
 +
  $84/80CA AB          PLB          ; Restore Data Bank
 +
  $84/80CB 6B          RTL
 +
 
 +
== $84/80CC Figure Animation related ==
  
= Bank $86 =
+
$84/80CC 86 3B      STX $3B      ; ??? (Buffer Figure's 1E3E value)
== $86/8019 ? ==
+
$84/80CE 84 39      STY $39      ; Buffer Figure's Number
 +
$84/80D0 B9 DF 19    LDA $19DF,y[$84:19DF]  A:0008 X:0000 Y:0000 P:envMxdizc
 +
$84/80D3 10 20      BPL $20    [$80F5]      A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$84/80F5 B9 AE 17    LDA $17AE,y  ; Load Figure's Graphic Set
 +
$84/80F8 C9 F0      CMP #$F0                A:0032 X:0000 Y:0000 P:envMxdizc
 +
$84/80FA B0 25      BCS $25    [$8121]      A:0032 X:0000 Y:0000 P:envMxdizc
 +
$84/80FC B9 DE 19    LDA $19DE,y[$84:19DE]  A:0032 X:0000 Y:0000 P:envMxdizc
 +
$84/80FF 4A          LSR A                  A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$84/8100 90 0B      BCC $0B    [$810D]      A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$84/810D BB          TYX                    A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$84/810E 20 67 C2    JSR $C267  [$84:C267]  A:0000 X:0000 Y:0000 P:envMxdiZc
 +
$84/8111 D9 EF 1D    CMP $1DEF,y[$84:1DEF]  A:0001 X:0000 Y:0000 P:envMxdiZc
 +
$84/8114 F0 0B      BEQ $0B    [$8121]      A:0001 X:0000 Y:0000 P:envMxdiZC
 +
$84/8121 B9 17 1E    LDA $1E17,y[$84:1E17]  A:0001 X:0000 Y:0000 P:envMxdiZC
 +
$84/8124 F0 06      BEQ $06    [$812C]      A:0001 X:0000 Y:0000 P:envMxdizC
 +
$84/8126 3A          DEC A                  A:0001 X:0000 Y:0000 P:envMxdizC
 +
$84/8127 99 17 1E    STA $1E17,y[$84:1E17]  A:0000 X:0000 Y:0000 P:envMxdiZC
 +
$84/812A D0 45      BNE $45    [$8171]      A:0000 X:0000 Y:0000 P:envMxdiZC
 +
$84/812C 7B          TDC                    A:0000 X:0000 Y:0000 P:envMxdiZC
 +
$84/812D B9 EF 1D    LDA $1DEF,y[$84:1DEF]  A:0000 X:0000 Y:0000 P:envMxdiZC
 +
$84/8130 AA          TAX                    A:0001 X:0000 Y:0000 P:envMxdizC
 +
$84/8131 BD A6 83    LDA $83A6,x[$84:83A7]  A:0001 X:0001 Y:0000 P:envMxdizC
 +
$84/8134 18          CLC                    A:0005 X:0001 Y:0000 P:envMxdizC
 +
$84/8135 79 16 1E    ADC $1E16,y[$84:1E16]  A:0005 X:0001 Y:0000 P:envMxdizc
 +
$84/8138 AA          TAX                    A:0009 X:0001 Y:0000 P:envMxdizc
 +
$84/8139 BD C9 83    LDA $83C9,x[$84:83D2]  A:0009 X:0009 Y:0000 P:envMxdizc
 +
$84/813C 10 07      BPL $07    [$8145]      A:00FF X:0009 Y:0000 P:eNvMxdizc
 +
$84/813E A9 00      LDA #$00                A:00FF X:0009 Y:0000 P:eNvMxdizc
 +
$84/8140 99 16 1E    STA $1E16,y[$84:1E16]  A:0000 X:0009 Y:0000 P:envMxdiZc
 +
$84/8143 80 E7      BRA $E7    [$812C]      A:0000 X:0009 Y:0000 P:envMxdiZc
 +
$84/8145 48          PHA                    A:0007 X:0005 Y:0000 P:envMxdizc
 +
$84/8146 B9 DE 19    LDA $19DE,y[$84:19DE]  A:0007 X:0005 Y:0000 P:envMxdizc
 +
$84/8149 89 20      BIT #$20                A:0000 X:0005 Y:0000 P:envMxdiZc
 +
$84/814B D0 0E      BNE $0E    [$815B]      A:0000 X:0005 Y:0000 P:envMxdiZc
 +
$84/814D 89 40      BIT #$40                A:0000 X:0005 Y:0000 P:envMxdiZc
 +
$84/814F D0 05      BNE $05    [$8156]      A:0000 X:0005 Y:0000 P:envMxdiZc
 +
$84/8151 BD 9C 84    LDA $849C,x[$84:84A1]  A:0000 X:0005 Y:0000 P:envMxdiZc
 +
$84/8154 80 08      BRA $08    [$815E]      A:0001 X:0005 Y:0000 P:envMxdizc
 +
$84/815E 99 17 1E    STA $1E17,y[$84:1E17]  A:0001 X:0005 Y:0000 P:envMxdizc
 +
$84/8161 B9 16 1E    LDA $1E16,y[$84:1E16]  A:0001 X:0005 Y:0000 P:envMxdizc
 +
$84/8164 1A          INC A                  A:0000 X:0005 Y:0000 P:envMxdiZc
 +
$84/8165 99 16 1E    STA $1E16,y[$84:1E16]  A:0001 X:0005 Y:0000 P:envMxdizc
 +
$84/8168 68          PLA                    A:0001 X:0005 Y:0000 P:envMxdizc
 +
$84/8169 A6 3B      LDX $3B    [$00:003B]  A:0007 X:0005 Y:0000 P:envMxdizc
 +
$84/816B 9D C4 06    STA $06C4,x[$84:06C4]  A:0007 X:0000 Y:0000 P:envMxdiZc
 +
$84/816E 20 72 81    JSR $8172  [$84:8172]  A:0007 X:0000 Y:0000 P:envMxdiZc
 +
$84/8171 60          RTS                    A:00FF X:000E Y:8A23 P:envMxdiZC
  
This is executed in the title screen demo, when the soldier jumps over the gap and beats the archeress(?)
+
== $84/8172 Figure Animation related ==
  
  $86/8019 8B         PHB          ; Preserve Bank on Stack
+
  $84/8172 3A         DEC A                  A:0007 X:0000 Y:0000 P:envMxdiZc
  $86/801A 4B          PHK          ; Change Bank
+
  $84/8173 30 5E      BMI $5E    [$81D3]      A:0006 X:0000 Y:0000 P:envMxdizc
  $86/801B AB         PLB
+
  $84/8175 0A         ASL A                  A:0006 X:0000 Y:0000 P:envMxdizc
  $86/801C A2 20 05   LDX #$0520   ; [assumed] start of the OAM high table buffer
+
  $84/8176 85 00      STA $00   [$00:0000]  A:000C X:0000 Y:0000 P:envMxdizc
  $86/801F A0 20 03    LDY #$0320   ; [assumed] start of the OAM low table buffer
+
$84/8178 64 01      STZ $01   [$00:0001]   A:000C X:0000 Y:0000 P:envMxdizc
  $86/8022 CC 45 05   CPY $0545    ; Is this actually the position?
+
$84/817A 7B          TDC                    A:000C X:0000 Y:0000 P:envMxdizc
  $86/8025 D0 06       BNE $06      ; [$802D] If it isn't, skip this next part
+
  $84/817B BD 03 06   LDA $0603,x[$84:0603]  A:0000 X:0000 Y:0000 P:envMxdiZc
  $86/8027 A2 00 03   LDX #$0300   ; ??? Change position of OAM high table buffer?
+
$84/817E 3A          DEC A                  A:0001 X:0000 Y:0000 P:envMxdizc
  $86/802A A0 00 01   LDY #$0100   ; ??? Change position of OAM high table buffer?
+
$84/817F C2 20      REP #$20                A:0000 X:0000 Y:0000 P:envMxdiZc
  $86/802D 86 26       STX $26       ; Store in Temp Register
+
$84/8181 0A          ASL A                  A:0000 X:0000 Y:0000 P:envmxdiZc
  $86/802F 84 29       STY $29      ; Store in Temp Register
+
$84/8182 A8          TAY                    A:0000 X:0000 Y:0000 P:envmxdiZc
  $86/8031 C2 20      REP #$20
+
$84/8183 B9 15 87    LDA $8715,y[$84:8715]  A:0000 X:0000 Y:0000 P:envmxdiZc
  $86/8033 AD 43 05    LDA $0543    ; ??? Load number currently used sprites?
+
$84/8186 65 00      ADC $00   [$00:0000]   A:87D5 X:0000 Y:0000 P:eNvmxdizc
  $86/8036 0A         ASL A
+
  $84/8188 A8          TAY                    A:87E1 X:0000 Y:0000 P:eNvmxdizc
  $86/8037 0A         ASL A         ; Multiply by 4 (each sprite needs 4 bytes in Low Table)
+
$84/8189 B9 00 00   LDA $0000,y[$84:87E1]  A:87E1 X:0000 Y:87E1 P:eNvmxdizc
  $86/8038 65 29       ADC $29       ; Add Low Table Offset
+
$84/818C A8          TAY                    A:8A14 X:0000 Y:87E1 P:eNvmxdizc
  $86/803A 85 29       STA $29      ; Store in $29 the address of the first unused Low Table entry
+
  $84/818D BD C3 06   LDA $06C3,x[$84:06C3]   A:8A14 X:0000 Y:8A14 P:eNvmxdizc
  $86/803C AD 43 05    LDA $0543    ; ??? Load number currently used sprites?
+
  $84/8190 29 FF 00    AND #$00FF              A:0708 X:0000 Y:8A14 P:envmxdizc
  $86/803F 4A         LSR A
+
$84/8193 20 13 9E   JSR $9E13  [$84:9E13]  A:0008 X:0000 Y:8A14 P:envmxdizc
  $86/8040 4A          LSR A         ; Divide by 4 (each sprite needs 2 bits in High Table)
+
  $84/8196 85 02      STA $02    [$00:0002]  A:4400 X:0000 Y:8A14 P:envmxdizc
  $86/8041 65 26       ADC $26      ; Add High Table Offset
+
$84/8198 85 04      STA $04   [$00:0004]  A:4400 X:0000 Y:8A14 P:envmxdizc
  $86/8043 85 26       STA $26      ; Store in $26 the address of the first unused High Table entry
+
$84/819A E2 20      SEP #$20                A:4400 X:0000 Y:8A14 P:envmxdizc
  $86/8045 E2 20      SEP #$20
+
$84/819C 7B          TDC                    A:4400 X:0000 Y:8A14 P:envMxdizc
  $86/8047 A9 80      LDA #$80     ; Max. number of sprites
+
$84/819D B9 00 00    LDA $0000,y[$84:8A14]  A:0000 X:0000 Y:8A14 P:envMxdiZc
  $86/8049 38         SEC
+
$84/81A0 10 09      BPL $09   [$81AB]      A:0081 X:0000 Y:8A14 P:eNvMxdizc
  $86/804A ED 43 05   SBC $0543    ; Subtract number of used sprites(?)
+
  $84/81A2 C9 FF       CMP #$FF                A:0081 X:0000 Y:8A14 P:eNvMxdizc
  $86/804D 85 2B       STA $2B       ; Store in $2B (Number of free sprites)
+
$84/81A4 F0 2D       BEQ $2D    [$81D3]      A:0081 X:0000 Y:8A14 P:eNvMxdizc
  $86/804F A9 80       LDA #$80      ; ???
+
  $84/81A6 20 1A 82    JSR $821A  [$84:821A]  A:0081 X:0000 Y:8A14 P:eNvMxdizc
  $86/8051 85 28       STA $28       ; ???
+
$84/81A9 80 F1       BRA $F1    [$819C]      A:3A01 X:0000 Y:8A16 P:eNvMxdizc
  $86/8053 A0 00 00    LDY #$0000    ; ???
+
  $84/81AB C2 20      REP #$20               A:0002 X:0000 Y:8A16 P:envMxdizc
  $86/8056 BE 83 0E   LDX $0E83,y   ; ???
+
  $84/81AD EB          XBA                    A:0002 X:0000 Y:8A16 P:envmxdizc
  $86/8059 30 4A       BMI $4A      ; [$80A5]
+
$84/81AE 4A          LSR A                  A:0200 X:0000 Y:8A16 P:envmxdiZc
  $86/805B 5A         PHY          ; ???
+
  $84/81AF 4A         LSR A                  A:0100 X:0000 Y:8A16 P:envmxdizc
  $86/805C 7B         TDC          ; ???
+
  $84/81B0 4A         LSR A                  A:0080 X:0000 Y:8A16 P:envmxdizc
  $86/805D BD C3 09   LDA $09C3,x   ; ???
+
  $84/81B1 85 0C       STA $0C    [$00:000C]  A:0040 X:0000 Y:8A16 P:envmxdizc
  $86/8060 10 05       BPL $05       ; [$8067]
+
$84/81B3 E2 20       SEP #$20                A:0040 X:0000 Y:8A16 P:envmxdizc
  $86/8062 20 81 81   JSR $8181    ; ???
+
$84/81B5 BE 01 00    LDX $0001,y[$84:8A17]  A:0040 X:0000 Y:8A16 P:envMxdizc
  $86/8065 80 37       BRA $37       ; [$809E]
+
$84/81B8 C8          INY                    A:0040 X:0728 Y:8A16 P:envMxdizc
Code is missing here
+
$84/81B9 C8          INY                    A:0040 X:0728 Y:8A17 P:eNvMxdizc
  $86/809E 7A         PLY          ; ???
+
$84/81BA C8          INY                    A:0040 X:0728 Y:8A18 P:eNvMxdizc
  $86/809F C8         INY          ; ???
+
$84/81BB 5A          PHY                    A:0040 X:0728 Y:8A19 P:eNvMxdizc
  $86/80A0 C8         INY          ; ???
+
$84/81BC 20 D4 81    JSR $81D4  [$84:81D4]  A:0040 X:0728 Y:8A19 P:eNvMxdizc
  $86/80A1 A5 2B       LDA $2B       ; ???
+
  $84/81BF A4 04       LDY $04    [$00:0004]  A:9FBA X:9F00 Y:8A19 P:eNvMxdizc
  $86/80A3 D0 B1       BNE $B1       ; [$8056]
+
  $84/81C1 22 B7 9F 80 JSL $809FB7  ; Animation VRAM DMA
  $86/80A5 20 96 84    JSR $8496    ; Check if more Sprites are needed and clear OAM entries for it
+
  $84/81C5 7A         PLY                    A:9F05 X:0008 Y:4400 P:eNvMxdizc
  $86/80A8 A0 20 03   LDY #$0320   ; Change OAM Buffer address from $100 to $320 or vice versa
+
$84/81C6 C2 20      REP #$20                A:9F05 X:0008 Y:8A19 P:eNvMxdizc
  $86/80AB CC 45 05   CPY $0545
+
$84/81C8 A5 0C      LDA $0C    [$00:000C]  A:9F05 X:0008 Y:8A19 P:eNvmxdizc
  $86/80AE D0 03       BNE $03       ; [$80B3] Take branch if it isn't $320
+
  $84/81CA 4A          LSR A                   A:0040 X:0008 Y:8A19 P:envmxdizc
  $86/80B0 A0 00 01   LDY #$0100
+
  $84/81CB 65 04       ADC $04    [$00:0004]  A:0020 X:0008 Y:8A19 P:envmxdizc
  $86/80B3 8C 45 05   STY $0545
+
  $84/81CD 85 04       STA $04    [$00:0004]  A:4420 X:0008 Y:8A19 P:envmxdizc
  $86/80B6 A9 01       LDA #$01      ; Set OAM Update flag
+
  $84/81CF E2 20      SEP #$20               A:4420 X:0008 Y:8A19 P:envmxdizc
  $86/80B8 8D 40 05   STA $0540
+
  $84/81D1 80 C9      BRA $C9    [$819C]      A:4420 X:0008 Y:8A19 P:envMxdizc
  $86/80BB AB         PLB          ; Restore Program Bank
+
$84/81D3 60          RTS                    A:00FF X:000E Y:8A23 P:envMxdiZC
  $86/80BC 6B         RTL
+
 
 +
== $84/81D4 Figure Animation related ==
 +
 
 +
$84/81D4 C2 21       REP #$21                A:0040 X:0728 Y:8A19 P:eNvMxdizc
 +
$84/81D6 8A          TXA                    A:0040 X:0728 Y:8A19 P:eNvmxdizc
 +
$84/81D7 10 13      BPL $13    [$81EC]     A:0728 X:0728 Y:8A19 P:envmxdizc
 +
$84/81EC 0A          ASL A        ; Multiply by #$20
 +
$84/81ED 0A          ASL A
 +
$84/81EE 0A          ASL A
 +
  $84/81EF 0A          ASL A
 +
$84/81F0 0A          ASL A
 +
$84/81F1 29 FF 7F    AND #$7FFF    ; This line could be removed?
 +
$84/81F4 18         CLC          ; This line could be removed?
 +
  $84/81F5 69 00 80   ADC #$8000    ; This line could be removed?
 +
  $84/81F8 09 00 80    ORA #$8000    ; Set MSB
 +
$84/81FB 85 06       STA $06    [$00:0006]  A:E500 X:0728 Y:8A19 P:eNvmxdizc
 +
$84/81FD 8A          TXA                    A:E500 X:0728 Y:8A19 P:eNvmxdizc
 +
$84/81FE EB          XBA                    A:0728 X:0728 Y:8A19 P:envmxdizc
 +
$84/81FF E2 20       SEP #$20                A:2807 X:0728 Y:8A19 P:envmxdizc
 +
$84/8201 08          PHP                    A:2807 X:0728 Y:8A19 P:envMxdizc
 +
$84/8202 4A          LSR A                  A:2807 X:0728 Y:8A19 P:envMxdizc
 +
$84/8203 4A          LSR A                  A:2803 X:0728 Y:8A19 P:envMxdizC
 +
$84/8204 28          PLP                    A:2801 X:0728 Y:8A19 P:envMxdizC
 +
  $84/8205 69 B7       ADC #$B7                A:2801 X:0728 Y:8A19 P:envMxdizc
 +
  $84/8207 85 08       STA $08    [$00:0008]  A:28B8 X:0728 Y:8A19 P:eNvMxdizc
 +
$84/8209 C2 21      REP #$21                A:28B8 X:0728 Y:8A19 P:eNvMxdizc
 +
$84/820B A5 20       LDA $20    [$00:0020]  A:28B8 X:0728 Y:8A19 P:eNvmxdizc
 +
  $84/820D 65 06      ADC $06    [$00:0006]  A:3A00 X:0728 Y:8A19 P:envmxdizc
 +
$84/820F 09 00 80   ORA #$8000              A:1F00 X:0728 Y:8A19 P:envmxdizC
 +
$84/8212 AA          TAX                    A:9F00 X:0728 Y:8A19 P:eNvmxdizC
 +
$84/8213 E2 20      SEP #$20                A:9F00 X:9F00 Y:8A19 P:eNvmxdizC
 +
  $84/8215 A5 22      LDA $22   [$00:0022]   A:9F00 X:9F00 Y:8A19 P:eNvMxdizC
 +
  $84/8217 65 08       ADC $08    [$00:0008]   A:9F01 X:9F00 Y:8A19 P:envMxdizC
 +
  $84/8219 60          RTS                    A:9FBA X:9F00 Y:8A19 P:eNvMxdizc
 +
 
 +
== $84/821A Use Jump Table ==
 +
 
 +
$84/821A 0A         ASL A                  A:0081 X:0000 Y:89C4 P:eNvMxdizc
 +
  $84/821B AA         TAX                    A:0002 X:0000 Y:89C4 P:envMxdizC
 +
  $84/821C 7C 1F 82   JMP ($821F,x)[$84:8254] A:0002 X:0002 Y:89C4 P:envMxdizC
 +
 
 +
== $84/821F Jump Table for $84/821A ==
 +
 
 +
2F 82 - $822F - Entry #$00
 +
54 82 - $8254 - Entry #$01
 +
3E 82 - $823E - Entry #$02
 +
54 82 - $8254 - Entry #$03
 +
A4 82 - $82A4 - Entry #$04
 +
E4 82 - $82E4 - Entry #$05
 +
CD 82 - $82CD - Entry #$06
 +
4D 83 - $834D - Entry #$07
 +
 
 +
== $84/822F ? ==
 +
 
 +
  $84/822F C2 21       REP #$21                A:0000 X:0000 Y:8A1C P:envMxdiZC
 +
$84/8231 A5 02       LDA $02    [$00:0002]   A:0000 X:0000 Y:8A1C P:envmxdiZc
 +
  $84/8233 69 00 01   ADC #$0100              A:4400 X:0000 Y:8A1C P:envmxdizc
 +
  $84/8236 85 02       STA $02    [$00:0002]  A:4500 X:0000 Y:8A1C P:envmxdizc
 +
$84/8238 85 04       STA $04    [$00:0004]   A:4500 X:0000 Y:8A1C P:envmxdizc
 +
$84/823A E2 20      SEP #$20                A:4500 X:0000 Y:8A1C P:envmxdizc
 +
  $84/823C C8          INY                    A:4500 X:0000 Y:8A1C P:envMxdizc
 +
$84/823D 60         RTS                    A:4500 X:0000 Y:8A1D P:eNvMxdizc
 +
 
 +
== $84/8254 ? ==
 +
 
 +
$84/8254 A6 39      LDX $39    [$00:0039]  A:0002 X:0002 Y:8A14 P:envMxdizC
 +
$84/8256 22 38 A1 88 JSL $88A138[$88:A138]  A:0002 X:0000 Y:8A14 P:envMxdiZC
 +
$84/825A DA          PHX                    A:0032 X:0000 Y:8A14 P:envMxdiZc
 +
$84/825B C2 20      REP #$20                A:0032 X:0000 Y:8A14 P:envMxdiZc
 +
$84/825D 0A          ASL A                  A:0032 X:0000 Y:8A14 P:envmxdiZc
 +
  $84/825E 0A         ASL A                  A:0064 X:0000 Y:8A14 P:envmxdizc
 +
  $84/825F AA         TAX                    A:00C8 X:0000 Y:8A14 P:envmxdizc
 +
  $84/8260 E2 20       SEP #$20                A:00C8 X:00C8 Y:8A14 P:envmxdizc
 +
$84/8262 7B          TDC                    A:00C8 X:00C8 Y:8A14 P:envMxdizc
 +
$84/8263 BF 41 A6 84 LDA $84A641,x[$84:A709] A:0000 X:00C8 Y:8A14 P:envMxdiZc
 +
$84/8267 FA          PLX                    A:001F X:00C8 Y:8A14 P:envMxdizc
 +
$84/8268 85 20      STA $20    [$00:0020]  A:001F X:0000 Y:8A14 P:envMxdiZc
 +
$84/826A 64 21       STZ $21    [$00:0021]  A:001F X:0000 Y:8A14 P:envMxdiZc
 +
$84/826C B9 01 00    LDA $0001,y[$84:8A15]  A:001F X:0000 Y:8A14 P:envMxdiZc
 +
  $84/826F D0 04       BNE $04    [$8275]      A:0006 X:0000 Y:8A14 P:envMxdizc
 +
$84/8275 C9 03       CMP #$03                A:0006 X:0000 Y:8A14 P:envMxdizc
 +
$84/8277 D0 0D      BNE $0D    [$8286]     A:0006 X:0000 Y:8A14 P:envMxdizC
 +
  $84/8286 4A          LSR A                  A:0006 X:0000 Y:8A14 P:envMxdizC
 +
$84/8287 F0 06      BEQ $06   [$828F]      A:0003 X:0000 Y:8A14 P:envMxdizc
 +
  $84/8289 06 20      ASL $20    [$00:0020]  A:0003 X:0000 Y:8A14 P:envMxdizc
 +
$84/828B 26 21      ROL $21   [$00:0021]  A:0003 X:0000 Y:8A14 P:envMxdizc
 +
  $84/828D 80 E6      BRA $E6   [$8275]      A:0003 X:0000 Y:8A14 P:envMxdiZc
 +
  $84/8279 C2 21       REP #$21                A:0003 X:0000 Y:8A14 P:envMxdiZC
 +
$84/827B A5 20       LDA $20    [$00:0020]   A:0003 X:0000 Y:8A14 P:envmxdiZc
 +
$84/827D 0A          ASL A                  A:003E X:0000 Y:8A14 P:envmxdizc
 +
  $84/827E 65 20      ADC $20    [$00:0020]  A:007C X:0000 Y:8A14 P:envmxdizc
 +
$84/8280 85 20      STA $20   [$00:0020]  A:00BA X:0000 Y:8A14 P:envmxdizc
 +
$84/8282 E2 20      SEP #$20                A:00BA X:0000 Y:8A14 P:envmxdizc
 +
  $84/8284 80 09      BRA $09   [$828F]      A:00BA X:0000 Y:8A14 P:envMxdizc
 +
$84/828F C2 20      REP #$20                A:00BA X:0000 Y:8A14 P:envMxdizc
 +
  $84/8291 A5 20       LDA $20    [$00:0020]  A:00BA X:0000 Y:8A14 P:envmxdizc
 +
$84/8293 E2 20      SEP #$20                A:00BA X:0000 Y:8A14 P:envmxdizc
 +
$84/8295 C9 80      CMP #$80                A:00BA X:0000 Y:8A14 P:envMxdizc
 +
$84/8297 29 7F      AND #$7F                A:00BA X:0000 Y:8A14 P:envMxdizC
 +
  $84/8299 64 20      STZ $20   [$00:0020]  A:003A X:0000 Y:8A14 P:envMxdizC
 +
$84/829B 85 21      STA $21    [$00:0021]  A:003A X:0000 Y:8A14 P:envMxdizC
 +
  $84/829D EB         XBA                    A:003A X:0000 Y:8A14 P:envMxdizC
 +
$84/829E 2A          ROL A                  A:3A00 X:0000 Y:8A14 P:envMxdiZC
 +
$84/829F 85 22      STA $22    [$00:0022]  A:3A01 X:0000 Y:8A14 P:envMxdizc
 +
$84/82A1 C8          INY                    A:3A01 X:0000 Y:8A14 P:envMxdizc
 +
$84/82A2 C8          INY                    A:3A01 X:0000 Y:8A15 P:eNvMxdizc
 +
  $84/82A3 60         RTS
 +
 
 +
== $84/82A4 ? ==
  
== $86/8181 ? ==
+
$84/82A4 7B          TDC                    A:0008 X:0008 Y:8C90 P:envMxdizC
 
+
  $84/82A5 B9 01 00   LDA $0001,y[$84:8C91]  A:0000 X:0008 Y:8C90 P:envMxdiZC
  $86/8181 BD 03 06   LDA $0603,x[$86:0603]  A:00FF X:0000 Y:0000 P:eNVMxdizC
+
  $84/82A8 C2 20       REP #$20                A:0002 X:0008 Y:8C90 P:envMxdizC
  $86/8184 F0 0B       BEQ $0B    [$8191]      A:0001 X:0000 Y:0000 P:enVMxdizC
+
  $84/82AA EB          XBA                    A:0002 X:0008 Y:8C90 P:envmxdizC
  $86/8186 BD 04 06    LDA $0604,x[$86:0604]  A:0001 X:0000 Y:0000 P:enVMxdizC
+
  $84/82AB 4A          LSR A                  A:0200 X:0008 Y:8C90 P:envmxdiZC
  $86/8189 F0 06      BEQ $06    [$8191]      A:0001 X:0000 Y:0000 P:enVMxdizC
+
  $84/82AC 4A          LSR A                  A:0100 X:0008 Y:8C90 P:envmxdizc
  $86/818B BD 04 07    LDA $0704,x[$86:0704]  A:0001 X:0000 Y:0000 P:enVMxdizC
+
  $84/82AD 4A          LSR A                  A:0080 X:0008 Y:8C90 P:envmxdizc
  $86/818E 4A          LSR A                  A:0000 X:0000 Y:0000 P:enVMxdiZC
+
  $84/82AE 85 0C       STA $0C   [$00:000C]   A:0040 X:0008 Y:8C90 P:envmxdizc
  $86/818F 90 03       BCC $03   [$8194]     A:0000 X:0000 Y:0000 P:enVMxdiZc
+
  $84/82B0 E2 20       SEP #$20               A:0040 X:0008 Y:8C90 P:envmxdizc
Code is missing here
+
  $84/82B2 C8         INY                     A:0040 X:0008 Y:8C90 P:envMxdizc
  $86/8194 A9 8B       LDA #$8B               A:0000 X:0000 Y:0000 P:enVMxdiZc
+
  $84/82B3 C8         INY                     A:0040 X:0008 Y:8C91 P:eNvMxdizc
  $86/8196 48         PHA                     A:008B X:0000 Y:0000 P:eNVMxdizc
+
  $84/82B4 5A          PHY                    A:0040 X:0008 Y:8C92 P:eNvMxdizc
  $86/8197 AB         PLB                     A:008B X:0000 Y:0000 P:eNVMxdizc
+
  $84/82B5 A4 04      LDY $04   [$00:0004]  A:0040 X:0008 Y:8C92 P:eNvMxdizc
  $86/8198 86 3B      STX $3B    [$00:003B]  A:008B X:0000 Y:0000 P:eNVMxdizc
+
  $84/82B7 A2 15 B8    LDX #$B815   ; VRAM DMA Source Address: #$84/B815
  $86/819A BD 03 07   LDA $0703,x[$8B:0703]  A:008B X:0000 Y:0000 P:eNVMxdizc
+
$84/82BA A9 84      LDA #$84
  $86/819D 85 06      STA $06   [$00:0006]  A:0006 X:0000 Y:0000 P:enVMxdizc
+
$84/82BC 22 B7 9F 80 JSL $809FB7  ; Animation VRAM DMA
  $86/819F BD 43 08    LDA $0843,x[$8B:0843]  A:0006 X:0000 Y:0000 P:enVMxdizc
+
$84/82C0 7A          PLY                    A:1800 X:0040 Y:4740 P:eNvMxdizc
  $86/81A2 85 05       STA $05   [$00:0005]  A:0001 X:0000 Y:0000 P:enVMxdizc
+
  $84/82C1 C2 20      REP #$20                A:1800 X:0040 Y:8C92 P:eNvMxdizc
  $86/81A4 7B         TDC                    A:0001 X:0000 Y:0000 P:enVMxdizc
+
  $84/82C3 A5 0C       LDA $0C   [$00:000C]  A:1800 X:0040 Y:8C92 P:eNvmxdizc
  $86/81A5 BD 03 06   LDA $0603,x[$8B:0603]  A:0000 X:0000 Y:0000 P:enVMxdiZc
+
  $84/82C5 4A         LSR A                  A:0040 X:0040 Y:8C92 P:envmxdizc
  $86/81A8 C2 20       REP #$20                A:0001 X:0000 Y:0000 P:enVMxdizc
+
  $84/82C6 65 04      ADC $04   [$00:0004]  A:0020 X:0040 Y:8C92 P:envmxdizc
  $86/81AA 3A          DEC A                  A:0001 X:0000 Y:0000 P:enVmxdizc
+
  $84/82C8 85 04       STA $04    [$00:0004]  A:4760 X:0040 Y:8C92 P:envmxdizc
  $86/81AB 0A         ASL A                  A:0000 X:0000 Y:0000 P:enVmxdiZc
+
  $84/82CA E2 20      SEP #$20                A:4760 X:0040 Y:8C92 P:envmxdizc
$86/81AC 69 2F A6    ADC #$A62F              A:0000 X:0000 Y:0000 P:enVmxdiZc
+
  $84/82CC 60         RTS                    A:4760 X:0040 Y:8C92 P:envMxdizc
$86/81AF A8          TAY                    A:A62F X:0000 Y:0000 P:eNvmxdizc
+
 
  $86/81B0 BD 04 06   LDA $0604,x[$8B:0604]  A:A62F X:0000 Y:A62F P:eNvmxdizc
+
== $84/837A Tile/Sprite Animation To-Do-List for each General Animation Counter Value ==
  $86/81B3 3A          DEC A                  A:0001 X:0000 Y:A62F P:envmxdizc
+
 
  $86/81B4 29 FF 00    AND #$00FF              A:0000 X:0000 Y:A62F P:envmxdiZc
+
80 FF FF FF - Entry #$00 - Do the Tile Animation
$86/81B7 0A          ASL A                  A:0000 X:0000 Y:A62F P:envmxdiZc
+
81 FF FF FF - Entry #$01 - Do the Tile Animation and Increment $05F5
  $86/81B8 79 00 00    ADC $0000,y[$8B:A62F]  A:0000 X:0000 Y:A62F P:envmxdiZc
+
  00 02 04 06 - Entry #$02 - Do the Figure Animation for #$00, #$02, #$04 and #$06
$86/81BB A8          TAY                    A:A7E9 X:0000 Y:A62F P:eNvmxdizc
+
  08 0A 0C 0E - Entry #$03 - Do the Figure Animation for #$08, #$0A, #$0C and #$0E
  $86/81BC B9 00 00    LDA $0000,y[$8B:A7E9]  A:A7E9 X:0000 Y:A7E9 P:eNvmxdizc
+
  10 12 FF FF - Entry #$04 - Do the Figure Animation for #$10, and #$12
  $86/81BF 85 23      STA $23    [$00:0023]  A:B5DF X:0000 Y:A7E9 P:eNvmxdizc
+
  14 16 18 1A - Entry #$05 - Do the Figure Animation for #$14, #$16, #$18 and #$1A
  $86/81C1 BD 83 09    LDA $0983,x[$8B:0983]  A:B5DF X:0000 Y:A7E9 P:eNvmxdizc
+
  1C 1E 20 22 - Entry #$06 - Do the Figure Animation for #$1C, #$1E, #$20 and #$22
  $86/81C4 85 00      STA $00   [$00:0000]  A:0000 X:0000 Y:A7E9 P:envmxdiZc
+
  24 26 FF FF - Entry #$07 - Do the Figure Animation for #$24, and #$26
  $86/81C6 A5 29      LDA $29    [$00:0029]  A:0000 X:0000 Y:A7E9 P:envmxdiZc
+
 
$86/81C8 9D 83 09    STA $0983,x[$8B:0983]  A:03A0 X:0000 Y:A7E9 P:envmxdizc
+
== $86/964C ? ==
  $86/81CB E2 20       SEP #$20                A:03A0 X:0000 Y:A7E9 P:envmxdizc
+
 
  $86/81CD B2 23      LDA ($23)  [$8B:B5DF]  A:03A0 X:0000 Y:A7E9 P:envMxdizc
+
  $84/964C 8B          PHB          ; Preserve Data Bank on Stack
  $86/81CF D0 03       BNE $03    [$81D4]      A:0391 X:0000 Y:A7E9 P:eNvMxdizc
+
$84/964D 4B          PHK          ; Change Data Bank to $84
  $86/81D4 7B          TDC                    A:0391 X:0000 Y:A7E9 P:eNvMxdizc
+
  $84/964E AB          PLB
  $86/81D5 18          CLC                    A:0000 X:0000 Y:A7E9 P:envMxdiZc
+
$84/964F 20 54 96   JSR $9654  [$84:9654]  A:0000 X:003E Y:000A P:eNvMxdizc
$86/81D6 BD C3 06    LDA $06C3,x[$8B:06C3]  A:0000 X:0000 Y:A7E9 P:envMxdiZc
+
  $84/9652 AB          PLB          ; Restore old bank
  $86/81D9 29 3C       AND #$3C                A:0008 X:0000 Y:A7E9 P:envMxdizc
+
$84/9653 6B          RTL
  $86/81DB 7D C3 06    ADC $06C3,x[$8B:06C3]  A:0008 X:0000 Y:A7E9 P:envMxdizc
+
 
  $86/81DE C2 20       REP #$20                A:0010 X:0000 Y:A7E9 P:envMxdizc
+
== $86/9654 ? ==
  $86/81E0 0A          ASL A                  A:0010 X:0000 Y:A7E9 P:envmxdizc
+
 
  $86/81E1 0A          ASL A                  A:0020 X:0000 Y:A7E9 P:envmxdizc
+
$84/9654 08          PHP          ; Push Status Register
$86/81E2 85 08       STA $08   [$00:0008]   A:0040 X:0000 Y:A7E9 P:envmxdizc
+
  $84/9655 C2 10       REP #$10      ; X/Y = 16 bit
  $86/81E4 E2 20      SEP #$20                A:0040 X:0000 Y:A7E9 P:envmxdizc
+
  $84/9657 BD 04 07    LDA $0704,x[$84:0742]  A:0000 X:003E Y:000A P:eNvMxdizc
  $86/81E6 A6 29       LDX $29    [$00:0029]  A:0040 X:0000 Y:A7E9 P:envMxdizc
+
  $84/965A 89 04       BIT #$04                A:0000 X:003E Y:000A P:envMxdiZc
  $86/81E8 DA         PHX                     A:0040 X:03A0 Y:A7E9 P:envMxdizc
+
  $84/965C F0 07      BEQ $07    [$9665]      A:0000 X:003E Y:000A P:envMxdiZc
  $86/81E9 A6 3B      LDX $3B    [$00:003B]  A:0040 X:03A0 Y:A7E9 P:envMxdizc
+
;Code is missing here
  $86/81EB A0 10 00   LDY #$0010              A:0040 X:0000 Y:A7E9 P:envMxdiZc
+
  $84/9665 BD 84 06    LDA $0684,x[$84:06C2]  A:0000 X:003E Y:000A P:envMxdiZc
  $86/81EE B2 23       LDA ($23)  [$8B:B5DF]   A:0040 X:0000 Y:0010 P:envMxdizc
+
  $84/9668 F0 0B       BEQ $0B    [$9675]      A:0005 X:003E Y:000A P:envMxdizc
  $86/81F0 30 03      BMI $03    [$81F5]     A:0091 X:0000 Y:0010 P:eNvMxdizc
+
  $84/966A C9 FF      CMP #$FF                A:0005 X:003E Y:000A P:envMxdizc
Code is missing here
+
  $84/966C F0 05       BEQ $05    [$9673]      A:0005 X:003E Y:000A P:envMxdizc
$86/81F5 84 0E       STY $0E    [$00:000E]  A:0091 X:0000 Y:0010 P:eNvMxdizc
+
  $84/966E DE 84 06    DEC $0684,x[$84:06C2]  A:0005 X:003E Y:000A P:envMxdizc
  $86/81F7 4A         LSR A                  A:0091 X:0000 Y:0010 P:eNvMxdizc
+
  $84/9671 F0 02       BEQ $02   [$9675]     A:0005 X:003E Y:000A P:envMxdizc
  $86/81F8 4A         LSR A                  A:0048 X:0000 Y:0010 P:envMxdizC
+
  $84/9673 28          PLP          ; Restore Status Register
  $86/81F9 4A          LSR A                  A:0024 X:0000 Y:0010 P:envMxdizc
+
$84/9674 60          RTS
  $86/81FA 29 07       AND #$07                A:0012 X:0000 Y:0010 P:envMxdizc
+
  $86/81FC 85 02       STA $02    [$00:0002]  A:0002 X:0000 Y:0010 P:envMxdizc
+
$84/9675 8B          PHB                    A:0001 X:003E Y:000A P:envMxdiZc
  $86/81FE B2 23      LDA ($23)  [$8B:B5DF]  A:0002 X:0000 Y:0010 P:envMxdizc
+
  $84/9676 A9 8A       LDA #$8A                A:0001 X:003E Y:000A P:envMxdiZc
  $86/8200 29 07      AND #$07                A:0091 X:0000 Y:0010 P:eNvMxdizc
+
$84/9678 48          PHA                    A:008A X:003E Y:000A P:eNvMxdizc
  $86/8202 85 03      STA $03    [$00:0003]  A:0001 X:0000 Y:0010 P:envMxdizc
+
  $84/9679 AB         PLB                     A:008A X:003E Y:000A P:eNvMxdizc
  $86/8204 A0 01 00    LDY #$0001              A:0001 X:0000 Y:0010 P:envMxdizc
+
  $84/967A 7B          TDC                    A:008A X:003E Y:000A P:eNvMxdizc
  $86/8207 A5 06       LDA $06    [$00:0006]  A:0001 X:0000 Y:0001 P:envMxdizc
+
  $84/967B BD 03 06   LDA $0603,x[$8A:0641]  A:0000 X:003E Y:000A P:envMxdiZc
  $86/8209 0A          ASL A                  A:0006 X:0000 Y:0001 P:envMxdizc
+
  $84/967E F0 35       BEQ $35    [$96B5]     A:00C9 X:003E Y:000A P:eNvMxdizc
  $86/820A 0A          ASL A                  A:000C X:0000 Y:0001 P:envMxdizc
+
  $84/9680 BD 43 06    LDA $0643,x[$8A:0681]   A:00C9 X:003E Y:000A P:eNvMxdizc
  $86/820B 7B          TDC                    A:0018 X:0000 Y:0001 P:envMxdizc
+
$84/9683 C2 20       REP #$20                A:00C9 X:003E Y:000A P:eNvMxdizc
  $86/820C B1 23      LDA ($23),y[$8B:B5E0]  A:0000 X:0000 Y:0001 P:envMxdiZc
+
  $84/9685 0A         ASL A                  A:00C9 X:003E Y:000A P:eNvmxdizc
  $86/820E 90 06      BCC $06    [$8216]      A:00F8 X:0000 Y:0001 P:eNvMxdizc
+
  $84/9686 A8         TAY                    A:0192 X:003E Y:000A P:envmxdizc
Code is missing here
+
  $84/9687 B9 7A ED    LDA $ED7A,y[$8A:EF0C]  A:0192 X:003E Y:0192 P:envmxdizc
  $86/8216 C2 20       REP #$20                A:00F8 X:0000 Y:0001 P:eNvMxdizc
+
  $84/968A 85 20       STA $20    [$00:0020]  A:F131 X:003E Y:0192 P:eNvmxdizc
  $86/8218 C9 80 00    CMP #$0080              A:00F8 X:0000 Y:0001 P:eNvmxdizc
+
  $84/968C E2 20       SEP #$20                A:F131 X:003E Y:0192 P:eNvmxdizc
  $86/821B 90 03       BCC $03    [$8220]      A:00F8 X:0000 Y:0001 P:envmxdizC
+
  $84/968E 7B          TDC                    A:F131 X:003E Y:0192 P:eNvMxdizc
  $86/821D E9 00 01   SBC #$0100              A:00F8 X:0000 Y:0001 P:envmxdizC
+
$84/968F BD 44 06    LDA $0644,x[$8A:0682]  A:0000 X:003E Y:0192 P:envMxdiZc
  $86/8220 18          CLC                    A:FFF8 X:0000 Y:0001 P:eNvmxdizc
+
  $84/9692 0A          ASL A                  A:0000 X:003E Y:0192 P:envMxdiZc
  $86/8221 7D 43 07    ADC $0743,x[$8B:0743]  A:FFF8 X:0000 Y:0001 P:eNvmxdizc
+
  $84/9693 A8          TAY                    A:0000 X:003E Y:0192 P:envMxdiZc
  $86/8224 85 0A      STA $0A    [$00:000A]  A:0088 X:0000 Y:0001 P:envmxdizC
+
  $84/9694 C2 20      REP #$20                A:0000 X:003E Y:0000 P:envMxdiZc
  $86/8226 E2 20      SEP #$20                A:0088 X:0000 Y:0001 P:envmxdizC
+
  $84/9696 B1 20       LDA ($20),y[$8A:F131]  A:0000 X:003E Y:0000 P:envmxdiZc
  $86/8228 C8         INY                     A:0088 X:0000 Y:0001 P:envMxdizC
+
  $84/9698 85 29      STA $29    [$00:0029]  A:F13D X:003E Y:0000 P:eNvmxdizc
  $86/8229 A5 06       LDA $06    [$00:0006]  A:0088 X:0000 Y:0002 P:envMxdizC
+
  $84/969A E2 20      SEP #$20                A:F13D X:003E Y:0000 P:eNvmxdizc
  $86/822B 0A          ASL A                  A:0006 X:0000 Y:0002 P:envMxdizC
+
  $84/969C 7B          TDC                    A:F13D X:003E Y:0000 P:eNvMxdizc
  $86/822C 7B         TDC                     A:000C X:0000 Y:0002 P:envMxdizc
+
  $84/969D BD 83 06    LDA $0683,x[$8A:06C1]  A:0000 X:003E Y:0000 P:envMxdiZc
  $86/822D B1 23      LDA ($23),y[$8B:B5E1]  A:0000 X:0000 Y:0002 P:envMxdiZc
+
  $84/96A0 A8          TAY                    A:0002 X:003E Y:0000 P:envMxdizc
  $86/822F 90 06      BCC $06    [$8237]      A:00F6 X:0000 Y:0002 P:eNvMxdizc
+
  $84/96A1 B1 29       LDA ($29),y[$8A:F13F]  A:0002 X:003E Y:0002 P:envMxdizc
Code is missing here
+
  $84/96A3 C8          INY                    A:0003 X:003E Y:0002 P:envMxdizc
  $86/8237 C2 20       REP #$20               A:00F6 X:0000 Y:0002 P:eNvMxdizc
+
  $84/96A4 C9 C0       CMP #$C0                A:0003 X:003E Y:0003 P:envMxdizc
  $86/8239 C9 80 00    CMP #$0080              A:00F6 X:0000 Y:0002 P:eNvmxdizc
+
  $84/96A6 B0 12      BCS $12   [$96BA]      A:0003 X:003E Y:0003 P:envMxdizc
  $86/823C 90 03      BCC $03    [$8241]      A:00F6 X:0000 Y:0002 P:envmxdizC
+
  $84/96A8 9D 04 06    STA $0604,x[$8A:0642]  A:0003 X:003E Y:0003 P:envMxdizc
  $86/823E E9 00 01    SBC #$0100              A:00F6 X:0000 Y:0002 P:envmxdizC
+
  $84/96AB B1 29      LDA ($29),y[$8A:F140]  A:0003 X:003E Y:0003 P:envMxdizc
  $86/8241 18          CLC                    A:FFF6 X:0000 Y:0002 P:eNvmxdizc
+
  $84/96AD 9D 84 06    STA $0684,x[$8A:06C2]  A:0003 X:003E Y:0003 P:envMxdizc
  $86/8242 7D 83 07   ADC $0783,x[$8B:0783]  A:FFF6 X:0000 Y:0002 P:eNvmxdizc
+
  $84/96B0 C8          INY                    A:0003 X:003E Y:0003 P:envMxdizc
  $86/8245 3A          DEC A                  A:003D X:0000 Y:0002 P:envmxdizC
+
  $84/96B1 98         TYA                     A:0003 X:003E Y:0004 P:envMxdizc
  $86/8246 85 20       STA $20   [$00:0020]  A:003C X:0000 Y:0002 P:envmxdizC
+
  $84/96B2 9D 83 06   STA $0683,x[$8A:06C1]  A:0004 X:003E Y:0004 P:envMxdizc
  $86/8248 E2 20      SEP #$20                A:003C X:0000 Y:0002 P:envmxdizC
+
  $84/96B5 A6 3B      LDX $3B    [$00:003B]  A:0004 X:003E Y:0004 P:envMxdizc
  $86/824A C8          INY                    A:003C X:0000 Y:0002 P:envMxdizC
+
  $84/96B7 AB         PLB                     A:0004 X:003E Y:0004 P:envMxdizc
  $86/824B FA          PLX                    A:003C X:0000 Y:0003 P:envMxdizC
+
  $84/96B8 28          PLP                    A:0004 X:003E Y:0004 P:eNvMxdizc
  $86/824C A5 02       LDA $02    [$00:0002]  A:003C X:03A0 Y:0003 P:envMxdizC
+
  $84/96B9 60          RTS
  $86/824E 85 04       STA $04    [$00:0004]  A:0002 X:03A0 Y:0003 P:envMxdizC
+
  $86/8250 C2 20      REP #$20                A:0002 X:03A0 Y:0003 P:envMxdizC
+
  $84/96BA 49 FF       EOR #$FF               A:00FD X:003E Y:0013 P:envMxdizC
  $86/8252 A5 20       LDA $20    [$00:0020]  A:0002 X:03A0 Y:0003 P:envmxdizC
+
  $84/96BC 0A          ASL A                  A:0002 X:003E Y:0013 P:envMxdizC
  $86/8254 85 0C      STA $0C   [$00:000C]   A:003C X:03A0 Y:0003 P:envmxdizC
+
  $84/96BD AA          TAX                    A:0004 X:003E Y:0013 P:envMxdizc
  $86/8256 B1 23       LDA ($23),y[$8B:B5E2]  A:003C X:03A0 Y:0003 P:envmxdizC
+
  $84/96BE C2 20      REP #$20                A:0004 X:0004 Y:0013 P:envMxdizc
  $86/8258 C9 FF FF   CMP #$FFFF              A:0000 X:03A0 Y:0003 P:envmxdiZC
+
  $84/96C0 BF CD 96 84 LDA $8496CD,x[$84:96D1] A:0004 X:0004 Y:0013 P:envmxdizc
  $86/825B D0 07       BNE $07    [$8264]     A:0000 X:03A0 Y:0003 P:envmxdizc
+
  $84/96C4 85 00      STA $00   [$00:0000]  A:97A0 X:0004 Y:0013 P:eNvmxdizc
Code is missing here
+
  $84/96C6 E2 20      SEP #$20                A:97A0 X:0004 Y:0013 P:eNvmxdizc
  $86/8264 A5 0C      LDA $0C    [$00:000C]  A:0000 X:03A0 Y:0003 P:envmxdizc
+
  $84/96C8 A6 3B       LDX $3B   [$00:003B]  A:97A0 X:0004 Y:0013 P:eNvMxdizc
  $86/8266 38         SEC                     A:003C X:03A0 Y:0003 P:envmxdizc
+
  $84/96CA 6C 00 00    JMP ($0000)[$84:97A0]  A:97A0 X:003E Y:0013 P:envMxdizc
  $86/8267 ED 97 05    SBC $0597  [$8B:0597]  A:003C X:03A0 Y:0003 P:envmxdizC
+
  $86/826A C9 E0 00    CMP #$00E0              A:0064 X:03A0 Y:0003 P:envmxdizc
+
  $84/97A0 9E 83 06    STZ $0683,x[$8A:06C1]  A:97A0 X:003E Y:0013 P:envMxdizc
$86/826D 90 05       BCC $05    [$8274]     A:0064 X:03A0 Y:0003 P:eNvmxdizc
+
  $84/97A3 4C 9C 96    JMP $969C  [$84:969C]  A:97A0 X:003E Y:0013 P:envMxdizc
Code is missing here
+
 
  $86/8274 E2 20       SEP #$20               A:0064 X:03A0 Y:0003 P:eNvmxdizc
+
== $84/9D2D ? ==
  $86/8276 95 01       STA $01,[$00:03A1]  A:0064 X:03A0 Y:0003 P:eNvMxdizc
+
 
  $86/8278 C2 20      REP #$20                A:0064 X:03A0 Y:0003 P:eNvMxdizc
+
  $84/9CAB A5 01       LDA $01      ; Load number of Loop Runs to do
  $86/827A A5 0A       LDA $0A   [$00:000A]  A:0064 X:03A0 Y:0003 P:eNvmxdizc
+
  $84/9CAD C9 01      CMP #$01
  $86/827C 38          SEC                    A:0088 X:03A0 Y:0003 P:envmxdizc
+
$84/9CAF D0 15       BNE $15      ; [$9CC6] Branch if number of Loop Runs isn't one
  $86/827D ED 95 05    SBC $0595  [$8B:0595]  A:0088 X:03A0 Y:0003 P:envmxdizC
+
; Code is missing here
  $86/8280 C9 00 01   CMP #$0100             A:0078 X:03A0 Y:0003 P:envmxdizC
+
$84/9CC6 A0 03 00   LDY #$0003              A:0002 X:000E Y:AF2B P:envMxdizC
  $86/8283 90 05       BCC $05   [$828A]     A:0078 X:03A0 Y:0003 P:eNvmxdizc
+
  $84/9CC9 5A          PHY                    A:0002 X:000E Y:0003 P:envMxdizC
Code is missing here
+
  $84/9CCA 20 2D 9D    JSR $9D2D  [$84:9D2D]  A:0002 X:000E Y:0003 P:envMxdizC
  $86/828A E2 20      SEP #$20                A:0078 X:03A0 Y:0003 P:eNvmxdizc
+
  $84/9CCD A2 40 00   LDX #$0040    ; Number of Bytes to Load from VRAM
  $86/828C 95 00      STA $00,x  [$00:03A0]  A:0078 X:03A0 Y:0003 P:eNvMxdizc
+
$84/9CD0 22 E4 A0 80 JSL $80A0E4   ; Add Entry to the VRAM Read DMA Pipeline
  $86/828E EB         XBA                    A:0078 X:03A0 Y:0003 P:eNvMxdizc
+
  $84/9CD4 C2 21       REP #$21      ; 16-bit A, Clear Carry
  $86/828F 4A         LSR A                  A:7800 X:03A0 Y:0003 P:envMxdiZc
+
$84/9CD6 98          TYA          ; Transfer VRAM Destination in A
  $86/8290 66 28      ROR $28   [$00:0028]  A:7800 X:03A0 Y:0003 P:envMxdiZc
+
  $84/9CD7 69 00 01    ADC #$0100   ; Add #$0100
  $86/8292 80 09       BRA $09   [$829D]      A:7800 X:03A0 Y:0003 P:envMxdizc
+
$84/9CDA A8          TAY          ; Transfer back to Y (to use for the Read DMA)
Code is missing here
+
  $84/9CDB E2 20       SEP #$20     ; 8-bit A
  $86/829D A5 05       LDA $05   [$00:0005]  A:7800 X:03A0 Y:0003 P:envMxdizc
+
$84/9CDD 22 E4 A0 80 JSL $80A0E4  ; Add Entry to the VRAM Read DMA Pipeline
  $86/829F D0 16      BNE $16   [$82B7]      A:7801 X:03A0 Y:0003 P:envMxdizc
+
  $84/9CE1 7A          PLY                    A:0040 X:0040 Y:5180 P:eNvMxdizc
Code is missing here
+
  $84/9CE2 C8         INY                     A:0040 X:0040 Y:0003 P:envMxdizc
  $86/82B7 B1 23       LDA ($23),y[$8B:B5E2]  A:7801 X:03A0 Y:0003 P:envMxdizc
+
  $84/9CE3 C8          INY                    A:0040 X:0040 Y:0004 P:envMxdizc
  $86/82B9 18          CLC                    A:7800 X:03A0 Y:0003 P:envMxdiZc
+
  $84/9CE4 C6 01      DEC $01      ; Decrement Loop Counter
$86/82BA 65 08       ADC $08   [$00:0008]  A:7800 X:03A0 Y:0003 P:envMxdiZc
+
$84/9CE6 D0 E1       BNE $E1      ; [$9CC9] Loop
  $86/82BC 95 02      STA $02,x [$00:03A2]  A:7840 X:03A0 Y:0003 P:envMxdizc
+
  $84/9CE8 60          RTS
  $86/82BE 08         PHP                    A:7840 X:03A0 Y:0003 P:envMxdizc
+
 
  $86/82BF 51 23      EOR ($23),y[$8B:B5E2]  A:7840 X:03A0 Y:0003 P:envMxdizc
+
== $84/9D2D ? ==
  $86/82C1 29 10      AND #$10                A:7840 X:03A0 Y:0003 P:envMxdizc
+
 
$86/82C3 18          CLC                    A:7800 X:03A0 Y:0003 P:envMxdiZc
+
$84/9D2D C2 21       REP #$21               A:0002 X:000E Y:0003 P:envMxdizC
  $86/82C4 75 02       ADC $02,x  [$00:03A2]  A:7800 X:03A0 Y:0003 P:envMxdiZc
+
  $84/9D2F B1 20       LDA ($20),y[$8B:CA99]  A:0002 X:000E Y:0003 P:envmxdizc
  $86/82C6 95 02      STA $02,x  [$00:03A2]  A:7840 X:03A0 Y:0003 P:envMxdizc
+
  $84/9D31 29 FF 01    AND #$01FF              A:00A4 X:000E Y:0003 P:envmxdizc
  $86/82C8 C8          INY                    A:7840 X:03A0 Y:0003 P:envMxdizc
+
  $84/9D34 65 02       ADC $02   [$00:0002]  A:00A4 X:000E Y:0003 P:envmxdizc
  $86/82C9 B1 23      LDA ($23),y[$8B:B5E3]  A:7840 X:03A0 Y:0004 P:envMxdizc
+
  $84/9D36 85 06      STA $06    [$00:0006]  A:0108 X:000E Y:0003 P:envmxdizc
$86/82CB C8          INY                    A:7800 X:03A0 Y:0004 P:envMxdiZc
+
  $84/9D38 51 20      EOR ($20),y[$8B:CA99]  A:0108 X:000E Y:0003 P:envmxdizc
  $86/82CC 85 25       STA $25   [$00:0025]  A:7800 X:03A0 Y:0005 P:envMxdizc
+
  $84/9D3A 29 10 00    AND #$0010             A:01AC X:000E Y:0003 P:envmxdizc
  $86/82CE A5 06      LDA $06   [$00:0006]  A:7800 X:03A0 Y:0005 P:envMxdizc
+
$84/9D3D 18          CLC                    A:0000 X:000E Y:0003 P:envmxdiZc
  $86/82D0 29 0E      AND #$0E                A:7806 X:03A0 Y:0005 P:envMxdizc
+
  $84/9D3E 65 06       ADC $06   [$00:0006]   A:0000 X:000E Y:0003 P:envmxdiZc
  $86/82D2 F0 08       BEQ $08   [$82DC]     A:7806 X:03A0 Y:0005 P:envMxdizc
+
  $84/9D40 0A          ASL A                  A:0108 X:000E Y:0003 P:envmxdizc
  $86/82D4 EB          XBA                    A:7806 X:03A0 Y:0005 P:envMxdizc
+
  $84/9D41 0A          ASL A                  A:0210 X:000E Y:0003 P:envmxdizc
  $86/82D5 A9 0E      LDA #$0E                A:0678 X:03A0 Y:0005 P:envMxdizc
+
  $84/9D42 0A         ASL A                  A:0420 X:000E Y:0003 P:envmxdizc
  $86/82D7 14 25      TRB $25    [$00:0025]  A:060E X:03A0 Y:0005 P:envMxdizc
+
  $84/9D43 0A         ASL A                  A:0840 X:000E Y:0003 P:envmxdizc
  $86/82D9 EB          XBA                    A:060E X:03A0 Y:0005 P:envMxdiZc
+
  $84/9D44 C9 00 10   CMP #$1000              A:1080 X:000E Y:0003 P:envmxdizc
  $86/82DA 04 25       TSB $25   [$00:0025]   A:0E06 X:03A0 Y:0005 P:envMxdizc
+
  $84/9D47 90 0C       BCC $0C   [$9D55]      A:1080 X:000E Y:0003 P:envmxdizC
  $86/82DC A5 06       LDA $06   [$00:0006]  A:0E06 X:03A0 Y:0005 P:envMxdiZc
+
  $84/9D49 85 06       STA $06   [$00:0006]  A:1080 X:000E Y:0003 P:envmxdizC
  $86/82DE 29 C0      AND #$C0                A:0E06 X:03A0 Y:0005 P:envMxdizc
+
  $84/9D4B AD 88 05    LDA $0588    ; Load $2101 Buffer
  $86/82E0 45 25      EOR $25    [$00:0025]  A:0E00 X:03A0 Y:0005 P:envMxdiZc
+
$84/9D4E 29 18 00    AND #$0018   ; Exempt the Object Size
  $86/82E2 28         PLP                    A:0E06 X:03A0 Y:0005 P:envMxdizc
+
$84/9D51 EB          XBA                    A:0000 X:000E Y:0003 P:envmxdiZC
  $86/82E3 65 09      ADC $09    [$00:0009]  A:0E06 X:03A0 Y:0005 P:envMxdizc
+
$84/9D52 0A          ASL A                  A:0000 X:000E Y:0003 P:envmxdiZC
  $86/82E5 85 25       STA $25   [$00:0025]  A:0E06 X:03A0 Y:0005 P:envMxdizc
+
  $84/9D53 65 06       ADC $06    [$00:0006]  A:0000 X:000E Y:0003 P:envmxdiZc
  $86/82E7 A5 06      LDA $06    [$00:0006]  A:0E06 X:03A0 Y:0005 P:envMxdizc
+
  $84/9D55 85 06       STA $06   [$00:0006]  A:1080 X:000E Y:0003 P:envmxdizc
$86/82E9 29 30      AND #$30                A:0E06 X:03A0 Y:0005 P:envMxdizc
+
  $84/9D57 AD 88 05    LDA $0588    ; Load $2101 Buffer
$86/82EB D0 03      BNE $03    [$82F0]      A:0E00 X:03A0 Y:0005 P:envMxdiZc
+
  $84/9D5A 29 07 00   AND #$0007    ; Exempt the Object Size
  $86/82ED 20 61 83    JSR $8361 [$86:8361]  A:0E00 X:03A0 Y:0005 P:envMxdiZc
+
$84/9D5D 4A          LSR A                  A:0002 X:000E Y:0003 P:envmxdizc
 +
  $84/9D5E 6A         ROR A                  A:0001 X:000E Y:0003 P:envmxdizc
 +
  $84/9D5F 6A          ROR A                  A:0000 X:000E Y:0003 P:envmxdiZC
 +
  $84/9D60 6A          ROR A                   A:8000 X:000E Y:0003 P:eNvmxdizc
 +
  $84/9D61 65 06       ADC $06    [$00:0006]  A:4000 X:000E Y:0003 P:envmxdizc
 +
  $84/9D63 A8          TAY                    A:5080 X:000E Y:0003 P:envmxdizc
 +
  $84/9D64 E2 20      SEP #$20                A:5080 X:000E Y:5080 P:envmxdizc
 +
  $84/9D66 60          RTS                    A:5080 X:000E Y:5080 P:envMxdizc
 +
 
 +
== $84/9E13 ? ==
 +
 
 +
  $84/9E13 85 02       STA $02   [$00:0002]  A:000F X:0016 Y:89B4 P:envmxdizc
 +
  $84/9E15 29 3C 00   AND #$003C              A:000F X:0016 Y:89B4 P:envmxdizc
 +
  $84/9E18 18          CLC                    A:000C X:0016 Y:89B4 P:envmxdizc
 +
  $84/9E19 65 02       ADC $02   [$00:0002]   A:000C X:0016 Y:89B4 P:envmxdizc
 +
  $84/9E1B EB          XBA                    A:001B X:0016 Y:89B4 P:envmxdizc
 +
  $84/9E1C 4A          LSR A                  A:1B00 X:0016 Y:89B4 P:envmxdiZc
 +
  $84/9E1D 4A          LSR A                  A:0D80 X:0016 Y:89B4 P:envmxdizc
 +
  $84/9E1E C9 00 10    CMP #$1000              A:06C0 X:0016 Y:89B4 P:envmxdizc
 +
  $84/9E21 90 0C       BCC $0C   [$9E2F]     A:06C0 X:0016 Y:89B4 P:eNvmxdizc
 +
; Code is missing here
 +
  $84/9E2F 85 02       STA $02   [$00:0002]  A:06C0 X:0016 Y:89B4 P:eNvmxdizc
 +
  $84/9E31 AD 88 05    LDA $0588    ; Load $2101 Buffer
 +
$84/9E34 29 07 00    AND #$0007    ; Exempt the Object Size
 +
$84/9E37 4A          LSR A                  A:0002 X:0016 Y:89B4 P:envmxdizc
 +
  $84/9E38 6A          ROR A                  A:0001 X:0016 Y:89B4 P:envmxdizc
 +
  $84/9E39 6A         ROR A                  A:0000 X:0016 Y:89B4 P:envmxdiZC
 +
  $84/9E3A 6A          ROR A                  A:8000 X:0016 Y:89B4 P:eNvmxdizc
 +
  $84/9E3B 65 02       ADC $02   [$00:0002]  A:4000 X:0016 Y:89B4 P:envmxdizc
 +
  $84/9E3D 60          RTS                    A:46C0 X:0016 Y:89B4 P:envmxdizc
 +
 
 +
== $84/B98A Battle figure moving animation? ==
 +
 
 +
This is executed in the title screen demo, when the soldier jumps over the gap and beats the archeress(?)
 +
 
 +
This executes an VRAM DMA - I can imagine this is the graphics update for a marching game figure animation.
 +
 
 +
There are some values to this subroutine carried in before it is called:
 +
 
 +
A contains some Index for a table at $84/BA03 ($0002:3A03)
 +
 
 +
Y contains the VRAM destination address
 +
 
 +
$20 to $22 contains an offset for the DMA Source Address
 +
 
 +
$84/B98A 8B          PHB          ; Preserve Data Bank on Stack
 +
  $84/B98B 4B          PHK          ; Change Data Bank to $84
 +
  $84/B98C AB          PLB
 +
$84/B98D D4 00      PEI ($00)    ; Push current content of $00 on stack
 +
$84/B98F D4 02      PEI ($02)    ; Push current content of $02 on stack
 +
$84/B991 D4 0C      PEI ($0C)    ; Push current content of $0C on stack
 +
$84/B993 D4 0E      PEI ($0E)    ; Push current content of $0E on stack
 +
$84/B995 09 00      ORA #$00      ; Set the "focus" of the flag register back on the Accumulator???
 +
$84/B997 10 0A      BPL $0A      ; [$B9A3] Branch if A value is between #$00 and #$7F
 +
$84/B999 29 7F      AND #$7F      ; If not, remove the MSB anyways
 +
$84/B99B 85 00      STA $00      ; Store Original A minus MSB in $00
 +
$84/B99D A9 02      LDA #$02      ; Set up a counter for left/right side of the  graphic
 +
$84/B99F 85 01      STA $01      ; Yeah, I wouldn't understand that comment, too
 +
$84/B9A1 80 04      BRA $04      ; [$B9A7]
 +
Code is missing here
 +
$84/B9A7 84 02      STY $02      ; Buffer VRAM destination in $02
 +
$84/B9A9 A2 40 00