MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / UpdateDHiResCell

Function UpdateDHiResCell

source/RGBMonitor.cpp:618–647  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

616#define VALUE (dwordval >> (4 + PIXEL - COLOR))
617
618void UpdateDHiResCell(int x, int y, uint16_t addr, bgra_t* pVideoAddress, bool updateAux, bool updateMain)
619{
620 const int xpixel = x * 14;
621
622 uint8_t* pAux = MemGetAuxPtr(addr);
623 uint8_t* pMain = MemGetMainPtr(addr);
624
625 BYTE byteval1 = (x > 0) ? *(pMain - 1) : 0;
626 BYTE byteval2 = *pAux;
627 BYTE byteval3 = *pMain;
628 BYTE byteval4 = (x < 39) ? *(pAux + 1) : 0;
629
630 uint32_t dwordval = (byteval1 & 0x70) | ((byteval2 & 0x7F) << 7) |
631 ((byteval3 & 0x7F) << 14) | ((byteval4 & 0x07) << 21);
632
633#define PIXEL 0
634 if (updateAux)
635 {
636 CopySource(7, 2, SRCOFFS_DHIRES + 10 * HIBYTE(VALUE) + COLOR, LOBYTE(VALUE), pVideoAddress);
637 pVideoAddress += 7;
638 }
639#undef PIXEL
640
641#define PIXEL 7
642 if (updateMain)
643 {
644 CopySource(7, 2, SRCOFFS_DHIRES + 10 * HIBYTE(VALUE) + COLOR, LOBYTE(VALUE), pVideoAddress);
645 }
646#undef PIXEL
647}
648
649//===========================================================================
650// RGB videocards HGR

Callers 1

Calls 3

MemGetAuxPtrFunction · 0.85
MemGetMainPtrFunction · 0.85
CopySourceFunction · 0.85

Tested by

no test coverage detected