interface.cpp 850 B

12345678910111213141516171819202122232425262728293031
  1. SNESInterface snesinterface;
  2. void SNESInterface::video_refresh(uint16_t *data, unsigned pitch, unsigned *line, unsigned width, unsigned height) {
  3. uint32_t *output;
  4. unsigned outpitch;
  5. if(video.lock(output, outpitch) == true) {
  6. unsigned outwidth, outheight;
  7. libfilter::filter.render(output, outpitch, outwidth, outheight, data, pitch, line, width, height);
  8. video.unlock();
  9. video.refresh(outwidth, outheight);
  10. }
  11. }
  12. void SNESInterface::audio_sample(uint16_t left, uint16_t right) {
  13. if(config.audio.mute) left = right = 0;
  14. audio.sample(left, right);
  15. }
  16. void SNESInterface::input_poll() {
  17. inputManager.poll();
  18. }
  19. int16_t SNESInterface::input_poll(unsigned deviceid, unsigned id) {
  20. return inputManager.getStatus(deviceid, id);
  21. }
  22. void SNESInterface::init() {
  23. }
  24. void SNESInterface::term() {
  25. }