NBA Jam Tournament Edition (SNES)/ROM map/Graphic decompression routine

From Data Crystal
< NBA Jam Tournament Edition (SNES)‎ | ROM map
Revision as of 05:23, 19 October 2018 by Phonymike (talk | contribs) (added subpage)
Jump to navigation Jump to search

This is a sub-page of NBA Jam Tournament Edition (SNES)/ROM map.

Note for template.png
Note:
The code below may not be commented perfectly. I was trying to grasp how it worked, and I commented as I went. Eventually I was able to write this into C code and I stopped adding/cleaning up comments. If something doesn't look right, it's probably my mistake.


Commented decompression routine

$26/FC03 22 39 F0 89 JSL $89F039[$89:F039]   A:8001 X:0000 Y:0000 D:0000 DB:00 S:05FC P:envmXdIzC HC:1190 VC:261 FC:17 I:00

========================================================
load pointer to Acclaim logo 2C:A3D0 and dest of 7F:0000
========================================================
$89/F039 E2 10       SEP #$10                A:8001 X:0000 Y:0000 D:0000 DB:00 S:05F9 P:envmXdIzC HC:1254 VC:261 FC:17 I:00
$89/F03B E2 20       SEP #$20                A:8001 X:0000 Y:0000 D:0000 DB:00 S:05F9 P:envmXdIzC HC:1284 VC:261 FC:17 I:00
$89/F03D A9 8F       LDA #$8F                A:8001 X:0000 Y:0000 D:0000 DB:00 S:05F9 P:envMXdIzC HC:1314 VC:261 FC:17 I:00
$89/F03F 8D 00 21    STA $2100  [$00:2100]   A:808F X:0000 Y:0000 D:0000 DB:00 S:05F9 P:eNvMXdIzC HC:1338 VC:261 FC:17 I:00
$89/F042 C2 20       REP #$20                A:808F X:0000 Y:0000 D:0000 DB:00 S:05F9 P:eNvMXdIzC HC:0012 VC:000 FC:17 I:00
$89/F044 A9 D0 A3    LDA #$A3D0              A:808F X:0000 Y:0000 D:0000 DB:00 S:05F9 P:eNvmXdIzC HC:0042 VC:000 FC:17 I:00
$89/F047 85 D8       STA $D8    [$00:00D8]   A:A3D0 X:0000 Y:0000 D:0000 DB:00 S:05F9 P:eNvmXdIzC HC:0074 VC:000 FC:17 I:00
$89/F049 A9 A3 2C    LDA #$2CA3              A:A3D0 X:0000 Y:0000 D:0000 DB:00 S:05F9 P:eNvmXdIzC HC:0114 VC:000 FC:17 I:00
$89/F04C 85 D9       STA $D9    [$00:00D9]   A:2CA3 X:0000 Y:0000 D:0000 DB:00 S:05F9 P:envmXdIzC HC:0146 VC:000 FC:17 I:00
$89/F04E A9 00 00    LDA #$0000              A:2CA3 X:0000 Y:0000 D:0000 DB:00 S:05F9 P:envmXdIzC HC:0186 VC:000 FC:17 I:00
$89/F051 85 DB       STA $DB    [$00:00DB]   A:0000 X:0000 Y:0000 D:0000 DB:00 S:05F9 P:envmXdIZC HC:0218 VC:000 FC:17 I:00
$89/F053 A9 00 7F    LDA #$7F00              A:0000 X:0000 Y:0000 D:0000 DB:00 S:05F9 P:envmXdIZC HC:0258 VC:000 FC:17 I:00
$89/F056 85 DC       STA $DC    [$00:00DC]   A:7F00 X:0000 Y:0000 D:0000 DB:00 S:05F9 P:envmXdIzC HC:0290 VC:000 FC:17 I:00
$89/F058 22 00 80 A9 JSL $A98000[$A9:8000]   A:7F00 X:0000 Y:0000 D:0000 DB:00 S:05F9 P:envmXdIzC HC:0330 VC:000 FC:17 I:00

================================
*start of decompression routine*
================================
$A9/8000 08          PHP                     A:7F00 X:0000 Y:0000 D:0000 DB:00 S:05F6 P:envmXdIzC HC:0394 VC:000 FC:17 I:00
$A9/8001 8B          PHB                     A:7F00 X:0000 Y:0000 D:0000 DB:00 S:05F5 P:envmXdIzC HC:0424 VC:000 FC:17 I:00
$A9/8002 A5 DA       LDA $DA    [$00:00DA]   A:7F00 X:0000 Y:0000 D:0000 DB:00 S:05F4 P:envmXdIzC HC:0454 VC:000 FC:17 I:00
$A9/8004 85 EA       STA $EA    [$00:00EA]   A:002C X:0000 Y:0000 D:0000 DB:00 S:05F4 P:envmXdIzC HC:0494 VC:000 FC:17 I:00
$A9/8006 85 ED       STA $ED    [$00:00ED]   A:002C X:0000 Y:0000 D:0000 DB:00 S:05F4 P:envmXdIzC HC:0534 VC:000 FC:17 I:00
$A9/8008 C2 30       REP #$30                A:002C X:0000 Y:0000 D:0000 DB:00 S:05F4 P:envmXdIzC HC:0614 VC:000 FC:17 I:00
$A9/800A 64 E2       STZ $E2    [$00:00E2]   A:002C X:0000 Y:0000 D:0000 DB:00 S:05F4 P:envmxdIzC HC:0644 VC:000 FC:17 I:00

===========================
get size of compressed data
===========================
$A9/800C A7 D8       LDA [$D8]  [$2C:A3D0]   A:002C X:0000 Y:0000 D:0000 DB:00 S:05F4 P:envmxdIzC HC:0708 VC:000 FC:17 I:00
$A9/800E A8          TAY                     A:0801 X:0000 Y:0000 D:0000 DB:00 S:05F4 P:envmxdIzC HC:0772 VC:000 FC:17 I:00

=======================================
set pointer to start of compressed data
=======================================
$A9/800F B7 D8       LDA [$D8],y[$2C:ABD1]   A:0801 X:0000 Y:0801 D:0000 DB:00 S:05F4 P:envmxdIzC HC:0818 VC:000 FC:17 I:00
$A9/8011 85 E6       STA $E6    [$00:00E6]   A:0E70 X:0000 Y:0801 D:0000 DB:00 S:05F4 P:envmxdIzC HC:0882 VC:000 FC:17 I:00
$A9/8013 18          CLC                     A:0E70 X:0000 Y:0801 D:0000 DB:00 S:05F4 P:envmxdIzC HC:0922 VC:000 FC:17 I:00
$A9/8014 65 DB       ADC $DB    [$00:00DB]   A:0E70 X:0000 Y:0801 D:0000 DB:00 S:05F4 P:envmxdIzc HC:0944 VC:000 FC:17 I:00
$A9/8016 85 EE       STA $EE    [$00:00EE]   A:0E70 X:0000 Y:0801 D:0000 DB:00 S:05F4 P:envmxdIzc HC:0984 VC:000 FC:17 I:00
$A9/8018 88          DEY                     A:0E70 X:0000 Y:0801 D:0000 DB:00 S:05F4 P:envmxdIzc HC:1024 VC:000 FC:17 I:00

===========================
get compression key pointer
===========================
$A9/8019 E2 20       SEP #$20                A:0E70 X:0000 Y:0800 D:0000 DB:00 S:05F4 P:envmxdIzc HC:1046 VC:000 FC:17 I:00
$A9/801B B7 D8       LDA [$D8],y[$2C:ABD0]   A:0E70 X:0000 Y:0800 D:0000 DB:00 S:05F4 P:envMxdIzc HC:1100 VC:000 FC:17 I:00
$A9/801D 85 DE       STA $DE    [$00:00DE]   A:0E01 X:0000 Y:0800 D:0000 DB:00 S:05F4 P:envMxdIzc HC:1156 VC:000 FC:17 I:00
$A9/801F 88          DEY                     A:0E01 X:0000 Y:0800 D:0000 DB:00 S:05F4 P:envMxdIzc HC:1188 VC:000 FC:17 I:00

==========================
load first unkeyed command
==========================
$A9/8020 B7 D8       LDA [$D8],y[$2C:ABCF]   A:0E01 X:0000 Y:07FF D:0000 DB:00 S:05F4 P:envMxdIzc HC:1234 VC:000 FC:17 I:00
$A9/8022 85 E0       STA $E0    [$00:00E0]   A:0E80 X:0000 Y:07FF D:0000 DB:00 S:05F4 P:eNvMxdIzc HC:1290 VC:000 FC:17 I:00

