dmitrysmagin / a2t_play

Utility to play a2m/a2t files from Adlib Tracker 2
5 stars 0 forks source link

Use with a real OPL3? #4

Open tomas opened 3 years ago

tomas commented 3 years ago

Hi, I'm trying to use a2t_play in an old computer with a real OPL3 chip but I'm not sure how to adapt the play loop for this.

I thought I could simply do something like:

  while (!kbhit()) {
    a2t_update(someFakeBuffer, someNumber);
    sleep(someMilisecs);
  }

However I'm not sure what values to provide to those functions. The someMilisecs value should probably consider the current tempo of the player.

I'm also thinking I would need to adapt the a2t_update logic, considering there are a lot of timers and irq stuff that probably don't apply in this case.

What do you think?

If you can provide any pointers it'd be great!

tomas commented 3 years ago

Null pointers? ;)

tomas commented 3 years ago

Bump?

dmitrysmagin commented 3 years ago

Hi. In order to rewrite everything back to DOS and real OPL3 you'll have to code new timer irq routines and call a2t_update() from it (and modify it appropriately) and also replace all calls to OPL3 emulator with real hardware out's and in's. As a reference I can direct yout to adlibtracker sources, most functions are named identically http://adlibtracker.net/files/at2_sourcecode_09-09-2019.zip

tomas commented 3 years ago

I see, thanks. The in/out calls are the easy part. I was wondering if it'd be possible without rewriting the IRQ routines, that AFAICT seem quite harder.

dmitrysmagin commented 3 years ago

Just look in adt2play folder of the archive above. a2player.pas has all needed routines, though they are for FreePascal and Dos4gw extender. You may use either OpenWatcom or dos port of GCC (djgpp) to try to compile my port for DOS.

tomas commented 3 years ago

Will do, thanks!