CPCWiki forum

General Category => Emulators => Topic started by: Devilmarkus on 10:38, 13 March 09

Title: Need help to emulate CDT/WAV in JavaCPC
Post by: Devilmarkus on 10:38, 13 March 09
Hi together,
as you know, I am enhancing Executioner's "JEMU" as separate project "JavaCPC".

Before I want to release Version 6.2, I need help from emu-coders:

I want to support tape images. CDT and WAV files are preferred.

I already wrote the tape mechanics and also made the "noise" hearable, when saving files to tape.
Also the sources from ZZSpectrum emulator, to read TZX files, are imported, but not embedded in emulation (I don't have enough knowledge about this)

Who wants to help me, please contact me.
I will send my actual sources.

I made a small video about tape mechanics.

http://cpc-live.com/videos/tape (http://cpc-live.com/videos/tape)

Please help....

Cheers,
Markus
Title: Re: Need help to emulate CDT/WAV in JavaCPC
Post by: gandu_soor on 12:40, 13 March 09
just use wincpc :-\
Title: Re: Need help to emulate CDT/WAV in JavaCPC
Post by: Devilmarkus on 12:45, 13 March 09
Quote from: gandu_soor on 12:40, 13 March 09
just use wincpc :-\

I also could use my real CPC...
But I want to emulate CDT.
Other 'useful' ideas?
Title: Re: Need help to emulate CDT/WAV in JavaCPC
Post by: Gryzor on 19:34, 13 March 09
Nahhh calmo down guys :D Gandu_soor, CPC-Live (as he goes by here) is developing his very own and fantastic online emu, he doesn't just want to *use* an emulator :)
Title: Re: Need help to emulate CDT/WAV in JavaCPC
Post by: Devilmarkus on 18:57, 31 March 09
In fact, I am always calm & silent  ;)

No, really, I need help in decoding CDT files.

I managed today to import WAV files.

But only converted WAV files are possible (Used Tape2WAV.exe)

