SMPS Player with Visuals (Preview)

Discussion in 'Technical Discussion' started by Oerg866, Apr 22, 2010.

  1. So I thought I should post a little preview about it.

    [​IMG]
    [​IMG]
    [​IMG]

    This SMPS player is losely based on my bugfix of JoseTB's SMPS ROM that did nothing other than play a SMPS music. After some hard work that took roughly about 4 months to complete, I finally have a SMPS player with visuals, like I always wanted it before :)

    * Logo on top
    * Current note & Instrument on all channels
    * Ability to give names to songs
    * Fully compatible with real hardware

    TODO:
    * Loader that figures out whether FM6 = PCM/FM6, PSG3 = NOISE/PSG3
    * Gradient on the VU meter
    * Much more to come (Intro, Changing top logo with UP/DOWN buttons, pallette shifting for demo-like effects on font etc.)


    Preview ROM: <a href="http://oerg866.tototek.com/evoke3.bin" target="_blank">http://oerg866.tototek.com/evoke3.bin</a>

    Comments and criticism and feature requests are welcome.
     
  2. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    0
    0
    Writing my own MD/Genesis sound driver :D
    <!--quoteo(post=446151:date=Apr 22 2010, 06:25 AM:name=Oerg866)--><div class='quotetop'>QUOTE (Oerg866 @ Apr 22 2010, 06:25 AM) <a href="index.php?act=findpost&pid=446151">[​IMG]</a></div><div class='quotemain'><!--quotec-->* Loader that figures out whether PSG3 = NOISE/PSG3<!--QuoteEnd--></div><!--QuoteEEnd-->
    Coordination flag $F3 determines that, so I hope you can switch from tone to noise at will! <a href="http://info.sonicretro.org/SCHG:Music_Hacking" target="_blank">Seriously, read this.</a>
     
  3. <!--quoteo(post=446174:date=Apr 22 2010, 03:26 PM:name=Andlabs)--><div class='quotetop'>QUOTE (Andlabs @ Apr 22 2010, 03:26 PM) <a href="index.php?act=findpost&pid=446174">[​IMG]</a></div><div class='quotemain'><!--quotec--><!--quoteo(post=446151:date=Apr 22 2010, 06:25 AM:name=Oerg866)--><div class='quotetop'>QUOTE (Oerg866 @ Apr 22 2010, 06:25 AM) <a href="index.php?act=findpost&pid=446151">[​IMG]</a></div><div class='quotemain'><!--quotec-->* Loader that figures out whether PSG3 = NOISE/PSG3<!--QuoteEnd--></div><!--QuoteEEnd-->
    Coordination flag $F3 determines that, so I hope you can switch from tone to noise at will! <a href="http://info.sonicretro.org/SCHG:Music_Hacking" target="_blank">Seriously, read this.</a>
    <!--QuoteEnd--></div><!--QuoteEEnd-->

    Well, I cannot read coordination flags because all I have to read is a small memory area.

    However, I might have a solution: If the channel is noise, then the note value is always $0000.

    The FM channel thing though, that's quite 'lot more complicated.
     
  4. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    0
    0
    Writing my own MD/Genesis sound driver :D
    Then you should probably go and modify SMPS to do what your player needs to do. It's not that hard once you knowwhere everything is. Are you using SMPS Z80 or SMPS 68k?
     
  5. SMPS 68k
     
  6. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    0
    0
    Writing my own MD/Genesis sound driver :D
    Then it's easy: just find where the effects are handled, set a flag in RAM, then clear it when a new song is played.
     
  7. amphobius

    amphobius

    doing more important things with my life Member
    2,120
    0
    16
    life
    Looks clean and to the point. I happily await for proper channel naming and a source release.

    I will say that Fraggle sounds nice, too. :P
     
  8. Mairtrus

    Mairtrus

    Get a load of this!! Tech Member
    27
    0
    0
    Mendoza, Argentina
    Sonic Z. The Z DOESN'T means nothing.
    <!--quoteo(post=446191:date=Apr 22 2010, 12:05 PM:name=Andlabs)--><div class='quotetop'>QUOTE (Andlabs @ Apr 22 2010, 12:05 PM) <a href="index.php?act=findpost&pid=446191">[​IMG]</a></div><div class='quotemain'><!--quotec-->Then it's easy: just find where the effects are handled, set a flag in RAM, then clear it when a new song is played.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Or even easier, check the location $FFF1F1. If the value is $E0, you have the NOISE. Whatever else (I think it's $C0), it's the PSG 3. Aditionally, the bit 7 at $FFF040 controlls if the DAC channel is activated or not. The same bit at $FFF160 do the same function for the FM6. Understandable?
     
  9. Wow, thanks, mate! :)
     
  10. ICEknight

    ICEknight

    Researcher Researcher
    Looks very cool. Does it work by adding the music tracks at the end of the ROM, or something like that?
     
  11. well. it works using standard includes and a few extra data you have to specify (Song name etc).

    Right now I'm trying to eliminate a bug that makes the pcm-driver not work right for samples over $87 for some reason.
     
  12. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    0
    0
    Writing my own MD/Genesis sound driver :D
    The Z80 driver in Sonic 1 resamples the existing timpani sample if the number is above $87. This is done using special entries in the DAC table. For what it's worth you probably shouldn't be modifying the Sonic 1 DAC driver if you want something truly general purpose. Use jman2050's driver or write a new DAC driver instead.
     
  13. Mairtrus

    Mairtrus

    Get a load of this!! Tech Member
    27
    0
    0
    Mendoza, Argentina
    Sonic Z. The Z DOESN'T means nothing.
    <!--quoteo(post=448298:date=Apr 27 2010, 03:15 PM:name=Andlabs)--><div class='quotetop'>QUOTE (Andlabs @ Apr 27 2010, 03:15 PM) <a href="index.php?act=findpost&pid=448298">[​IMG]</a></div><div class='quotemain'><!--quotec-->The Z80 driver in Sonic 1 resamples the existing timpani sample if the number is above $87. This is done using special entries in the DAC table. For what it's worth you probably shouldn't be modifying the Sonic 1 DAC driver if you want something truly general purpose. Use jman2050's driver or write a new DAC driver instead.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Wrong. The "special cases" are handled by the M68K, specifically by the routine loc_71CAC. It looks something like this:
    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='geshimain'><!--eg1--><pre class="asm" style="font-family:monospace;"> <span style="color: #00bfff;">btst</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">3</span>,<span style="font-weight:bold;">d0</span> <span style="color: #adadad; font-style: italic;">; it's a special timpani?</span>
    <span style="color: #00bfff;">bne</span>.<span style="color: #00bfff;">s</span> loc_71CAC <span style="color: #adadad; font-style: italic;">; if yes, branch...</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">b</span> <span style="font-weight:bold;">d0</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">A01FFF</span><span style="">)</span>.<span style="color: #00bfff;">l</span> <span style="color: #adadad; font-style: italic;">; writes the sample's number into the Z80 RAM</span>
    &nbsp;
    locret_71CAA:
    <span style="color: #00bfff;">rts</span> <span style="color: #adadad; font-style: italic;">; leave...</span>
    <span style="color: #adadad; font-style: italic;">; ===========================================================================</span>
    &nbsp;
    loc_71CAC:
    <span style="color: #00bfff;">subi</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">88</span>,<span style="font-weight:bold;">d0</span> <span style="color: #adadad; font-style: italic;">; adjusts to the correct number</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">b</span> Timpani_Pitches<span style="">(</span>pc,<span style="font-weight:bold;">d0</span>.<span style="color: #00bfff;">w</span><span style="">)</span>,<span style="font-weight:bold;">d0</span> <span style="color: #adadad; font-style: italic;">; loads the modified pitch for the timpani</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">b</span> <span style="font-weight:bold;">d0</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">A000EA</span><span style="">)</span>.<span style="color: #00bfff;">l</span> <span style="color: #adadad; font-style: italic;">; modifies the pitch</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">83</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">A01FFF</span><span style="">)</span>.<span style="color: #00bfff;">l</span> <span style="color: #adadad; font-style: italic;">; plays the normal timpani</span>
    <span style="color: #00bfff;">rts</span> <span style="color: #adadad; font-style: italic;">; leave...</span>
    <span style="color: #adadad; font-style: italic;">; End of function Sound_PlayDAC</span>
    &nbsp;
    <span style="color: #adadad; font-style: italic;">; ===========================================================================</span>
    Timpani_Pitches: <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">12</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">15</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">1C</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">1D</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">FF</span>, <span style="color: #ff0000;">$</span><span style="color: #ff0000;">FF</span></pre><!--gc2--><!--CQlidHN0CSMzLGQwCQkJOyBpdCYjMzk7cyBhIHNwZWNpYWwgdGltcGFuaT8KCQlibmUucwlsb2NfNzFD
    QUMJCTsgaWYgeWVzLCBicmFuY2guLi4KCQltb3ZlLmIJZDAsKCYjMDM2O0EwMUZGRikubAkJOyB3cml0Z
    XMgdGhlIHNhbXBsZSYjMzk7cyBudW1iZXIgaW50byB0aGUgWjgwIFJBTQoKbG9jcmV0XzcxQ0FBOgoJCX
    J0cwkJCQk7IGxlYXZlLi4uCjsgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0
    9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Cgpsb2NfNzFDQUM6CgkJc3ViaS5iCSMmIzAz
    Njs4OCxkMAkJCTsgYWRqdXN0cyB0byB0aGUgY29ycmVjdCBudW1iZXIKCQltb3ZlLmIJVGltcGFuaV9Qa
    XRjaGVzKHBjLGQwLncpLGQwIDsgbG9hZHMgdGhlIG1vZGlmaWVkIHBpdGNoIGZvciB0aGUgdGltcGFuaQ
    oJCW1vdmUuYglkMCwoJiMwMzY7QTAwMEVBKS5sCQk7IG1vZGlmaWVzIHRoZSBwaXRjaAoJCW1vdmUuYgk
    jJiMwMzY7ODMsKCYjMDM2O0EwMUZGRikubAk7IHBsYXlzIHRoZSBub3JtYWwgdGltcGFuaQoJCXJ0cwkJ
    CQk7IGxlYXZlLi4uCjsgRW5kIG9mIGZ1bmN0aW9uIFNvdW5kX1BsYXlEQUMKCjsgPT09PT09PT09PT09P
    T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT
    09ClRpbXBhbmlfUGl0Y2hlczogZGMuYiAmIzAzNjsxMiwgJiMwMzY7MTUsICYjMDM2OzFDLCAmIzAzNjs
    xRCwgJiMwMzY7RkYsICYjMDM2O0ZG--><!--egc2--><!--g2--></div><!--eg2-->
    In other words, the engine just modifies the current pitch asociated to the (unique) timpani entry in the DAC table in the Z80 code. You only need to cut off the lines above to erase that restriction...
     
  14. Well, actually I am using jman's driver.
     
  15. amphobius

    amphobius

    doing more important things with my life Member
    2,120
    0
    16
    life
    I sincerely hope that modification of DAC samples are done in an ASM format and not a binary.
     
  16. <!--quoteo(post=448558:date=Apr 28 2010, 07:03 PM:name=DalekSam)--><div class='quotetop'>QUOTE (DalekSam @ Apr 28 2010, 07:03 PM) <a href="index.php?act=findpost&pid=448558">[​IMG]</a></div><div class='quotemain'><!--quotec-->I sincerely hope that modification of DAC samples are done in an ASM format and not a binary.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Well, you're in luck.

    Code (Text):
    1. PCM_Table:
    2. &nbsp;&nbsp;&nbsp;&nbsp;pcm_table_entry a81,a81_end,$2; Sample 81
    3. &nbsp;&nbsp;&nbsp;&nbsp;pcm_table_entry a82,a82_end,$2; Sample 82
    4. &nbsp;&nbsp;&nbsp;&nbsp;pcm_table_entry a83,a83_end,$2; Sample 83
    5. &nbsp;&nbsp;&nbsp;&nbsp;pcm_table_entry a84,a84_end,$2 ; sample 84
    6. &nbsp;&nbsp;&nbsp;&nbsp;pcm_table_entry xguard1,xguard1_end,$9; Sample 85, XGUARD SNARE1
    7. &nbsp;&nbsp;&nbsp;&nbsp;pcm_table_entry xguard2,xguard2_end,$9; Sample 86, XGUARD SNARE2
    8. &nbsp;&nbsp;&nbsp;&nbsp;pcm_table_entry xguard3,xguard3_end,$9; Sample 87, XGUARD HAT1
    9. &nbsp;&nbsp;&nbsp;&nbsp;pcm_table_entry xguard4,xguard4_end,$9; Sample 88, XGUARD HAT2
    10. &nbsp;&nbsp;&nbsp;&nbsp;pcm_table_entry xguard5,xguard5_end,$9; Sample 89, XGUARD HAT3
    11. &nbsp;&nbsp;&nbsp;&nbsp;pcm_table_entry xguard6,xguard6_end,$9; Sample 8a, XGUARD HAT4
    12. &nbsp;&nbsp;&nbsp;&nbsp;pcm_table_entry hc1, hc1_end, $2; 8b
    13. &nbsp;&nbsp;&nbsp;&nbsp;pcm_table_entry hc2, hc2_end, $2; 8b
    14. &nbsp;&nbsp;&nbsp;&nbsp;pcm_table_entry hc3, hc3_end, $2; 8b
    15. &nbsp;&nbsp;&nbsp;&nbsp;pcm_table_entry hc4, hc4_end, $2; 8b
     
  17. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    0
    0
    Writing my own MD/Genesis sound driver :D
    New idea: make programs that'll create a custom ROM using the sound player given file names like dac81.bin, song81.bin, etc.
     
  18. [​IMG]

    <a href="http://pixelbanane.de/yafu/2441081305/BUILT.bin" target="_blank">http://pixelbanane.de/yafu/2441081305/BUILT.bin</a>

    New preview and some added things like scroller and palette effect :)
     
  19. New build!

    Actually done some real progress: A song can switch PCM/FM6 and PSG/Noise without any problems on the fly!. :)

    <a href="http://oerg866.tototek.com/PCMPSG_Recognition_Build.bin" target="_blank">http://oerg866.tototek.com/PCMPSG_Recognition_Build.bin</a>
     
  20. Bibin

    Bibin

    DON'T LET THE SUN LAUGH AT YOU. Member
    882
    0
    0
    New York City
    Ghost in the Machine
    This is really great, but why in the world did you do Cleartype-esuqe antialiasing on the text?