Econet for Arculator (and other emulators)
Econet for Arculator (and other emulators)
Just in case anyone is interested (or also working on this), I've started on an Econet implementation for Arculator. It's a high-level model of the MC68B54 chip as found in MAME and BeebEm, and I'm intending on supporting AUN, so it should be able to talk to aund and beebem's AUN code (and maybe RPCEmu?) when it's done.
(I'm aware I'm reinventing the wheel here and could just port the GPL code from beebem-windows or the 3-clause-BSD code from MAME, but this is partly an educational mission for me, to understand how RISC OS and the Acorn MOS talk to the 6854, so I can one day make my econet_from_scratch board function as an Econet module in a Master or Arc.)
So far, on my macOS build, I have RISC OS 3.11 booting and showing the 'Net' icon in the icon bar, and logging scout packets when I try to do things like browse the network or log in to a file server. I haven't implemented any of the actual networking code yet.
(I'm aware I'm reinventing the wheel here and could just port the GPL code from beebem-windows or the 3-clause-BSD code from MAME, but this is partly an educational mission for me, to understand how RISC OS and the Acorn MOS talk to the 6854, so I can one day make my econet_from_scratch board function as an Econet module in a Master or Arc.)
So far, on my macOS build, I have RISC OS 3.11 booting and showing the 'Net' icon in the icon bar, and logging scout packets when I try to do things like browse the network or log in to a file server. I haven't implemented any of the actual networking code yet.
SW/EE from New Zealand, now in Mountain View, CA, making BBC/Electron hardware projects for fun.
Most interesting: Arcflash, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.
Most interesting: Arcflash, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.
Re: Econet for Arculator (and other emulators)
More the merrier. 
I find beebems implementation of econet very buggy. Times out and hangs.
RPCemu is pretty rock solid for RISC OS.

