Everything's better with Magitek
I don't really know how random encounters work - that's why I'm hoping some TASers could help out with this.
Invoke game loading screen (gen. act. AB) C0/B91B: A902 LDA #$02 C0/B91D: 8D0002 STA $0200 C0/B920: 20CAC6 JSR $C6CA (jump to C3/0000->C3/001B) C0/B923: AFF17F30 LDA $307FF1 C0/B927: 18 CLC C0/B928: 690D ADC #$0D C0/B92A: 8FF17F30 STA $307FF1 C0/B92E: 8D6D1F STA $1F6D (RNG index) C0/B931: 8DA11F STA $1FA1 (index when overworld encounter will occur) C0/B934: 8DA21F STA $1FA2 (index when town/dungeon encounter will occur) C0/B937: 8DA41F STA $1FA4 (overworld addition for encounter rate) C0/B93A: 8DA31F STA $1FA3 (town/dungeon addition for encounter rate) C0/B93D: 8DA51F STA $1FA5 (Veldt pack #, obviously $1FA1-$1FA5 will be the same at load up) C0/B940: AD0502 LDA $0205 C0/B943: 2980 AND #$80 C0/B945: 851A STA $1A C0/B947: ADDF1E LDA $1EDF C0/B94A: 297F AND #$7F C0/B94C: 051A ORA $1A C0/B94E: 8DDF1E STA $1EDF C0/B951: 6458 STZ $58 C0/B953: 20F36C JSR $6CF3 (calls equipment check function) C0/B956: 208603 JSR $0386 C0/B959: A901 LDA #$01 C0/B95B: 4C5C9B JMP $9B5C
$0200 is #$02, used when the loading screen is called C3/016F: AFF17F30 LDA $307FF1 C3/0173: 1A INC A C3/0174: 8FF17F30 STA $307FF1 C3/0178: 2224A4C3 JSL $C3A424 (timer resetting for input decoding) C3/017C: 202370 JSR $7023 (make sure SRAM markers are intact) C3/017F: 901E BCC $019F (branch if not, which forces a new game) C3/0181: A901 LDA #$01 C3/0183: 8D0113 STA $1301 (set song as the Prelude) C3/0186: A910 LDA #$10 C3/0188: 8D0013 STA $1300 C3/018B: A980 LDA #$80 C3/018D: 8D0213 STA $1302 (normal volume) C3/0190: 220400C5 JSL $C50004 (play the Prelude) C3/0194: A9FF LDA #$FF C3/0196: 8D0502 STA $0205 C3/0199: A920 LDA #$20 C3/019B: 8526 STA $26 (execute at C3/1D03) C3/019D: 801B BRA $01BA