pcmplay - new dragon sound routine

A place to discuss everything Dragon related that doesn't fall into the other categories.
User avatar
utz
Posts: 18
Joined: Mon Aug 31, 2015 8:49 pm
Location: Absurdistan
Contact:

Re: pcmplay - new dragon sound routine

Post by utz »

Thanks sorchard ;)

@all, Simon just notified me of a small error. DP was set to a wrong value because I changed the .org adress at the last minute. This has been fixed now in the github release.

Does anybody know how I can export the high byte of the current adress to a symbol in lwasm? ie. instead of lda #$0f \ tfr a,dp \ setdp $0f, I'd like to do something like lda #(int(*/256)) \ tfr a,dp \ setdp int(*/256). So the only thing a user would need to change when assembling to a different address would be the org statement.
sorchard
Posts: 531
Joined: Sat Jun 07, 2014 9:43 pm
Location: Norwich UK

Re: pcmplay - new dragon sound routine

Post by sorchard »

utz wrote:Does anybody know how I can export the high byte of the current adress to a symbol in lwasm?
Not sure about lwasm but this is what I do in asm6809. Perhaps lwasm will let you do something similar...

Code: Select all

start		org $2000

		pshs cc,dp
		orcc #$50
		lda #(start >> 8)
		tfr a,dp
		setdp (start >> 8)
 ;etc
btw I should take the opportunity to thank you personally: Your xm pattern extracting script was incredibly helpful in putting together the SOSJ music loader demo that Simon and I worked on. I had not used a tracker for composing before and never imagined that my first effort would be targetting a 6809! Many thanks!
Stew
pser1
Posts: 1668
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: pcmplay - new dragon sound routine

Post by pser1 »

Just a question about this ...
Should the BIN file do anything when loaded into a Dragon 64 without DOS emulation in XRoar?
It loads but does nothing at all (?)
I must be doing something the wrong way, but I can't spot what.
Any advice?

thanks beforehand
pere
User avatar
utz
Posts: 18
Joined: Mon Aug 31, 2015 8:49 pm
Location: Absurdistan
Contact:

Re: pcmplay - new dragon sound routine

Post by utz »

@pser1: Hmm, you should be able to run it with EXEC &HF00. That works for me at least.

@sorchard: No need to thank me for that, I'm glad that somebody put it to good use ;)
That bitshifting trick seems like a good idea, I'll check if that works in lwasm tomorrow. There also seems to be a problem with the keyhandler not detecting the space key on the Dragon - anybody else having that problem? Is the Dragon's keyboard wired differently than the CoCo's?
sorchard
Posts: 531
Joined: Sat Jun 07, 2014 9:43 pm
Location: Norwich UK

Re: pcmplay - new dragon sound routine

Post by sorchard »

utz wrote:Is the Dragon's keyboard wired differently than the CoCo's?
It is. Changing bita #8 to bita #$20 should fix the space bar.

Dragon key map below:

Code: Select all

Keyboard matrix
Bit is pulled low by key

     FE  FD  FB  F7  EF  DF  BF  7F  Write FF02

01   0   1   2   3   4   5   6   7  (Right joystick button)
02   8   9   :   ;   ,   -   .   /  (Left joystick button)
04   @   A   B   C   D   E   F   G
08   H   I   J   K   L   M   N   O
10   P   Q   R   S   T   U   V   W
20   X   Y   Z   Up  Dn  Lft Rgt Spc
40   Ent Clr Brk NC  NC  NC  NC  Sh
80   (Comparator input)

Read FF00
Stew
User avatar
Stig
Posts: 74
Joined: Mon Mar 17, 2014 4:54 pm

Re: pcmplay - new dragon sound routine

Post by Stig »

Can anyone tell me how I can run this on my real dragon ?

I don't have drivewire but I have the means to transfer .vdk files to real floppy disks.

Maybe someone can add the .bin file to a .vdk file for me ?

Thanks for any help

John
sorchard
Posts: 531
Joined: Sat Jun 07, 2014 9:43 pm
Location: Norwich UK

Re: pcmplay - new dragon sound routine

Post by sorchard »

I'm a bit rusty on disks but I managed to crudely save a big chunk of memory to a vdk and that seems to work.

RUN"PCMPLAY.BIN"

Pressing the 'O' key quits, as that is what the coco space bar maps to on a Dragon.
Attachments
pcmplay.zip
(2.07 KiB) Downloaded 199 times
Stew
User avatar
Stig
Posts: 74
Joined: Mon Mar 17, 2014 4:54 pm

Re: pcmplay - new dragon sound routine

Post by Stig »

Fantastic ! Thanks very much :)

Can you explain how to do this easily, so I may do it with any future releases ?

Thanks again

John

Edit: just wrote it to a floppy and it works great on the real Dragon !
pser1
Posts: 1668
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: pcmplay - new dragon sound routine

Post by pser1 »

Hello,
I don't know what did I do wrong the first time ...
I have loaded TEST.BIN and then EXEC &HF00 and works flawlessly.
The same applies to the VDK uploaded by sorchard, works with no problems.

This is the procedure I use to put any binary file onto a VDK file:
- Copy the .BIN file to a PC folder
- Using any viewer / hex editor, Look at the bytes 2-3 and 4-5. The 2-3 are the file length, being the 4-5 the load/exec address
both 16 bits. In this case I found these ones: $14D1 and $0F00
These offsets apply only when the binary file has a CoCo-like header (begins with a $00) as is the case.
If it had a Dragon-like header (begins with a $55) then the bytes are: 5-6 (length), 3-4 (load) and 7-8 (exec)
- Start XRoar and attach an empty VDK file (180k) I am attaching a zip that contains a VDK 180-360 and 720k
- Next, load the bin file: Ctrl+L and then choose the desired file
- Finally save the file: SAVE "TEST",&H0F00,&HF00+&H14D1,&H0F00
And that is all you have to do to have the binary file ready to be run from the disc, just by RUN"TEST.BIN"

If you have a drivewire server and any parallel to USB adapter, Tormod's one for instance
viewtopic.php?f=6&t=4270
then you could use my dweeb V2FLO to copy the whole disk to the floppy in the default drive or you could use my extender and
then LINK the VDK to unit 4 and send a BACKUP 4 to 1
You could find the V2FLO dweeb here:
viewtopic.php?f=5&t=4968
And the extender here:
viewtopic.php?f=5&t=5363

Hope this could help


cheers
pere
Attachments
_DW4 Dragon Empty Discs.zip
(1.93 KiB) Downloaded 180 times
sorchard
Posts: 531
Joined: Sat Jun 07, 2014 9:43 pm
Location: Norwich UK

Re: pcmplay - new dragon sound routine

Post by sorchard »

Pere's solution is much smarter than my hack and creates a file of the correct size so it should load a lot faster.
Stew
Post Reply