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) » Mon Apr 28, 2008 1:01 am

OOPS !!! I forgot to increase the 30h by 4 everytime I send in a byte.... I'll check other bugs
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) » Mon Apr 28, 2008 1:10 am

Fixed test proggy... here's its source (I hope its understandable)

Code: Select all

DECLARE SUB SETPSGNOTE (PSGCh%, PSGNote%)
DECLARE SUB SETPSGVOL (PSGCh%, PSGvol%)
DECLARE SUB LOADSAMPLE (SAMnum%, SAMfile$)

DIM SHARED PSGfreqs%(127)

COMMON SHARED Ch%, SAMnum%, SAMfile$

RESTORE PSGfreqData
DEF SEG = VARSEG(PSGfreqs%(0))
OFFSET& = VARPTR(PSGfreqs%(0))
FOR i% = 45 TO 95
READ A%
POKE OFFSET& + (i% * 2), A%
READ A%
POKE OFFSET& + (i% * 2) + 1, A%
NEXT i%
DEF SEG

CLS

A$ = CHR$(INP(&H100)) + CHR$(INP(&H101)) + CHR$(INP(&H102)) + CHR$(INP(&H103))
PRINT "DOSboxMD ID string : "; A$
PRINT
PRINT "1/2/3 - PSG ch 0/1/2 ON"
PRINT "Q/W/E - PSG ch 0/1/2 OFF"
PRINT "4/5   - Play sample ch 1/2"
PRINT "6     - YM2612 Ch0 key ON"
PRINT "7     - YM2612 Ch0 key OFF"
PRINT "ESC   - quit"
PRINT

PRINT "Resetting YM2612...";
OUT &H104, 255
PRINT "DONE"
PRINT "Loading instrument...";
A% = &H30
FOR i% = 0 TO 27
OUT &H100, A%
A% = A% + 4
READ B%
OUT &H102, B%
NEXT i%
OUT &H100, &HB0
READ B%
OUT &H102, B%
OUT &H100, &HA4   ' C-4
OUT &H102, (2 OR (4 * 8))
OUT &H100, &HA0
OUT &H102, &H85
PRINT "DONE"

PRINT "Loading sample 1 (SEGA)...";
LOADSAMPLE 1, "SEGA.MDS"
PRINT "DONE"
PRINT "Loading sample 2 (BANG !!!)...";
LOADSAMPLE 2, "BANG.MDS"
PRINT "DONE"
PRINT
PRINT "Ready for testing !!!"

SETPSGNOTE 0, 45  ' A
SETPSGNOTE 1, 49  ' C#
SETPSGNOTE 2, 52  ' E



WHILE KEYS% <> 1
KEYS% = INP(&H60)
NOTHING$ = INKEY$
LOCATE 3, 40: PRINT INP(&H60)

SELECT CASE KEYS%
CASE 2: SETPSGVOL 0, 127
CASE 3: SETPSGVOL 1, 127
CASE 4: SETPSGVOL 2, 127
CASE 16: SETPSGVOL 0, 0
CASE 17: SETPSGVOL 1, 0
CASE 18: SETPSGVOL 2, 0
CASE 5: OUT &H105, 1: OUT &H106, 2: WHILE INP(&H60) < 128: WEND
CASE 6: OUT &H105, 2: OUT &H106, 3: WHILE INP(&H60) < 128: WEND
CASE 7: OUT &H100, &H28: OUT &H102, &HF0: WHILE INP(&H60) < 128: WEND
CASE 8: OUT &H100, &H28: OUT &H102, &H0: WHILE INP(&H60) < 128: WEND
END SELECT


WEND

SYSTEM

PSGfreqData:
DATA &H9, &H3F, &H0, &H3C, &HA, &H38, &H7, &H35, &H7, &H32, &HA, &H2F
DATA &HF, &H2C, &H7, &H2A, &H1, &H28, &HD, &H25, &HB, &H23, &HB, &H21
DATA &HC, &H1F, &H0, &H1E, &H5, &H1C, &HC, &H1A, &H4, &H19, &HD, &H17
DATA &H8, &H16, &H3, &H15, &H0, &H14, &HE, &H12, &HD, &H11, &HD, &H10
DATA &HE, &HF, &H0, &HF, &H2, &HE, &H6, &HD, &HA, &HC, &HE, &HB, &H4, &HB
DATA &HA, &HA, &H0, &HA, &H7, &H9, &HF, &H8, &H7, &H8, &HF, &H7, &H8, &H7
DATA &H1, &H7, &HB, &H6, &H5, &H6, &HF, &H5, &HA, &H5, &H5, &H5, &H0, &H5
DATA &HC, &H4, &H7, &H4, &H3, &H4, &H0, &H4, &HC, &H3, &H9, &H3

TYIdata:
DATA &H30,&H20,&H51,&H20,&H1F,&H23,&H0,&H0,&H10,&H10,&H4C,&H1F,&H3,&H0
DATA &H0,&HE,&H0,&H0,&H4,&H1,&H12,&H22,&H7,&HC7,&H0,&H0,&H0,&H0,&H3C

SUB LOADSAMPLE (SAMnum%, SAMfile$)

OUT &H105, SAMnum%
OUT &H106, 1
OPEN SAMfile$ FOR BINARY AS #1
A& = LOF(1) \ 256
FOR i& = 1 TO A&
A$ = INPUT$(256, #1)
FOR i% = 1 TO 256
OUT &H107, ASC(MID$(A$, i%, 1))
NEXT i%
NEXT i&
CLOSE #1

END SUB

SUB SETPSGNOTE (PSGCh%, PSGNote%)

SEGM% = VARSEG(PSGfreqs%(0))
DEF SEG = SEGM%
OFFSETP& = VARPTR(PSGfreqs%(PSGNote%))
OUT &HC0, (PEEK(OFFSETP&) OR 128) OR (PSGCh% * 32)
OUT &HC0, PEEK(OFFSETP& + 1)
DEF SEG

END SUB

SUB SETPSGVOL (PSGCh%, PSGvol%)

OUT &HC0, ((PSGCh% * 32) OR 144) OR (((NOT PSGvol%) AND 127) \ 8)

END SUB
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 1:19 am

FM is works in that version which I uploaded recently, but I still don't see any data for 0107h. I see you send something in your code (I'm actually don't know QBasic), but in DosBox I recieve nothing on this port. Are you sure test is OK in that part?

Upd: I fixed problem with PSG, file is updated.

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) » Mon Apr 28, 2008 1:24 am

Samples seem to get loaded... all writes are shown. But when I play samples, any channel, I get some weird sounds and DOSbox crashes with Illegal Operation 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 » Mon Apr 28, 2008 1:27 am

So, maybe you not updated test? Because I don't see writes and don't get any sound or crash when tried to play 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) » Mon Apr 28, 2008 1:31 am

I uploaded the file again.
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 1:45 am

I'm right that you didn't give me sample files?

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) » Mon Apr 28, 2008 1:49 am

yup :oops:

EDIT : Updated the file... AGAIN
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 2:14 am

Samples is fixed, file updated.

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) » Mon Apr 28, 2008 2:24 am

Everything works perfectly now :D

Now I hope that there's some solution to my QB issue...

EDIT : YM2612 Output should be much louder, samples are around as loud compared to PSG as they need to be. YM2612 should sound as loud as PSG does.
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 2:39 am

File is updated. New ports:

0108h - PSG volume
0109h - YM2612 volume
0110h - DAC volume

Volume is 0..255 (min/max). Generally you must lower volumes of PSG and DAC.

Post Reply