Lorom

org $89AC00

JSR $AF50
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP


org $89AF50
CMP #$00C0
BCS TooHigh
CMP #$0080
BCS NewPalette 
TooHigh:
TAX
LDA $89AA02,X
STA $7EC232
LDA $89AA04,X
STA $7EC234
LDA $89AA06,X
STA $7EC236
RTS

NewPalette:

SEC
SBC #$0080
ASL A
TAX
JSR (PaletteIndex, X)
RTS

PaletteIndex:
DW $B0E0 ;80
DW $B200 ;81
DW $B320 ;82
DW $B440 ;83
DW $B560 ;84
DW $B680 ;85
DW $B7A0 ;86
DW $B8C0 ;87
DW $B9E0 ;88
DW $BB00 ;89
DW $BC20 ;8A
DW $BD40 ;8B
DW $BE60 ;8C
DW $BF80 ;8D
DW $C0A0 ;8E
DW $C1C0 ;8F
DW $C2E0 ;90
DW $C400 ;91
DW $C520 ;92
DW $C640 ;93
DW $C760 ;94
DW $C880 ;95
DW $C9A0 ;96
DW $CAC0 ;97
DW $CBE0 ;98
DW $CD00 ;99
DW $CE20 ;9A
DW $CF40 ;9B
DW $D060 ;9C
DW $D180 ;9D
DW $D2A0 ;9E
DW $D3C0 ;9F
DW $D4E0 ;A0
DW $D600 ;A1
DW $D720 ;A2
DW $D840 ;A3
DW $D960 ;A4
DW $DA80 ;A5
DW $DBA0 ;A6
DW $DCC0 ;A7
DW $DDE0 ;A8
DW $DF00 ;A9
DW $E020 ;AA
DW $E140 ;AB
DW $E260 ;AC
DW $E380 ;AD
DW $E4A0 ;AE
DW $E5C0 ;AF
DW $E6E0 ;B0
DW $E800 ;B1
DW $E920 ;B2
DW $EA40 ;B3
DW $EB60 ;B4
DW $EC80 ;B5
DW $EDA0 ;B6
DW $EEC0 ;B7
DW $EFE0 ;B8
DW $F100 ;B9
DW $F220 ;BA
DW $F340 ;BB
DW $F460 ;BC
DW $F580 ;BD
DW $F6A0 ;BE
DW $F7C0 ;BF

org $89B0E0
PHB
LDA #$00FF
LDX #$B0FF
LDY #$C200
MVN $897E
PLB
RTS

org $89B200
PHB
LDA #$00FF
LDX #$B21F
LDY #$C200
MVN $897E
PLB
RTS

org $89B320
PHB
LDA #$00FF
LDX #$B33F
LDY #$C200
MVN $897E
PLB
RTS

org $89B440
PHB
LDA #$00FF
LDX #$B45F
LDY #$C200
MVN $897E
PLB
RTS

org $89B560
PHB
LDA #$00FF
LDX #$B57F
LDY #$C200
MVN $897E
PLB
RTS

org $89B680
PHB
LDA #$00FF
LDX #$B69F
LDY #$C200
MVN $897E
PLB
RTS

org $89B7A0
PHB
LDA #$00FF
LDX #$B7BF
LDY #$C200
MVN $897E
PLB
RTS

org $89B8C0
PHB
LDA #$00FF
LDX #$B8DF
LDY #$C200
MVN $897E
PLB
RTS

org $89B9E0
PHB
LDA #$00FF
LDX #$B9FF
LDY #$C200
MVN $897E
PLB
RTS

org $89BB00
PHB
LDA #$00FF
LDX #$BB1F
LDY #$C200
MVN $897E
PLB
RTS

org $89BC20
PHB
LDA #$00FF
LDX #$BC3F
LDY #$C200
MVN $897E
PLB
RTS

org $89BD40
PHB
LDA #$00FF
LDX #$BD5F
LDY #$C200
MVN $897E
PLB
RTS

org $89BE60
PHB
LDA #$00FF
LDX #$BE7F
LDY #$C200
MVN $897E
PLB
RTS

org $89BF80
PHB
LDA #$00FF
LDX #$BF9F
LDY #$C200
MVN $897E
PLB
RTS

org $89C0A0
PHB
LDA #$00FF
LDX #$C0BF
LDY #$C200
MVN $897E
PLB
RTS

org $89C1C0
PHB
LDA #$00FF
LDX #$C1DF
LDY #$C200
MVN $897E
PLB
RTS

org $89C2E0
PHB
LDA #$00FF
LDX #$C2FF
LDY #$C200
MVN $897E
PLB
RTS

org $89C400
PHB
LDA #$00FF
LDX #$C41F
LDY #$C200
MVN $897E
PLB
RTS

org $89C520
PHB
LDA #$00FF
LDX #$C53F
LDY #$C200
MVN $897E
PLB
RTS

org $89C640
PHB
LDA #$00FF
LDX #$C65F
LDY #$C200
MVN $897E
PLB
RTS

org $89C760
PHB
LDA #$00FF
LDX #$C77F
LDY #$C200
MVN $897E
PLB
RTS

org $89C880
PHB
LDA #$00FF
LDX #$C89F
LDY #$C200
MVN $897E
PLB
RTS

org $89C9A0
PHB
LDA #$00FF
LDX #$C9BF
LDY #$C200
MVN $897E
PLB
RTS

