Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Drive code for IECHost
2015-11-22 14:12
TCE

Registered: Sep 2011
Posts: 29
Drive code for IECHost

Hi guys.

I recently started the IECHost project: an IEC bus master that can control Commodore drives such as the 1541 and 1541-II, and possibly other Commodore devices interfaced via the IEC bus such as printers and plotters.

I got to the point where I can upload code into my 1541's RAM and use a common 2-bit protocol afterwards, in order to transfer data to and from the drive pretty quickly. In particular the IECHost side is quite faster than a C64 so I can shorten the 1541 byte receive routine by at least 6 cycles (8 or 12 in a better or best scenario, but I need to do more testing for that).

I've created a simple server application that runs on the drive and waits for a command to which it replies with a message: both transfers use the 2-bit protocol.

; Main loop on the drive
mloop
	jsr readbyte
	cmp #'h'
	bne mloop

	lda #hmsge-hellomsg	; number of bytes that we'll be sending
	jsr sendbyte

	ldx #hmsge-hellomsg
	stx $06

sendhello
	ldx $06
	lda hellomsg-1,x	; send message to IECHost using the fast protocol
	jsr sendbyte
	dec $06
	bne sendhello

	beq mloop

hellomsg
	.text "!DLROW OLLEH"	; hello world!
hmsge

In the short term I'd like to add disk dumping through the use of the server application and fast 2-bit protocol but I also thought to ask for opinions and suggestions here.
Is there anything you would think worthwhile adding at this stage? Would you be interested in writing your own flavour of the server code?

Have a say, join the fun!

Cheers,

TCE/HF
 
... 10 posts hidden. Click here to view all posts....
 
2017-04-12 21:10
Repose

Registered: Oct 2010
Posts: 222
Can't you send bytes while reading from the drive? I know it takes 11 cycles to read a byte but then you have over 16 cycles left to send something. It would be a custom xfer and then switch to a faster one during the sector gap.
2017-04-12 22:11
TCE

Registered: Sep 2011
Posts: 29
Quote: Can't you send bytes while reading from the drive? I know it takes 11 cycles to read a byte but then you have over 16 cycles left to send something. It would be a custom xfer and then switch to a faster one during the sector gap.

Thanks for suggesting that. However, I am afraid it would complicate the approach to the extent that it might become difficult to maintain in future.

I am satisfied with the current solution and will only pursue a more feature rich experience for users.

Credit and glory go to Graham for a "first release" of the Warp mode. Happy to have got there, even if late. Second perhaps. Perhaps later than that, but there.
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Sumaleth/Pearl
curtcool
Didi/Laxity
tlr
zscs
Frostbyte/Artline De..
Higgie/Kraze/Onslaught
Kakka/Extend, Damone..
Guests online: 124
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Logo Graphicians
1 Sander  (9.9)
2 Facet  (9.6)
3 Mermaid  (9.4)
4 Pal  (9.4)
5 Shine  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.037 sec.