Yes I know, lol sorry if I'm frustrating you, I know about calls, jmp, replacing code, ret, etc the piece i was missing was bank 0 which is what I was trying to get at but didn't know the name for. When I said have it run, i meant a location that I can legally put code into and call it from the loop that writes to the palette registers and not some space like where the tiles are stored or whatever. Thanks, I'm gonna play around with it and see what i can come up with in the morning.
Edit:
The code resides in bank 21 for Link's Awakening and bank 3f for the Oracle games (which makes sense given the address I mentioned earlier, 0xfc067). Lin, do you think you can take a look at this?
I'm not to the point in asm where stuff like this makes sense to me, but I have a feeling it's much simpler than how it looks:
RO3F:4067
ldi a,(hl)
ld c,a
and a,e0
ld b,a
ld a,(hl)
and a,03
or b
swap a
ld b,a
ldd a,(hl)
and a,7c
rrca
rrca
push hl
ld hl,de60
rst 10
ld a,b
ld b,(hl)
ld hl,de21
rst 10
ldd a,(hl)
or b
ld b,a
ld a,c
and a,1f
ld c,(hl)
ld hl,de00
rst 10
ld a,(hl)
or c
pop hl
ld c,h
res 7,l
ld h,df
ldi (hl),a
ld a,b
ldi (hl),a
set 7,l
ld h,c
ret