=================
set dest pointers
=================
$A9/8024 C2 20       REP #$20                A:0E80 X:0000 Y:07FF D:0000 DB:00 S:05F4 P:eNvMxdIzc HC:1322 VC:000 FC:17 I:00
$A9/8026 98          TYA                     A:0E80 X:0000 Y:07FF D:0000 DB:00 S:05F4 P:eNvmxdIzc HC:1352 VC:000 FC:17 I:00
$A9/8027 18          CLC                     A:07FF X:0000 Y:07FF D:0000 DB:00 S:05F4 P:envmxdIzc HC:0010 VC:001 FC:18 I:00
$A9/8028 65 D8       ADC $D8    [$00:00D8]   A:07FF X:0000 Y:07FF D:0000 DB:00 S:05F4 P:envmxdIzc HC:0032 VC:001 FC:18 I:00
$A9/802A 3A          DEC A                   A:ABCF X:0000 Y:07FF D:0000 DB:00 S:05F4 P:eNvmxdIzc HC:0072 VC:001 FC:18 I:00
$A9/802B 85 E8       STA $E8    [$00:00E8]   A:ABCE X:0000 Y:07FF D:0000 DB:00 S:05F4 P:eNvmxdIzc HC:0094 VC:001 FC:18 I:00
$A9/802D 85 EB       STA $EB    [$00:00EB]   A:ABCE X:0000 Y:07FF D:0000 DB:00 S:05F4 P:eNvmxdIzc HC:0134 VC:001 FC:18 I:00

==============
set bank to 7F
==============
$A9/802F E2 30       SEP #$30                A:ABCE X:0000 Y:07FF D:0000 DB:00 S:05F4 P:eNvmxdIzc HC:0174 VC:001 FC:18 I:00
$A9/8031 A6 DD       LDX $DD    [$00:00DD]   A:ABCE X:0000 Y:00FF D:0000 DB:00 S:05F4 P:eNvMXdIzc HC:0204 VC:001 FC:18 I:00
$A9/8033 DA          PHX                     A:ABCE X:007F Y:00FF D:0000 DB:00 S:05F4 P:envMXdIzc HC:0236 VC:001 FC:18 I:00
$A9/8034 AB          PLB                     A:ABCE X:007F Y:00FF D:0000 DB:00 S:05F3 P:envMXdIzc HC:0266 VC:001 FC:18 I:00

======================================
make sure decompression key isn't zero
======================================
$A9/8035 A6 DE       LDX $DE    [$00:00DE]   A:ABCE X:007F Y:00FF D:0000 DB:7F S:05F4 P:envMXdIzc HC:0302 VC:001 FC:18 I:00
$A9/8037 D0 06       BNE $06    [$803F]      A:ABCE X:0001 Y:00FF D:0000 DB:7F S:05F4 P:envMXdIzc HC:0334 VC:001 FC:18 I:00
$A9/8039 A9 80       LDA #$80                A:ABCE X:0000 Y:00FF D:0000 DB:7F S:05F4 P:envMXdIZc HC:0374 VC:001 FC:18 I:00
$A9/803B 85 E0       STA $E0    [$00:00E0]   A:AB80 X:0000 Y:00FF D:0000 DB:7F S:05F4 P:eNvMXdIzc HC:0406 VC:001 FC:18 I:00
$A9/803D 80 1C       BRA $1C    [$805B]      A:AB80 X:0000 Y:00FF D:0000 DB:7F S:05F4 P:eNvMXdIzc HC:0446 VC:001 FC:18 I:00
$A9/803F CA          DEX                     A:ABCE X:0001 Y:00FF D:0000 DB:7F S:05F4 P:envMXdIzc HC:0364 VC:001 FC:18 I:00

==============================================
load decompression key pointer, get key (0x80)
==============================================
$A9/8040 BF 83 82 29 LDA $298283,x[$29:8283] A:ABCE X:0000 Y:00FF D:0000 DB:7F S:05F4 P:envMXdIZc HC:0386 VC:001 FC:18 I:00
$A9/8044 85 F4       STA $F4    [$00:00F4]   A:AB80 X:0000 Y:00FF D:0000 DB:7F S:05F4 P:eNvMXdIzc HC:0434 VC:001 FC:18 I:00

===============================================
merge key into first command byte (result 0xC0)
===============================================
$A9/8046 A5 E0       LDA $E0    [$00:00E0]   A:AB80 X:0000 Y:00FF D:0000 DB:7F S:05F4 P:eNvMXdIzc HC:0466 VC:001 FC:18 I:00
$A9/8048 0A          ASL A                   A:AB80 X:0000 Y:00FF D:0000 DB:7F S:05F4 P:eNvMXdIzc HC:0498 VC:001 FC:18 I:00
$A9/8049 05 F4       ORA $F4    [$00:00F4]   A:AB00 X:0000 Y:00FF D:0000 DB:7F S:05F4 P:envMXdIZC HC:0520 VC:001 FC:18 I:00
$A9/804B 6A          ROR A                   A:AB80 X:0000 Y:00FF D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:0592 VC:001 FC:18 I:00
$A9/804C 85 E0       STA $E0    [$00:00E0]   A:ABC0 X:0000 Y:00FF D:0000 DB:7F S:05F4 P:eNvMXdIzc HC:0614 VC:001 FC:18 I:00


===========================================
*initial decompression sequence (run once)*
===========================================
$A9/804E C2 20       REP #$20                A:ABC0 X:0000 Y:00FF D:0000 DB:7F S:05F4 P:eNvMXdIzc HC:0646 VC:001 FC:18 I:00
$A9/8050 A9 00 00    LDA #$0000              A:ABC0 X:0000 Y:00FF D:0000 DB:7F S:05F4 P:eNvmXdIzc HC:0676 VC:001 FC:18 I:00
$A9/8053 E2 20       SEP #$20                A:0000 X:0000 Y:00FF D:0000 DB:7F S:05F4 P:envmXdIZc HC:0708 VC:001 FC:18 I:00
$A9/8055 26 E0       ROL $E0    [$00:00E0]   A:0000 X:0000 Y:00FF D:0000 DB:7F S:05F4 P:envMXdIZc HC:0738 VC:001 FC:18 I:00
$A9/8057 2A          ROL A                   A:0000 X:0000 Y:00FF D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:0784 VC:001 FC:18 I:00
$A9/8058 A8          TAY                     A:0001 X:0000 Y:00FF D:0000 DB:7F S:05F4 P:envMXdIzc HC:0806 VC:001 FC:18 I:00
$A9/8059 80 1C       BRA $1C    [$8077]      A:0001 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0828 VC:001 FC:18 I:00


===================================================
*main decompression sequence (run each time after)*
===================================================
--------------------------
read next bit into A and Y
--------------------------
$A9/805B C2 20       REP #$20                A:000F X:0000 Y:0002 D:0000 DB:7F S:05F4 P:eNvMXdIzc HC:0746 VC:007 FC:18 I:00
$A9/805D A9 00 00    LDA #$0000              A:000F X:0000 Y:0002 D:0000 DB:7F S:05F4 P:eNvmXdIzc HC:0776 VC:007 FC:18 I:00
$A9/8060 E2 20       SEP #$20                A:0000 X:0000 Y:0002 D:0000 DB:7F S:05F4 P:envmXdIZc HC:0808 VC:007 FC:18 I:00
$A9/8062 06 E0       ASL $E0    [$00:00E0]   A:0000 X:0000 Y:0002 D:0000 DB:7F S:05F4 P:envMXdIZc HC:0838 VC:007 FC:18 I:00
$A9/8064 D0 0F       BNE $0F    [$8075]      A:0000 X:0000 Y:0002 D:0000 DB:7F S:05F4 P:envMXdIZC HC:0884 VC:007 FC:18 I:00
$A9/8066 A7 E8       LDA [$E8]  [$2C:ABBF]   A:0000 X:0000 Y:0002 D:0000 DB:7F S:05F4 P:envMXdIZC HC:0932 VC:007 FC:18 I:00
$A9/8068 2A          ROL A                   A:00E4 X:0000 Y:0002 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:0988 VC:007 FC:18 I:00
$A9/8069 85 E0       STA $E0    [$00:00E0]   A:00C9 X:0000 Y:0002 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:1010 VC:007 FC:18 I:00
$A9/806B A5 E8       LDA $E8    [$00:00E8]   A:00C9 X:0000 Y:0002 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:1042 VC:007 FC:18 I:00
$A9/806D D0 02       BNE $02    [$8071]      A:00BF X:0000 Y:0002 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:1074 VC:007 FC:18 I:00
$A9/8071 C6 E8       DEC $E8    [$00:00E8]   A:00BF X:0000 Y:0002 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:1104 VC:007 FC:18 I:00
$A9/8073 A9 00       LDA #$00                A:00BF X:0000 Y:0002 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:1150 VC:007 FC:18 I:00
$A9/8075 2A          ROL A                   A:0000 X:0000 Y:0002 D:0000 DB:7F S:05F4 P:envMXdIZC HC:1174 VC:007 FC:18 I:00
$A9/8076 A8          TAY                     A:0001 X:0000 Y:0002 D:0000 DB:7F S:05F4 P:envMXdIzc HC:1196 VC:007 FC:18 I:00

