DIY: 80 column WordPak board (CRT9128)

A place to discuss everything Dragon related that doesn't fall into the other categories.
pser1
Posts: 1655
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: DIY: 80 column WordPak board (CRT9128)

Post by pser1 »

back again,
I have tested from disc in my Dragon64 and it works perfect. I attach a screenshot with the results and the listing of the program that just uses PRINT@
I have saved it to Audacity: CSAVEM"WP23D64",&H7D00,&H7F70,&H7D04
and then I have loaded it to XRoar and saved it to the VDK image with that new name.
Later I have saved it from XRoar to CAS and WAV files wich are in the attached zip together with the VDK image.
Hope it works good for you too.
regards
pere

Ps I understand that you are testing it on a Dragon, not on a CoCo, am I right?
I changed a verification for the output device, original compared to #3 (retrocanada), now compares to #$FE, so that Printer is not affected ...
Attachments
downscaled screen shot
downscaled screen shot
05 - PRINT@ TEST.jpg (50.76 KiB) Viewed 5046 times
WP23 PRINT@ VERIFIED.zip
different file formats and VDK
(8.88 KiB) Downloaded 214 times
Last edited by pser1 on Fri Jun 06, 2014 12:11 pm, edited 1 time in total.
pser1
Posts: 1655
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: DIY: 80 column WordPak board (CRT9128)

Post by pser1 »

I have read your message again and I have detected that you write the command PRINT then a space and finally the @ sign.
If this is the case, then it will NOT work!
I had always written PRINT@ together when I used to program many years ago ...
I did rewrite the PRINT hook so that it verifies first that the token is $87 (PRINT) and then it verifies that NEXT char is @, in this case it sets the flag else it does nothing, so the text will be displayed on the next line.
Just confirm this point and if so, I will add a bit of code so that it will skip the spaces between PRINT and @
regards
pere
KenH
Posts: 182
Joined: Fri Oct 12, 2012 9:50 am

Re: DIY: 80 column WordPak board (CRT9128)

Post by KenH »

pser1 wrote:I have read your message again and I have detected that you write the command PRINT then a space and finally the @ sign.
If this is the case, then it will NOT work!
Great observation, pere!
Old habits die hard ;)
The code you uploaded yesterday works great without the space!
I am testing on a Dragon 64, using hdbdos and drivewire.


It would be a good idea to add code to ignore spaces to ensure compatibility with existing basic programs.
I'd be happy to continue testing.
pser1
Posts: 1655
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: DIY: 80 column WordPak board (CRT9128)

Post by pser1 »

pleased to know it :D
I am re-reading the code to better understand some obscure parts (to me).
I know that now it works, but there are still a few code lines I would like to modify and re-test.
By now, skipping the spaces is already added, so next release will have that correction. I should have known ;)
Do you think it will be usefull to have the margins as variables so that we could tweak them to change on the fly the working area?
As the program has RAM data, to make it absolutely PIC, there are a lot of sentences that should be modified and so the size of the driver will increase, of course.
By now it uses 2 bytes for the controller address, one for the TV signal type and one for the cursor, so 4 bytes.
In the event we add two more for the margins, we could use 6 bytes in the range $F7-$FF despite I am sure that many programmers do the same when fixed ram bytes are needed.
That way it will be far easier to convert all of the code to PIC, allowing it to be burned on an EPROM after the D.O.S. area, let's say $E400 not to collide with the versions with a better DIR that are a bit greater than 8K.
Any comment / advice will be wellcome
regards
pere
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: DIY: 80 column WordPak board (CRT9128)

Post by zephyr »

pser1 wrote: By now it uses 2 bytes for the controller address, one for the TV signal type and one for the cursor, so 4 bytes.
In the event we add two more for the margins, we could use 6 bytes in the range $F7-$FF despite I am sure that many programmers do the same when fixed ram bytes are needed.
Those bytes are used by DOS:
$00f4 DOS - Current disk type - taken from directory track on
first disk access after switch on or reset
0x00 1 side 40 tracks
0x01 2 sides 40 tracks
0xfe 2 sides 80 tracks
0xff 1 side 80 tracks

$00f4 DOS - {2} lists this as "Record Length Flag"
0x00 don't care, 0xff do care

$00f5 DOS - File read/write/verify flag
0x00 read
0x01 write
0xff verify

$00f6 DOS - I/O currently in progress flag
0x00 check for time out, Non-0x00 skip timeout check

$00f7 DOS - Enable/disable selective file closure {DragonDos 1.2}
0x00 disable, Non-0x00 enable

$00f8 DOS - Sector currently seeking {SuperDos Rom}

$00f9 DOS - CumanaDOS ??

$00f3-00fc Used by HDB-DOS and RGB-DOS for Dynamic Storage

