Official GEMS development kit + an unreleased game

For anything related to sound (YM2612, PSG, Z80, PCM...)

Moderator: BigEvilCorporation

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

Post by Shiru » Thu Oct 11, 2007 5:43 am

TulioAdriano wrote:I don't know how complicated that would be for Shiru but would be an amazing feature on TFM Music Maker also.
It's possible (and was planned, but in different form).

If somebody develop SMD-PC link and document it well, I'll support that in TFM MM. I can make SMD-side driver by myself or write list of needed features of such driver, if somebody else plan to make that.

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 Oct 11, 2007 7:32 am

Well, I AM going to make a PC to MD link... so I could get some real sound out of my MD tracker

Simple LPT port to MD controller port cable
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

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Post by Mask of Destiny » Thu Oct 11, 2007 9:01 pm

Such a cable already exists:
http://www.retrodev.com/transfer.html

The protocol used is relatively simple. 4-bits data, 2-bits for handshaking. I can describe a working protocol in more detail if you like. I think the ISO file contains the source code for the Genesis side, though that's using my older less efficient protocol. I began work on a newer protocol that was both more efficient and more sophisticated, but never finished it. IIRC, basic data transfer worked. If either of you want the source to use as a base, all you have to do is ask.

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 Oct 12, 2007 5:25 am

Cool, but will it work on XP when I do direct I/O from a DOS program ? As much as I have tested LPT port in XP using DOS, I can't manipulate some signals of LPT port (don't remember which ones)...
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 Oct 12, 2007 5:46 am

That will be fine if there is C source code for data transfer through that cable both for PC and SMD. Code must be 100% working because I don't have real hardware to test it by myself.

TmEE, there is some drivers which open LPT ports under XP - DirectIO, UserPort. They allows to old 16/32-bit Windows applications to work with LPT directly, but I'm not sure if they work with DOS software.

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 Oct 12, 2007 10:51 am

Thanks Shiru... I hope these work with DOS programs otherwise I may have to make a different cable than MODs one (IF it doesn't work with/without these drivers).

EDIT : DirectIO didn't help with XP, BUT UserPort did !!!
Image
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 Oct 15, 2007 2:08 am

That's good. I also remember another one driver which can work with DOS software too - GiveIO.

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Post by Mask of Destiny » Tue Oct 16, 2007 5:47 pm

Shiru wrote:That will be fine if there is C source code for data transfer through that cable both for PC and SMD. Code must be 100% working because I don't have real hardware to test it by myself.
The source code I have is C on the PC side and 68K asm on the SMD side. If need be I could probably whip together and test a C version of the SMD side or alternatively wrap the 68K ASM in some C functions.

Transferring data is definately 100% working. The parts that weren't finished (in the newer code anyway) were the higher level parts of the protocol.

I'll dig up what I have sometime this week.

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

Post by Shiru » Wed Oct 17, 2007 1:51 pm

Mask of Destiny, there is also important question: how fast data transfer with this interface can be? To use SMD as synth for music editor it needed to be up to ~16K per second in peak (in worst case for FM part), usually less, but I can't say how much for now.

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Post by Mask of Destiny » Wed Oct 17, 2007 8:20 pm

Is that 16kbit/sec or 16kbyte/sec?

IIRC, with the old protocol I got somewhere in the neighborhood of 16 kilobytes/sec (128kbit/sec), maybe a little less. New protocol should be faster, but I don't think I've benchmarked it yet. I should be able to do a quick benchmark once I dig the code up again.

Keep in mind that the handshaking is completely done in software, so the 68K will be completely occupied while doing a transfer (unless you break out of it with an interrupt or something).

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

Post by Shiru » Wed Oct 17, 2007 10:36 pm

Mask of Destiny wrote:Is that 16kbit/sec or 16kbyte/sec?
16 KByte/sec
Mask of Destiny wrote:Keep in mind that the handshaking is completely done in software, so the 68K will be completely occupied while doing a transfer (unless you break out of it with an interrupt or something).
That's OK, I can use VSYNC interrupt or (if that slowdown transfer below acceptable speed) move registers output code to Z80.

org
Newbie
Posts: 8
Joined: Wed Dec 12, 2007 8:08 am

Post by org » Wed Dec 12, 2007 8:21 am

drx
There must be some sound present, according to source code, so I also tried to compile it with Microtec compiler, but I have missed graphics somewhere (SEGA logo and sprites), dont know why :(

My resources:

http://org.dremora.com/SMD/Microtec_C_Compiler.rar
http://org.dremora.com/SMD/M68000PRM.pdf
http://org.dremora.com/SMD/GEMS.rar (I replaced old 2.0 GEMS in SHIP directory to the new 2.5 from GEMS directory)
http://org.dremora.com/SMD/srec_120.zip
http://org.dremora.com/SMD/FixCheckSum.rar

To compile demo, run test.bat in GEMS.rar
You must replace paths to your MCC68K in test.bat and ship.cmd also.

SHIP.BIN in GEMS.rar is my compilation and SHIPORIG.BIN is made by drx.

Regarding IO port access under XP: I think WinIO library from http://www.internals.com/ can be useful.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Wed Dec 12, 2007 12:50 pm

org wrote:drx
There must be some sound present, according to source code, so I also tried to compile it with Microtec compiler, but I have missed graphics somewhere (SEGA logo and sprites), dont know why :(

My resources:

http://org.dremora.com/SMD/Microtec_C_Compiler.rar
http://org.dremora.com/SMD/M68000PRM.pdf
http://org.dremora.com/SMD/GEMS.rar (I replaced old 2.0 GEMS in SHIP directory to the new 2.5 from GEMS directory)
http://org.dremora.com/SMD/srec_120.zip
http://org.dremora.com/SMD/FixCheckSum.rar

To compile demo, run test.bat in GEMS.rar
You must replace paths to your MCC68K in test.bat and ship.cmd also.

SHIP.BIN in GEMS.rar is my compilation and SHIPORIG.BIN is made by drx.

Regarding IO port access under XP: I think WinIO library from http://www.internals.com/ can be useful.
Hey another C compiler for 68000 =)
Do you know how good is code optimisation compared to GCC ?

org
Newbie
Posts: 8
Joined: Wed Dec 12, 2007 8:08 am

Post by org » Wed Dec 12, 2007 1:12 pm

I'm not sure how good GCC at optimizations, but this one has many -O options, listed in RTL/CONFIG/A_TYPE.H including:
- Global variable optimization
- Stack pop optimization
- Single function return()
- Function in-lining
- Code hoisting and cross jump optimizations
- Register allocation using coloring algorithm
- Instruction ordering
- Optimize in favor size/speed

Since GEMS is compiled with MCC, I have feeling this compiler is used in many SMD games.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Thu Dec 13, 2007 5:45 pm

org wrote:I'm not sure how good GCC at optimizations, but this one has many -O options, listed in RTL/CONFIG/A_TYPE.H including:
- Global variable optimization
- Stack pop optimization
- Single function return()
- Function in-lining
- Code hoisting and cross jump optimizations
- Register allocation using coloring algorithm
- Instruction ordering
- Optimize in favor size/speed

Since GEMS is compiled with MCC, I have feeling this compiler is used in many SMD games.
That sounds good :)
Do you know if it can pass parameters in register ?
at least it support function inline which GCC does not support for M68K :-/

Post Reply