======================
test first command bit
======================
$A9/8077 D0 03       BNE $03    [$807C]      A:0001 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0858 VC:001 FC:18 I:00
$A9/8079 4C 3D 81    JMP $813D  [$A9:813D]   A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIZc HC:0942 VC:034 FC:18 I:00

==================================================
first bit is high, read next two bits into A and Y
==================================================
$A9/807C C2 20       REP #$20                A:0001 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0888 VC:001 FC:18 I:00
$A9/807E A9 00 00    LDA #$0000              A:0001 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envmXdIzc HC:0918 VC:001 FC:18 I:00
$A9/8081 E2 20       SEP #$20                A:0000 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envmXdIZc HC:0950 VC:001 FC:18 I:00
$A9/8083 06 E0       ASL $E0    [$00:00E0]   A:0000 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIZc HC:0980 VC:001 FC:18 I:00
$A9/8085 D0 0F       BNE $0F    [$8096]      A:0000 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIZC HC:1026 VC:001 FC:18 I:00
$A9/8087 A7 E8       LDA [$E8]  [$2C:ABCE]   A:0000 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIZC HC:1074 VC:001 FC:18 I:00
$A9/8089 2A          ROL A                   A:00D3 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:1130 VC:001 FC:18 I:00
$A9/808A 85 E0       STA $E0    [$00:00E0]   A:00A7 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:1152 VC:001 FC:18 I:00
$A9/808C A5 E8       LDA $E8    [$00:00E8]   A:00A7 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:1184 VC:001 FC:18 I:00
$A9/808E D0 02       BNE $02    [$8092]      A:00CE X:0000 Y:0001 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:1216 VC:001 FC:18 I:00
$A9/8092 C6 E8       DEC $E8    [$00:00E8]   A:00CE X:0000 Y:0001 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:1246 VC:001 FC:18 I:00
$A9/8094 A9 00       LDA #$00                A:00CE X:0000 Y:0001 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:1292 VC:001 FC:18 I:00
$A9/8096 2A          ROL A                   A:0000 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIZC HC:1316 VC:001 FC:18 I:00

$A9/8097 06 E0       ASL $E0    [$00:00E0]   A:0001 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:1338 VC:001 FC:18 I:00
$A9/8099 D0 0F       BNE $0F    [$80AA]      A:0001 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzC HC:0020 VC:002 FC:18 I:00
$A9/809B A8          TAY                     A:0001 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIZC HC:0840 VC:029 FC:18 I:00
$A9/809C A7 E8       LDA [$E8]  [$2C:ABA1]   A:0001 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzC HC:0886 VC:029 FC:18 I:00
$A9/809E 2A          ROL A                   A:008A X:0000 Y:0001 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:0942 VC:029 FC:18 I:00
$A9/809F 85 E0       STA $E0    [$00:00E0]   A:0015 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzC HC:0964 VC:029 FC:18 I:00
$A9/80A1 A5 E8       LDA $E8    [$00:00E8]   A:0015 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzC HC:0996 VC:029 FC:18 I:00
$A9/80A3 D0 02       BNE $02    [$80A7]      A:00A1 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:1028 VC:029 FC:18 I:00
$A9/80A7 C6 E8       DEC $E8    [$00:00E8]   A:00A1 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:1058 VC:029 FC:18 I:00
$A9/80A9 98          TYA                     A:00A1 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:1104 VC:029 FC:18 I:00
$A9/80AA 2A          ROL A                   A:0001 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzC HC:0050 VC:002 FC:18 I:00
$A9/80AB A8          TAY                     A:0003 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0072 VC:002 FC:18 I:00

=====================
branch if less than 3
=====================
$A9/80AC C9 03       CMP #$03                A:0003 X:0000 Y:0003 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0094 VC:002 FC:18 I:00
$A9/80AE 90 45       BCC $45    [$80F5]      A:0003 X:0000 Y:0003 D:0000 DB:7F S:05F4 P:envMXdIZC HC:0118 VC:002 FC:18 I:00


===================================================
COMMAND CODE 111: read 4, 8, or 16 bit count, add 4
===================================================
direct copy bytes
then copy previous?

111 Lx count
 |  |  |
 |  |  |
 |  |  4, 8, or 16 bits
 |  Length bit
 copy following bytes
 
L:0 = 4 bit count:CCCC
L:10 = 8 bit count:CCCCCCC
L:11 = 16 bit count:CCCCCCCCCCCCCC

---------------------------
read next bit into A and Y
---------------------------
$A9/80B0 C2 20       REP #$20                A:0003 X:0000 Y:0003 D:0000 DB:7F S:05F4 P:envMXdIZC HC:0142 VC:002 FC:18 I:00
$A9/80B2 A9 00 00    LDA #$0000              A:0003 X:0000 Y:0003 D:0000 DB:7F S:05F4 P:envmXdIZC HC:0172 VC:002 FC:18 I:00
$A9/80B5 E2 20       SEP #$20                A:0000 X:0000 Y:0003 D:0000 DB:7F S:05F4 P:envmXdIZC HC:0204 VC:002 FC:18 I:00
$A9/80B7 06 E0       ASL $E0    [$00:00E0]   A:0000 X:0000 Y:0003 D:0000 DB:7F S:05F4 P:envMXdIZC HC:0234 VC:002 FC:18 I:00
$A9/80B9 D0 0F       BNE $0F    [$80CA]      A:0000 X:0000 Y:0003 D:0000 DB:7F S:05F4 P:eNvMXdIzc HC:0280 VC:002 FC:18 I:00
$A9/80BB A7 E8       LDA [$E8]  [$2C:ABA7]   A:0000 X:0000 Y:0003 D:0000 DB:7F S:05F4 P:envMXdIZC HC:1038 VC:024 FC:18 I:00
$A9/80BD 2A          ROL A                   A:0004 X:0000 Y:0003 D:0000 DB:7F S:05F4 P:envMXdIzC HC:1094 VC:024 FC:18 I:00
$A9/80BE 85 E0       STA $E0    [$00:00E0]   A:0009 X:0000 Y:0003 D:0000 DB:7F S:05F4 P:envMXdIzc HC:1116 VC:024 FC:18 I:00
$A9/80C0 A5 E8       LDA $E8    [$00:00E8]   A:0009 X:0000 Y:0003 D:0000 DB:7F S:05F4 P:envMXdIzc HC:1148 VC:024 FC:18 I:00
$A9/80C2 D0 02       BNE $02    [$80C6]      A:00A7 X:0000 Y:0003 D:0000 DB:7F S:05F4 P:eNvMXdIzc HC:1180 VC:024 FC:18 I:00
$A9/80C6 C6 E8       DEC $E8    [$00:00E8]   A:00A7 X:0000 Y:0003 D:0000 DB:7F S:05F4 P:eNvMXdIzc HC:1210 VC:024 FC:18 I:00
$A9/80C8 A9 00       LDA #$00                A:00A7 X:0000 Y:0003 D:0000 DB:7F S:05F4 P:eNvMXdIzc HC:1256 VC:024 FC:18 I:00
$A9/80CA 2A          ROL A                   A:0000 X:0000 Y:0003 D:0000 DB:7F S:05F4 P:eNvMXdIzc HC:0310 VC:002 FC:18 I:00
$A9/80CB A8          TAY                     A:0000 X:0000 Y:0003 D:0000 DB:7F S:05F4 P:envMXdIZc HC:0332 VC:002 FC:18 I:00

===============
test length bit
===============
$A9/80CC F0 1D       BEQ $1D    [$80EB]      A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIZc HC:0354 VC:002 FC:18 I:00

