DWLOAD - DriveWire for everybody

A place to discuss everything Dragon related that doesn't fall into the other categories.

DWLOAD - DriveWire for everybody

Postby tormod » Sat Oct 25, 2014 9:42 pm

DWLOAD is a small DriveWire client for BASIC which works without needing a DOS. It loads files as-is from the DriveWire server, that is, not using disk images like HDB-DOS or NitrOS-9 does.

Simply put: Just drop the files in your DriveWire4 server folder, and access them from the Dragon using DLOAD"FILE".

The files can be Dragon DOS binary or BASIC files, or DECB binaries.

The DWLOAD client can be loaded from tape or disk or, most conveniently, embedded into the BASIC ROM.

The DWLOAD ROM

The DWLOAD client nicely replaces the (dysfunctional on Dragon 32, slow on Dragon 64) DLOAD command, and makes use of the DLOAD code locations and some unused spots in the ROM. No other parts of the BASIC ROM have been touched, so the modified ROM is 100% compatible with the original. Luckily, it fits into the high 8K ROM chip, which on most Dragon 32's is socketed (the lower 8K ROM is often soldered). The modified ROM image can therefore be burned to an EPROM and only a 24-pin ROM to 28-pin EPROM adapter is needed.

On Dragon 64, DWLOAD works in 32K mode. A modified ROM image replaces the 32K ROM (which also is socketed). This thanks to Ken, who rearranged the 32K ROM to fit the same DWLOAD code as on the Dragon 32. Compatibility is here less than 100% but you have the possibility to go full-RAM and run the original ROM from RAM if ever needed.

On power-on, the DWLOAD silently attempts to load an AUTOLOAD.DWL file. This makes it possible to have for instance a menu program running automatically. Or your favorite game :) The auto-loading can be disabled by pressing the Shift key.

Note that is called DWLOAD but it is spelled DLOAD on the Dragon :!:

DWLOAD Extensible Execution Blocks (dweeb)

The DWLOAD client is relatively simple, due to the space contraints in the ROM. The dweeb is a mechanism to dynamically extend the functionality of DWLOAD. The dweeb is loaded from the server like any other program, but accesses the I/O routines of DWLOAD. It also reads its command parameters from the DWLOAD command line.

The best example is the "SAVE" dweeb. There is not enough room in the ROM to include support for saving files over DriveWire. However, this functionality can be loaded on demand. DLOAD"SAVE""MYFILE.BAS" saves a BASIC program to the DriveWire server. The SAVE functionality is only temporarily loaded into RAM and used during this invocation.

Another typical dweeb is "DOS" for booting an operating system (NitrOS-9), similar to the DOS command in HDB-DOS or the DWDOS program.

Pere has also created some dweebs for accessing VDK disk images on the DriveWire server, this is very useful for accessing Dragon DOS program collections without using a disk drive or DOS.

Since a dweeb uses the I/O routines of the calling DWLOAD, it is independent of the real transport being used, which makes development with for instance the Becker interface in XRoar very convenient.

Memory requirements

DWLOAD only uses RAM when it is run, there is no resident code or data in RAM. It uses the same buffer space in lower RAM as CLOAD/CLOADM. A few, normally unused, locations in lower RAM is used for bookkeeping during loading.

Advantages of DWLOAD

  • No fiddling with disk images
  • No need for a DOS consuming RAM and blocking some programs
  • Frees the cartridge memory space for other things
  • Also works well in combination with DOS

Advantages of DriveWire in general

  • Fast and low latency
  • Cartridge port free for other purposes (2015 will give us more of those)
  • Puts the rarely used printer port to good use

Background

This started last year when I revived the DLOAD command, fitting in the low-level bit-banging routines from the HDB-DOS/NitrOS9 code. However the DLOAD protocol is not so efficient, and it needs a special DLOAD server. At the same time we already have a great DriveWire4 server... I went on to extending the DWDOS program to load arbitrary files from a DriveWire server, not just boot tracks. Further work added support for reading DECB binaries, and DWLOAD was born. Months has passed with testing and further refinement, seeing the addition of Dragon DOS file format support. Still fitting in the BASIC ROM :geek:

