News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

CDTMaster

Started by CECPC, 11:31, 07 January 15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

CECPC

I 'm in process to do a new utility named CDTMaster.

It is a Taper like utility for Windows, although include other options like import files from DSK, convert files into TZX/CDT blocks (like 2cdt) and convert CDT to WAV (like playtzx). In a future, i hope include wav to CDT decoding like samp2cdt but this feature is not included.
The editor has only partial support, because it is in alpha status, but you can try it for now.

The code is GPL/LGPL, located in sourceforge.

Sorry for the language. I'm spanish and i have not include multilanguage for now. But because there is small options, is not a problem.

You can download the 0.2 alpha version from: https://sourceforge.net/projects/cdtmaster/files/latest/download

Some notes. The lists are Windows "multiselect" standard. So use CTRL key to make multiselection.
To copy/paste blocks, use CTRL+C/CTRL+V shortcuts.
To delete blocks, use DELETE key.
To edit some block, "double click" on it.

The menu "Archivo (Files) Herramientas (Tools)" change their submenus when you change the TAB between CDT and AMSDOS mode.

I think that this compilation requires .NET 4, so it is possible that it don't work in XP. I work on Win 7 (64 bit) but I suppose that it work on other versions that support .NET 4.

I hope your feedback.

Gryzor

Sounds really nice! Can't wait for future, more feature-complete versions! Just a note, as you add features it'd be good to have multi-language support...

arnoldemu

I like this project.

It would be nice if this project could also be run under linux.
Can you tell me more about the language and tools you are using to develop this?

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

CECPC

Quote from: arnoldemu on 14:00, 07 January 15
I like this project.

It would be nice if this project could also be run under linux.
Can you tell me more about the language and tools you are using to develop this?
Visual Studio 2013.

It is all c#. The source is basic, so It could be possible to port to Mono. It depends of Windows.Forms support on Mono ( In my lasts test for other aplication some years ago was a total failure).
I have ported console applications with Xamarin Studio. Make console utilities using my TZX lib should be easy.

I use the libs NAudio and Be.HexEditor. Other dependencies could be here.
But the code compile (mine and this two libs) on .Net Framework 2.0 too (tested couple months ago in a XP).

AMSDOS

#4
PlayTZX doesn't strictly convert a file to WAV format does it?


EDIT:The information I have suggests that PlayTZX creates a VOC file, but I'm unsure how many audio sound programs convert a VOC into a WAV. Interesting VOC files relate to Voice Data Recorder produced files.
* Using the old Amstrad Languages :D * And create my own ;)
* Incorporating the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

CECPC

Quote from: AMSDOS on 09:04, 08 January 15
PlayTZX doesn't strictly convert a file to WAV format does it?


EDIT:The information I have suggests that PlayTZX creates a VOC file, but I'm unsure how many audio sound programs convert a VOC into a WAV. Interesting VOC files relate to Voice Data Recorder produced files.
PlayTZX has a switch to generate a WAV. In any case, the format is not important, as WAV and VOC are both normal sound formats.
Im not sure if there is some emulator that work with VOC and not with WAV.

NAudio has not support of VOC format, but it is enough simple to be programmed by myself in the future if it is important.

CECPC

Quote from: arnoldemu on 14:00, 07 January 15
It would be nice if this project could also be run under linux.
Hey! It has work on mono!
Just install on Windows and copy the files to a folder on Linux.
"mono CDTMaster.exe"

Graphics look horrible and flick a lot, but it works!

jrodriguezv

I'll try it under Linux. Keep on good work ;-)

CECPC

#8
Quote from: jrodriguezv on 12:21, 09 January 15
I'll try it under Linux. Keep on good work ;-)
I have success with Debian 7

But it crash on Hex edit. That is because the component. hexbox don't support Linux  >:( .

https://sourceforge.net/p/hexbox/bugs/3/

We must found an alternative hex editor component with Linux support.
I will try to add some code to disable HexBox initialization if Linux is detected on next snapshot.
It is better disabled than get a crash.

It crash on Wav generation too. It is some dependency problem of NAudio library.

CECPC

I fixed some bugs and I translate the program to English.
It is not multilanguage yet, but i think that spanish could adapt better to english than the opposite.

https://sourceforge.net/projects/cdtmaster/files/

trabitboy

Hello, I was searching exactly for that some weeks ago, gonna give it a try! !!!

trabitboy

Hello,
I took the bin from the attached dsk and
created a cbt from it ,
but could not successfuly load it into winape ?
( ]tape run" )
it starts loading, tells the name of the bin then hangs or something .
The bin is assembled in winape to work at &4000,
there is a simple basic loader.




Devilmarkus

look into SMZ.BAS:

LOAD"SMAZ.BIN",&4000

change to

LOAD"!",&4000 or LOAD"SMAZ    .BIN",&4000 (4x space!!!)

(because you load from tape!)

Here's your CDT file:
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

CECPC

