Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //opcode for drawing sprites
- //DXYN or something
- //be sure all variables are defined
- rx = opcode[0] & 0x0F;
- ry = opcode[1] & 0xF0;
- hbyte = opcode[1] & 0x0F;
- for (j = 0; j <= hbyte; j++) {
- lbyte = memory[i + j];
- for (k = 0; k < 8; k++) {
- pbit = lbyte & ( 1 << k);
- if (pbit) {
- pixelRect.x = rx * displaywidth;
- pixelRect.y = ry * displayheight;
- pixelRect.w = displayscale;
- pixelRect.h = displayscale;
- SDL_RenderReadPixels(renderer, pixelRect, 0, pixelData, pitch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement