Previous Thread
Next Thread
Print Thread
Page 1 of 4 1 2 3 4
BBC Tube WIP #110092
07/02/17 03:20 PM
07/02/17 03:20 PM
Joined: Apr 2012
Posts: 214
UK
Pernod Offline OP
Senior Member
Pernod  Offline OP
Senior Member
Joined: Apr 2012
Posts: 214
UK
I'm starting to finally add various Tube devices to the BBC Micro range. These are 2nd processors that can be added and the official Acorn devices include 6502, 65C102, Z80, 32016, 80186, 80286, ARM. They (parasite) communicate with the BBC Micro (host) via a Tube ULA (Ferranti and later Acorn). The Tube ULA is fairly well documented and I've added this as a new machine device (tube). When working we'll be able to promote some machines to working bbcmt, bbcm512 and support the currently not supported software lists bbc_flop_6502, bbc_flop_z80, etc.

So far I have 6502 and almost 65C102 working, just need to check interrupts are fully handled between host and parasite CPU's.
6502 2nd Processor:
[Linked Image]
The Z80 is in progress but I'll come back to that later.

I need a little advice on the 80186. The Tube device has 8 registers to be addressed from the parasite CPU. The 8-bit CPU's map these consecutively so I have handlers parasite_r, parasite_w and for the Z80 are addressed:
Code
static ADDRESS_MAP_START(tube_z80_io, AS_IO, 8, bbc_tube_z80_device)
	AM_RANGE(0x00, 0x07) AM_DEVREADWRITE("ula", tube_device, parasite_r, parasite_w)
ADDRESS_MAP_END

For the 80186 the registers are mapped into even locations only:
Code
static ADDRESS_MAP_START(tube_x86_io, AS_IO, 16, bbc_tube_80186_device)
	AM_RANGE(0x80, 0x8e) AM_DEVREADWRITE8("ula", tube_device, parasite_r, parasite_w, 0x00ff)
ADDRESS_MAP_END

Is there a way to map my 8 registers into even locations only, ie. 0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c, 0x8e. Or should I just create another set of handlers in my tube_device, parasite_x86_r, parasite_x86_w?

The 80186 co-processor has 512K RAM and 16K ROM and memory map is:
00000h to 3FFFFh : Lower 256kb of RAM
40000h to 7FFFFh : Upper 256kb of RAM
80000h to BFFFFh : Upper 256kb of RAM
C0000h to FFFFFh : ROM

My address map for this is:
Code
static ADDRESS_MAP_START(tube_x86_mem, AS_PROGRAM, 16, bbc_tube_80186_device)
	AM_RANGE(0x00000, 0x3ffff) AM_RAM
	AM_RANGE(0x40000, 0x7ffff) AM_RAM AM_MIRROR(0x80000)
	AM_RANGE(0xc0000, 0xc3fff) AM_ROM AM_REGION("bootstrap", 0) AM_MIRROR(0x3c000)
ADDRESS_MAP_END

But am unsure of my AM_MIRROR's and when run I don't see my bootstrap region anywhere in memory, am expecting to see it mirrored throughout c0000-fffff.


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Re: BBC Tube WIP [Re: Pernod] #110097
07/02/17 03:58 PM
07/02/17 03:58 PM
Joined: Jan 2012
Posts: 783
C
crazyc Offline
Senior Member
crazyc  Offline
Senior Member
C
Joined: Jan 2012
Posts: 783
Originally Posted by Pernod

For the 80186 the registers are mapped into even locations only:
Code
static ADDRESS_MAP_START(tube_x86_io, AS_IO, 16, bbc_tube_80186_device)
	AM_RANGE(0x80, 0x8e) AM_DEVREADWRITE8("ula", tube_device, parasite_r, parasite_w, 0x00ff)
ADDRESS_MAP_END

Is there a way to map my 8 registers into even locations only, ie. 0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c, 0x8e. Or should I just create another set of handlers in my tube_device, parasite_x86_r, parasite_x86_w?

That's right, I think. Using a 0xff mask will map it into the even addresses on a little endian machine like the 80186.

Re: BBC Tube WIP [Re: Pernod] #110100
07/02/17 05:43 PM
07/02/17 05:43 PM
Joined: Mar 2001
Posts: 15,988
USA
R
R. Belmont Offline
Very Senior Member
R. Belmont  Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 15,988
USA
Yeah, the 0x00ff mask should be correct.

Re: BBC Tube WIP [Re: crazyc] #110102
07/02/17 06:20 PM
07/02/17 06:20 PM
Joined: Apr 2012
Posts: 214
UK
Pernod Offline OP
Senior Member
Pernod  Offline OP
Senior Member
Joined: Apr 2012
Posts: 214
UK
Originally Posted by crazyc
That's right, I think. Using a 0xff mask will map it into the even addresses on a little endian machine like the 80186.

