[Coco] Having fun with hacking HDB-DOS

Bill Pierce ooogalapasooo at aol.com
Fri Feb 14 01:50:09 EST 2014


I thought there was a ram hook, but I didn't want to go out on a limb without doing some research in the unraveled books.
The use the dw4 printer, you would have to intercept each byte or complete string and redirect it (them) to the dw4 routines in hdbdos. Each byte sent has to be preceded with dw4's print opcode. Dw4 will cache all bytes in the server's buffer until the dw4 flush command is received and then will process the buffer.

This has already been done with the DW4 version of Lyra as well as the Becker Lyra version by sending the actual Midi bytes to the routine instead of the bitbanger or midipak. In using midi, First a 3 byte init code is sent to open the port then each midi byte has to be preceded by the virtual port number 14 so that dw4 recognizes then following byte as midi (and what port is talking in case of multiple open ports). Virtual port 14 is the midi port. (/N15 or /MIDI in NOS9).

DW4 Midi uses high level cmd via the ports where as the virt printer uses low level protocol, hence the printer opcode before each byte instead of a port number so dw will know that byte goes to the print buffer.
The DW4 in/out routine are listed in the device table in the HDBDOS source.
Aaron may know an easier way, but I think this is how it'll work.

(BASIC)
ST$="HELLO"
PRINT#-2,ST$ (probably wrong syntax but you get the idea. It's been 25 years since I worked in BASIC)

(Sent to HDBDOS DW4 parser) - Entry: Y=number of bytes, X=Address of Data
Create a 2 byte buffer with $50 (dw print opcode) as the first byte (MSB) and the intercepted string byte as LSB
As sent the complete string would be

BUFFER FDB $5000

(intercept byte and put it buffer+1)
 LDY #2
 LDX #BUFFER
 JSR [DWOUT]
(rinse and repeat)

Bytes actually sent: 
$5048 $5045 $504C $504C $504F

The last byte sent is a single DWFlush command
 LDY #1
 LDX #DWFLUSH
 JSR [DWOUT]

DWFLUSH FCB $46 (flush dw4 print buffer)

You could collect each byte and store until it's complete then send the whole string, but that would take a dynamic buffer size and routines to add the opcode before each byte. Easier to do it as it's passed (if possible) through the ram hook. Then you only need to steal 2 bytes in basic for the buffer.

Aaron, please correct me if I'm wrong. (I know you will LMAO)


Bill Pierce
"Today is a good day... I woke up" - Ritchie Havens
 

My Music from the Tandy/Radio Shack Color Computer 2 & 3
https://sites.google.com/site/dabarnstudio/
Co-Webmaster of The TRS-80 Color Computer Archive
http://www.colorcomputerarchive.com/
Co-Contributor, Co-Editor for CocoPedia
http://www.cocopedia.com/wiki/index.php/Main_Page
E-Mail: ooogalapasooo at aol.com




-----Original Message-----
From: William Astle <lost at l-w.ca>
To: coco <coco at maltedmedia.com>
Sent: Fri, Feb 14, 2014 12:11 am
Subject: Re: [Coco] Having fun with hacking HDB-DOS


Actually you can hook the printer output using one of the ram hooks so it should 
be easy even without having the roms copied to ram. The console out hook is the 
relevant one I believe. Disk basic already hooks it so you should be able to 
modify that routine.

-------- Original message --------
From: Bill Pierce <ooogalapasooo at aol.com> 
Date: 02-13-2014  9:51 PM  (GMT-07:00) 
To: coco at maltedmedia.com 
Subject: Re: [Coco] Having fun with hacking HDB-DOS 
 

Good work Juan, sounds like you're having fun.
How about adding some DW4 commands? 
Redirect PRINT#-2 to the DW4 file printer. It shouldn't be a hard command to 
patch into and the DW4 routines to pass the data are already present in the 
hdbdosdw versions. It might be tricky (or improbable) on a Coco 1 or 2 as you 
may have to move rom to ram, but on a Coco 3 this is already done and patching 
the CB & ECB roms is easy.


Bill Pierce
"Today is a good day... I woke up" - Ritchie Havens


My Music from the Tandy/Radio Shack Color Computer 2 & 3
https://sites.google.com/site/dabarnstudio/
Co-Webmaster of The TRS-80 Color Computer Archive
http://www.colorcomputerarchive.com/
Co-Contributor, Co-Editor for CocoPedia
http://www.cocopedia.com/wiki/index.php/Main_Page
E-Mail: ooogalapasooo at aol.com




-----Original Message-----
From: Juan Castro <jccyc1965 at gmail.com>
To: Lista CoCo <coco3 at googlegroups.com>; CoCo List <coco at maltedmedia.com>
Sent: Thu, Feb 13, 2014 10:53 pm
Subject: [Coco] Having fun with hacking HDB-DOS


Now the WIDTH command works and drops you in the PMODE 4 screen if the
argument is 51 or 64. WIDTH 32 takes you back to text mode. Also, all
CoCo 3 tokens are recognized. But, of course, all but WIDTH will give
you an error.

Next up: LOCATE. Then... BUTTON? ERR/ERNO/ERLIN?

ROMs: https://dl.dropboxusercontent.com/u/15643089/16kroms.zip
Source patch: https://dl.dropboxusercontent.com/u/15643089/hdbdos-16krom.patch

Juan

--
Coco mailing list
Coco at maltedmedia.com
http://five.pairlist.net/mailman/listinfo/coco



--
Coco mailing list
Coco at maltedmedia.com
http://five.pairlist.net/mailman/listinfo/coco

--
Coco mailing list
Coco at maltedmedia.com
http://five.pairlist.net/mailman/listinfo/coco

 



More information about the Coco mailing list