Quote from: trabitboy on 14:46, 03 March 15
Hello,
I took the bin from the attached dsk and
created a cbt from it ,
but could not successfuly load it into winape ?
( ]tape run" )
it starts loading, tells the name of the bin then hangs or something .
The bin is assembled in winape to work at &4000,
there is a simple basic loader.

Ok. The problem is that in your disk, there is a .BAS, that it is the loader, and a .BIN.

The code of the .BAS is only this.
10 MEMORY &3FFF
20 LOAD "smaz.bin",&4000
30 CALL &4000

This loader load "smaz.bin" on &4000 and call it in this position.
But if you import smaz.bin with CDTMASTER ( AMSDOS Files (Tab) -> Import from DSK -> Load your dsk image -> select "smaz.bin" on the file list)
... you will see.

Load Position => 0

If you want smaz.bin to run directly without a .bas, Load position and Execute Position must be 0x4000.
You can use CDTMASTER to change that before create the TZXBLOCKS. It works.

Other way is to convert first "smaz.bas" into tzxblocks and later "smaz.bin". It's work too.
But I suggest you to change the line 20 of the BAS
from
20 LOAD "smaz.bin",&4000
to
20 LOAD "!smaz.bin",&4000
Because where is on TAPE mode, LOAD waits for a key and writes message on Screen. And "!" is ommited on disk too, so it will work on both disc and tape.
If you put .BAS as is, there will appear another "Press PLAY then any key:" after load "smaz.bas"

But remember to convert to tzx blocks in order. First BAS and later BIN.

trabitboy

Thanks for taking the time I will have a go for the first solution ( without .bas ) .


I'm not sure to have understood the second solution:
- do a cbt with a .bas block and the .bin block
- upon loading the .bas will run and will load and execute the .bin


Thanks for the very detailed explanation  8)

CECPC

Quote from: trabitboy on 15:39, 05 March 15
I'm not sure to have understood the second solution:
- do a cbt with a .bas block and the .bin block
- upon loading the .bas will run and will load and execute the .bin
Ok. Step by step.

Open your favorite emulator.
Load the DSK image.
On emulated AMSTRAD

LOAD"SMZ.BAS"
20 LOAD "!smaz.bin",&4000
save "SMZ.BAS"


Close the emulator (to ensure the disk image is not used by emulator)
Open CDTMaster

Select the TAB "AMSDOS Files"
On Menu, Select "Import from DSK"
Select your DSK image.

On the list under "AMSDOS Files" select "SMZ.BAS"
On Menu . Tools -> Convert to TZXBlocks
Select your Write Speed preference (Ej: 2000)
Leave other options by default.
Select "Accept"
CDTMaster responds "Generated 1 block"

On the list under "AMSDOS Files" select "SMAZ.BIN"
On Menu . Tools -> Convert to TZXBlocks
Select your Write Speed preference
Leave other options by default.
Select "Accept"
CDTMaster responds "Generated 2 block"

Select the TAB "CDT/TZX Editor"
On the right panel should be 6 Turbo Speed Data Blocks (2 turbo blocks per AMSDOS Block, 1 AMSDOS block for SMZ.BAS and 2 for SMAZ.BIN)
Select the first with a click.
Press SHIFT and click on the last block.
Press CTRL+C

On left panel, select "*** End of file"
Press "CTRL+V"
The six blocks should be copied here.

On Menu, select File -> Save CDT/TZX

Choose a name for your CDT

Easy, isn't it?

trabitboy

Tested and it works :)
Really awesome from you to take the time to do detailed steps,
I now understand much more what I am doing .

CECPC

I have launched a new version that fix some bugs in import from disk option, contextual menu (mouse right button) for easier manage, insert blocks without copy from other CDT , support for edit "Hardware Type blocks" and some other minor things.

DARKGATE

 :D Good news, listen CECPC can i take a .CDT file for example TOMBSTOWNE (with standard loader to blocks) and convert it with another loader ? Thank you.
Do not underestimate the power of AMSTRAD CPC.

CECPC

#19
Quote from: DARKGATE on 09:19, 10 September 15
:D Good news, listen CECPC can i take a .CDT file for example TOMBSTOWNE (with standard loader to blocks) and convert it with another loader ? Thank you.
I'm afraid not. But is a tool that helps a lot to make it.

Normally I use CDTMaster and WinAPE with a loader in ASM that WinAPE could compile to make it in little time.

But with Standard Tapes, you could change the speed and make a semistandar tapes with only two blocks. Very fast.

For example, with TOMSTOWNE.

Load it in CDTMASTER and use Tools -> Find AMSDOS files.
It will find 3 files that put it into "AMSDOS Files" tab.

If you want fast tapes, for example make it at 2000 baud and semistandard, go to AMSDOS files and use "Tools -> Convert to TZX" so you can recodificate the files in other way.
Try it and use "Write Speed (baud): 2000
And "Maximun length for other blocks": 65535
For each file, and in order (from up to bottom):

You can return to CDT/TZX Editor and you will see some blocks in the list of the right.
Then, you can remove the items on the left list from the first "Turbo Speed Data Block" to the last and press "Delete" (or use right mouse and choose the correct option). The copy the blocks from the right list to the left list and save the tape again.

