cx4.hpp 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. class Cx4 : public Memory {
  2. private:
  3. uint8 ram[0x0c00];
  4. uint8 reg[0x0100];
  5. uint32 r0, r1, r2, r3, r4, r5, r6, r7,
  6. r8, r9, r10, r11, r12, r13, r14, r15;
  7. static const uint8 immediate_data[48];
  8. static const uint16 wave_data[40];
  9. static const uint32 sin_table[256];
  10. static const int16 SinTable[512];
  11. static const int16 CosTable[512];
  12. int16 C4WFXVal, C4WFYVal, C4WFZVal, C4WFX2Val, C4WFY2Val, C4WFDist, C4WFScale;
  13. int16 C41FXVal, C41FYVal, C41FAngleRes, C41FDist, C41FDistVal;
  14. double tanval;
  15. double c4x,c4y,c4z, c4x2,c4y2,c4z2;
  16. void C4TransfWireFrame();
  17. void C4TransfWireFrame2();
  18. void C4CalcWireFrame();
  19. void C4DrawLine(int32 X1, int32 Y1, int16 Z1, int32 X2, int32 Y2, int16 Z2, uint8 Color);
  20. void C4DrawWireFrame();
  21. void C4DoScaleRotate(int row_padding);
  22. public:
  23. uint32 ldr(uint8 r);
  24. void str(uint8 r, uint32 data);
  25. void mul(uint32 x, uint32 y, uint32 &rl, uint32 &rh);
  26. uint32 sin(uint32 rx);
  27. uint32 cos(uint32 rx);
  28. void transfer_data();
  29. void immediate_reg(uint32 num);
  30. void op00_00();
  31. void op00_03();
  32. void op00_05();
  33. void op00_07();
  34. void op00_08();
  35. void op00_0b();
  36. void op00_0c();
  37. void op00();
  38. void op01();
  39. void op05();
  40. void op0d();
  41. void op10();
  42. void op13();
  43. void op15();
  44. void op1f();
  45. void op22();
  46. void op25();
  47. void op2d();
  48. void op40();
  49. void op54();
  50. void op5c();
  51. void op5e();
  52. void op60();
  53. void op62();
  54. void op64();
  55. void op66();
  56. void op68();
  57. void op6a();
  58. void op6c();
  59. void op6e();
  60. void op70();
  61. void op72();
  62. void op74();
  63. void op76();
  64. void op78();
  65. void op7a();
  66. void op7c();
  67. void op89();
  68. uint8 readb(uint16 addr);
  69. uint16 readw(uint16 addr);
  70. uint32 readl(uint16 addr);
  71. void writeb(uint16 addr, uint8 data);
  72. void writew(uint16 addr, uint16 data);
  73. void writel(uint16 addr, uint32 data);
  74. //
  75. void init();
  76. void enable();
  77. void power();
  78. void reset();
  79. uint8 read (unsigned addr);
  80. void write(unsigned addr, uint8 data);
  81. };
  82. extern Cx4 cx4;