MD tracker 0.3 ALPHA

Talk about development tools here

Moderator: BigEvilCorporation

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Thu Apr 24, 2008 5:29 pm

My work PC is not enough to run it properly, but gaming one is.

work PC:
1.1GHz Celeron
512MB RAM
onboard video
98SE + XP pro

Gaming PC:
2.3GHz AMD Athlon 64 X2
2048MB RAM
Nvidia 8600
XP pro (and sometimes 98SE)
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Fri Apr 25, 2008 6:49 pm

File is updated. Keyboard now works for me, and some new I/O ports were added:

#CC - write anything to reset YM2612
#C8 - read returns 'T'
#C9 - read returns 'M'
#CA - read returns 'E'
#CB - read returns 'E'


When I asked about best settings, I meant DosBox configuration file - CPU core, number of cycles, etc. These settings can change emulation speed (and accuracy) very noticeable.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Fri Apr 25, 2008 7:31 pm

ah, well, I used your defaults... I didn't change anything that the last lines so thing would be convenient for me :)

I can take CPU cycles only down, but it won't really change anything. In any case I will not get any suitable speed out of my work PC through DOSbox.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Sat Apr 26, 2008 9:12 pm

About sample playing. How about something like high-level sampler with own memory, which can be controlled through some ports:

- sample number port, selects one of 256 possible samples to perform operations
- command port
- data port

Commands is:

- clear sample
- load sample (now whole sample can be sent to data port, any size)
- play (stop) sample on ch1 or ch2

Sampler will mix two channels together and send result to YM2612 DAC port.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Sat Apr 26, 2008 9:26 pm

Well, nice idea. I think something through I/O ports works out very well. There's support only for 127 samples, total is 128 but first one is no sample (MD side thing).

2 I/O ports for sample playback control, sample can't be stopped when its issued, unless you play another sample (that's on MD). The sample lenght is stored inside sample file, all samples are in 256 byte blocks where 2 bytes of first block determine the lenght of sample (real sample lenght / 256). The rest of the bytes in 1st block are ignored (I have some string there usually). 0 lenth means 1 audio block, the info block is always there. And the length is in little endian way.

There should be some ports for loading samples, a Data port, a Sample Slot port. There should be auto increment address feature, and address would be set back to 0 whenever Sample Slot port is written.

I don't think feeding the samples directly to YM2612 emu is good idea, since all emulators present have poor PCM emulation. I think its easier to mix the samples to final buffer. The sample rate is about 22KHz on MD, few Hz here there won't make any real difference in sound.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Sun Apr 27, 2008 1:05 am

File is updated. Nothing tested, so you must test it (and YM2612), and if there any problems, some simple tests from you will help.

Ports:

CDh - Sample select (0..127)
CEh - Command (0..3)
CFh - Data

Commands:

0 - Clear current sample (unload from sample memory)
1 - Load current sample
2 - Play current sample on first channel
3 - Play current sample on second channel

Uploading sample: CDh=number of sample slot, CEh=1. Now send all sample data to port CFh (complete with header etc).

Playing sample: CDh=number of needed sample, CEh=2 or 3


Sound mixed on 22KHz and goes directly to output, not to YM2612 DAC. I assume that you have samples range 0..127 and just add them together before output. I also expect that some volume adjust (PSG/FM/DAC) will be required.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Sun Apr 27, 2008 4:46 pm

actually the samples are 8 bit, but one extra operation during sample loading solves it all. I haven't had chance to test it yet...

ONE THING : C0h....DFh is used by DMA controller, and it may be the reason why I couldn't read "TMEE" (got 0, 255, 0, 255), you should put the stuff to 100h, its a safe area.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Sun Apr 27, 2008 6:48 pm

Ok, file is updated. Port C0h for PSG is still same (because you said it works), other ports moved:

0100h - write - YM2612 A0, read - 'T'
0101h - write - YM2612 A1, read - 'M'
0102h - write - YM2612 D0, read - 'E'
0103h - write - YM2612 D1, read - 'E'
0104h - YM2612 reset
0105h - sample select
0106h - command
0107h - sample data

Mixer now uses 8-bit samples.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Sun Apr 27, 2008 7:13 pm

The input doesn't work again :/

AND I can't compile MDT anymore, getting memory overflow errors, and that means my code is TOO big... I've had them before, and successfully got rid of them... but not this time... seems I need to start digging FreeBASIC... which will lead to a Win version of MDT, which in turn leads to other nice things... but before then, its a pmode DOS program instead of a realmode one !!! But first I'll ask form QB guru's what they think about "memory overflow error"...
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Sun Apr 27, 2008 7:19 pm

TmEE co.(TM) wrote:The input doesn't work again :/
Input - keyboard (it works on my computer) or reading ports?

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Sun Apr 27, 2008 7:27 pm

Keyboard, and I couldn't read TMEE too... I'll write some simple test program, not write stuff into MDT until I find a cure to my compiling issue...
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Sun Apr 27, 2008 7:46 pm

DOSBOXMD is fine... my shortcut was outdated :P launced wrong file

BUT PSG plays only a short time not forever like it should... and samples don't seem to play.

Should I prepare that test file for you ?
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Sun Apr 27, 2008 7:59 pm

Yes, make simple test please, it will help to debug things much faster.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Sun Apr 27, 2008 11:56 pm

Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Mon Apr 28, 2008 12:22 am

About samples. Seems you missed SampleLoad command (1) before data loading. And I don't see, where sample data is loaded? 0107h does not recieves any data.

About YM2612. I didn't understand, what you trying to write to it? I see series of writes of different values in #30 register only (that's strange), then writes to #B0, #A4, #A0 (that's OK).


Anyway, I made some small changes, so I updated the file. Nothing changed in your current test, but there was bug with second sample channel.

Post Reply