Gfx.h
上传用户:luhy168
上传日期:2022-01-10
资源大小:240k
文件大小:2k
源码类别:

模拟服务器

开发平台:

Visual C++

  1. //------------------------------------------------------------------------------
  2. // Name: Gfx.h
  3. // Desc: Header file for Gfx.cpp
  4. //------------------------------------------------------------------------------
  5. #ifndef __GFX_H__
  6. #define __GFX_H__
  7. //------------------------------------------------------------------------------
  8. // Defines
  9. //------------------------------------------------------------------------------
  10. #define SPRITE_BEHIND         0x20
  11. #define SPRITE_INFRONT        0
  12. #define TILE_X_SIZE           8
  13. #define TILE_Y_SIZE           8
  14. #define NUM_X_TILES           32
  15. #define NUM_Y_TILES           32
  16. #define SCREEN_WIDTH          256
  17. #define SCREEN_HEIGHT         240
  18. #define PATTERN_TABLE_ADDRESS 00010000b
  19. #define NAME_TABLE_ADDRESS_H  00000011b
  20. #define NUMBER_OF_COLORS      64        // Set to however many colors we need.
  21. // Includes
  22. #include <ddraw.h>
  23. #include "Cpu.h"
  24. #include "Ppu.h"
  25. // Functions prototypes.
  26. HRESULT BeginDrawing();
  27. VOID    ClearScreen(COLORREF crColor);
  28. VOID    CompilePixel(LPDIRECTDRAWSURFACE7 lpSurf, int nColorIndex, int r, int g, int b);
  29. HRESULT CreateDirectDraw(HWND hwnd);
  30. HRESULT DestroyDirectDraw();
  31. VOID    DoSprite0();
  32. VOID    DrawScanline();
  33. VOID    DrawScanlineH();
  34. VOID    DrawScanlineSprites();
  35. VOID    DrawSpriteLine(BYTE bySpriteNum);
  36. VOID    DrawSprite(BYTE bySpriteNum);
  37. VOID    DrawSprites(BYTE byPriority);
  38. VOID    EndDrawing();
  39. VOID    Flip();
  40. INT     GetMaskInfo(DWORD dwBitmask, int* pnShift);
  41. VOID    __stdcall PutBackgroundPixel(BYTE nColor);
  42. VOID    __stdcall PutSpritePixel(BYTE nColor);
  43. HRESULT UpdateBounds(HWND hwnd);
  44. VOID    OutputText(LPSTR strText, INT nX, INT nY, COLORREF cfFront, COLORREF cfBack);
  45. // External variables needed.
  46. extern NES6502 CPU;
  47. extern NESPPU  PPU;
  48. extern WORD    wScanline;
  49. extern BYTE    abySPRRAM[256];
  50. extern BYTE    byHScroll[300];
  51. extern BYTE    byVScroll[300];
  52. #endif