Skip to content

Commit

Permalink
Speed up Pixel Writes
Browse files Browse the repository at this point in the history
  • Loading branch information
fdivitto committed Jul 19, 2019
1 parent 6fcd27f commit 0caceca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vgacontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ RGB COLOR2RGB[16] = {
// pixel : 0 1 2 3 4 5 6 7 8 9 10 11 ...etc...
// byte : 2 3 0 1 6 7 4 5 10 11 8 9 ...etc...
// dword : 0 1 2 ...etc...
#define PIXELINROW(row, X) (row[((X) & 0xFFFC) + ((2 + (X)) & 3)])
// Thanks to https://github.com/paulscottrobson for the new macro. Before was: (row[((X) & 0xFFFC) + ((2 + (X)) & 3)])
#define PIXELINROW(row, X) (row[(X) ^ 2])

// requires variables: m_viewPort
#define PIXEL(X, Y) PIXELINROW(m_viewPort[(Y)], X)
Expand Down

0 comments on commit 0caceca

Please sign in to comment.