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 > How to receive a byte in 1541 drivecode?
2021-06-28 00:52
Zibri
Account closed

Registered: May 2020
Posts: 304
How to receive a byte in 1541 drivecode?

Imagine this situation:

C64 SIDE:
open 15,8,15,"u3"
print#15,"ABCDE" : rem ANY LENGTH...
print#15,"X"
get#15,S$
close15

1541 side:
I don't understand how can I:
read a byte from IEC, wait for "X" and then send back a string.

Everything I tried failed.. I am missing something.
Can anyone help?
2021-06-28 11:36
Krill

Registered: Apr 2002
Posts: 2839
1541 ROM doesn't appear to have handy subroutines to call for receiving serial bus data with the standard protocol. The code jumps back to ROM idle loop left and right at the drop of a hat.

Since you're running own code at $0500 via U3 anyways, you can deep-copy and modify the relevant bits at http://unusedino.de/ec64/technical/aay/c1541/ro41e85b.htm - but make sure to never let ROM code handle interrupts, lest you'll lose control.
2021-06-28 18:00
Martin Piper

Registered: Nov 2007
Posts: 634
Would have to handle all the TALK and LISTEN requests, as well as checking for the correct device number etc. Lovely. :)
2021-06-28 18:19
chatGPZ

Registered: Dec 2001
Posts: 11111
just steal protocol from some 2bit loader, it'll be easier to use and faster too :)
2021-06-28 23:26
Zibri
Account closed

Registered: May 2020
Posts: 304
Quote: just steal protocol from some 2bit loader, it'll be easier to use and faster too :)

that's not what I need.
Clearly nobody knows the answer to my question.
What I needed is a loop to run:

something like a jsr to a routine like $E85B / $E9C9.
in a loop... trashing every received byte until a certain byte comes in.. then answering. in NORMAL 1 bit protocol. DOS compliant.
2021-06-28 23:27
Zibri
Account closed

Registered: May 2020
Posts: 304
Quote: 1541 ROM doesn't appear to have handy subroutines to call for receiving serial bus data with the standard protocol. The code jumps back to ROM idle loop left and right at the drop of a hat.

Since you're running own code at $0500 via U3 anyways, you can deep-copy and modify the relevant bits at http://unusedino.de/ec64/technical/aay/c1541/ro41e85b.htm - but make sure to never let ROM code handle interrupts, lest you'll lose control.


Yep.. exactly.. that's what I meant.
For now I don't have a good result.
Hence my question.
2021-06-28 23:30
Zibri
Account closed

Registered: May 2020
Posts: 304
Quote: Would have to handle all the TALK and LISTEN requests, as well as checking for the correct device number etc. Lovely. :)

no need to check for the right device number...

One of the purposes would be also to be able to log traffic from c64 to device 8, for example running the code on device 9 and log all sent/received commands in device 9 memory or a disk.
But I also have some other ideas.
But I didn't find any similar code around, they all use 2 bit protocol in different custom ways. While instead I need a DOS compliant way.
2021-06-28 23:33
Zibri
Account closed

Registered: May 2020
Posts: 304
About traffic logging anyway, I fortunately found another way to do it...

Soon I will release another new crack of rubicon based on that method.

Because of a nice challenge with Flavio, I was able to skip the protection check on rubicon in a very "innovative" way.

More on that later...
2021-06-29 10:53
Krill

Registered: Apr 2002
Posts: 2839
Quoting Krill
you can deep-copy and modify the relevant bits at http://unusedino.de/ec64/technical/aay/c1541/ro41e85b.htm
Quoting Zibri
Clearly nobody knows the answer to my question.
Quoting Krill
you can deep-copy and modify the relevant bits at http://unusedino.de/ec64/technical/aay/c1541/ro41e85b.htm
Quoting Zibri
Yep.. exactly.. that's what I meant.
For now I don't have a good result.
Hence my question.
Pretty sure what i said IS an answer. Doing the actual gruntwork of reimplementing the protocol (and also make the code just snoop, not actually talk on the bus, which is a different beast) is left to the reader as an exercise.
2021-06-29 12:43
Martin Piper

Registered: Nov 2007
Posts: 634
I did a cartridge version of Summer Games that intercepted the kernal routines some returned the expected error. :)
2021-07-02 00:24
Zibri
Account closed

Registered: May 2020
Posts: 304
Quote: I did a cartridge version of Summer Games that intercepted the kernal routines some returned the expected error. :)

Yep.. I do that often, but no, I was searching for a different thing. If nobody did it until now, the better... I will do it.
2021-07-02 00:26
Zibri
Account closed

Registered: May 2020
Posts: 304
Quoting Krill
Doing the actual gruntwork of reimplementing the protocol (and also make the code just snoop, not actually talk on the bus, which is a different beast) is left to the reader as an exercise.

Yeah.. sure... that's why I asked. If I were able I would not have asked. But anyway.. ok... nobody clearly did it until now.
I'll see what I come up with.
2021-07-02 18:47
tlr

Registered: Sep 2003
Posts: 1714
If you are writing a passive analyzer it could be made to run on a second c64 connected to the same bus iec-bus.
2021-07-02 19:08
chatGPZ

Registered: Dec 2001
Posts: 11111
I'd just clip the logic analyzer on the bus and then decode the capture, much easier :)
2021-07-04 16:13
Krill

Registered: Apr 2002
Posts: 2839
Quoting Groepaz
I'd just clip the logic analyzer on the bus and then decode the capture, much easier :)
Doing whatever with early 1980s stock hardware does have its charm, though. :)
2021-07-04 16:16
Krill

Registered: Apr 2002
Posts: 2839
Quoting tlr
If you are writing a passive analyzer it could be made to run on a second c64 connected to the same bus iec-bus.
Maybe, but the C-64's inability to read the state of the ATN line could be a problem.
2021-07-04 20:07
tlr

Registered: Sep 2003
Posts: 1714
Quote: Quoting tlr
If you are writing a passive analyzer it could be made to run on a second c64 connected to the same bus iec-bus.
Maybe, but the C-64's inability to read the state of the ATN line could be a problem.


Good point. Maybe a userport connection instead? A few resistors could be added to minimize the loading and perhaps also sampling $dd01 using a REU.
2021-07-04 20:29
Krill

Registered: Apr 2002
Posts: 2839
Quoting tlr
Good point. Maybe a userport connection instead? A few resistors could be added to minimize the loading and perhaps also sampling $dd01 using a REU.
Yes, either user port or joystick port(s). The latter could also sample real analogue values, perhaps, for a true stock hardware (except the adaptor) homebrew oscilloscope. Not sure how sensible that is, of course. =)
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
MCM/ONSLAUGHT
Malmix/Fatzone
visionvortex
Guests online: 72
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 Bromance  (9.6)
10 Memento Mori  (9.6)
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 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

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