Thanks a lot to Ken and Pere who have been beta-testing, burning ROMs and given many excellent inputs, as well as writing dweebs! I am sure they are as excited as me to share this with the Dragon community!

See also the post I made on the CoCo list in June: http://thread.gmane.org/gmane.comp.hard ... coco/78869

Availability of EPROMs and ROM/EPROM adapters

For those who cannot burn their own EPROMs I will be offering a DWLOAD EPROM modding service and socket adapters. Stay tuned on the "Sales" section.

For the press

"Best thing for the Dragon since Microsoft Color BASIC"

"Bye-bye CLOAD"

"After trying DWLOAD from ROM there is no going back"


"Cross-development made easy: just assemble with lwasm --format decb and directly DWLOAD it on your real Dragon"



Notes on the DriveWire4 program

The DriveWire4 server program currently has a few limitations:
  • It is not able to create files using the OBJ_NAMEOBJ_CREATE DriveWire request
    To save files, create empty files on the server, and use the "RESAVE" dweeb.
  • Mounted files must have length of a multiple of 256 bytes
    All files must be padded to be n*256 bytes long.
    The attached pad256 script can be used on Linux and MacOSX.
These limitations will be lifted in future DriveWire4 versions.

Please see the readme.txt files in the attached collections! Use 7-zip on Windows to open .tar.xz files.
Attachments
dwload-demo-files.tar.xz.zip
Example files to load using DWLOAD. Compressed with xz but wrapped in zip because of forum filter.
(165.79 KiB) Downloaded 93 times
pad256.zip
bash script for padding files to n*256 bytes
(329 Bytes) Downloaded 78 times
dwload-roms.tar.xz.zip
ROM images for real and for XRoar. Compressed with xz but wrapped in zip because of forum filter.
(19.13 KiB) Downloaded 120 times
Last edited by tormod on Tue Jan 06, 2015 7:56 pm, edited 5 times in total.
User avatar
tormod
 
Posts: 406
Joined: Sat Apr 27, 2013 12:06 pm
Location: Switzerland

DWLOAD - HOWTO 1 : DWLOAD in ROM/EPROM (real or Xroar)

Postby tormod » Sat Oct 25, 2014 9:46 pm

DWLOAD comes to its full glory when it is embedded in ROM. Just turn on your Dragon, and DLOAD any program from the server. If there is an AUTOLOAD.DWL file on the server, it will be loaded and run automatically.

If you don't have an EPROM yet, use XRoar to see how it works.

For all examples, start out putting some DECB binary, Dragon DOS binary or BASIC files in your DriveWire4 folder. (Due to a limitation in the current version of DriveWire4, the files must be padded so their length is a multiple of 256.)

Example 1: Using DWLOAD with a DWLOAD EPROM

1) Run any program from the DriveWire4 server simply using DLOAD:
DLOAD"MYFILE"


Example 2: Running DWLOAD from ROM in XRoar (Dragon 32)

1) Set up DriveWire4 to use the Becker interface for emulators
2) Use the patched d32-dwload-becker.rom instead of the original ROM:
Code: Select all
  xroar -default-machine dragon32 -romlist d32=d32-dwload-becker.rom -cart rsdos -cart-becker

3) On your emulated Dragon, load files using DLOAD:
DLOAD"MYFILE"


Example 3: Running DWLOAD from ROM in XRoar (Dragon 64 in 32K mode)

1) Set up DriveWire4 to use the Becker interface for emulators
2) Use the patched d64-dwload-becker.rom instead of the original IC18 ROM
Code: Select all
 xroar -default-machine dragon64 -romlist d64_1=d64-dwload-becker.rom -cart rsdos -cart-becker

3) On your emulated Dragon, load files using DLOAD:
DLOAD"MYFILE"


Example 4: Saving a BASIC program on the DriveWire server

1) Write your BASIC program or load it via tape, etc
2) Add an empty MYPROG.BAS file to your DriveWire4 folder (The current version of DriveWire4 cannot create files)
3) Load and run the "RESAVE "dweeb:
DLOAD"RESAVE""MYPROG.BAS"
User avatar
tormod
 