=====================================
length bit is high, read 8 or 16 bits
=====================================
--------------------------
read next bit into A and Y
--------------------------
$A9/80CE C2 20       REP #$20                A:0001 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0844 VC:101 FC:18 I:00
$A9/80D0 A9 00 00    LDA #$0000              A:0001 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envmXdIzc HC:0874 VC:101 FC:18 I:00
$A9/80D3 E2 20       SEP #$20                A:0000 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envmXdIZc HC:0906 VC:101 FC:18 I:00
$A9/80D5 06 E0       ASL $E0    [$00:00E0]   A:0000 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIZc HC:0936 VC:101 FC:18 I:00
$A9/80D7 D0 0F       BNE $0F    [$80E8]      A:0000 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0982 VC:101 FC:18 I:00
$A9/80D9 A7 E8       LDA [$E8]  [$2C:AB66]   A:0000 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIZc HC:1030 VC:101 FC:18 I:00
$A9/80DB 2A          ROL A                   A:0079 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:1118 VC:101 FC:18 I:00
$A9/80DC 85 E0       STA $E0    [$00:00E0]   A:00F2 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:eNvMXdIzc HC:1148 VC:101 FC:18 I:00
$A9/80DE A5 E8       LDA $E8    [$00:00E8]   A:00F2 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:eNvMXdIzc HC:1188 VC:101 FC:18 I:00
$A9/80E0 D0 02       BNE $02    [$80E4]      A:0066 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:1228 VC:101 FC:18 I:00
$A9/80E4 C6 E8       DEC $E8    [$00:00E8]   A:0066 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:1266 VC:101 FC:18 I:00
$A9/80E6 A9 00       LDA #$00                A:0066 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:1320 VC:101 FC:18 I:00
$A9/80E8 2A          ROL A                   A:0000 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:1012 VC:101 FC:18 I:00
$A9/80E9 A8          TAY                     A:0000 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIZc HC:1034 VC:101 FC:18 I:00

=============================================
if bit is 10, read 8 bits, if 11 read 16 bits
=============================================
$A9/80EA 1A          INC A                   A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIZc HC:1056 VC:101 FC:18 I:00

=================================
length bit is 0, read next 4 bits
=================================
$A9/80EB A8          TAY                     A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIZc HC:0384 VC:002 FC:18 I:00
$A9/80EC 20 19 82    JSR $8219  [$A9:8219]   A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIZc HC:0406 VC:002 FC:18 I:00

===============
add 4 to number
===============
$A9/80EF C2 20       REP #$20                A:0009 X:00FF Y:0009 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0042 VC:003 FC:18 I:00
$A9/80F1 18          CLC                     A:0009 X:00FF Y:0009 D:0000 DB:7F S:05F4 P:envmXdIzc HC:0072 VC:003 FC:18 I:00
$A9/80F2 69 03 00    ADC #$0003              A:0009 X:00FF Y:0009 D:0000 DB:7F S:05F4 P:envmXdIzc HC:0094 VC:003 FC:18 I:00

$A9/80F5 1A          INC A                   A:000C X:00FF Y:0009 D:0000 DB:7F S:05F4 P:envmXdIzc HC:0126 VC:003 FC:18 I:00

====================
adjust dest pointers
====================
$A9/80F6 C2 20       REP #$20                A:000D X:00FF Y:0009 D:0000 DB:7F S:05F4 P:envmXdIzc HC:0148 VC:003 FC:18 I:00
$A9/80F8 85 E4       STA $E4    [$00:00E4]   A:000D X:00FF Y:0009 D:0000 DB:7F S:05F4 P:envmXdIzc HC:0178 VC:003 FC:18 I:00
$A9/80FA A5 E8       LDA $E8    [$00:00E8]   A:000D X:00FF Y:0009 D:0000 DB:7F S:05F4 P:envmXdIzc HC:0218 VC:003 FC:18 I:00
$A9/80FC 38          SEC                     A:ABCD X:00FF Y:0009 D:0000 DB:7F S:05F4 P:eNvmXdIzc HC:0258 VC:003 FC:18 I:00
$A9/80FD E5 E4       SBC $E4    [$00:00E4]   A:ABCD X:00FF Y:0009 D:0000 DB:7F S:05F4 P:eNvmXdIzC HC:0280 VC:003 FC:18 I:00
$A9/80FF 85 E8       STA $E8    [$00:00E8]   A:ABC0 X:00FF Y:0009 D:0000 DB:7F S:05F4 P:eNvmXdIzC HC:0320 VC:003 FC:18 I:00
$A9/8101 1A          INC A                   A:ABC0 X:00FF Y:0009 D:0000 DB:7F S:05F4 P:eNvmXdIzC HC:0360 VC:003 FC:18 I:00
$A9/8102 85 EB       STA $EB    [$00:00EB]   A:ABC1 X:00FF Y:0009 D:0000 DB:7F S:05F4 P:eNvmXdIzC HC:0382 VC:003 FC:18 I:00
$A9/8104 A5 EE       LDA $EE    [$00:00EE]   A:ABC1 X:00FF Y:0009 D:0000 DB:7F S:05F4 P:eNvmXdIzC HC:0422 VC:003 FC:18 I:00
$A9/8106 38          SEC                     A:0E70 X:00FF Y:0009 D:0000 DB:7F S:05F4 P:envmXdIzC HC:0462 VC:003 FC:18 I:00
$A9/8107 E5 E4       SBC $E4    [$00:00E4]   A:0E70 X:00FF Y:0009 D:0000 DB:7F S:05F4 P:envmXdIzC HC:0484 VC:003 FC:18 I:00
$A9/8109 85 EE       STA $EE    [$00:00EE]   A:0E63 X:00FF Y:0009 D:0000 DB:7F S:05F4 P:envmXdIzC HC:0524 VC:003 FC:18 I:00
$A9/810B C2 10       REP #$10                A:0E63 X:00FF Y:0009 D:0000 DB:7F S:05F4 P:envmXdIzC HC:0604 VC:003 FC:18 I:00
$A9/810D A0 00 00    LDY #$0000              A:0E63 X:00FF Y:0009 D:0000 DB:7F S:05F4 P:envmxdIzC HC:0634 VC:003 FC:18 I:00
$A9/8110 A5 E4       LDA $E4    [$00:00E4]   A:0E63 X:00FF Y:0000 D:0000 DB:7F S:05F4 P:envmxdIZC HC:0666 VC:003 FC:18 I:00

=====================================
test for even number of bytes to copy
=====================================
$A9/8112 4A          LSR A                   A:000D X:00FF Y:0000 D:0000 DB:7F S:05F4 P:envmxdIzC HC:0706 VC:003 FC:18 I:00
$A9/8113 AA          TAX                     A:0006 X:00FF Y:0000 D:0000 DB:7F S:05F4 P:envmxdIzC HC:0728 VC:003 FC:18 I:00
$A9/8114 90 0E       BCC $0E    [$8124]      A:0006 X:0006 Y:0000 D:0000 DB:7F S:05F4 P:envmxdIzC HC:0750 VC:003 FC:18 I:00

===========
copy 1 byte
===========
$A9/8116 E2 20       SEP #$20                A:0006 X:0006 Y:0000 D:0000 DB:7F S:05F4 P:envmxdIzC HC:0774 VC:003 FC:18 I:00
$A9/8118 B7 EB       LDA [$EB],y[$2C:ABC1]   A:0006 X:0006 Y:0000 D:0000 DB:7F S:05F4 P:envMxdIzC HC:0828 VC:003 FC:18 I:00
$A9/811A 91 EE       STA ($EE),y[$7F:0E63]   A:0000 X:0006 Y:0000 D:0000 DB:7F S:05F4 P:envMxdIZC HC:0900 VC:003 FC:18 I:00

$A9/811C C2 20       REP #$20                A:0000 X:0006 Y:0000 D:0000 DB:7F S:05F4 P:envMxdIZC HC:0954 VC:003 FC:18 I:00
$A9/811E E0 00 00    CPX #$0000              A:0000 X:0006 Y:0000 D:0000 DB:7F S:05F4 P:envmxdIZC HC:0984 VC:003 FC:18 I:00
$A9/8121 F0 0A       BEQ $0A    [$812D]      A:0000 X:0006 Y:0000 D:0000 DB:7F S:05F4 P:envmxdIzC HC:1016 VC:003 FC:18 I:00
$A9/8123 C8          INY                     A:0000 X:0006 Y:0000 D:0000 DB:7F S:05F4 P:envmxdIzC HC:1040 VC:003 FC:18 I:00

=====================
copy 1 word at a time
=====================
$A9/8124 B7 EB       LDA [$EB],y[$2C:ABC2]   A:0000 X:0006 Y:0001 D:0000 DB:7F S:05F4 P:envmxdIzC HC:1086 VC:003 FC:18 I:00
$A9/8126 91 EE       STA ($EE),y[$7F:0E64]   A:005F X:0006 Y:0001 D:0000 DB:7F S:05F4 P:envmxdIzC HC:1166 VC:003 FC:18 I:00
$A9/8128 C8          INY                     A:005F X:0006 Y:0001 D:0000 DB:7F S:05F4 P:envmxdIzC HC:1228 VC:003 FC:18 I:00
$A9/8129 C8          INY                     A:005F X:0006 Y:0002 D:0000 DB:7F S:05F4 P:envmxdIzC HC:1250 VC:003 FC:18 I:00
$A9/812A CA          DEX                     A:005F X:0006 Y:0003 D:0000 DB:7F S:05F4 P:envmxdIzC HC:1272 VC:003 FC:18 I:00
$A9/812B D0 F7       BNE $F7    [$8124]      A:005F X:0005 Y:0003 D:0000 DB:7F S:05F4 P:envmxdIzC HC:1294 VC:003 FC:18 I:00

