2023-02-23 22:48:19 +00:00
|
|
|
#include "platform.h"
|
|
|
|
#include "x86real.h"
|
|
|
|
#include "pc98.h"
|
|
|
|
#include "planar.h"
|
|
|
|
#include "platform/x86real/pc98/grcg.hpp"
|
|
|
|
|
2023-06-25 18:41:05 +00:00
|
|
|
void GRCG::setcolor(vc_t col)
|
2023-02-23 22:48:19 +00:00
|
|
|
{
|
|
|
|
// By shifting each successive bit of [col] into the carry flag and using
|
|
|
|
// tile_register_from_carry(), we get the minimum of three instructions
|
|
|
|
// (SHR, SBB, OUT) per bitplane, with no register spills. Quite a beautiful
|
|
|
|
// optimization!
|
|
|
|
_AH = col;
|
|
|
|
outportb(0x7E, tile_register_from_carry(_AH >>= 1));
|
|
|
|
outportb(0x7E, tile_register_from_carry(_AH >>= 1));
|
|
|
|
outportb(0x7E, tile_register_from_carry(_AH >>= 1));
|
|
|
|
outportb(0x7E, tile_register_from_carry(_AH >>= 1));
|
|
|
|
}
|