Posts: 406
Joined: Sat Apr 27, 2013 12:06 pm
Location: Switzerland

DWLOAD HOWTO 2 : DWLOAD in RAM (without EPROM)

Postby tormod » Sat Oct 25, 2014 9:50 pm

To see what you can do with DWLOAD, you can also load DWLOAD from tape or disk into RAM. You won't get the power-on "wow" experience, but maybe you get another when you see how fast you can load your favorite game over DriveWire.

Example 5: Trying out DWLOAD from RAM (Dragon 32)

1) Load the DWLOAD client from tape (dwload-ram.wav) or floppy (DWLOADR.BIN)
2) Run DWLOAD to load your file over DriveWire:
EXEC&H7400"MYFILE"

Note that dwload-ram loads at $7400-$765D so it cannot load any program into that space!


Example 6: Running DWLOAD from ROM-in-RAM (Dragon 64 in 32K mode)


1) Put d64-patched-rom17.bin into your DriveWire4 folder
1) Load the dw64ram loader from tape (dw64ram.wav) or floppy (DW64RAM.BIN)
2) The program will load the patched ROM image via DriveWire to RAM:
EXEC
3) Load programs using DLOAD:
DLOAD"MYFILE"


Example 7: Saving a BASIC program on the DriveWire server (RAM version)

1) Write your BASIC program or load it via tape/etc
2) Add an empty MYPROG.BAS file to your DriveWire4 folder
(The current version of DriveWire4 cannot create files)
3) Load the DWLOAD client from tape (dwload-ram.wav) or floppy (DWLOADR.BIN)
4) Load and run the "RESAVE "dweeb to save your file over DriveWire:
EXEC&H7400"RESAVE""MYPROG.BAS"
Attachments
dwload-examples-ram.tar.xz.zip
DWLOAD RAM versions. Compressed with xz but wrapped in zip because of forum filter.
(17.13 KiB) Downloaded 79 times
User avatar
tormod
 
Posts: 406
Joined: Sat Apr 27, 2013 12:06 pm
Location: Switzerland

DWLOAD demo files: Games collection in DECB format

Postby tormod » Sat Oct 25, 2014 9:58 pm

DWLOAD can load any DECB binary, Dragon DOS binary or BASIC files from a DriveWire server*.

The attached collection of 90 games was auto-converted from CAS files using cas2decb from https://gitorious.org/m6809-computer-tools/conv-tools

The auto-conversion can not guarantee 100% working files, since CAS files might include various loading tricks to display splash screens, or to make illegal copying more difficult, and thus depend on the "real" tape reading routines.

I haven't tested them all. Please PM me if there is an issue with any of the games and I will update the collection. Some of the games seems to come from CoCo and use the CoCo keyboard map. See the included readme.txt for the full game titles.

*) Note that the current version of DriveWire4 (4.3.4) requires all files to be a multiple of 256 bytes. cas2decb pads the DECB files for this reason.

PS. I have also attached a zip file with MS Windows versions of my conversion tools. There is an issue with image-patcher.exe but that is not important here.
Attachments
conv-tools_win32.zip
MS Windows binaries of conversion tools.
(33.64 KiB) Downloaded 84 times
games-decb.tar.xz.zip
Games in DECB format. Compressed with xz but wrapped in zip because of forum filter.
(554.73 KiB) Downloaded 84 times
User avatar
tormod
 
Posts: 406
Joined: Sat Apr 27, 2013 12:06 pm
Location: Switzerland

Re: DWLOAD - DriveWire for everybody

Postby pser1 » Sun Oct 26, 2014 10:49 am

Hello Tormod,

great!
I have added a thread with a link to this one in the spanish RetroWiki
They need to know this !

cheers
pere
pser1
 
Posts: 867
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: DWLOAD - DriveWire for everybody

Postby sorchard » Sun Oct 26, 2014 11:58 am

This is really impressive stuff Tormod. I shall probably invest in a DriveWire + D64 EPROM & adaptor when the kit is available.