I find beebems implementation of econet very buggy. Times out and hangs.
RPCemu is pretty rock solid for RISC OS.
Re: Econet for Arculator (and other emulators)
The implementation in MAME is also not complete, it's never worked afaik. I'll be following your progress to hopefully improve MAME too.
- Nigel
BBC Model B: ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, BeebZIF, etc.
BBC Model B: ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, BeebZIF, etc.
-
- Posts: 121
- Joined: Fri Nov 24, 2017 1:35 pm
- Contact:
Re: Econet for Arculator (and other emulators)
Call me crazy, but it would be nice to have an emulator-agnostic "podule emulation API" so that once a podule emulation has been written for one emulator, it can be used with another emulator just by copying the precompiled podule DLL and a few configuration files to the right location.
I'd hope that in terms of emulating a podule this would be pretty straightforward (there are only so many bus operations that can be performed on a podule connector!). But maybe the stumbling block would be working out a user-friendly way of configuring the podules - e.g. configuring how the virtual econet/ethernet podule connects to your real network. Ideally this would be done via the emulator's native configuration UI, but since each emulator will be using its own choice of UI framework, there'd have to be some kind of interface to wrap that as well.
Then you get to the annoying podules which tap into other signals within the system (e.g. video compositing), which would be a lot harder to deal with in an efficient and emulator-agnostic manner. But still, it's nice to dream!
I'd hope that in terms of emulating a podule this would be pretty straightforward (there are only so many bus operations that can be performed on a podule connector!). But maybe the stumbling block would be working out a user-friendly way of configuring the podules - e.g. configuring how the virtual econet/ethernet podule connects to your real network. Ideally this would be done via the emulator's native configuration UI, but since each emulator will be using its own choice of UI framework, there'd have to be some kind of interface to wrap that as well.
Then you get to the annoying podules which tap into other signals within the system (e.g. video compositing), which would be a lot harder to deal with in an efficient and emulator-agnostic manner. But still, it's nice to dream!
Jeffrey Lee
http://www.phlamethrower.co.uk/
http://www.phlamethrower.co.uk/
Re: Econet for Arculator (and other emulators)
Sounds like an excellent plan!
It looks like Arculator and RPCEmu already do this, at least for the simple case (no configuration, no complicated magic like video)... here's the interface podules have to implement to be dynamically loadable:
For Econet it's a bit different because, at least on the pre-RiscPC machines, the Econet module isn't a podule; it's a custom socket that takes the same module used by the Master 128. The code should be shareable between all the emulators though... I'm hoping to contribute it to as many emulators as possible, under their own licenses (or something compatible with them all to make it easy to share everything).
It looks like Arculator and RPCEmu already do this, at least for the simple case (no configuration, no complicated magic like video)... here's the interface podules have to implement to be dynamically loadable:
Code: Select all
typedef struct podule
{
void (*writeb)(struct podule *p, int easi, uint32_t addr, uint8_t val);
void (*writew)(struct podule *p, int easi, uint32_t addr, uint16_t val);
void (*writel)(struct podule *p, int easi, uint32_t addr, uint32_t val);
uint8_t (*readb)(struct podule *p, int easi, uint32_t addr);
uint16_t (*readw)(struct podule *p, int easi, uint32_t addr);
uint32_t (*readl)(struct podule *p, int easi, uint32_t addr);
void (*memc_writeb)(struct podule *p, uint32_t addr, uint8_t val);
void (*memc_writew)(struct podule *p, uint32_t addr, uint16_t val);
uint8_t (*memc_readb)(struct podule *p, uint32_t addr);
uint16_t (*memc_readw)(struct podule *p, uint32_t addr);
int (*timercallback)(struct podule *p);
void (*reset)(struct podule *p);
int irq,fiq;
int msectimer;
int broken;
} podule;
SW/EE from New Zealand, now in Mountain View, CA, making BBC/Electron hardware projects for fun.
Most interesting: Arcflash, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.
Most interesting: Arcflash, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.
- SarahWalker
- Posts: 1329
- Joined: Fri Jan 14, 2005 3:56 pm
- Contact:
Re: Econet for Arculator (and other emulators)
For basic configuration I was planning to bring the PCem config system over to Arculator. This lets you define this sort of thing :
which then gets turned into a dialog box by the emulator :
This works well for simple stuff (it currently implements integer, binary (ie checkbox), selection (ie listbox) and a special type for MIDI out devices).
For more complex stuff, eg SCSI card configuration, I was intending to allow podule DLLs to implement a custom dialog through wxWidgets. This would work well for Arculator, but if there's a desire for this to be cross-emulator then obviously that's a non-starter.
Code: Select all
static device_config_t sb_config[] =
{
{
.name = "addr",
.description = "Address",
.type = CONFIG_SELECTION,
.selection =
{
{
.description = "0x210",
.value = 0x210
},
{
.description = "0x220",
.value = 0x220
},
{
.description = "0x230",
.value = 0x230
},
{
.description = "0x240",
.value = 0x240
},
{
.description = "0x250",
.value = 0x250
},
{
.description = "0x260",
.value = 0x260
},
{
.description = ""
}
},
.default_int = 0x220
},
{
.name = "irq",
.description = "IRQ",
.type = CONFIG_SELECTION,
.selection =
{
{
.description = "IRQ 2",
.value = 2
},
{
.description = "IRQ 3",
.value = 3
},
{
.description = "IRQ 5",
.value = 5
},
{
.description = "IRQ 7",
.value = 7
},
{
.description = ""
}
},
.default_int = 7
},
{
.name = "dma",
.description = "DMA",
.type = CONFIG_SELECTION,
.selection =
{
{
.description = "DMA 1",
.value = 1
},
{
.description = "DMA 3",
.value = 3
},
{
.description = ""
}
},
.default_int = 1
},
{
.type = -1
}
};
For more complex stuff, eg SCSI card configuration, I was intending to allow podule DLLs to implement a custom dialog through wxWidgets. This would work well for Arculator, but if there's a desire for this to be cross-emulator then obviously that's a non-starter.
Re: Econet for Arculator (and other emulators)
Exactly what I proposed and pushed for years ago, a Windows equivalent of the RISC OS emulated 6502 I/O and similar RISC OS emulated Z80 I/O service calls. If I dig through the mailing list archive I may even find the original posts.Phlamethrower wrote: ↑Thu May 31, 2018 1:33 pmCall me crazy, but it would be nice to have an emulator-agnostic "podule emulation API" so that once a podule emulation has been written for one emulator, it can be used with another emulator just by copying the precompiled podule DLL and a few configuration files to the right location.
Code: Select all
$ bbcbasic
PDP11 BBC BASIC IV Version 0.32
(C) Copyright J.G.Harston 1989,2005-2020
>_
- SarahWalker
- Posts: 1329
- Joined: Fri Jan 14, 2005 3:56 pm
- Contact:
Re: Econet for Arculator (and other emulators)
You mentioned it here : viewtopic.php?f=4&t=3864. You can see quite how little interest there was.
It's probably worth noting that despite RPCemu having had podule support for more than 10 years now, the only publicly released podules were the ones I threw together to test the DLL interface.
It's also worth noting that RPCemu is the only Archimedes/RiscPC emulator that has had a public release in the last 5 years, so being emulator agnostic is perhaps a little unnecessary at this point?
It's probably worth noting that despite RPCemu having had podule support for more than 10 years now, the only publicly released podules were the ones I threw together to test the DLL interface.
It's also worth noting that RPCemu is the only Archimedes/RiscPC emulator that has had a public release in the last 5 years, so being emulator agnostic is perhaps a little unnecessary at this point?
-
- Posts: 121
- Joined: Fri Nov 24, 2017 1:35 pm
- Contact:
Re: Econet for Arculator (and other emulators)
From my perspective, it would have be nice to have the API defined, so that if/when I eventually add podule support to ArcEm I'd be able to implement support for it there. But since that's likely to be at least a year or two away, I do agree that if no other emulator developers are interested in implementing such a thing then it would just be a bit of a waste of effort.
Jeffrey Lee
http://www.phlamethrower.co.uk/
http://www.phlamethrower.co.uk/
Re: Econet for Arculator (and other emulators)
This does sound interesting, would be fun to connect a virtual arc to a virtual beeb over a virtual networkmyelin wrote: ↑Thu May 31, 2018 11:27 amJust in case anyone is interested (or also working on this), I've started on an Econet implementation for Arculator. It's a high-level model of the MC68B54 chip as found in MAME and BeebEm, and I'm intending on supporting AUN, so it should be able to talk to aund and beebem's AUN code (and maybe RPCEmu?) when it's done.