$A9/812D A5 E4       LDA $E4    [$00:00E4]   A:0063 X:0000 Y:000D D:0000 DB:7F S:05F4 P:envmxdIZC HC:1304 VC:004 FC:18 I:00
$A9/812F 18          CLC                     A:000D X:0000 Y:000D D:0000 DB:7F S:05F4 P:envmxdIzC HC:1344 VC:004 FC:18 I:00
$A9/8130 65 E2       ADC $E2    [$00:00E2]   A:000D X:0000 Y:000D D:0000 DB:7F S:05F4 P:envmxdIzc HC:1366 VC:004 FC:18 I:00
$A9/8132 C5 E6       CMP $E6    [$00:00E6]   A:000D X:0000 Y:000D D:0000 DB:7F S:05F4 P:envmxdIzc HC:0042 VC:005 FC:18 I:00
$A9/8134 90 03       BCC $03    [$8139]      A:000D X:0000 Y:000D D:0000 DB:7F S:05F4 P:eNvmxdIzc HC:0082 VC:005 FC:18 I:00
$A9/8139 85 E2       STA $E2    [$00:00E2]   A:000D X:0000 Y:000D D:0000 DB:7F S:05F4 P:eNvmxdIzc HC:0112 VC:005 FC:18 I:00
$A9/813B E2 30       SEP #$30                A:000D X:0000 Y:000D D:0000 DB:7F S:05F4 P:eNvmxdIzc HC:0152 VC:005 FC:18 I:00


=========================
backstep and copy command
=========================
--------------------------
read next bit into A and Y
--------------------------
code 0
$A9/813D C2 20       REP #$20                A:000D X:0000 Y:000D D:0000 DB:7F S:05F4 P:eNvMXdIzc HC:0182 VC:005 FC:18 I:00
$A9/813F A9 00 00    LDA #$0000              A:000D X:0000 Y:000D D:0000 DB:7F S:05F4 P:eNvmXdIzc HC:0212 VC:005 FC:18 I:00
$A9/8142 E2 20       SEP #$20                A:0000 X:0000 Y:000D D:0000 DB:7F S:05F4 P:envmXdIZc HC:0244 VC:005 FC:18 I:00
$A9/8144 06 E0       ASL $E0    [$00:00E0]   A:0000 X:0000 Y:000D D:0000 DB:7F S:05F4 P:envMXdIZc HC:0274 VC:005 FC:18 I:00
$A9/8146 D0 0F       BNE $0F    [$8157]      A:0000 X:0000 Y:000D D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:0320 VC:005 FC:18 I:00
$A9/8148 A7 E8       LDA [$E8]  [$2C:ABB6]   A:0000 X:0000 Y:0008 D:0000 DB:7F S:05F4 P:envMXdIZC HC:1018 VC:010 FC:18 I:00
$A9/814A 2A          ROL A                   A:0080 X:0000 Y:0008 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:1074 VC:010 FC:18 I:00
$A9/814B 85 E0       STA $E0    [$00:00E0]   A:0001 X:0000 Y:0008 D:0000 DB:7F S:05F4 P:envMXdIzC HC:1096 VC:010 FC:18 I:00
$A9/814D A5 E8       LDA $E8    [$00:00E8]   A:0001 X:0000 Y:0008 D:0000 DB:7F S:05F4 P:envMXdIzC HC:1128 VC:010 FC:18 I:00
$A9/814F D0 02       BNE $02    [$8153]      A:00B6 X:0000 Y:0008 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:1160 VC:010 FC:18 I:00
$A9/8153 C6 E8       DEC $E8    [$00:00E8]   A:00B6 X:0000 Y:0008 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:1190 VC:010 FC:18 I:00
$A9/8155 A9 00       LDA #$00                A:00B6 X:0000 Y:0008 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:1236 VC:010 FC:18 I:00
$A9/8157 2A          ROL A                   A:0000 X:0000 Y:000D D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:0350 VC:005 FC:18 I:00
$A9/8158 A8          TAY                     A:0001 X:0000 Y:000D D:0000 DB:7F S:05F4 P:envMXdIzc HC:0372 VC:005 FC:18 I:00

======================
test first command bit
======================
$A9/8159 F0 0B       BEQ $0B    [$8166]      A:0001 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0394 VC:005 FC:18 I:00


=================================================
COMMAND CODE ---1: read 8 bit count, -copy 2 bytes
=================================================
$A9/815B 20 19 82    JSR $8219  [$A9:8219]   A:0001 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0418 VC:005 FC:18 I:00
$A9/815E A2 02       LDX #$02                A:0003 X:00FF Y:0003 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0966 VC:006 FC:18 I:00
$A9/8160 86 E4       STX $E4    [$00:00E4]   A:0003 X:0002 Y:0003 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0990 VC:006 FC:18 I:00
$A9/8162 64 E5       STZ $E5    [$00:00E5]   A:0003 X:0002 Y:0003 D:0000 DB:7F S:05F4 P:envMXdIzc HC:1022 VC:006 FC:18 I:00
$A9/8164 80 6F       BRA $6F    [$81D5]      A:0003 X:0002 Y:0003 D:0000 DB:7F S:05F4 P:envMXdIzc HC:1054 VC:006 FC:18 I:00

==========================
first command bit is low 0
==========================
--------------------------
read next bit into A and Y
--------------------------
code 00

$A9/8166 C2 20       REP #$20                A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIZc HC:0358 VC:016 FC:18 I:00
$A9/8168 A9 00 00    LDA #$0000              A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envmXdIZc HC:0388 VC:016 FC:18 I:00
$A9/816B E2 20       SEP #$20                A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envmXdIZc HC:0420 VC:016 FC:18 I:00
$A9/816D 06 E0       ASL $E0    [$00:00E0]   A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIZc HC:0450 VC:016 FC:18 I:00
$A9/816F D0 0F       BNE $0F    [$8180]      A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0496 VC:016 FC:18 I:00
$A9/8171 A7 E8       LDA [$E8]  [$2C:AB47]   A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIZC HC:0896 VC:114 FC:18 I:00
$A9/8173 2A          ROL A                   A:00A0 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:eNvMXdIzC HC:0952 VC:114 FC:18 I:00
$A9/8174 85 E0       STA $E0    [$00:00E0]   A:0041 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIzC HC:0974 VC:114 FC:18 I:00
$A9/8176 A5 E8       LDA $E8    [$00:00E8]   A:0041 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIzC HC:1006 VC:114 FC:18 I:00
$A9/8178 D0 02       BNE $02    [$817C]      A:0047 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIzC HC:1038 VC:114 FC:18 I:00
$A9/817C C6 E8       DEC $E8    [$00:00E8]   A:0047 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIzC HC:1068 VC:114 FC:18 I:00
$A9/817E A9 00       LDA #$00                A:0047 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIzC HC:1114 VC:114 FC:18 I:00
$A9/8180 2A          ROL A                   A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0526 VC:016 FC:18 I:00
$A9/8181 A8          TAY                     A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIZc HC:0588 VC:016 FC:18 I:00

=======================
test second command bit
=======================
$A9/8182 F0 27       BEQ $27    [$81AB]      A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIZc HC:0610 VC:016 FC:18 I:00


=====================================================
COMMAND CODE 01: read 4 or 8 bit count, -copy 5 bytes
=====================================================
code ---001
--------------------------
read next bit into A and Y
--------------------------
$A9/8184 C2 20       REP #$20                A:0001 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0348 VC:035 FC:18 I:00
$A9/8186 A9 00 00    LDA #$0000              A:0001 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envmXdIzc HC:0378 VC:035 FC:18 I:00
$A9/8189 E2 20       SEP #$20                A:0000 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envmXdIZc HC:0410 VC:035 FC:18 I:00
$A9/818B 06 E0       ASL $E0    [$00:00E0]   A:0000 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIZc HC:0440 VC:035 FC:18 I:00
$A9/818D D0 0F       BNE $0F    [$819E]      A:0000 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0486 VC:035 FC:18 I:00
$A9/818F A7 E8       LDA [$E8]  [$2C:AB75]   A:0000 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIZC HC:0560 VC:086 FC:18 I:00
$A9/8191 2A          ROL A                   A:0008 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzC HC:0656 VC:086 FC:18 I:00
$A9/8192 85 E0       STA $E0    [$00:00E0]   A:0011 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0678 VC:086 FC:18 I:00
$A9/8194 A5 E8       LDA $E8    [$00:00E8]   A:0011 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0710 VC:086 FC:18 I:00
$A9/8196 D0 02       BNE $02    [$819A]      A:0075 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0742 VC:086 FC:18 I:00
$A9/819A C6 E8       DEC $E8    [$00:00E8]   A:0075 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0772 VC:086 FC:18 I:00
$A9/819C A9 00       LDA #$00                A:0075 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0818 VC:086 FC:18 I:00
$A9/819E 2A          ROL A                   A:0000 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0516 VC:035 FC:18 I:00
$A9/819F A8          TAY                     A:0000 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIZc HC:0538 VC:035 FC:18 I:00

