don't click here

SMPS Player Public Pack Release!

Discussion in 'Technical Discussion' started by Oerg866, Aug 9, 2010.

  1. Dear Sonic Retro,

    Today I release my main project at public playground release for the first time. It is entered in the HAcking contest just for the heck of it.

    http://oerg866.tototek.com/SMPSPLAY_PUBLIC.ZIP

    Criticism&Comments welome.

    The pack right now contains the demo song and PSG/PCM definitions formatted to Sonic 1 standards.

    The toolkit sources are public domain.

    Cheers,
    Oerg

    Code (Text):
    1.  ______________________________________________________
    2. |                                                      |
    3. |    .d8888b.  888b     d888  8888888b.   .d8888b.     |
    4. |   d88P  Y88b 8888b   d8888  888   Y88b d88P  Y88b    |
    5. |   Y88b.      88888b.d88888  888    888 Y88b.         |
    6. |    "Y888b.   888Y88888P888  888   d88P  "Y888b.      |
    7. |       "Y88b. 888 Y888P 888  8888888P"      "Y88b.    |
    8. |         "888 888  Y8P  888  888              "888    |
    9. |   Y88b  d88P 888   "   888  888        Y88b  d88P    |
    10. |    "Y8888P"  888       888  888         "Y8888P"     |
    11. |                                                      |
    12. | h t t p : / / o e r g 8 6 6 . t o t o t e k . c o m  |
    13. |                                                      |
    14. |  8888888b.  888  By Oerg866 Software      (C) 2010   |                            
    15. |  888   Y88b 888  ---------------------------------   |      
    16. |  888    888 888                                      |
    17. |  888   d88P 888  8888b.  888  888  .d88b.  888d888   |
    18. |  8888888P"  888     "88b 888  888 d8P  Y8b 888P"     |
    19. |  888        888 .d888888 888  888 88888888 888       |
    20. |  888        888 888  888 Y88b 888 Y8b.     888       |
    21. |  888        888 "Y888888  "Y88888  "Y8888  888       |
    22. |                               888                    |
    23. |                          Y8b d88P    V E R S I O N   |
    24. |                           "Y88P"             2 . 5   |
    25. |______________________________________________________|
    26. |                                                      |
    27. | Dear user,                                           |
    28. |                                                      |
    29. | Thank you for downloading my SMPS Player for the     |
    30. | SEGA Mega Drive / Genesis system! Oh, and thank you  |
    31. | for caring to read the ReadMe-File =P!               |
    32. |                                                      |
    33. | My SMPS player is simple to use and visualizes what  |
    34. | happens inside SMPS just like you want it, and while |
    35. | that is actually enough to be a program itself, it   |
    36. | actually lets you have many songs specializing its   |
    37. | name and all, adding more and custom (!) PCM samples |
    38. | just how you feel the need to!                       |
    39. |                                                      |
    40. | The player features:                                 |
    41. |                                                      |
    42. | * Correct channel recognition and naming             |
    43. |   (FM6 / PCM and PSG3 / Noise)                       |
    44. | * VU-Meter-ish bars for visualisation's sake         |
    45. | * Display of current note and instrument             |
    46. |   (With a REALLY sexy font drawn by me :3)           |
    47. | * A *lot* of music slots! ($81 until $FB)            |
    48. | * Simple to use programs to guide you through adding |
    49. |   stuff                                              |
    50. | * Song naming                                        |
    51. | * Simple controls for changing current song          |
    52. | * A sexy logo with effects                           |
    53. | * A sexy scoller XD                                  |
    54. |                                                      |
    55. | The player comes pre-loaded with some PCM samples:   |
    56. |______________________________________________________|
    57. |                                                      |
    58. | Sample     Description           ------------------- |
    59. | 81         Base drum             Note: this is Sonic |
    60. | 82         Snare drum            the hedgehog 1 defs |
    61. | 83         High timpani          + clap + cymbal !!! |
    62. | 84         Clap                  ------------------- |
    63. | 85         Cymbal                                    |
    64. | 88         Hi-Mid timpani                            |
    65. | 89         Mid timpani                               |
    66. | 8A         Lo-Mid timpani                            |
    67. | 8B         Low timpani                               |
    68. |______________________________________________________|
    69. |                                                      |
    70. | Credits and thanks:                                  |
    71. |                                                      |
    72. | Jman2050     PCM Driver                              |
    73. | JoseTB       Initial Idea and SMPS Extraction        |
    74. | TmEE         Various advice, explanation, additions  |
    75. | Jorge Nuno   Testing                                 |
    76. | Sik          Testing & Help                          |
    77. | Nineko       Motivation, Testing                     |
    78. |______________________________________________________|
    79. |                                                      |
    80. | For help with the included tools, please read        |
    81. | \TOOLKIT\README.TXT                                  |
    82. |______________________________________________________|
    83. |                                                      |
    84. | W W W H H AAA TTT ' SSS    W W W H H EEE RR  EEE ??  |
    85. | W w W H H A A  T  ' S      W W W H H E   R R E     ? |
    86. | W W W HHH AAA  T    SSS    W W W HHH EEE RR  EEE  ?  |
    87. | W W W H H A A  T      S    W W W H H E   R R E       |
    88. | WWWWW H H A A  T    SSS    WWWWW H H EEE R R EEE  ?  |
    89. |                                                      |
    90. | SMPSPLAY FOLDER                                      |
    91. |   \ASM\                   SMPSPLAY assembly files    |
    92. |   \GRAPHICS\              Graphics stuff             |
    93. |   \MUSIC\                 Music file directory       |
    94. |   \S1DRV\                 Sonic 1 Sound Driver       |
    95. |   \SAMPS\                 PCM Sample directory       |
    96. |   \TOOLKIT\               SMPSPLAY Tools             |
    97. |   \ASM68K.EXE             68k assembler program      |
    98. |   \BUILD.BAT              SMPSPLAY Builder           |
    99. |   \README.TXT             This file                  |
    100. |                                                      |
    101. | ASSEMBLY FILES (PLEASE DO NOT EDIT IF YOU'RE A NOOB) |
    102. |                                                      |
    103. |   AMOUNT.ASM              Music Amount Equate        |
    104. |   CONTROL.ASM             Controller routines        |
    105. |   DATA.ASM                Some data the program uses |
    106. |   EQUATES.ASM             Some necessary equates     |
    107. |   GFXSTUFF.ASM            Graphics data and stuff    |
    108. |   HEADER.ASM              ROM Header                 |
    109. |   INCLUDES.ASM            ASM File includes          |
    110. |   MD_INIT.ASM             Initialization of the sys  |
    111. |   MusicText.ASM           Routines for song names    |
    112. |   MusicPTR.ASM            Pointers to Musics         |
    113. |   MUSTEXT.ASM             Song name pointers         |
    114. |   NUMSTEXT.ASM            Screen printing routines   |
    115. |   OTHER.ASM               Other stuff...             |
    116. |   OTHER.MAC               Some (unused =P) macros    |
    117. |   PAL_FX.ASM              The logo color effect      |
    118. |   PALETTE.ASM             Palette loading routine    |
    119. |   PCM_SAMPLES.ASM         PCM Sample related things  |
    120. |   PCM_TABLE.ASM           PCM Sample lookup table    |
    121. |   PCMSAMPS.ASM            Inclusion of PCM Samples   |
    122. |   PSGINDEX.ASM            PSG envelope pointers      |
    123. |   PSG_INST.ASM            PSG envelopes              |
    124. |   SCROLLER.ASM            Scrolling routine          |
    125. |   SEGA.I                  Some SEGA macros           |
    126. |   SNDTYPE.BIN             Sound types                |
    127. |   SONGLIST.BIN            SMPS Songs                 |
    128. |   SONGNAME.ASM            Song names                 |
    129. |   TILESHIT.ASM            Tile load stuff etc etc... |
    130. |   TIMING.ASM              Some timing stuff          |
    131. |   VDP.ASM                 VDP setup                  |
    132. |   VU_STUFF.ASM            VU_Meter drawing routine   |
    133. |______________________________________________________|
    134. |                                                      |
    135. | I hope you enjoy this !                              |
    136. |                                                      |
    137. | If you have any questions, do not hesitate to ask !  |
    138. |                                                      |
    139. | http://oerg866.tototek.com                           |
    140. | [email protected]                                  |
    141. |______________________________________________________|
     
  2. nineko

    nineko

    I am the Holy Cat Tech Member
    6,308
    486
    63
    italy
    In a word: soniNeko :U

    Seriously though, glad to see this thing released, and thanks for the credit, even if I did almost nothing at all, lol.
     
  3. amphobius

    amphobius

    doing more important things with my life Member
    2,120
    0
    16
    life
    Great to see this released, as I've been looking forward to it for quite a while.
     
  4. Selbi

    Selbi

    The Euphonic Mess Member
    1,497
    48
    28
    Northern Germany
    Sonic ERaZor
    Either I'm blind (which is probably the case) or you didn't include the file MAIN.ASM in the download. Because it's missing, I can't build. :V
     
  5. Oops! Sorry! I will fix that, hold on.
     
  6. Right, fixed that.
     
  7. MaliceX

    MaliceX

    hi i code and quack. Oldbie
    Wow, just thought I'd drop in to say that player is amazing, thanks for sharing. :O
    This is the result of toying with the other tool, followed by output to this and VGMTool: http://djtbmx.stdrand.com/junkpile/djtBMX_...s-oerg-test.vgz

    PS: I had trouble 'adding' onto the playlist, ended up making the ROM crash after silence if I tried changing track, managed to get this playing by replacing song81.
     
  8. Did you use \toolkit\addmus.exe ?

    Great to see people are getting the hang of it :)

    BTW: Link is dead :(
     
  9. MaliceX

    MaliceX

    hi i code and quack. Oldbie
    Oerg866: Yes. Adds an entry in their relevant files, builds without errors, but I can't seem to get it to play a track other than the first one.
     
  10. Tweaker

    Tweaker

    Banned
    12,387
    2
    0
    This is awesome! Really enjoying the voice selection and how well you make use of the channels. You've definitely got the hang of it. :)
     
  11. Send me your bin file and I'll have a look at it ;)
     
  12. MaliceX

    MaliceX

    hi i code and quack. Oldbie
    Oerg866: http://djtbmx.stdrand.com/junkpile/BUILT.bin (built ROM, crashes on attempt to change track)
    http://djtbmx.stdrand.com/junkpile/djtBMX_...s-oerg-test.bin (the SMPS bin I want to add)

    Thanks.
     
  13. I'm very sorry for the late response.

    However I did take a look at your problems now:

    I was able to successfully add your file without problems. Tested it twice.

    Can you reproduce it?
     
  14. ValleyBell

    ValleyBell

    Tech Member
    246
    25
    28
    researching PC-98/X68000 sound drivers
    I'm bumping this topic to report some quite serious bugs.

    The first bug is, that the DAC driver doesn't support bank switching within DAC samples, so if a sample starts e.g. at 0x7000 and ends at 0x8FFF, there'll be play garbage. (usually a terrible noise)
    To solve this edit PCMSAMPS.ASM:
    1. insert a line "align $8000" at the start of the file
    2. after you included up to 32768 bytes (not a single byte more), put another "align $8000"-line after the sample#_end-line

    Example (fixed original ASM file):
    Code (Text):
    1.  
    2.     align $8000, $FF
    3. sample1:    incbin samps\samp1.snd  ; include 1700 byte sample
    4. sample1_end:    even
    5. sample2:    incbin samps\samp2.snd  ; include 3808 byte sample
    6. sample2_end:    even
    7. sample3:    incbin samps\samp3.snd  ; include 8236 byte sample
    8. sample3_end:    even
    9. sample4:    incbin samps\clap.snd   ; include 2526 byte sample
    10. sample4_end:    even
    11.     align $8000, $FF    ; fill remaining 16498 bytes of the bank, as it isn't enough for 18476 bytes (1978 bytes too much)
    12. sample5:    incbin samps\cymbal.snd ; include 18476 byte sample
    13. sample5_end:    even
    It will work this way, but your samples are limited to 32768 bytes.

    The second bug is worse: If you try to play a DAC sample with the ID A0 or higher, the DAC driver will screw up entirely (it plays all data in the ROM, beginning at the offset of the sample you wanted to play). Playing another DAC sample won't do anything anymore and you need to reset the emulation to make it work again.
    I made an SMPS DAC Test ROM to show this.

    I'd like to fix it by myself, but I'm no asm coder, so that's beyond my skills.

    Everything else works fine and it's very useful to test mid2smps conversions. (and to make vgms of them)
     
  15. Well I didn't write the PCM driver, so :D
     
  16. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    1
    0
    Writing my own MD/Genesis sound driver :D
    The second bug sounds like an error in jman2050's code from long ago =P The first thing is a problem most drivers have; since this is using ASM68K, there is a way to automate this, assuming ASM68K can translate macro parameters into label names (as can), using something along these lines (invalid syntax; fix as needed):
    Code (Text):
    1. PCMSample macro startlabel, endlabel, filename
    2.     if (*+filesize(filename))>((*&$FF8000)|$7FFF)
    3.         dcb.b ((*&$FF8000)+$8000)-*,0 ; or $FF, or any other byte
    4.         ; ... actually will align $8000,$FF work as well? if so that would be better since it's simpler =P
    5.     endif
    6. startlabel: incbin filename
    7. endlabel:
    8.     endm
    as ASM68K provides filesize()

    (Assemblers need to stop using * for the current pc as it can get confused with the multiplication symbol * if the expression parser is dumb enough...)
     
  17. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,718
    1
    0
    being an asshole =P
    Do you mean something like this?
    Code (Text):
    1. PCMSample macro startlabel, endlabel, filename
    2.     if ((*+filesize(\filename))&$FF8000)>(*&$FF8000)
    3.     cnop 0, $8000
    4.     endc
    5. \startlabel: incbin \filename
    6. \endlabel:
    7.     endm
    8.  
    Blame whoever makes assembly syntax. I don't think there's any situation in asm68k where that issue can arise though, since * is considered the multiplication operator when expecting an operator and the current PC when expecting an operand. Remember that * can't be an unary operator here.

    EDIT: lol $20000 *fixes*
     
  18. ValleyBell

    ValleyBell

    Tech Member
    246
    25
    28
    researching PC-98/X68000 sound drivers
    Thanks, I got it to work:
    Code (Text):
    1. align macro
    2.     ; cnop only padds with 0
    3.     ;cnop 0,\1
    4.     dcb.b ((*&(~(\1-1)))+\1)-*,\2
    5.     endm
    6.  
    7. PCMSample macro startlabel, endlabel, filename
    8.     if ((*+filesize(\filename))&$FF8000)>(*&$FF8000)
    9.     align $8000, $80
    10.     endc
    11. \startlabel:
    12.     incbin \filename
    13.     align 2, $80
    14. \endlabel:
    15.     endm
    16.  
    17.     align $8000, $FF
    18.  
    19.     include ./ASM/PCMSAMPS.ASM
    Does anyone have a solution for the second bug?
     
  19. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    1
    0
    Writing my own MD/Genesis sound driver :D
    Fixing the second bug would require access to the source code to jman2050's Z80 driver, which it does not appear either he or oerg866 provided.
     
  20. Puto

    Puto

    Shin'ichi Kudō, detective. Tech Member
    2,013
    0
    16
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    You could just workaround it by managing the PCM sample table on the 68k side, and just using a single entry on the Z80 side and moving the appropriate values to Z80 ram when you want to play a sample.