lorom header org $01F464 ; 01/F45C: A9 01 LDA #$01 ; 01/F45E: 85 18 STA $18 ; 01/F460: AF 05 C0 7E LDA $7EC005 (is possibly dark room?) BEQ skipBrightChg1 ; branch if not LDX $045A ; get lit torch count INC $045A ; increment it CPX #$03 BCS skipBrightChg1 ; branch if originally >= 3 LDA $7EF34A ; is Lantern/Lamp possessed? BEQ clearSpot ; branch if not lda $0458 cmp #$01 ; was this room determined to be dark, have proper lit ; torch count, etc. upon entry? bne clearSpot ; branch if not, as we know we're above stricter ; original spotlight threshold of == 0. CPX #$02 ; we're using patch's more lenient threshold of < 3. ; will we be at 3 after the increment? BCC changeBright1 ; branch if not clearSpot: STZ $1D ; disable subscreen/overlay spotlight ; 39 bytes changeBright1: inx ; X = new lit torch count changeBright1b: JSR common1 ; set desired ambient room brightness skipBrightChg1: common2: LDA $0333 AND #$0F TAX PLA STA $04F0,X ; set starting torch timer (or zero it if reached ; from next function) STZ $0333 RTL ; 18 bytes ; total = 57 bytes versus 63 original ; --------------------------------- org $01F4AC LDA #$00 ; here are 5 reordered Nintendo instructions PHA ; put 00h on stack instead of C0h or C1h. lets us reuse ; above skipBrightChg1 code from this function, which ; won't read the pulled A in vanilla anyway (nor do ; its callers). ; Going to be using data bank $00 PHB PHA PLB org $01F4F2 ; 01/F4EA: A9 01 LDA #$01 ; 01/F4EC: 85 18 STA $18 ; 01/F4EE: AF 05 C0 7E LDA $7EC005 (is possibly dark room?) BEQ skipBrightChg1 ; branch if not LDX $045A ; get lit torch count BEQ skipBrightChg1 ; branch if already zero somehow DEX ; decrement it STX $045A ; store decremented lit torch count CPX #$03 BCS skipBrightChg1 ; branch if new count >= 3 ; 116-byte relative branch. unseemly? LDA $7EF34A ; is Lantern/Lamp possessed? BEQ skipSpotLt ; branch if not. maybe go to "STA $1D" if stricter? lda $0458 cmp #$01 ; was this room determined to be dark, have proper lit ; torch count, etc. upon entry? beq storeSpotLt ; branch if so, as we're using patch's more lenient ; spotlight threshold of < 3. txa ; get new lit torch count again bne skipSpotLt ; branch if it doesn't meet stricter original value ; of == 0. inc ; 40 bytes doSpotLt: ; LDA #$01 storeSpotLt: STA $1D ; value of 1 enables subscreen/overlay spotlight skipSpotLt: JMP changeBright1b ; set desired ambient room brightness, then zero ; torch timer and do something else with it ; 5 bytes common1: LDA $02A1E5,X ; get a brightness reducer based on new lit torch count STA $7EC017 ; save target value. will be phased in. LDA #$0A STA $11 STZ $B0 RTS ; 15 bytes ; total = 60 bytes versus 62 original