$A9/81A0 20 19 82    JSR $8219  [$A9:8219]   A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIZc HC:0600 VC:035 FC:18 I:00

$A9/81A3 C2 20       REP #$20                A:0000 X:00FF Y:0000 D:0000 DB:7F S:05F4 P:envMXdIZc HC:0188 VC:036 FC:18 I:00
$A9/81A5 18          CLC                     A:0000 X:00FF Y:0000 D:0000 DB:7F S:05F4 P:envmXdIZc HC:0218 VC:036 FC:18 I:00
$A9/81A6 69 04 00    ADC #$0004              A:0000 X:00FF Y:0000 D:0000 DB:7F S:05F4 P:envmXdIZc HC:0240 VC:036 FC:18 I:00
$A9/81A9 80 06       BRA $06    [$81B1]      A:0004 X:00FF Y:0000 D:0000 DB:7F S:05F4 P:envmXdIzc HC:0272 VC:036 FC:18 I:00

===============================
COMMAND CODE 000: -copy 3 bytes
===============================
$A9/81AB C2 20       REP #$20                A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIZc HC:0640 VC:016 FC:18 I:00
$A9/81AD 18          CLC                     A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envmXdIZc HC:0670 VC:016 FC:18 I:00
$A9/81AE 69 03 00    ADC #$0003              A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envmXdIZc HC:0692 VC:016 FC:18 I:00

$A9/81B1 85 E4       STA $E4    [$00:00E4]   A:0003 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envmXdIzc HC:0724 VC:016 FC:18 I:00
$A9/81B3 E2 20       SEP #$20                A:0003 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envmXdIzc HC:0764 VC:016 FC:18 I:00

--------------------------
read next bit into A and Y
--------------------------
$A9/81B5 C2 20       REP #$20                A:0003 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0794 VC:016 FC:18 I:00
$A9/81B7 A9 00 00    LDA #$0000              A:0003 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envmXdIzc HC:0824 VC:016 FC:18 I:00
$A9/81BA E2 20       SEP #$20                A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envmXdIZc HC:0856 VC:016 FC:18 I:00
$A9/81BC 06 E0       ASL $E0    [$00:00E0]   A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIZc HC:0886 VC:016 FC:18 I:00
$A9/81BE D0 0F       BNE $0F    [$81CF]      A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0932 VC:016 FC:18 I:00
$A9/81C0 A7 E8       LDA [$E8]  [$2C:AB88]   A:0000 X:00FF Y:0003 D:0000 DB:7F S:05F4 P:envMXdIZC HC:1180 VC:053 FC:18 I:00
$A9/81C2 2A          ROL A                   A:0004 X:00FF Y:0003 D:0000 DB:7F S:05F4 P:envMXdIzC HC:1236 VC:053 FC:18 I:00
$A9/81C3 85 E0       STA $E0    [$00:00E0]   A:0009 X:00FF Y:0003 D:0000 DB:7F S:05F4 P:envMXdIzc HC:1258 VC:053 FC:18 I:00
$A9/81C5 A5 E8       LDA $E8    [$00:00E8]   A:0009 X:00FF Y:0003 D:0000 DB:7F S:05F4 P:envMXdIzc HC:1290 VC:053 FC:18 I:00
$A9/81C7 D0 02       BNE $02    [$81CB]      A:0088 X:00FF Y:0003 D:0000 DB:7F S:05F4 P:eNvMXdIzc HC:1322 VC:053 FC:18 I:00
$A9/81CB C6 E8       DEC $E8    [$00:00E8]   A:0088 X:00FF Y:0003 D:0000 DB:7F S:05F4 P:eNvMXdIzc HC:1352 VC:053 FC:18 I:00
$A9/81CD A9 00       LDA #$00                A:0088 X:00FF Y:0003 D:0000 DB:7F S:05F4 P:eNvMXdIzc HC:0034 VC:054 FC:18 I:00
$A9/81CF 2A          ROL A                   A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIzc HC:0962 VC:016 FC:18 I:00
$A9/81D0 A8          TAY                     A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIZc HC:0984 VC:016 FC:18 I:00

load 8 or 16 bit count, copy 3 bytes
$A9/81D1 C8          INY                     A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F4 P:envMXdIZc HC:1006 VC:016 FC:18 I:00
$A9/81D2 20 19 82    JSR $8219  [$A9:8219]   A:0000 X:0000 Y:0001 D:0000 DB:7F S:05F4 P:envMXdIzc HC:1028 VC:016 FC:18 I:00

============================
A: set pointer back xx bytes
X: copy this many bytes
============================
$A9/81D5 C2 20       REP #$20                A:0003 X:0002 Y:0003 D:0000 DB:7F S:05F4 P:envMXdIzc HC:1084 VC:006 FC:18 I:00
$A9/81D7 18          CLC                     A:0003 X:0002 Y:0003 D:0000 DB:7F S:05F4 P:envmXdIzc HC:1114 VC:006 FC:18 I:00
$A9/81D8 65 EE       ADC $EE    [$00:00EE]   A:0003 X:0002 Y:0003 D:0000 DB:7F S:05F4 P:envmXdIzc HC:1136 VC:006 FC:18 I:00
$A9/81DA 3A          DEC A                   A:0E66 X:0002 Y:0003 D:0000 DB:7F S:05F4 P:envmXdIzc HC:1176 VC:006 FC:18 I:00
$A9/81DB 85 EB       STA $EB    [$00:00EB]   A:0E65 X:0002 Y:0003 D:0000 DB:7F S:05F4 P:envmXdIzc HC:1198 VC:006 FC:18 I:00
$A9/81DD A5 EE       LDA $EE    [$00:00EE]   A:0E65 X:0002 Y:0003 D:0000 DB:7F S:05F4 P:envmXdIzc HC:1238 VC:006 FC:18 I:00
$A9/81DF 38          SEC                     A:0E63 X:0002 Y:0003 D:0000 DB:7F S:05F4 P:envmXdIzc HC:1278 VC:006 FC:18 I:00
$A9/81E0 E5 E4       SBC $E4    [$00:00E4]   A:0E63 X:0002 Y:0003 D:0000 DB:7F S:05F4 P:envmXdIzC HC:1300 VC:006 FC:18 I:00
$A9/81E2 85 EE       STA $EE    [$00:00EE]   A:0E61 X:0002 Y:0003 D:0000 DB:7F S:05F4 P:envmXdIzC HC:1340 VC:006 FC:18 I:00
$A9/81E4 C2 10       REP #$10                A:0E61 X:0002 Y:0003 D:0000 DB:7F S:05F4 P:envmXdIzC HC:0016 VC:007 FC:18 I:00
$A9/81E6 A0 00 00    LDY #$0000              A:0E61 X:0002 Y:0003 D:0000 DB:7F S:05F4 P:envmxdIzC HC:0046 VC:007 FC:18 I:00
$A9/81E9 A5 E4       LDA $E4    [$00:00E4]   A:0E61 X:0002 Y:0000 D:0000 DB:7F S:05F4 P:envmxdIZC HC:0078 VC:007 FC:18 I:00
$A9/81EB 4A          LSR A                   A:0002 X:0002 Y:0000 D:0000 DB:7F S:05F4 P:envmxdIzC HC:0118 VC:007 FC:18 I:00
$A9/81EC AA          TAX                     A:0001 X:0002 Y:0000 D:0000 DB:7F S:05F4 P:envmxdIzc HC:0140 VC:007 FC:18 I:00
$A9/81ED 90 0E       BCC $0E    [$81FD]      A:0001 X:0001 Y:0000 D:0000 DB:7F S:05F4 P:envmxdIzc HC:0162 VC:007 FC:18 I:00