org $89CAC0
PHB
LDA #$00FF
LDX #$CADF
LDY #$C200
MVN $897E
PLB
RTS

org $89CBE0
PHB
LDA #$00FF
LDX #$CBFF
LDY #$C200
MVN $897E
PLB
RTS

org $89CD00
PHB
LDA #$00FF
LDX #$CD1F
LDY #$C200
MVN $897E
PLB
RTS

org $89CE20
PHB
LDA #$00FF
LDX #$CE3F
LDY #$C200
MVN $897E
PLB
RTS

org $89CF40
PHB
LDA #$00FF
LDX #$CF5F
LDY #$C200
MVN $897E
PLB
RTS

org $89D060
PHB
LDA #$00FF
LDX #$D07F
LDY #$C200
MVN $897E
PLB
RTS

org $89D180
PHB
LDA #$00FF
LDX #$D19F
LDY #$C200
MVN $897E
PLB
RTS

org $89D2A0
PHB
LDA #$00FF
LDX #$D2BF
LDY #$C200
MVN $897E
PLB
RTS

org $89D3C0
PHB
LDA #$00FF
LDX #$D3DF
LDY #$C200
MVN $897E
PLB
RTS

org $89D4E0
PHB
LDA #$00FF
LDX #$D4FF
LDY #$C200
MVN $897E
PLB
RTS

org $89D600
PHB
LDA #$00FF
LDX #$D61F
LDY #$C200
MVN $897E
PLB
RTS

org $89D720
PHB
LDA #$00FF
LDX #$D73F
LDY #$C200
MVN $897E
PLB
RTS

org $89D840
PHB
LDA #$00FF
LDX #$D85F
LDY #$C200
MVN $897E
PLB
RTS

org $89D960
PHB
LDA #$00FF
LDX #$D97F
LDY #$C200
MVN $897E
PLB
RTS

org $89DA80
PHB
LDA #$00FF
LDX #$DA9F
LDY #$C200
MVN $897E
PLB
RTS

org $89DBA0
PHB
LDA #$00FF
LDX #$DBBF
LDY #$C200
MVN $897E
PLB
RTS

org $89DCC0
PHB
LDA #$00FF
LDX #$DCDF
LDY #$C200
MVN $897E
PLB
RTS

org $89DDE0
PHB
LDA #$00FF
LDX #$DDFF
LDY #$C200
MVN $897E
PLB
RTS

org $89DF00
PHB
LDA #$00FF
LDX #$DF1F
LDY #$C200
MVN $897E
PLB
RTS

org $89E020
PHB
LDA #$00FF
LDX #$E03F
LDY #$C200
MVN $897E
PLB
RTS

org $89E140
PHB
LDA #$00FF
LDX #$E15F
LDY #$C200
MVN $897E
PLB
RTS

org $89E260
PHB
LDA #$00FF
LDX #$E27F
LDY #$C200
MVN $897E
PLB
RTS

org $89E380
PHB
LDA #$00FF
LDX #$E39F
LDY #$C200
MVN $897E
PLB
RTS

org $89E4A0
PHB
LDA #$00FF
LDX #$E4BF
LDY #$C200
MVN $897E
PLB
RTS

org $89E5C0
PHB
LDA #$00FF
LDX #$E5DF
LDY #$C200
MVN $897E
PLB
RTS

org $89E6E0
PHB
LDA #$00FF
LDX #$E6FF
LDY #$C200
MVN $897E
PLB
RTS

org $89E800
PHB
LDA #$00FF
LDX #$E81F
LDY #$C200
MVN $897E
PLB
RTS

org $89E920
PHB
LDA #$00FF
LDX #$E93F
LDY #$C200
MVN $897E
PLB
RTS

org $89EA40
PHB
LDA #$00FF
LDX #$EA5F
LDY #$C200
MVN $897E
PLB
RTS

org $89EB60
PHB
LDA #$00FF
LDX #$EB7F
LDY #$C200
MVN $897E
PLB
RTS

org $89EC80
PHB
LDA #$00FF
LDX #$EC9F
LDY #$C200
MVN $897E
PLB
RTS

org $89EDA0
PHB
LDA #$00FF
LDX #$EDBF
LDY #$C200
MVN $897E
PLB
RTS

org $89EEC0
PHB
LDA #$00FF
LDX #$EEDF
LDY #$C200
MVN $897E
PLB
RTS

org $89EFE0
PHB
LDA #$00FF
LDX #$EFFF
LDY #$C200
MVN $897E
PLB
RTS

org $89F100
PHB
LDA #$00FF
LDX #$F11F
LDY #$C200
MVN $897E
PLB
RTS

org $89F220
PHB
LDA #$00FF
LDX #$F23F
LDY #$C200
MVN $897E
PLB
RTS

org $89F340
PHB
LDA #$00FF
LDX #$F35F
LDY #$C200
MVN $897E
PLB
RTS

org $89F460
PHB
LDA #$00FF
LDX #$F47F
LDY #$C200
MVN $897E
PLB
RTS

org $89F580
PHB
LDA #$00FF
LDX #$F59F
LDY #$C200
MVN $897E
PLB
RTS

org $89F6A0
PHB
LDA #$00FF
LDX #$F6BF
LDY #$C200
MVN $897E
PLB
RTS

org $89F7C0
PHB
LDA #$00FF
LDX #$F7DF
LDY #$C200
MVN $897E
PLB
RTS