Yep, that seems to work and the device does now boot, but only if I remove
Code
AM_RANGE(0x40000, 0x7ffff) AM_RAM AM_MIRROR(0x80000)
and it reports 256K.
So what should my AM_MIRROR be to not also mirror at 0xc0000-0xfffff?


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Re: BBC Tube WIP [Re: Pernod] #110104
07/02/17 06:38 PM
07/02/17 06:38 PM
Joined: Jan 2012
Posts: 783
C
crazyc Offline
Senior Member
crazyc  Offline
Senior Member
C
Joined: Jan 2012
Posts: 783
I'm not sure there is a way to do that. You might have to do
Code
AM_RANGE(0x40000, 0x7ffff) AM_RAM AM_SHARE("ram")
AM_RANGE(0x80000, 0xbffff) AM_RAM AM_SHARE("ram")

Re: BBC Tube WIP [Re: Pernod] #110121
07/03/17 06:43 PM
07/03/17 06:43 PM
Joined: Apr 2012
Posts: 214
UK
Pernod Offline OP
Senior Member
Pernod  Offline OP
Senior Member
Joined: Apr 2012
Posts: 214
UK
So when adding my new tube_device to mess.lua do I also add it to arcade.lua, but commented out? I see lots of MESS MACHINES in arcade.lua but commented out. What's the preferred practice?


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Re: BBC Tube WIP [Re: Pernod] #110165
07/05/17 01:59 PM
07/05/17 01:59 PM
Joined: Apr 2012
Posts: 214
UK
Pernod Offline OP
Senior Member
Pernod  Offline OP
Senior Member
Joined: Apr 2012
Posts: 214
UK
A little more progress but I sometimes get
Code
[:tube:65c102:maincpu] Exceeded pending input line event queue on device ':tube:65c102:maincpu'!
in my log. What does it mean, and how can I avoid it?

Also had fun with my memory map as I use a flag to switch out ROM in a handler. Wish I'd known about machine().side_effect_disabled() sooner.


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Re: BBC Tube WIP [Re: Pernod] #110166
07/05/17 02:32 PM
07/05/17 02:32 PM
Joined: Mar 2001
Posts: 15,988
USA
R
R. Belmont Offline
Very Senior Member
R. Belmont  Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 15,988
USA
Stuff that arcade machines don't use only needs to be in mess.lua.

The error message about the input line queue means the 65c102 isn't servicing and lowering the interrupts fast enough. You may need a higher MCFG_QUANTUM() value if the 65c102 is otherwise hooked up correctly.

Re: BBC Tube WIP [Re: R. Belmont] #110205
07/07/17 11:19 AM
07/07/17 11:19 AM
Joined: Apr 2012
Posts: 214
UK
Pernod Offline OP
Senior Member
Pernod  Offline OP
Senior Member
Joined: Apr 2012
Posts: 214
UK
Originally Posted by R. Belmont
The error message about the input line queue means the 65c102 isn't servicing and lowering the interrupts fast enough. You may need a higher MCFG_QUANTUM() value if the 65c102 is otherwise hooked up correctly.

Thanks, though I more suspect that I need to implement some timing in my new tube_device, will come back to it later.

The 65C102 is now running, though with known interrupt issues:
[Linked Image]

The Z80 is also fully implemented with no known issues. It runs Acorn CP/M from the softlist and Colossal Cave:
[Linked Image] [Linked Image]

Now returning to the 80186, circuit diagram at http://mdfs.net/Info/Comp/BBC/Circuits/Tube/80186copro.gif. It looks like I need to use the TMROUT handlers, need to read up on what these do ...


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Re: BBC Tube WIP [Re: Pernod] #110206
07/07/17 12:07 PM
07/07/17 12:07 PM
Joined: Mar 2001
Posts: 15,988
USA
R
R. Belmont Offline
Very Senior Member
R. Belmont  Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 15,988
USA
From that schematic, Timer 0 toggles the HOLD pin (and appears to have something to do with the DRAM refresh, similar to one of the timers on PCs) and Timer 1 produces NMIs either on the 80186 or the host system via the Tube chip depending how a jumper is set. (The schematic shows it in the "on the 80186" position).

Page 1 of 4 1 2 3 4

Who's Online Now
4 registered members (Edstrom, Dorando, B2K24, 1 invisible), 36 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,564
Posts111,885
Members4,805
Most Online225
May 26th, 2014
Powered by UBB.threads™ PHP Forum Software 7.6.1.1
(Release build 20180111)
Page Time: 0.029s Queries: 15 (0.010s) Memory: 5.7250 MB (Peak: 5.9454 MB) Zlib enabled. Server Time: 2018-08-15 18:38:46 UTC