That one is actually far easier. Sex determination is something that has evolved multiple times across different lineages. But it's also important to distinguish between triggering genes, such as the presence of a male determining factor on the human Y chromosome and the Sxl gene on the X of fruit flies, and the mechanism of actually making a male or female. For example, the Sxl is a dose dependant signal that, if there is enough of it, triggers the female phenotype. Let's look closer at the gene:
http://www.sdbonline.org/sites/fly/gene/sexlthl1.htm
You see once again we have interplay between several genes. Sxl is primarily a regulator of other gene's expression, which would make sense since sex determination existed in insects far before fruit fly's Sxl system of triggering it. Switching from Sxl to some other mechanism of triggering sex determination isn't really any different than establishing Sxl sex determination in the first place.