Author Topic: Need help to emulate CDT/WAV in JavaCPC  (Read 6191 times)

0 Members and 1 Guest are viewing this topic.

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Need help to emulate CDT/WAV in JavaCPC
« on: 11: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

Please help....

Cheers,
Markus
« Last Edit: 11:40, 13 March 09 by CPC-Live »
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline gandu_soor

  • CPC464
  • **
  • Posts: 10
  • Liked: 0
  • Likes Given: 0
Re: Need help to emulate CDT/WAV in JavaCPC
« Reply #1 on: 13:40, 13 March 09 »
just use wincpc :-\

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Need help to emulate CDT/WAV in JavaCPC
« Reply #2 on: 13:45, 13 March 09 »
just use wincpc :-\

I also could use my real CPC...
But I want to emulate CDT.
Other 'useful' ideas?
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.570
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3137
  • Likes Given: 5786
Re: Need help to emulate CDT/WAV in JavaCPC
« Reply #3 on: 20: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 :)

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Need help to emulate CDT/WAV in JavaCPC
« Reply #4 on: 20: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

Another:
Cauldron 2 tapeloading

And another:
Cybernoid 1 tapeloading

Speedlock?
Robocop 1 tapeloading
« Last Edit: 21:35, 31 March 09 by CPC-Live »
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.570
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3137
  • Likes Given: 5786
Re: Need help to emulate CDT/WAV in JavaCPC
« Reply #5 on: 16: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...
« Last Edit: 16:34, 01 April 09 by Gryzor »

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Need help to emulate CDT/WAV in JavaCPC
« Reply #6 on: 17:44, 01 April 09 »
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...

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!
Side B!
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Need help to emulate CDT/WAV in JavaCPC
« Reply #7 on: 15: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.
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Need help to emulate CDT/WAV in JavaCPC
« Reply #8 on: 21: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 loading and listen to the music ;-)

You can also download harvey_headbanger.zip
(containing the loader-music as YM-file, I recorded with JavaCPC)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline dlfrsilver

  • CPC6128
  • ****
  • Posts: 249
  • Liked: 73
  • Likes Given: 6
Re: Need help to emulate CDT/WAV in JavaCPC
« Reply #9 on: 08:46, 19 April 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

Another:
Cauldron 2 tapeloading

And another:
Cybernoid 1 tapeloading

Speedlock?
Robocop 1 tapeloading

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

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Need help to emulate CDT/WAV in JavaCPC
« Reply #10 on: 01:28, 21 April 09 »
Rainbow Island and Gryzor are the only games, which load correctly  ;D

So hints about avoiding speedlock protection would be helpful  ;)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Need help to emulate CDT/WAV in JavaCPC
« Reply #11 on: 23: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)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.570
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3137
  • Likes Given: 5786
Re: Need help to emulate CDT/WAV in JavaCPC
« Reply #12 on: 10:56, 22 April 09 »
Rainbow Island and Gryzor are the only games, which load correctly  ;D


So you're all set, I'd say :D

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Need help to emulate CDT/WAV in JavaCPC
« Reply #13 on: 16:58, 22 April 09 »
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Need help to emulate CDT/WAV in JavaCPC
« Reply #14 on: 13:13, 26 April 09 »
CDT emulation is working now...
Load the game "BeTiled" here

Emulator still seems to have a Z80-bug, so that I still have problems with Speedlock protected games...
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Need help to emulate CDT/WAV in JavaCPC
« Reply #15 on: 23:52, 02 June 09 »
Question to Executioner:

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

For what is here R++; ?

I changed it to:
Code: [Select]
  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)
« Last Edit: 23:54, 02 June 09 by CPC-Live »
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Need help to emulate CDT/WAV in JavaCPC
« Reply #16 on: 00:02, 03 June 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

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

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
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline Executioner

  • Supporter
  • 6128 Plus
  • *
  • Posts: 783
  • Country: au
  • WinAPE Developer
    • WinAPE
  • Liked: 391
  • Likes Given: 60
Re: Need help to emulate CDT/WAV in JavaCPC
« Reply #17 on: 07:21, 03 June 09 »
Question to Executioner:

I found something in Z80.java (jemu.core.cpu.Z80.java):
Code: [Select]
  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.

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Need help to emulate CDT/WAV in JavaCPC
« Reply #18 on: 13:18, 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?
Code: [Select]
      case 0x66:
      case 0x6e: R++; ldrixiyd(ixiy,opcode);                  break;

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

Or better like the second example?
Code: [Select]
  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]);
  }
« Last Edit: 13:21, 03 June 09 by CPC-Live »
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Offline Executioner

  • Supporter
  • 6128 Plus
  • *
  • Posts: 783
  • Country: au
  • WinAPE Developer
    • WinAPE
  • Liked: 391
  • Likes Given: 60
Re: Need help to emulate CDT/WAV in JavaCPC
« Reply #19 on: 07: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.