
Tools:
- TRG source code file (http://milkcrate.com.au/_other/chipmusic_software/sms/TRG_20110502.sms)
- Context editor (http://www.context.cx/)
- WLA DX assembler (http://www.villehelin.com/wla.html)
- Sample converter patch (http://milkcrate.com.au/_other/chipmusic_software/sms/misc/sample_converter.maxpat)
- Max/MSP runtime (http://cycling74.com/downloads/)
1. Prepare Samples
Make your samples as loud as you can. Clip them if you want - keep in mind that the SN76489 plays back samples very quietly! This is especially the case if you are using a Game Gear with dying capacitors in it - these are notorious for causing a very quiet sound output.
2. Prepare Software
Set up WLA DX / Context as outlined by Maxim in his How To Program tutorial (see here: http://www.smspower.org/maxim/HowToProgram/SettingItUp).
3. Import a sample
Use the Max MSP audio sample converter patch to convert a sample to a text format. Open a sample by using the read button, and navigate to the sample.

Click on the toggle connected to the metro 1 object. This will convert up to 1000 samples of your chosen sample - at the chosen undersampling ratio.
Double-click on the on the text object to open up the converted sample data. Copy the sample data.
4. Format the Data
Format the data by pasting it into a new text file using WordPad or TextEdit. Truncate the sample date if there are superfluous 7's at the start or at the end of the data in order to save space in the ROM.


5. Insert the Data into the Source Code
Open up the source code .asm file in the Context editor. Copy the formatted audio sample data from the text file to the .asm file. First, choose a sample that you want to replace. In this example, we will use sample number one. Find the start of the sample, which is denoted by the label "Sample_01". Delete the existing data (which is found after the .db definition, below the "Sample_01" label).

Paste the new data after the .db definition.
Repeat steps 3 - 5 in order to add additional samples.
6. Compile a New ROM
Use the compile function of Context / WLA DX to create a new .SMS file that can be used with an emulator or on hardware.
0 comments:
Post a Comment