A really first test can be seen here:
Cauldron 1 tapeloading (http://cpc-live.com/javacpc.php?menu=true&tape=http://cpc-live.com/jemu/cauldron1.jtp)

Another:
Cauldron 2 tapeloading (http://cpc-live.com/javacpc.php?menu=true&tape=http://cpc-live.com/jemu/cauldron2.jtp)

And another:
Cybernoid 1 tapeloading (http://cpc-live.com/javacpc.php?menu=true&tape=http://cpc-live.com/jemu/cybernoid1.jtp)

Speedlock?
Robocop 1 tapeloading (http://cpc-live.com/javacpc.php?menu=true&tape=http://cpc-live.com/jemu/robocop.jtp)
Title: Re: Need help to emulate CDT/WAV in JavaCPC
Post by: Gryzor on 14:25, 01 April 09
Got to say, when I have some free time, I really *love* the sound of tape loading. My girlfriend, of course, doesn't share my feelings, but what the heck...

[EDIT] Works beautifully, and I just saw the performance optimization... :)

Just one thing, pertaining (as most of my comments on the emu, I think!) to the interface: having windows all over the place is not that nice...
Title: Re: Need help to emulate CDT/WAV in JavaCPC
Post by: Devilmarkus on 15:44, 01 April 09
Quote from: Gryzor on 14:25, 01 April 09Just one thing, pertaining (as most of my comments on the emu, I think!) to the interface: having windows all over the place is not that nice...

The "JavaCPC menu" is only shown, because a parameter in URL said this.
It can be closed  ;)
Doubleclick with right mouse button into the applet opens it

"TapeDeck" and "YM-Control" are windows, which do only appear, when they are used.
(I forgot to code close option for tape window, but I will fix that)

LOL! fixed now, during posting  ;D !

BTW.: Do you remember the first tape, which came with a CPC464?
Nostalgia pure! (http://cpc-live.com/javacpc.php?tape=http://cpc-live.com/jemu/wel-ams1.jtp&system=CPC464T&doubled=true)
Side B! (http://cpc-live.com/javacpc.php?tape=http://cpc-live.com/jemu/wel-ams2.jtp&system=CPC464T&doubled=true)
Title: Re: Need help to emulate CDT/WAV in JavaCPC
Post by: Devilmarkus on 13:53, 14 April 09
I am making progress in tape-emulation!

You can also record now to WAV-files.
Watch this little video:
http://cpc-live.com/videos/tapedeck

@ the moment I am still improving this and could really need help in converting CDT to WAV/ByteArray for reading CDT, too...
So, please help me.
Title: Re: Need help to emulate CDT/WAV in JavaCPC
Post by: Devilmarkus on 19:02, 17 April 09
Hey guys...
What's wrong in CPC-world?

I am still coding on tape support...

Today I managed to improve tape emulation playing loading-musics by Melvyn Wright.

Watch Harvey Headbanger original tape dump (http://cpc-live.com/javacpc.php?tape=http://cpc-live.com/tapes/harvey.zip&system=CPC464T&doubled=true&title=Harvey%20Headbanger%20loading%20from%20tape) loading and listen to the music ;-)

You can also download harvey_headbanger.zip
(containing the loader-music as YM-file, I recorded with JavaCPC)
Title: Re: Need help to emulate CDT/WAV in JavaCPC
Post by: dlfrsilver on 06:46, 19 April 09
Quote from: CPC-Live on 18:57, 31 March 09
In fact, I am always calm & silent  ;)

No, really, I need help in decoding CDT files.

I managed today to import WAV files.

But only converted WAV files are possible (Used Tape2WAV.exe)

A really first test can be seen here:
Cauldron 1 tapeloading (http://cpc-live.com/javacpc.php?menu=true&tape=http://cpc-live.com/jemu/cauldron1.jtp)

Another:
Cauldron 2 tapeloading (http://cpc-live.com/javacpc.php?menu=true&tape=http://cpc-live.com/jemu/cauldron2.jtp)

And another:
Cybernoid 1 tapeloading (http://cpc-live.com/javacpc.php?menu=true&tape=http://cpc-live.com/jemu/cybernoid1.jtp)

Speedlock?
Robocop 1 tapeloading (http://cpc-live.com/javacpc.php?menu=true&tape=http://cpc-live.com/jemu/robocop.jtp)

Robocop Here is the Spectrum variant 3 version (spanish tape), if you want to try the real speedlock 3 version on amstrad :

http://www.phenixinformatique.com/CPCGAMES/pages/download.php?fiche=1815&dsk=8

A few others :

Terminator 2 (Speedlock 7) :

http://www.phenixinformatique.com/CPCGAMES/pages/download.php?fiche=2196&dsk=8

Rainbow Islands (speedlock 6) :

http://www.phenixinformatique.com/CPCGAMES/pages/download.php?fiche=1751&dsk=8

Gryzor (Speedlock 2 type 1) :

http://www.phenixinformatique.com/CPCGAMES/pages/download.php?fiche=144&dsk=6

Batman the movie  (Speedlock 3) :

http://www.phenixinformatique.com/CPCGAMES/pages/download.php?fiche=135&dsk=8

here it is if you want to test :D
Title: Re: Need help to emulate CDT/WAV in JavaCPC
Post by: Devilmarkus on 23:28, 20 April 09
Rainbow Island and Gryzor are the only games, which load correctly  ;D

So hints about avoiding speedlock protection would be helpful  ;)
Title: Re: Need help to emulate CDT/WAV in JavaCPC
Post by: Devilmarkus on 21:21, 21 April 09
Some info:
- I am working on CDT-Support (girv is translating some code from C++ to Java, what I want to use then)

- I am also working on 'Breakpoints' in Debugger. Actually you can set up to 40! different breakpoints... You can also let the disassembler follow the CPU!
  (Watch demonstration here (http://cpc-live.com/videos/breakpoints/))
Title: Re: Need help to emulate CDT/WAV in JavaCPC
Post by: Gryzor on 08:56, 22 April 09
Quote from: CPC-Live on 23:28, 20 April 09
Rainbow Island and Gryzor are the only games, which load correctly  ;D


So you're all set, I'd say :D
Title: Re: Need help to emulate CDT/WAV in JavaCPC
Post by: Devilmarkus on 14:58, 22 April 09
Almost done... :

http://cpc-live.com/videos/cdt/ (http://cpc-live.com/videos/cdt/)
Title: Re: Need help to emulate CDT/WAV in JavaCPC
Post by: Devilmarkus on 11:13, 26 April 09
CDT emulation is working now...
Load the game "BeTiled" here (http://cpc-live.com/javacpc.php?samplerate=22khz&tape=betiled_090309.cdt&doubled=true&system=CPC464T&scaneffect=true&bilinear=true&title=BeTiled)

Emulator still seems to have a Z80-bug, so that I still have problems with Speedlock protected games...
Title: Re: Need help to emulate CDT/WAV in JavaCPC
Post by: Devilmarkus on 21:52, 02 June 09
Question to Executioner:

I found something in Z80.java (jemu.core.cpu.Z80.java):
  protected int executeDDFD(int ixiy, int opcode) {
    R++;
    switch(opcode) {
      .....................


For what is here R++; ?

I changed it to:
  protected int executeDDFD(int ixiy, int opcode) {
   
      // deactivated for Speedlock protection
      //R++;
    switch(opcode) {
       ..........


This makes speedlock protected games working.

Now my question:
- is this R++; necessary for other instructions?
(I'm still testing this)

Cheers,
Markus

Edit:
This also makes games like "Winter Games" work... (DSK, original dump)
Title: Re: Need help to emulate CDT/WAV in JavaCPC
Post by: Devilmarkus on 22:02, 02 June 09
Quote from: dlfrsilver on 06:46, 19 April 09
Robocop Here is the Spectrum variant 3 version (spanish tape), if you want to try the real speedlock 3 version on amstrad :

http://www.phenixinformatique.com/CPCGAMES/pages/download.php?fiche=1815&dsk=8 (http://www.phenixinformatique.com/CPCGAMES/pages/download.php?fiche=1815&dsk=8)

A few others :

Terminator 2 (Speedlock 7) :

http://www.phenixinformatique.com/CPCGAMES/pages/download.php?fiche=2196&dsk=8 (http://www.phenixinformatique.com/CPCGAMES/pages/download.php?fiche=2196&dsk=8)

Rainbow Islands (speedlock 6) :

http://www.phenixinformatique.com/CPCGAMES/pages/download.php?fiche=1751&dsk=8 (http://www.phenixinformatique.com/CPCGAMES/pages/download.php?fiche=1751&dsk=8)

Gryzor (Speedlock 2 type 1) :

http://www.phenixinformatique.com/CPCGAMES/pages/download.php?fiche=144&dsk=6 (http://www.phenixinformatique.com/CPCGAMES/pages/download.php?fiche=144&dsk=6)

Batman the movie  (Speedlock 3) :

http://www.phenixinformatique.com/CPCGAMES/pages/download.php?fiche=135&dsk=8 (http://www.phenixinformatique.com/CPCGAMES/pages/download.php?fiche=135&dsk=8)

here it is if you want to test :D

Thank you for giving the URL's...
(I already had all games LOL)
JavaCPC can load now all of these games, and other Speedlock protected games, too (Read response above)

Cheers,
Markus
Title: Re: Need help to emulate CDT/WAV in JavaCPC
Post by: Executioner on 05:21, 03 June 09
Quote from: CPC-Live on 21:52, 02 June 09
Question to Executioner:

I found something in Z80.java (jemu.core.cpu.Z80.java):
  protected int executeDDFD(int ixiy, int opcode) {
    R++;
    switch(opcode) {
      .....................


For what is here R++; ?

To increment the memory refresh register. It's wrong, because it gets incremented by the executeNormal method as called by most DD/FD instructions, but the two methods ldrixiyd and ldixiydr need the R++ inserted after the first cycle calls.
Title: Re: Need help to emulate CDT/WAV in JavaCPC
Post by: Devilmarkus on 11:18, 03 June 09
Quote from: Executioner on 05:21, 03 June 09
To increment the memory refresh register. It's wrong, because it gets incremented by the executeNormal method as called by most DD/FD instructions, but the two methods ldrixiyd and ldixiydr need the R++ inserted after the first cycle calls.

Like this?
      case 0x66:
      case 0x6e: R++; ldrixiyd(ixiy,opcode);                  break;

      case 0x74:
      case 0x75: R++; ldixiydr(ixiy,opcode);                  break;


Or better like the second example?
  protected void ldrixiyd(int ixiy, int opcode) {
    cycle(timePre[opcode] + timeExtra[CYCLES_EXTRA_IDXNORM]);
    R++;
    int r = (opcode & 0x38) >> 3;
    reg[r] = readByte((ixiy + (byte)fetch()) & 0xffff);
    cycle(timePost[opcode]);
  }

  protected void ldixiydr(int ixiy, int opcode) {
    cycle(timePre[opcode] + timeExtra[CYCLES_EXTRA_IDXNORM]);
    R++;
    int r = opcode & 0x07;
    writeByte((ixiy + (byte)fetch()) & 0xffff,reg[r]);
    cycle(timePost[opcode]);
  }
Title: Re: Need help to emulate CDT/WAV in JavaCPC
Post by: Executioner on 05:17, 04 June 09
Hi Markus, I'm not sure there is any difference, but go with the second option to keep it the same as JEMU.
Powered by SMFPacks Menu Editor Mod