=============
copy one byte
=============
$A9/81EF E2 20       SEP #$20                A:0001 X:0001 Y:0000 D:0000 DB:7F S:05F4 P:envmxdIzC HC:0678 VC:018 FC:18 I:00
$A9/81F1 B1 EB       LDA ($EB),y[$7F:0E5F]   A:0001 X:0001 Y:0000 D:0000 DB:7F S:05F4 P:envMxdIzC HC:0724 VC:018 FC:18 I:00
$A9/81F3 91 EE       STA ($EE),y[$7F:0E4F]   A:0000 X:0001 Y:0000 D:0000 DB:7F S:05F4 P:envMxdIZC HC:0794 VC:018 FC:18 I:00
$A9/81F5 C2 20       REP #$20                A:0000 X:0001 Y:0000 D:0000 DB:7F S:05F4 P:envMxdIZC HC:0848 VC:018 FC:18 I:00
$A9/81F7 E0 00 00    CPX #$0000              A:0000 X:0001 Y:0000 D:0000 DB:7F S:05F4 P:envmxdIZC HC:0878 VC:018 FC:18 I:00
$A9/81FA F0 0A       BEQ $0A    [$8206]      A:0000 X:0001 Y:0000 D:0000 DB:7F S:05F4 P:envmxdIzC HC:0910 VC:018 FC:18 I:00
$A9/81FC C8          INY                     A:0000 X:0001 Y:0000 D:0000 DB:7F S:05F4 P:envmxdIzC HC:0934 VC:018 FC:18 I:00

===================
copy multiple bytes
===================
$A9/81FD B1 EB       LDA ($EB),y[$7F:0E65]   A:0001 X:0001 Y:0000 D:0000 DB:7F S:05F4 P:envmxdIzc HC:0208 VC:007 FC:18 I:00
$A9/81FF 91 EE       STA ($EE),y[$7F:0E61]   A:5E00 X:0001 Y:0000 D:0000 DB:7F S:05F4 P:envmxdIzc HC:0286 VC:007 FC:18 I:00
$A9/8201 C8          INY                     A:5E00 X:0001 Y:0000 D:0000 DB:7F S:05F4 P:envmxdIzc HC:0348 VC:007 FC:18 I:00
$A9/8202 C8          INY                     A:5E00 X:0001 Y:0001 D:0000 DB:7F S:05F4 P:envmxdIzc HC:0370 VC:007 FC:18 I:00
$A9/8203 CA          DEX                     A:5E00 X:0001 Y:0002 D:0000 DB:7F S:05F4 P:envmxdIzc HC:0392 VC:007 FC:18 I:00
$A9/8204 D0 F7       BNE $F7    [$81FD]      A:5E00 X:0000 Y:0002 D:0000 DB:7F S:05F4 P:envmxdIZc HC:0414 VC:007 FC:18 I:00

$A9/8206 A5 E4       LDA $E4    [$00:00E4]   A:5E00 X:0000 Y:0002 D:0000 DB:7F S:05F4 P:envmxdIZc HC:0438 VC:007 FC:18 I:00
$A9/8208 18          CLC                     A:0002 X:0000 Y:0002 D:0000 DB:7F S:05F4 P:envmxdIzc HC:0478 VC:007 FC:18 I:00
$A9/8209 65 E2       ADC $E2    [$00:00E2]   A:0002 X:0000 Y:0002 D:0000 DB:7F S:05F4 P:envmxdIzc HC:0500 VC:007 FC:18 I:00
$A9/820B C5 E6       CMP $E6    [$00:00E6]   A:000F X:0000 Y:0002 D:0000 DB:7F S:05F4 P:envmxdIzc HC:0540 VC:007 FC:18 I:00
$A9/820D B0 07       BCS $07    [$8216]      A:000F X:0000 Y:0002 D:0000 DB:7F S:05F4 P:eNvmxdIzc HC:0620 VC:007 FC:18 I:00
$A9/820F 85 E2       STA $E2    [$00:00E2]   A:000F X:0000 Y:0002 D:0000 DB:7F S:05F4 P:eNvmxdIzc HC:0644 VC:007 FC:18 I:00
$A9/8211 E2 30       SEP #$30                A:000F X:0000 Y:0002 D:0000 DB:7F S:05F4 P:eNvmxdIzc HC:0684 VC:007 FC:18 I:00
$A9/8213 4C 5B 80    JMP $805B  [$A9:805B]   A:000F X:0000 Y:0002 D:0000 DB:7F S:05F4 P:eNvMXdIzc HC:0714 VC:007 FC:18 I:00

===========================================================================================================================
$A9/8216 AB          PLB                     A:0E70 X:0000 Y:0016 D:0000 DB:7F S:05F4 P:envmxdIZC HC:0024 VC:054 FC:27 I:00
$A9/8217 28          PLP                     A:0E70 X:0000 Y:0016 D:0000 DB:00 S:05F5 P:envmxdIZC HC:0060 VC:054 FC:27 I:00
$A9/8218 6B          RTL                     A:0E70 X:0000 Y:0016 D:0000 DB:00 S:05F6 P:envmXdIzC HC:0096 VC:054 FC:27 I:00
===========================================================================================================================


========================
get count from bitstream
========================
Y = 0: return 4 bits in A
Y = 1: return 8 bits in A
Y = 2: return 16 bits in A

$A9/8219 BB          TYX                     A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F2 P:envMXdIZc HC:0460 VC:002 FC:18 I:00
$A9/821A BF 7F 82 29 LDA $29827F,x[$29:827F] A:0000 X:0000 Y:0000 D:0000 DB:7F S:05F2 P:envMXdIZc HC:0482 VC:002 FC:18 I:00
$A9/821E AA          TAX                     A:0003 X:0000 Y:0000 D:0000 DB:7F S:05F2 P:envMXdIzc HC:0530 VC:002 FC:18 I:00
$A9/821F E0 0F       CPX #$0F                A:0003 X:0003 Y:0000 D:0000 DB:7F S:05F2 P:envMXdIzc HC:0592 VC:002 FC:18 I:00
$A9/8221 F0 20       BEQ $20    [$8243]      A:0003 X:0003 Y:0000 D:0000 DB:7F S:05F2 P:eNvMXdIzc HC:0616 VC:002 FC:18 I:00

---------------------------------
read next bit into A and Y keep A
---------------------------------
$A9/8223 C2 20       REP #$20                A:0003 X:0003 Y:0000 D:0000 DB:7F S:05F2 P:eNvMXdIzc HC:0640 VC:002 FC:18 I:00
$A9/8225 A9 00 00    LDA #$0000              A:0003 X:0003 Y:0000 D:0000 DB:7F S:05F2 P:eNvmXdIzc HC:0670 VC:002 FC:18 I:00
$A9/8228 E2 20       SEP #$20                A:0000 X:0003 Y:0000 D:0000 DB:7F S:05F2 P:envmXdIZc HC:0702 VC:002 FC:18 I:00

$A9/822A 06 E0       ASL $E0    [$00:00E0]   A:0000 X:0003 Y:0000 D:0000 DB:7F S:05F2 P:envMXdIZc HC:0740 VC:002 FC:18 I:00
$A9/822C D0 0F       BNE $0F    [$823D]      A:0000 X:0003 Y:0000 D:0000 DB:7F S:05F2 P:envMXdIzC HC:0786 VC:002 FC:18 I:00
$A9/822E A8          TAY                     A:0000 X:0007 Y:0001 D:0000 DB:7F S:05F2 P:envMXdIZC HC:0814 VC:005 FC:18 I:00
$A9/822F A7 E8       LDA [$E8]  [$2C:ABC0]   A:0000 X:0007 Y:0000 D:0000 DB:7F S:05F2 P:envMXdIZC HC:0860 VC:005 FC:18 I:00
$A9/8231 2A          ROL A                   A:0003 X:0007 Y:0000 D:0000 DB:7F S:05F2 P:envMXdIzC HC:0916 VC:005 FC:18 I:00
$A9/8232 85 E0       STA $E0    [$00:00E0]   A:0007 X:0007 Y:0000 D:0000 DB:7F S:05F2 P:envMXdIzc HC:0938 VC:005 FC:18 I:00
$A9/8234 A5 E8       LDA $E8    [$00:00E8]   A:0007 X:0007 Y:0000 D:0000 DB:7F S:05F2 P:envMXdIzc HC:0970 VC:005 FC:18 I:00
$A9/8236 D0 02       BNE $02    [$823A]      A:00C0 X:0007 Y:0000 D:0000 DB:7F S:05F2 P:eNvMXdIzc HC:1002 VC:005 FC:18 I:00
$A9/8238 C6 E9       DEC $E9    [$00:00E9]   A:0000 X:0006 Y:0000 D:0000 DB:7F S:05F2 P:envMXdIZc HC:0530 VC:196 FC:18 I:00
$A9/823A C6 E8       DEC $E8    [$00:00E8]   A:00C0 X:0007 Y:0000 D:0000 DB:7F S:05F2 P:eNvMXdIzc HC:1032 VC:005 FC:18 I:00
$A9/823C 98          TYA                     A:00C0 X:0007 Y:0000 D:0000 DB:7F S:05F2 P:eNvMXdIzc HC:1078 VC:005 FC:18 I:00

