Project Name: SKPIC32 Video Game with Sound Generator Module.
Author/Designer: YH
Project Description: A primitive video game set using SKPIC32 as the graphics processor, and the PIC32MX120F032B as the sound generator module. This final module is the combination of two projects which is the SKPIC32-based 256-color Video Experimental Game and a modified code of the 6-voice Polyphony Music Box based on SKPIC32.
The sound generator module is powered by the PIC32MX120F032B and uses Phase Modulation Synthesis to produce different sounds. To imitate the obsolete General Instruments/Microchip (Microchip Inc. was that division from that one) AY-3-8910 sound chip, the generator uses a specific ratio inside to form square-waves. Noise generation uses a wavetable which contains random numbers only. Random number generation is simply made by Excel. Other ratios can be used to create other different sounds like bell and clang, but in this game, generic square waves are used to make it more retro-like.
Sound effects are pre-programmed into the sound generator module as there are complexities involved in transferring sound data from the main processor. Future improvements including SPI microcontroller-to-microcontroller communication.
Take note that the sound generator has two channel square waves and one noise channel. The noise generation is in the third channel.
The tune from the start is from Action 52's "They came.../Beeps and Blips" theme. Action 52 is a 52-game compilation for the Nintendo Entertainment system and was very notorious for the poor design and atrocious game programming.
Sound Generator Hardware: PIC32MX120F032B with 8MHz crystal, operating at 40MHz. The single-bit DAC (using PWM) is at 78.125KHz and capable of three sound channels and one noise channel.
Noise wavetable is using random numbers generated in Excel, from 0~255. A high frequency noise will sound like a sharp buzz, and a medium frequency noise will hiss or "ssssh", and a low frequency noise will result in a deep "boom" or a "burning sound'.
Compiler: MPLAB C32 v1.00, MPLAB X IDE v1.10
Schematics:
Video:
All the codes for the respective modules are attached inside.
Note: A CRT monitor is best for this project if you have it. The graphics slightly tear in the LCD one.