Where is MBWAVE ASM replayer ?

Pagina 2/2
1 |

Van norakomi

Paragon (1125)

afbeelding van norakomi

12-02-2022, 15:46

Awesome Grauw !! Thanks a lot !

Van msd

Paragon (1472)

afbeelding van msd

13-02-2022, 09:14

Did I publish the sources in compass format. Hmm I’ve to look into that. This version is newer than the Remco version

Van norakomi

Paragon (1125)

afbeelding van norakomi

15-02-2022, 13:45

@msd I sent you a mail (not sure if the email address is correct).
I am not able to get the replayer to work.
Spent many days now trying to get it to work and I don't feel that I'm even close, could you help me out maybe ?
There are many things that I don't understand, lack of comments in the code make it very hard to understand what is going on.
I have the replayer in ram at $4000, the song (saved as user data) in rom at $8000. No kit needed, just romtones for now.
Maybe lets start with the song... how are .MWM files organised ?

and what is:
;---- initialise call statements ----
init_calls ? ; what does this do ?

And this part:
ld hl,(songdata_adres) ;$8000
ld de,xleng ;Start of songdata table
ld bc,220 ;lenght of that whole table that starts at xleng
ldir ; copy song settings
;xleng: ds 1 ; Song length (expressed in patterns I guess)
;xloop: ds 1 ; Loop position
;xwvstpr: ds 24 ; Stereo settings Wave
;xtempo: ds 1 ; Tempo
;xhzequal: ds 1 ; 50/60 Hz Equalizer
;xdetune: ds 24 ; Detune settings
;xmodtab: ds 3*16 ; Modulation tables
;xbegwav: ds 24 ; Start waves
;xwavnrs: ds 48 ; Wave numbers
;xwavvols: ds 48 ; Wave volumes

This makes no sense if I check the song in the hexeditor.
Even if I would skip the first 6 bytes (header = 6 bytes?) it still doesn't seem to match.


ld de,58
add hl,de ; skip name/wavekit
ld (pos_address),hl ; this is the start of the song I guess. Set this position.
ld a,(xleng)
inc a
ld e,a
add hl,de
ld (pat_address),hl ; address of current pattern maybe ?

Another 58 bytes later starts the song ?? Also this doesn't match with what I see in a hex editor analysing the song.

I have rewritten all the code to work in TNIASM, I added all the macro's manually, I removed code that I think is not needed....

There is also this part:
;--- Interrupt routine BEFORE play-interrupt ---


What exactly is the int routine before the play-int routine ?

I also see:
;--- decrunch one step ---

So the tune is crunched somehow ? and decrunched on the fly ?
Can you tell me a bit more about this ?

i also found another older piece of code, opl4driv.gen, and little bits and pieces are slightly different there....

Trying to make sense of it all, but I could really use some help...

Van ToriHino

Paladin (777)

afbeelding van ToriHino

15-02-2022, 17:59


I rewrote the player in C for RoboPlay (which can be found here).

If I remember correct, the interrupt routine was split up between the main play interrupt (called at replay counter = replay rate) and a second interrupt routine (called at replay counter = replay rate - 1), so one interrupt before the play interrupt is executed again, in order to decrunch the next line of music data to be played. In fact I think there was even a third one which calculates the wave part. This all to avoid having to do everything on the one single replay interrupt.

In the C code you can also find the decrunch routine.

Pagina 2/2
1 |