Networking Orics.
Re: Networking Orics.
Using the parallel port is an interesting idea, because for once that would be a device compatible with floppy disks or floppy emulators
That being said, to use the parallel port you need to go through the VIA, which has some implications on the maximum performance you can get, also you need to make sure that this does not cause interferences with the sound: Some of the earlier Oric joystick interfaces on parallel ports were causing problem with in-game audio.
Now question: Arduinos have a lot of input and outputs, after you have done the network part, would there is enough I/O available for things like joystick connectors, or even maybe MIDI ports?
That being said, to use the parallel port you need to go through the VIA, which has some implications on the maximum performance you can get, also you need to make sure that this does not cause interferences with the sound: Some of the earlier Oric joystick interfaces on parallel ports were causing problem with in-game audio.
Now question: Arduinos have a lot of input and outputs, after you have done the network part, would there is enough I/O available for things like joystick connectors, or even maybe MIDI ports?
Re: Networking Orics.
It has crossed my mind indeed, and I will try to find a way to stream both network and joystick data through the Arduino!
Networking Orics with an Arduino
First evening spent on this new project!
I connected the ethernet arduino to the printer port, and sent bytes (for example 13) with the command:
POKE #0301,13:POKE #0300,175
The arduino reads a single byte each time the strobe line goes off.
Currently, passing the value 13 triggers sending of a UDP packet by the Arduino to my remote server and receipt of an answer.
Next step: Send groups of bytes, based on a table of commands and associated data. Something like:
1 + Target IP (4 bytes)
2 + Target Port (2 bytes)
....
12 + Char Buffer (x bytes)
13 (Send UDP Packet)
I connected the ethernet arduino to the printer port, and sent bytes (for example 13) with the command:
POKE #0301,13:POKE #0300,175
The arduino reads a single byte each time the strobe line goes off.
Currently, passing the value 13 triggers sending of a UDP packet by the Arduino to my remote server and receipt of an answer.
Next step: Send groups of bytes, based on a table of commands and associated data. Something like:
1 + Target IP (4 bytes)
2 + Target Port (2 bytes)
....
12 + Char Buffer (x bytes)
13 (Send UDP Packet)
Re: Networking Orics.
Congrats! Attached you can find zipped sketch which I'm using. It's compatible with LLIST and LPRINT commands.
Of course POKE can be used always .
If I may suggest to include in your game support for Oric Serial interface too. It's emulated in Oricutron and there are already two "network" games: Tea4two and HNEFATAFL ONLINE. The point here is that most of the Oric users are using mainly emulator.
Of course POKE can be used always .
If I may suggest to include in your game support for Oric Serial interface too. It's emulated in Oricutron and there are already two "network" games: Tea4two and HNEFATAFL ONLINE. The point here is that most of the Oric users are using mainly emulator.
- Attachments
-
- oric-printer.ino.zip
- (1.45 KiB) Downloaded 278 times
Re: Networking Orics.
@iss: Thanks for posting your arduino code.
It made me smile that our solutions look almost identical!
For now I will focus on the printer port approach, trying to integrate ethernet+joystick in one package.
It made me smile that our solutions look almost identical!
For now I will focus on the printer port approach, trying to integrate ethernet+joystick in one package.
Re: Networking Orics.
Update: I got the output side all figured out (using table system).
So now I want to read data back from the Arduino, with:
(1) Send a byte (170) that means "please send me data".
(2) Set Port A to Listen with: POKE(0x0303, 0);
(3) Wait for change on ACK (pin 19).
(4) Read a byte with: PEEK(0x0301);
(5) Set Port A back to output with: POKE(0x0303, 255);
But I have a problem is with step (3), there is nothing in the oric manual that tells me where I can read the status of ACK.
The registers are not documented in this manual, any idea where I should look???
So now I want to read data back from the Arduino, with:
(1) Send a byte (170) that means "please send me data".
(2) Set Port A to Listen with: POKE(0x0303, 0);
(3) Wait for change on ACK (pin 19).
(4) Read a byte with: PEEK(0x0301);
(5) Set Port A back to output with: POKE(0x0303, 255);
But I have a problem is with step (3), there is nothing in the oric manual that tells me where I can read the status of ACK.
The registers are not documented in this manual, any idea where I should look???
Re: Networking Orics.
You need VIA 6522 datasheet (attached). You can use IRQ handler or polling to check the status of ACK.
- Attachments
-
- mos_6522.pdf
- (273.43 KiB) Downloaded 274 times
Re: Networking Orics.
Something like this?
.wait_ack
LDA $030D
AND #$02 ; Test if flag CA1 = 1 (%00000010)
BEQ .wait_ack
.wait_ack
LDA $030D
AND #$02 ; Test if flag CA1 = 1 (%00000010)
BEQ .wait_ack
Re: Networking Orics.
Yes, exactly, but I think you need first to read from (or write to) ORA register to clear the flag i.e.
Code: Select all
LDA $0301
.wait_ack
LDA $030D
AND #$02 ; Test if flag CA1 = 1 (%00000010)
BEQ .wait_ack
Re: Networking Orics.
I will try tonight, and see where it gets me!
Re: Networking Orics.
Today's update:
I managed to get the ACK pin working, and can now stream bytes up/down between the Atmos and Arduino (and thus the internet!).
As an example, the attached screenshot shows the ATMOS receiving the server list from my website (via a UDP request).
Next I will write a more generic set of wrapper functions for sending/receiving UDP packets (similar to the IP65 C header), and that part of the game port will be more or less done!
I managed to get the ACK pin working, and can now stream bytes up/down between the Atmos and Arduino (and thus the internet!).
As an example, the attached screenshot shows the ATMOS receiving the server list from my website (via a UDP request).
Next I will write a more generic set of wrapper functions for sending/receiving UDP packets (similar to the IP65 C header), and that part of the game port will be more or less done!
Re: Networking Orics.
Remember to correctly enable/disable interrupts (SEI/CLI) when playing with the VIA, else you risk to get the 100hz system IRQ to put havok in your routines when it decides to read the keyboard
Re: Networking Orics.
Good tip!! I will make sure to add something to that effect when switching Port A to input mode.
I assume that in output mode there is no such issue, right?
I assume that in output mode there is no such issue, right?
Re: Networking Orics.
This is starting to get really exciting... and amazing
Re: Networking Orics.
What is even better is that this system can be generalized to any 8bit system with a spare I/O port. And with still 5 free pins on the Arduino, I can still add a joystick!
Once the proof of concept is done, and associated CC65 libraries implemented, I may talk to someone like Lotharek to see if they are interested in commercializing the product...
Once the proof of concept is done, and associated CC65 libraries implemented, I may talk to someone like Lotharek to see if they are interested in commercializing the product...