An emulator, assembler, and disassembler for the Sega Game Gear
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

54 lines
952 B

  1. /* Copyright (C) 2014-2016 Ben Kurtovic <ben.kurtovic@gmail.com>
  2. Released under the terms of the MIT License. See LICENSE for details. */
  3. #include "psg.h"
  4. #include "util.h"
  5. /*
  6. Initialize the SN76489 Programmable Sound Generator (PSG).
  7. */
  8. void psg_init(PSG *psg)
  9. {
  10. // TODO
  11. (void) psg;
  12. }
  13. /*
  14. Free memory previously allocated by the PSG.
  15. */
  16. void psg_free(PSG *psg)
  17. {
  18. // TODO
  19. (void) psg;
  20. }
  21. /*
  22. Power on the PSG, setting up initial state.
  23. */
  24. void psg_power(PSG *psg)
  25. {
  26. psg->tone1 = psg->tone2 = psg->tone3 = 0x0000;
  27. psg->vol1 = psg->vol2 = psg->vol3 = 0x0F;
  28. psg->noise = 0x00;
  29. }
  30. /*
  31. Write a byte of input to the PSG.
  32. */
  33. void psg_write(PSG *psg, uint8_t byte)
  34. {
  35. // TODO
  36. (void) psg;
  37. TRACE("PSG ignoring write: 0x%02X", byte)
  38. }
  39. /*
  40. Send a byte to the PSG's stereo control.
  41. */
  42. void psg_stereo(PSG *psg, uint8_t byte)
  43. {
  44. // TODO
  45. (void) psg;
  46. TRACE("PSG ignoring stereo: 0x%02X", byte)
  47. }