Please consider improving cga compatibility while using the default vga mode. Things like the color register seem to work fine with -machine cga, but seem to be ignored by the vga card modeled by dosbox.
Right now, if one is using CGA software on the default vga machine, the color select register appears to be ignored and only the CMWK hi-intensity palette is available, and no other colors are selectable. The same code appears to work unmodified when using -machine cga.
Will also try to test this code on a real 486 machine with a basic vga card. Can't test it on anything lower since I don't have access to anything lower.
I suspect this might be easy enough to remedy, but I'm not familiar with the dosbox code.
I took a bit of time to test this on real hardware. It could be that cheap vga cards don't handle the color select register and good ones did, or it could be that they all simply ignored writes to port 0x3d9.
So if anyone can confirm that no vga card respects writes to 0x3d9, I guess it can be closed...