Re: Econet for Arculator (and other emulators)
We dropped the DLL support code from RPCEmu two years ago, we had nothing to use it. Of course the podule code is still there for compiled in podules (the rom podule and network podule), just not the ability to load plugins.SarahWalker wrote: ↑Sun Jun 03, 2018 8:06 pmYou mentioned it here : viewtopic.php?f=4&t=3864. You can see quite how little interest there was.
It's probably worth noting that despite RPCemu having had podule support for more than 10 years now, the only publicly released podules were the ones I threw together to test the DLL interface.
I am not in favour of any sort of podule DLL apiPhlamethrower wrote: ↑Sun Jun 03, 2018 8:38 pmFrom my perspective, it would have be nice to have the API defined, so that if/when I eventually add podule support to ArcEm I'd be able to implement support for it there. But since that's likely to be at least a year or two away, I do agree that if no other emulator developers are interested in implementing such a thing then it would just be a bit of a waste of effort.
1) The API is windows only, the emulators are not.
2) It's not needed, just contribute the podule's code to the emulators.
Whilst attempting to stay on topic, econet is not on the podule bus anyway.
- SarahWalker
- Posts: 1329
- Joined: Fri Jan 14, 2005 3:56 pm
- Contact:
-
- Posts: 121
- Joined: Fri Nov 24, 2017 1:35 pm
- Contact:
Re: Econet for Arculator (and other emulators)
I should have probably been clearer - I was just using "DLL" as shorthand for "whatever dynamic code loading system is appropriate for the host platform"
Jeffrey Lee
http://www.phlamethrower.co.uk/
http://www.phlamethrower.co.uk/
Re: Econet for Arculator (and other emulators)
Indeed! Hoping to do exactly that, and maybe have it use an USB Econet adapter (either my half-finished one, or flynnjs's one) as a bridge onto a real Econet. Not sure if that would play well with the AUN (or BeebEm's UDP system) side of things, but it would be fun if it worked.
Current status: I have it catching outbound frames from Arculator, and I'm working on figuring out how to properly map these to AUN packets. It looks like some things won't map too well (as I'll have to make the emulator fake an ack to get the OS to send the second half of a fileserver packet, but if the destination server is inaccessible, that'll probably result in the wrong error inside the emulator) but it should hopefully be workable.
SW/EE from New Zealand, now in Mountain View, CA, making BBC/Electron hardware projects for fun.
Most interesting: Arcflash, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.
Most interesting: Arcflash, FX2+PiTubeDirect Tube/Cartridge adapter, USB cart interface.