dsp2.hpp 787 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. class DSP2 : public Memory {
  2. public:
  3. struct {
  4. bool waiting_for_command;
  5. unsigned command;
  6. unsigned in_count, in_index;
  7. unsigned out_count, out_index;
  8. uint8 parameters[512];
  9. uint8 output[512];
  10. uint8 op05transparent;
  11. bool op05haslen;
  12. int op05len;
  13. bool op06haslen;
  14. int op06len;
  15. uint16 op09word1;
  16. uint16 op09word2;
  17. bool op0dhaslen;
  18. int op0doutlen;
  19. int op0dinlen;
  20. } status;
  21. void init();
  22. void enable();
  23. void power();
  24. void reset();
  25. uint8 read(unsigned addr);
  26. void write(unsigned addr, uint8 data);
  27. DSP2();
  28. ~DSP2();
  29. protected:
  30. void op01();
  31. void op03();
  32. void op05();
  33. void op06();
  34. void op09();
  35. void op0d();
  36. };
  37. extern DSP2 dsp2;