To test PC developed software on real hardware, I'm currently using Bluetooth to transfer wav files to my phone and then CLOADM for the final step which works well but I like the idea of using DriveWire for quick-turn testing.
Stew
sorchard
 
Posts: 346
Joined: Sat Jun 07, 2014 9:43 pm
Location: Norwich UK

Re: DWLOAD - DriveWire for everybody

Postby KenH » Mon Oct 27, 2014 10:02 am

Tormod has created a winner with DWLOAD!
It's easy.
It's fast.
And it's fully compatible with all your tape or disk programs.

Here is setting up DWLOAD in 3 steps:

Step 1 - Install the DWLOAD eprom in your Dragon
Image
Dragon 64 shown. The DWLOAD eprom replaces one of the Dragon's basic ROMs. Gently pull out your old rom and replace it with the new DWLOAD eprom. The DWLOAD basic rom is compatible with all the existing Dragon software (tape and disk).
The Dragon 32 requires an additional 28 to 24 pin socket adapter.

Step 2 - Connect the Drivewire adapter to your Dragon's parallel port and your PC's USB port
Image
The Drivewire adapter connects the Dragon to the PC using a fast 57kbs serial bitbanger port

Step 3 - Start the DW server program on your PC (Win/Linux/Mac)
Image
Just choose CoCo2 from the DriveWire Server simple config wizard. Keep all the default selections. For XRoar select Emulator/TCPIP.
If this is the first time you're running DW on your PC, mount a dsk image in Drive 0 to initialize the Drivewire server.


That's it!
Using the enhanced DLOAD command the Dragon can now load and run any .BIN or .BAS file that you copy to the Drivewire directory on your PC.

It takes less than 6 seconds to load The King binary (24k)!
Here's a short demo video:
https://www.youtube.com/watch?v=Rxo7cE5c8cY
Last edited by KenH on Wed Nov 05, 2014 8:18 pm, edited 4 times in total.
KenH
 
Posts: 176
Joined: Fri Oct 12, 2012 9:50 am

Re: DWLOAD - DriveWire for everybody

Postby jedie » Mon Oct 27, 2014 11:10 am

Realy, realy interesting! Good work!
... too many ideas and too little time ... Related stuff written in Python:
Dragon 32 emulator / PyDC - Python Dragon 32 converter: https://github.com/jedie/DragonPy
DWLOAD server / Dragon-Lib and other stuff: https://github.com/6809
jedie
 
Posts: 630
Joined: Wed Aug 14, 2013 12:23 pm
Location: germany

Re: DWLOAD - DriveWire for everybody

Postby tormod » Tue Oct 28, 2014 12:11 am

Thanks guys! I realize it is exactly one year ago I squeezed an extended DWDOS client into the BASIC ROM to load specially crafted binaries. But then it took me to April (after skiing season?) to get back to it and add DECB support. Since then it has been a lot of refinements and testing (also by Ken and Pere), and after the addition of BASIC and Dragon Dos formats I am confident it is full-featured, well-polished and ready for the fine world of Dragons.

sorchard, you'll be testing your software on the real Dragon all the time :) The ability to save back to the PC without tape recording software and wav conversion is also very convenient when working with BASIC.

Ken, thanks for a great tutorial!
User avatar
tormod
 
Posts: 406
Joined: Sat Apr 27, 2013 12:06 pm
Location: Switzerland

Re: DWLOAD - DriveWire for everybody

Postby jedie » Tue Oct 28, 2014 9:40 am

tormod wrote:Note that is called DWLOAD but it is spelled DLOAD on the Dragon :!:

That can be confusing... Why not call it DLOAD v2 or so?
... too many ideas and too little time ... Related stuff written in Python:
Dragon 32 emulator / PyDC - Python Dragon 32 converter: https://github.com/jedie/DragonPy
DWLOAD server / Dragon-Lib and other stuff: https://github.com/6809
jedie
 
Posts: 630
Joined: Wed Aug 14, 2013 12:23 pm
Location: germany

Next

Return to Dragon General

Who is online

Users browsing this forum: No registered users and 1 guest

cron