As you could see, the tape is a lot faster, because it will be only two blocks per file.
The Amstrad firmware support blocks larger than 2 kilobytes with the exception of the first, because the first block is copied into a buffer of this size, so it could'n be larger.

To make a turbo loader it is more complicate, because you must replicate, with you own code, the functionality of the original loader.


For example, for this game.

It put it in loading order. A loader in Basic.
OK... to "parse" the Basic the easiest form is with WinAPE. You load the tape normally, and when the first loader runs, press F7 (run debugger and Pause CPC emulation) and again, in the main window, Assembler -> Show Assembler.

There, you have "File -> Read Basic".

Here it is

10 POKE 48622,201:KEY DEF 66,0,0,0,0:MODE 1:MEMORY 36970:LOAD"!LOADER.BIN",36971:CALL 36971:CALL 0
1000 SPEED WRITE 0:|TAPE.OUT:SAVE"loader",p:MEMORY 15000:LOAD"loader.bin",36971:SAVE"!loader.bin",b,36971,3269:RUN"savegame

POKE 48622,201 -> Prohibits break
KEY DEF 66,0,0,0,0 -> Locks ESC key
MODE 1 -> Graphic mode
MEMORY 36970:LOAD"!LOADER.BIN",36971:CALL 36971 -> Loads "Loader.bin" in 36971 = 0x906B

So, we have a first loader that loads a second loader. To see the second loader, you bust use the debugger, put a breakpoint on 0x906B and see which it does.

In a fast watching, it the screen "painted" and later load the file with standard routines. So to make non-standard, you must program your own loader, that loads the screen, run it BUT intercepts the firmware callings so the next routines could use your own code for loading.
With a lot of work, perhaps someone could make a loader that intercepts tape routines on firmware so some standar tapes works without too many modifications. I do turbo versions like "Victory Road" patching the original code. Sometimes is easy. In this case it seems.

trabitboy

Hi!
I'm in a new case that I can't solve:

I have an amsdos bin on a dsk,
which I can simply load with load"cnb.bin

I import the bin in CDTmaster, it does recognise the start adress properly ( &8000 ) .
I do the cdt and save.

In winape :
|tape
load "cnb.bin

it says it finds the blocks, but nothing happens at end of tape?

Thanks in advance if you are around  8)
( trying to prepare my release for retrodev, and I'm a dsk guy  :picard: )

AMSDOS

#21
Quote from: trabitboy on 10:36, 21 October 16
Hi!
I'm in a new case that I can't solve:

I have an amsdos bin on a dsk,
which I can simply load with load"cnb.bin

I import the bin in CDTmaster, it does recognise the start adress properly ( &8000 ) .
I do the cdt and save.

In winape :
|tape
load "cnb.bin

it says it finds the blocks, but nothing happens at end of tape?

When you say nothing happens, does the program stop loading and "Ready" message display? I ask because you load"cnb.bin which will only load the program, you either need to run" the file, if the execution address is in the header it will run the program from there, otherwise you need to call <execution address> if you load.


If the Ready message doesn't appear, there's most likely a problem with the output from the file a part of the audio tail being snippet resulting in the program not loading and no read error reported (this happened with my game I think, which is only a hunch). If it's a single file, 2cdt could be used, it's simply a matter of extracting or copy the file using Edit Disc in Winape to a Directory. 2cdt is command line program though, simply put your file with 2cdt and type:


2cdt -n -r "cnb" "cnb.bin" "cnb.cdt"


should work.
* Using the old Amstrad Languages :D * And create my own ;)
* Incorporating the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

trabitboy

Hi , thanks for your answer,
with the support of Reidrac and cpc dev toolchain under cygwin,
I got it to work during lunch break :)
funnily I had to use -L and -X even though the adresses should be in the header.

./2cdt.exe -n -X "&8000" -L "&8000" -r cnb cnb.bin cnb.cdt

CECPC

Quote from: trabitboy on 12:42, 21 October 16
Hi , thanks for your answer,
with the support of Reidrac and cpc dev toolchain under cygwin,
I got it to work during lunch break :)
funnily I had to use -L and -X even though the adresses should be in the header.

./2cdt.exe -n -X "&8000" -L "&8000" -r cnb cnb.bin cnb.cdt
If the positions are not OK in the file in CDTMASTER Y remember you that the textboxes of CDTMASTER use decimal numbers, although you can input a number starting with & to use hexadecimal instead.

arnoldemu

Quote from: trabitboy on 12:42, 21 October 16
Hi , thanks for your answer,
with the support of Reidrac and cpc dev toolchain under cygwin,
I got it to work during lunch break :)
funnily I had to use -L and -X even though the adresses should be in the header.

./2cdt.exe -n -X "&8000" -L "&8000" -r cnb cnb.bin cnb.cdt
2cdt failed to detect the header. The file didn't have a header or the checksum was invalid.

If it found the header it would use the load address and execution address from it.

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Powered by SMFPacks Menu Editor Mod