SA-1 cpu chip; executed BEFORE C2/0546 C2/0556 A9 00 00 LDA #$0000 A:0000 X:0000 Y:7460 C2/0559 85 D2 STA $D2 [$00:00D2] A:0000 X:0000 Y:7460 C2/055B 85 D4 STA $D4 [$00:00D4] A:0000 X:0000 Y:7460 C2/055D 85 D8 STA $D8 [$00:00D8] A:0000 X:0000 Y:7460 C2/055F A9 01 00 LDA #$0001 A:0000 X:0000 Y:7460 C2/0562 8D 50 22 STA $2250 [$00:2250] A:0001 X:0000 Y:7460 C2/0565 A5 D0 LDA $D0 [$00:00D0] A:0001 X:0000 Y:7460 ;load final damage C2/0567 C9 10 27 CMP #$2710 A:04D2 X:0000 Y:7460 ;check if in 1000's C2/056A 30 18 BMI $18 [$0584] A:04D2 X:0000 Y:7460 ;branch if less than 1000 C2/056C 8D 51 22 STA $2251 [$00:2251] A:04D2 X:0000 Y:7460 C2/056F A9 10 27 LDA #$2710 A:04D2 X:0000 Y:7460 C2/0572 8D 53 22 STA $2253 [$00:2253] A:2710 X:0000 Y:7460 C2/0575 A9 04 00 LDA #$0005 A:2710 X:0000 Y:7460 ;load 4 C2/0578 85 D8 STA $D8 [$00:00D8] A:0005 X:0000 Y:7460 ;set numeral count as 4 (numerals) C2/057A AD 06 23 LDA $2306 [$00:2306] A:0005 X:0000 Y:7460 C2/057D 85 D2 STA $D2 [$00:00D2] A:0001 X:0000 Y:7460 C2/057F AD 08 23 LDA $2308 [$00:2308] A:0001 X:0000 Y:7460 ;load lower 3 digits (234) C2/0582 85 D0 STA $D0 [$00:00D0] A:00EA X:0000 Y:7460 C2/0584 C9 E8 03 CMP #$03E8 A:00EA X:0000 Y:7460 ;check if in 100's C2/0587 30 1C BMI $1C [$05A5] A:00EA X:0000 Y:7460 ;branch if less than 100 C2/0589 8D 51 22 STA $2251 [$00:2251] A:00EA X:0000 Y:7460 C2/058C A9 E8 03 LDA #$03E8 A:00EA X:0000 Y:7460 C2/058F 8D 53 22 STA $2253 [$00:2253] A:0064 X:0000 Y:7460 C2/0592 A5 D8 LDA $D8 [$00:00D8] A:0064 X:0000 Y:7460 ;load numeral count C2/0594 D0 05 BNE $05 [$059B] A:0004 X:0000 Y:7460 ;branch if not 0, otherwise set as 3 C2/0596 A9 04 00 LDA #$0004 C2/0599 85 D8 STA $D8 [$00:00D8] C2/057A AD 06 23 LDA $2306 [$00:2306] A:0004 X:0000 Y:7460 C2/057D 85 D3 STA $D3 [$00:00D3] A:0001 X:0000 Y:7460 C2/057F AD 08 23 LDA $2308 [$00:2308] A:0001 X:0000 Y:7460 ;load lower 3 digits (234) C2/0582 85 D0 STA $D0 [$00:00D0] A:00EA X:0000 Y:7460 C2/0584 C9 64 00 CMP #$0064 A:00EA X:0000 Y:7460 ;check if in 100's C2/0587 30 1C BMI $1C [$05A5] A:00EA X:0000 Y:7460 ;branch if less than 100 C2/0589 8D 51 22 STA $2251 [$00:2251] A:00EA X:0000 Y:7460 C2/058C A9 64 00 LDA #$0064 A:00EA X:0000 Y:7460 C2/058F 8D 53 22 STA $2253 [$00:2253] A:0064 X:0000 Y:7460 C2/0592 A5 D8 LDA $D8 [$00:00D8] A:0064 X:0000 Y:7460 ;load numeral count C2/0594 D0 05 BNE $05 [$059B] A:0004 X:0000 Y:7460 ;branch if not 0, otherwise set as 3 C2/0596 A9 03 00 LDA #$0003 C2/0599 85 D8 STA $D8 [$00:00D8] C2/059B AD 06 23 LDA $2306 [$00:2306] A:0004 X:0000 Y:7460 C2/059E 85 D4 STA $D4 [$00:00D4] A:0002 X:0000 Y:7460 C2/05A0 AD 08 23 LDA $2308 [$00:2308] A:0002 X:0000 Y:7460 ;load lower 2 digits (34) C2/05A3 85 D0 STA $D0 [$00:00D0] A:0022 X:0000 Y:7460 C2/05A5 C9 0A 00 CMP #$000A A:0022 X:0000 Y:7460 ;check if in 10's C2/05A8 30 1C BMI $1C [$05C6] A:0022 X:0000 Y:7460 ;branch if less than 10 C2/05AA 8D 51 22 STA $2251 [$00:2251] A:0022 X:0000 Y:7460 C2/05AD A9 0A 00 LDA #$000A A:0022 X:0000 Y:7460 C2/05B0 8D 53 22 STA $2253 [$00:2253] A:000A X:0000 Y:7460 C2/05B3 A5 D8 LDA $D8 [$00:00D8] A:000A X:0000 Y:7460 ;load numeral count C2/05B5 D0 05 BNE $05 [$05BC] A:0004 X:0000 Y:7460 ;branch if not 0, otherwise set as 2 C2/05B7 A9 02 00 LDA #$0002 C2/05BA 85 D8 STA $D8 [$00:00D8] C2/05BC AD 06 23 LDA $2306 [$00:2306] A:0004 X:0000 Y:7460 C2/05BF 85 D5 STA $D5 [$00:00D5] A:0003 X:0000 Y:7460 C2/05C1 AD 08 23 LDA $2308 [$00:2308] A:0003 X:0000 Y:7460 ;load lowest digit (4) C2/05C4 85 D0 STA $D0 [$00:00D0] A:0004 X:0000 Y:7460 C2/05C6 85 D6 STA $D6 [$00:00D6] A:0004 X:0000 Y:7460 C2/05C8 A5 D8 LDA $D8 [$00:00D8] A:0004 X:0000 Y:7460 ;load numeral count C2/05CA D0 05 BNE $05 [$05D1] A:0004 X:0000 Y:7460 ;branch if not 0, otherwise set as 1 C2/05CC A9 01 00 LDA #$0001 C2/05CF 85 D8 STA $D8 [$00:00D8] C2/05D1 A9 04 00 LDA #$0004 A:0004 X:0000 Y:7460 ;load 4 as maximum numeral count C2/05D4 38 SEC A:0004 X:0000 Y:7460 C2/05D5 E5 D8 SBC $D8 [$00:00D8] A:0004 X:0000 Y:7460 ;subtract current numeral count from 4 C2/05D7 F0 0B BEQ $0B [$05E4] A:0000 X:0000 Y:7460 ;branch if at 0 C2/05D9 3A DEC C2/05DA 9B TXY C2/05DB AA TAX C2/05DC B5 D2 LDA $D2,x [$00:00D2] C2/05DE 09 FF 00 ORA #$00FF C2/05E1 95 D2 STA $D2,x [$00:00D2] C2/05E3 BB TYX C2/05E4 A9 01 00 LDA #$0001 A:0000 X:0000 Y:7460 C2/05E7 8D 60 30 STA $3060 [$00:3060] A:0001 X:0000 Y:7460 C2/05EA 60 RTS A:0001 X:0000 Y:7460 C2/06A6 C2 30 REP #$30 A:0001 X:0000 Y:7460 C2/06A8 7A PLY A:0001 X:0000 Y:7460 C2/06A9 FA PLX A:0001 X:0000 Y:7460 C2/06AA 68 PLA A:0001 X:0000 Y:7460 C2/06AB 2B PLD A:0000 X:0000 Y:7460 C2/06AC AB PLB A:0000 X:0000 Y:7460 C2/06AD 6B RTL A:0000 X:0000 Y:7460 Load damage numerals; this example uses 1234 as damage C2/0546 AD D2 30 LDA $30D2 [$00:30D2] A:0001 X:00D2 Y:2400 C2/0549 95 00 STA $00,x [$00:00D2] A:0201 X:00D2 Y:2400 C2/054B AD D4 30 LDA $30D4 [$00:30D4] A:0201 X:00D2 Y:2400 C2/054E 95 02 STA $02,x [$00:00D4] A:0403 X:00D2 Y:2400 C2/0550 AD D8 30 LDA $30D8 [$00:30D8] A:0403 X:00D2 Y:2400 C2/0553 95 04 STA $04,x [$00:00D6] A:0004 X:00D2 Y:2400 C2/0555 60 RTS A:0004 X:00D2 Y:2400 C2/3064 A5 E0 LDA $E0 [$00:00E0] A:0005 X:00D2 Y:2400 C2/3066 10 07 BPL $07 [$306F] A:3FFF X:00D2 Y:2400 C2/306F A5 D6 LDA $D6 [$00:00D6] A:3FFF X:00D2 Y:2400 ;load total number of digits C2/3071 0A ASL A A:0003 X:00D2 Y:2400 C2/3072 AA TAX A:0006 X:00D2 Y:2400 C2/3073 BF 23 31 C2 LDA $C23123,x[$C2:3129] A:0006 X:0006 Y:2400 ;load horizontal position of digits for number C2/3077 85 D8 STA $D8 [$00:00D8] A:0008 X:0006 Y:2400 C2/3079 4C A4 30 JMP $30A4 [$00:30A4] A:0008 X:0006 Y:2400 C2/30A4 A6 66 LDX $66 [$00:0066] A:0008 X:0006 Y:2400 C2/30A6 BF 0E 00 40 LDA $40000E,x[$40:240E] A:0008 X:2400 Y:2400 C2/30AA AA TAX A:4000 X:2400 Y:2400 C2/30AB BF 19 00 40 LDA $400019,x[$40:4019] A:4000 X:4000 Y:2400 C2/30AF 29 FF 00 AND #$00FF A:0008 X:4000 Y:2400 C2/30B2 4A LSR A A:0008 X:4000 Y:2400 C2/30B3 4A LSR A A:0004 X:4000 Y:2400 C2/30B4 AA TAX A:0002 X:4000 Y:2400 C2/30B5 BF 2D 31 C2 LDA $C2312D,x[$C2:312F] A:0002 X:0002 Y:2400 ;load vertical position of digits for number C2/30B9 85 D9 STA $D9 [$00:00D9] A:000C X:0002 Y:2400 C2/30BB A6 66 LDX $66 [$00:0066] A:000C X:0002 Y:2400 C2/30BD E2 20 SEP #$20 A:000C X:2400 Y:2400 C2/30BF A5 D8 LDA $D8 [$00:00D8] A:000C X:2400 Y:2400 ;load horiz.position C2/30C1 18 CLC A:0008 X:2400 Y:2400 C2/30C2 7F 32 00 40 ADC $400032,x[$40:2432] A:0008 X:2400 Y:2400 ;add to numeral X OAM coord C2/30C6 85 D8 STA $D8 [$00:00D8] A:008F X:2400 Y:2400 C2/30C8 A5 D9 LDA $D9 [$00:00D9] A:008F X:2400 Y:2400 ;load vert.position C2/30CA 18 CLC A:000C X:2400 Y:2400 C2/30CB 7F 36 00 40 ADC $400036,x[$40:2436] A:000C X:2400 Y:2400 ;add to numeral Y OAM coord C2/30CF 85 D9 STA $D9 [$00:00D9] A:0083 X:2400 Y:2400 C2/30D1 C2 20 REP #$20 A:0083 X:2400 Y:2400 C2/30D3 A9 80 00 LDA #$0080 A:0083 X:2400 Y:2400 C2/30D6 85 E0 STA $E0 [$00:00E0] A:0080 X:2400 Y:2400 C2/30D8 A9 10 00 LDA #$0010 A:0080 X:2400 Y:2400 C2/30DB 85 E2 STA $E2 [$00:00E2] A:0010 X:2400 Y:2400 C2/30DD A9 00 00 LDA #$0000 A:0010 X:2400 Y:2400 C2/30E0 85 E4 STA $E4 [$00:00E4] A:0000 X:2400 Y:2400 C2/30E2 AF 30 A0 C2 LDA $C2A030[$C2:A030] A:0000 X:2400 Y:2400 C2/30E6 85 EA STA $EA [$00:00EA] A:E654 X:2400 Y:2400 C2/30E8 A9 C2 00 LDA #$00C2 A:E654 X:2400 Y:2400 C2/30EB 85 EC STA $EC [$00:00EC] A:00C2 X:2400 Y:2400 C2/30ED 20 30 07 JSR $0730 [$C2:0730] A:00C2 X:2400 Y:2400 C2/30F0 A5 66 LDA $66 [$00:0066] A:0000 X:2C00 Y:0020 C2/30F2 9F 0C 00 40 STA $40000C,x[$40:2C0C] A:2400 X:2C00 Y:0020 C2/30F6 AA TAX A:2400 X:2C00 Y:0020 C2/30F7 A5 D2 LDA $D2 [$00:00D2] A:2400 X:2400 Y:0020 C2/30F9 9F 48 00 40 STA $400048,x[$40:2448] A:0601 X:2400 Y:0020 C2/30FD A5 D4 LDA $D4 [$00:00D4] A:0601 X:2400 Y:0020 C2/30FF 9F 4A 00 40 STA $40004A,x[$40:244A] A:0803 X:2400 Y:0020 C2/3103 A5 D8 LDA $D8 [$00:00D8] A:0803 X:2400 Y:0020 C2/3105 9F 4C 00 40 STA $40004C,x[$40:244C] A:838F X:2400 Y:0020 C2/3109 BF 4F 00 40 LDA $40004F,x[$40:244F] A:838F X:2400 Y:0020 C2/310D 29 FE FF AND #$FFFE A:FF00 X:2400 Y:0020 C2/3110 9F 4F 00 40 STA $40004F,x[$40:244F] A:FF00 X:2400 Y:0020 C2/3114 E6 60 INC $60 [$00:0060] A:FF00 X:2400 Y:0020 C2/3116 4C 4F 0C JMP $0C4F [$00:0C4F] A:FF00 X:2400 Y:0020 $C2:8916 86 CE STX $CE [$00:00CE] A:0089 X:4300 Y:0004 $C2:8918 BF 2E 00 40 LDA $40002E,x[$40:432E] A:0089 X:4300 Y:0004 ;load tile index $C2:891C 85 DE STA $DE [$00:00DE] A:0006 X:4300 Y:0004 $C2:891E BF 30 00 40 LDA $400030,x[$40:4330] A:0006 X:4300 Y:0004 $C2:8922 85 DA STA $DA [$00:00DA] A:008F X:4300 Y:0004 $C2:8924 BF 32 00 40 LDA $400032,x[$40:4332] A:008F X:4300 Y:0004 $C2:8928 18 CLC A:0083 X:4300 Y:0004 $C2:8929 7F 34 00 40 ADC $400034,x[$40:4334] A:0083 X:4300 Y:0004 $C2:892D 85 DC STA $DC [$00:00DC] A:0080 X:4300 Y:0004 $C2:892F A5 BE LDA $BE [$00:00BE] A:0080 X:4300 Y:0004 $C2:8931 4A LSR A A:0000 X:4300 Y:0004 $C2:8932 4A LSR A A:0000 X:4300 Y:0004 $C2:8933 29 FF 00 AND #$00FF A:0000 X:4300 Y:0004 $C2:8936 09 00 01 ORA #$0100 A:0000 X:4300 Y:0004 $C2:8939 9F 2A 00 40 STA $40002A,x[$40:432A] A:0100 X:4300 Y:0004 $C2:893D E2 20 SEP #$20 A:0100 X:4300 Y:0004 $C2:893F A5 DF LDA $DF [$00:00DF] A:0100 X:4300 Y:0004 $C2:8941 1F 2D 00 40 ORA $40002D,x[$40:432D] A:0100 X:4300 Y:0004 $C2:8945 85 DF STA $DF [$00:00DF] A:0120 X:4300 Y:0004 $C2:8947 BF 00 00 40 LDA $400000,x[$40:4300] A:0120 X:4300 Y:0004 $C2:894B 89 08 BIT #$08 A:0189 X:4300 Y:0004 $C2:894D F0 0C BEQ $0C [$895B] A:0189 X:4300 Y:0004 $C2:894F 64 D9 STZ $D9 [$00:00D9] A:0189 X:4300 Y:0004 $C2:8951 A9 FC LDA #$FC A:0189 X:4300 Y:0004 $C2:8953 85 F4 STA $F4 [$00:00F4] A:01FC X:4300 Y:0004 $C2:8955 A9 F8 LDA #$F8 A:01FC X:4300 Y:0004 $C2:8957 85 F3 STA $F3 [$00:00F3] A:01F8 X:4300 Y:0004 $C2:8959 80 0C BRA $0C [$8967] A:01F8 X:4300 Y:0004 $C2:8967 A6 BE LDX $BE [$00:00BE] A:01F8 X:4300 Y:0004 $C2:8969 A5 F4 LDA $F4 [$00:00F4] A:01F8 X:0000 Y:0004 $C2:896B 30 05 BMI $05 [$8972] A:01FC X:0000 Y:0004 $C2:8972 EB XBA A:01FC X:0000 Y:0004 $C2:8973 A9 FF LDA #$FF A:FC01 X:0000 Y:0004 $C2:8975 EB XBA A:FCFF X:0000 Y:0004 $C2:8976 C2 20 REP #$20 A:FFFC X:0000 Y:0004 $C2:8978 18 CLC A:FFFC X:0000 Y:0004 $C2:8979 65 DA ADC $DA [$00:00DA] A:FFFC X:0000 Y:0004 $C2:897B C9 00 01 CMP #$0100 A:008B X:0000 Y:0004 $C2:897E 30 01 BMI $01 [$8981] A:008B X:0000 Y:0004 $C2:8981 C9 F1 FF CMP #$FFF1 A:008B X:0000 Y:0004 $C2:8984 10 01 BPL $01 [$8987] A:008B X:0000 Y:0004 $C2:8987 E2 20 SEP #$20 A:008B X:0000 Y:0004 $C2:8989 9D E0 34 STA $34E0,x[$00:34E0] A:008B X:0000 Y:0004 ;store X coord $C2:898C EB XBA A:008B X:0000 Y:0004 $C2:898D 29 55 AND #$55 A:8B00 X:0000 Y:0004 $C2:898F 85 FE STA $FE [$00:00FE] A:8B00 X:0000 Y:0004 $C2:8991 A5 F3 LDA $F3 [$00:00F3] A:8B00 X:0000 Y:0004 $C2:8993 30 05 BMI $05 [$899A] A:8BF8 X:0000 Y:0004 $C2:899A EB XBA A:8BF8 X:0000 Y:0004 $C2:899B A9 FF LDA #$FF A:F88B X:0000 Y:0004 $C2:899D EB XBA A:F8FF X:0000 Y:0004 $C2:899E C2 20 REP #$20 A:FFF8 X:0000 Y:0004 $C2:89A0 18 CLC A:FFF8 X:0000 Y:0004 $C2:89A1 65 DC ADC $DC [$00:00DC] A:FFF8 X:0000 Y:0004 $C2:89A3 C9 E0 00 CMP #$00E0 A:0078 X:0000 Y:0004 $C2:89A6 30 01 BMI $01 [$89A9] A:0078 X:0000 Y:0004 $C2:89A9 C9 F1 FF CMP #$FFF1 A:0078 X:0000 Y:0004 $C2:89AC 10 01 BPL $01 [$89AF] A:0078 X:0000 Y:0004 $C2:89AF E2 20 SEP #$20 A:0078 X:0000 Y:0004 $C2:89B1 9D E1 34 STA $34E1,x[$00:34E1] A:0078 X:0000 Y:0004 ;store Y coord $C2:89B4 A5 DE LDA $DE [$00:00DE] A:0078 X:0000 Y:0004 $C2:89B6 9D E2 34 STA $34E2,x[$00:34E2] A:0006 X:0000 Y:0004 ;store tile index $C2:89B9 A5 DF LDA $DF [$00:00DF] A:0006 X:0000 Y:0004 $C2:89BB 9D E3 34 STA $34E3,x[$00:34E3] A:0020 X:0000 Y:0004 ;store palette/tile index bit 9 $C2:89BE 9B TXY A:0020 X:0000 Y:0004 $C2:89BF E8 INX A:0020 X:0000 Y:0000 $C2:89C0 E8 INX A:0020 X:0001 Y:0000 $C2:89C1 E8 INX A:0020 X:0002 Y:0000 $C2:89C2 E8 INX A:0020 X:0003 Y:0000 $C2:89C3 86 BE STX $BE [$00:00BE] A:0020 X:0004 Y:0000 $C2:89C5 C2 20 REP #$20 A:0020 X:0004 Y:0000 $C2:89C7 98 TYA A:0020 X:0004 Y:0000 $C2:89C8 4A LSR A A:0000 X:0004 Y:0000 $C2:89C9 29 07 00 AND #$0007 A:0000 X:0004 Y:0000 $C2:89CC AA TAX A:0000 X:0004 Y:0000 $C2:89CD BF 13 8B C2 LDA $C28B13,x[$C2:8B13] A:0000 X:0000 Y:0000 $C2:89D1 85 FC STA $FC [$00:00FC] A:FC03 X:0000 Y:0000 $C2:89D3 98 TYA A:FC03 X:0000 Y:0000 $C2:89D4 4A LSR A A:0000 X:0000 Y:0000 $C2:89D5 4A LSR A A:0000 X:0000 Y:0000 $C2:89D6 4A LSR A A:0000 X:0000 Y:0000 $C2:89D7 4A LSR A A:0000 X:0000 Y:0000 $C2:89D8 AA TAX A:0000 X:0000 Y:0000 $C2:89D9 E2 20 SEP #$20 A:0000 X:0000 Y:0000 $C2:89DB A5 D9 LDA $D9 [$00:00D9] A:0000 X:0000 Y:0000 $C2:89DD 05 FE ORA $FE [$00:00FE] A:0000 X:0000 Y:0000 $C2:89DF 25 FC AND $FC [$00:00FC] A:0000 X:0000 Y:0000 $C2:89E1 85 FF STA $FF [$00:00FF] A:0000 X:0000 Y:0000 $C2:89E3 BD E0 36 LDA $36E0,x[$00:36E0] A:0000 X:0000 Y:0000 $C2:89E6 25 FD AND $FD [$00:00FD] A:00AA X:0000 Y:0000 $C2:89E8 05 FF ORA $FF [$00:00FF] A:00A8 X:0000 Y:0000 $C2:89EA 9D E0 36 STA $36E0,x[$00:36E0] A:00A8 X:0000 Y:0000 $C2:89ED A6 CE LDX $CE [$00:00CE] A:00A8 X:0000 Y:0000 $C2:89EF C2 20 REP #$20 A:00A8 X:4300 Y:0000 $C2:89F1 60 RTS A:00A8 X:4300 Y:0000