Networking Orics.

In this forum you can write about anything that does not fit in other forums.
This includes generic Oric talkings and things that are totaly unrelated but want to share with people here :)
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Networking Orics.

Post by Dbug »

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?
User avatar
8bit-Dude
Flying Officer
Posts: 141
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: Networking Orics.

Post by 8bit-Dude »

It has crossed my mind indeed, and I will try to find a way to stream both network and joystick data through the Arduino! :-)
User avatar
8bit-Dude
Flying Officer
Posts: 141
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Networking Orics with an Arduino

Post by 8bit-Dude »

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)
Attachments
2018-12-18 23.46.56.jpg
User avatar
iss
Wing Commander
Posts: 1637
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Networking Orics.

Post by iss »

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.
Attachments
oric-printer.ino.zip
(1.45 KiB) Downloaded 273 times
User avatar
8bit-Dude
Flying Officer
Posts: 141
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: Networking Orics.

Post by 8bit-Dude »

@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.
User avatar
8bit-Dude
Flying Officer
Posts: 141
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: Networking Orics.

Post by 8bit-Dude »

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???
User avatar
iss
Wing Commander
Posts: 1637
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Networking Orics.

Post by iss »

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 268 times
User avatar
8bit-Dude
Flying Officer
Posts: 141
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: Networking Orics.

Post by 8bit-Dude »

Something like this?

.wait_ack
LDA $030D
AND #$02 ; Test if flag CA1 = 1 (%00000010)
BEQ .wait_ack
User avatar
iss
Wing Commander
Posts: 1637
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Networking Orics.

Post by iss »

8bit-Dude wrote: Wed Dec 19, 2018 10:16 am Something like this?

.wait_ack
LDA $030D
AND #$02 ; Test if flag CA1 = 1 (%00000010)
BEQ .wait_ack
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
User avatar
8bit-Dude
Flying Officer
Posts: 141
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: Networking Orics.

Post by 8bit-Dude »

I will try tonight, and see where it gets me!
User avatar
8bit-Dude
Flying Officer
Posts: 141
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: Networking Orics.

Post by 8bit-Dude »

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! :D
Attachments
2018-12-20 00.58.53.jpg
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Networking Orics.

Post by Dbug »

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 :)
User avatar
8bit-Dude
Flying Officer
Posts: 141
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: Networking Orics.

Post by 8bit-Dude »

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?
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Networking Orics.

Post by Chema »

This is starting to get really exciting... and amazing :)
User avatar
8bit-Dude
Flying Officer
Posts: 141
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: Networking Orics.

Post by 8bit-Dude »

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! :D

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...
Post Reply