dma.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. struct {
  2. //$420b
  3. bool dma_enabled;
  4. //$420c
  5. bool hdma_enabled;
  6. //$43x0
  7. uint8 dmap;
  8. bool direction;
  9. bool hdma_indirect;
  10. bool reversexfer;
  11. bool fixedxfer;
  12. uint8 xfermode;
  13. //$43x1
  14. uint8 destaddr;
  15. //$43x2-$43x3
  16. uint16 srcaddr;
  17. //$43x4
  18. uint8 srcbank;
  19. //$43x5-$43x6
  20. union {
  21. uint16 xfersize;
  22. uint16 hdma_iaddr;
  23. };
  24. //$43x7
  25. uint8 hdma_ibank;
  26. //$43x8-$43x9
  27. uint16 hdma_addr;
  28. //$43xa
  29. uint8 hdma_line_counter;
  30. //$43xb/$43xf
  31. uint8 unknown;
  32. //internal variables
  33. bool hdma_completed;
  34. bool hdma_do_transfer;
  35. } channel[8];
  36. void dma_add_clocks(unsigned clocks);
  37. bool dma_addr_valid(uint32 abus);
  38. uint8 dma_read(uint32 abus);
  39. void dma_transfer(bool direction, uint8 bbus, uint32 abus);
  40. uint8 dma_bbus(uint8 i, uint8 index);
  41. uint32 dma_addr(uint8 i);
  42. uint32 hdma_addr(uint8 i);
  43. uint32 hdma_iaddr(uint8 i);
  44. uint8 dma_enabled_channels();
  45. void dma_run();
  46. bool hdma_active(uint8 i);
  47. bool hdma_active_after(uint8 i);
  48. uint8 hdma_enabled_channels();
  49. uint8 hdma_active_channels();
  50. void hdma_update(uint8 i);
  51. void hdma_run();
  52. void hdma_init_reset();
  53. void hdma_init();
  54. void dma_power();
  55. void dma_reset();