$A9/823D 2A          ROL A                   A:0000 X:0003 Y:0000 D:0000 DB:7F S:05F2 P:envMXdIzC HC:0816 VC:002 FC:18 I:00
$A9/823E CA          DEX                     A:0001 X:0003 Y:0000 D:0000 DB:7F S:05F2 P:envMXdIzc HC:0838 VC:002 FC:18 I:00
$A9/823F 10 E9       BPL $E9    [$822A]      A:0001 X:0002 Y:0000 D:0000 DB:7F S:05F2 P:envMXdIzc HC:0860 VC:002 FC:18 I:00
$A9/8241 A8          TAY                     A:0009 X:00FF Y:0000 D:0000 DB:7F S:05F2 P:eNvMXdIzc HC:1334 VC:002 FC:18 I:00
$A9/8242 60          RTS                     A:0009 X:00FF Y:0009 D:0000 DB:7F S:05F2 P:envMXdIzc HC:1356 VC:002 FC:18 I:00

=============================
count code 0x0F: read 16 bits
=============================
-----------------------------
read next 8 bits into A and Y
-----------------------------
$A9/8243 A2 07       LDX #$07                A:000F X:000F Y:0002 D:0000 DB:7F S:05F2 P:envMXdIZC HC:0196 VC:251 FC:18 I:00
$A9/8245 C2 20       REP #$20                A:000F X:0007 Y:0002 D:0000 DB:7F S:05F2 P:envMXdIzC HC:0220 VC:251 FC:18 I:00
$A9/8247 A9 00 00    LDA #$0000              A:000F X:0007 Y:0002 D:0000 DB:7F S:05F2 P:envmXdIzC HC:0250 VC:251 FC:18 I:00
$A9/824A E2 20       SEP #$20                A:0000 X:0007 Y:0002 D:0000 DB:7F S:05F2 P:envmXdIZC HC:0282 VC:251 FC:18 I:00
$A9/824C 06 E0       ASL $E0    [$00:00E0]   A:0000 X:0007 Y:0002 D:0000 DB:7F S:05F2 P:envMXdIZC HC:0312 VC:251 FC:18 I:00
$A9/824E D0 0F       BNE $0F    [$825F]      A:0000 X:0007 Y:0002 D:0000 DB:7F S:05F2 P:envMXdIzc HC:0358 VC:251 FC:18 I:00
$A9/8250 A8          TAY                     A:0000 X:0001 Y:0002 D:0000 DB:7F S:05F2 P:envMXdIZC HC:1322 VC:251 FC:18 I:00
$A9/8251 A7 E8       LDA [$E8]  [$2C:AABD]   A:0000 X:0001 Y:0000 D:0000 DB:7F S:05F2 P:envMXdIZC HC:1368 VC:251 FC:18 I:00
$A9/8253 2A          ROL A                   A:0057 X:0001 Y:0000 D:0000 DB:7F S:05F2 P:envMXdIzC HC:0060 VC:252 FC:18 I:00
$A9/8254 85 E0       STA $E0    [$00:00E0]   A:00AF X:0001 Y:0000 D:0000 DB:7F S:05F2 P:eNvMXdIzc HC:0082 VC:252 FC:18 I:00
$A9/8256 A5 E8       LDA $E8    [$00:00E8]   A:00AF X:0001 Y:0000 D:0000 DB:7F S:05F2 P:eNvMXdIzc HC:0114 VC:252 FC:18 I:00
$A9/8258 D0 02       BNE $02    [$825C]      A:00BD X:0001 Y:0000 D:0000 DB:7F S:05F2 P:eNvMXdIzc HC:0146 VC:252 FC:18 I:00
$A9/825C C6 E8       DEC $E8    [$00:00E8]   A:00BD X:0001 Y:0000 D:0000 DB:7F S:05F2 P:eNvMXdIzc HC:0176 VC:252 FC:18 I:00
$A9/825E 98          TYA                     A:00BD X:0001 Y:0000 D:0000 DB:7F S:05F2 P:eNvMXdIzc HC:0222 VC:252 FC:18 I:00
$A9/825F 2A          ROL A                   A:0000 X:0007 Y:0002 D:0000 DB:7F S:05F2 P:envMXdIzc HC:0388 VC:251 FC:18 I:00
$A9/8260 CA          DEX                     A:0000 X:0007 Y:0002 D:0000 DB:7F S:05F2 P:envMXdIZc HC:0410 VC:251 FC:18 I:00
$A9/8261 10 E9       BPL $E9    [$824C]      A:0000 X:0006 Y:0002 D:0000 DB:7F S:05F2 P:envMXdIzc HC:0432 VC:251 FC:18 I:00

=================================
move lower 8bits into upper 8bits
=================================
$A9/8263 EB          XBA                     A:0001 X:00FF Y:0000 D:0000 DB:7F S:05F2 P:eNvMXdIzc HC:0462 VC:252 FC:18 I:00

-----------------------------
read next 8 bits into A and Y
-----------------------------
$A9/8264 A2 07       LDX #$07                A:0100 X:00FF Y:0000 D:0000 DB:7F S:05F2 P:envMXdIZc HC:0490 VC:252 FC:18 I:00
$A9/8266 06 E0       ASL $E0    [$00:00E0]   A:0100 X:0007 Y:0000 D:0000 DB:7F S:05F2 P:envMXdIzc HC:0514 VC:252 FC:18 I:00
$A9/8268 D0 0F       BNE $0F    [$8279]      A:0100 X:0007 Y:0000 D:0000 DB:7F S:05F2 P:eNvMXdIzc HC:0600 VC:252 FC:18 I:00
$A9/826A A8          TAY                     A:0117 X:0001 Y:0000 D:0000 DB:7F S:05F2 P:envMXdIZC HC:0160 VC:253 FC:18 I:00
$A9/826B A7 E8       LDA [$E8]  [$2C:AABC]   A:0117 X:0001 Y:0017 D:0000 DB:7F S:05F2 P:envMXdIzC HC:0206 VC:253 FC:18 I:00
$A9/826D 2A          ROL A                   A:01A1 X:0001 Y:0017 D:0000 DB:7F S:05F2 P:eNvMXdIzC HC:0262 VC:253 FC:18 I:00
$A9/826E 85 E0       STA $E0    [$00:00E0]   A:0143 X:0001 Y:0017 D:0000 DB:7F S:05F2 P:envMXdIzC HC:0284 VC:253 FC:18 I:00
$A9/8270 A5 E8       LDA $E8    [$00:00E8]   A:0143 X:0001 Y:0017 D:0000 DB:7F S:05F2 P:envMXdIzC HC:0316 VC:253 FC:18 I:00
$A9/8272 D0 02       BNE $02    [$8276]      A:01BC X:0001 Y:0017 D:0000 DB:7F S:05F2 P:eNvMXdIzC HC:0348 VC:253 FC:18 I:00
$A9/8276 C6 E8       DEC $E8    [$00:00E8]   A:01BC X:0001 Y:0017 D:0000 DB:7F S:05F2 P:eNvMXdIzC HC:0378 VC:253 FC:18 I:00
$A9/8278 98          TYA                     A:01BC X:0001 Y:0017 D:0000 DB:7F S:05F2 P:eNvMXdIzC HC:0424 VC:253 FC:18 I:00
$A9/8279 2A          ROL A                   A:0100 X:0007 Y:0000 D:0000 DB:7F S:05F2 P:eNvMXdIzc HC:0630 VC:252 FC:18 I:00
$A9/827A CA          DEX                     A:0100 X:0007 Y:0000 D:0000 DB:7F S:05F2 P:envMXdIZc HC:0652 VC:252 FC:18 I:00
$A9/827B 10 E9       BPL $E9    [$8266]      A:0100 X:0006 Y:0000 D:0000 DB:7F S:05F2 P:envMXdIzc HC:0674 VC:252 FC:18 I:00

$A9/827D A8          TAY                     A:015E X:00FF Y:0017 D:0000 DB:7F S:05F2 P:eNvMXdIzc HC:0704 VC:253 FC:18 I:00
$A9/827E 60          RTS                     A:015E X:00FF Y:005E D:0000 DB:7F S:05F2 P:envMXdIzc HC:0726 VC:253 FC:18 I:00