$00fd-00ff Reserved for use as a 63x09 secondary error trap vector (Used by Steve Woolham's enhanced Dragon ROMs)
pser1
Posts: 1655
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: DIY: 80 column WordPak board (CRT9128)

Post by pser1 »

thanks a lot, Steve
according to the Grosvenor's Dragon DOS programmer's guide, it seemed that from $F7 on where free bytes ...
I had not taken into account the other DOS, unfortunately.
I will write down your amendments for future use.
Maybe, if needed, I could reserve from $7F00 to $7FFF by means of a CLEAR 200,&H7EFF
Keeping into account that the way retrocanada made this driver involves using three bytes inside the driver for every intercepted hook (three) where the old hook is copied
and the process finishes jumping where the hooks calls.
To make the driver PIC, these should go out of the driver, so 9 extra bytes plus the 6 for variables means 15 extra bytes, so they will fit in the reserved area ...
Need to think about this.
regards
pere
pser1
Posts: 1655
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: DIY: 80 column WordPak board (CRT9128)

Post by pser1 »

hello,
I attach here a version of the driver that accepts spaces between PRINT and the @ sign.
You will find the Basic installer and the driver in CAS and WAV versions, besides the BAS in text format and the driver in DRM format. An VDK disk is added too.

I have detected an annoying "Basic - Dragon 32 char screen" characteristic.
It turns out that when you LIST a Basic Program using the WordPak80x24 you will find, sometimes, that a line has been concatenated to the prior one instead being in the next line!
I attach a screenshot, you will see that line 230 is added to the line 220 which is exactly 32 chars long.
I didn't understand why this could happen ... untill, by hazard, I saw that every basic line that is exactly 32 chars length, is printed on screen by the basic but without any forthcoming ENTER, because it has changed of row, gracefully!
Unfortunately, we have plenty of space after the 32nd column and so next line will appear next to the end of the "odd 32 char length" line.
I think that it is going to be difficult to detect that case because we are receiving individual chars, so this problem will requiere some time to think of a solution.
If you have any idea to solve this problem, you are welcome!
regards
pere
Attachments
_DOS Driver for WorkPad80x24.zip
Files for Wordpak80x24 driver
(21.38 KiB) Downloaded 219 times
Concatenated lines by Basic
Concatenated lines by Basic
06 - BASIC LIST concatenates two lines!.jpg (63.02 KiB) Viewed 5007 times
User avatar
tormod
Posts: 416
Joined: Sat Apr 27, 2013 12:06 pm
Location: Switzerland
Contact:

Re: DIY: 80 column WordPak board (CRT9128)

Post by tormod »

pser1 wrote:Unfortunately, we have plenty of space after the 32nd column and so next line will appear next to the end of the "odd 32 char length" line.
I think that it is going to be difficult to detect that case because we are receiving individual chars, so this problem will requiere some time to think of a solution.
If you have any idea to solve this problem, you are welcome!
An interesting problem. I assume your driver only intercepts OUTCHR and you don't want to intercept and duplicate the LIST command. The LIST command runs from $8EAA. The decision to whether print CR is done in the routine called at $90A5. But your hook is never called from within there when this issue appears (the opposite problem would have been easier).

I'd suggest you check if CR was just printed when the line number is printed. If not, send a CR to the CRT9128.

So first of all your driver should keep track of the last printed character. The LIST code calls $957A (print D in decimal) to print the line number, which jumps to $90E5 to print the resulting string, which finally calls OUTCHR at $B54A. You should check the return addresses on the stack to see if you are in this situation, and then send a CR if a CR was not the last character printed. And you need to check that you are at the first digit of the line number string. For this, try comparing B (the string index of the string print routine) with the contents of $56 (BASIC string length).

For sake of performance you may want to check first that a decimal digit is printed before looking at the stack etc.

EDIT: I had originally made it more complicated than it had to be. The line number is printed as one string, not digit by digit. The stack should contain $B54D, $90F3, $8EF1.
EDIT2: It is more complicated but different: Need to check we're at the beginning of the string.
Last edited by tormod on Sat Jun 07, 2014 11:56 pm, edited 1 time in total.
pser1
Posts: 1655
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: DIY: 80 column WordPak board (CRT9128)

Post by pser1 »

wow!, what a great job you've done, Tormod
I will read it carefully next week and I'm sure that with this information we will find a reasonable patch to avoid the annoying lines being printed together.
Clearly, every time we change the environment constants, programs show unexpected behavior, but that is great, we love living on the edge!
will talk about that subject along next week ...
thanks a lot
regards
pere
User avatar
tormod
Posts: 416
Joined: Sat Apr 27, 2013 12:06 pm
Location: Switzerland
Contact:

Re: DIY: 80 column WordPak board (CRT9128)

Post by tormod »

Proof of principle in gdb:

Code: Select all

hbreak *0x0167
commands
>silent
>if (*$s == 0xB54D && *($s + 2) == 0x90F3 && *($s + 4) == 0x8EF1 && $b == *(char*)0x56 && $last_printed != 0x0D)
>    set $a = '*'
>end
>set $last_printed = $a
>cont
>end
cont
Post Reply