I got an idea that has to do with pixel shaders, but know next to nothing about them, so is it feasible? Let me explain...

Since I want my game to be in 256 colors and to use only the palette the NES used, would it be possible to throw it into true color mode since Direct 3D 8 doesn't support 256 color mode and make a pixel shader that maps things it's applied to, to the palette the frame uses? I would then apply the pixel shader to the whole layer of course that the game takes place on.

If it is possible could someone be nice and point me in the right direction for making a pixel shader like this, or, if it's not too much work, perhaps make me one? I will give you full credit in whatever category is applicable to this. Or perhaps even one has already been made? Could someone link me to it, if it exists?