Previous Thread
Next Thread
Print Thread
Page 1 of 2 1 2
#110092 - 07/02/17 03:20 PM BBC Tube WIP  
Joined: Apr 2012
Posts: 171
Pernod Offline
Senior Member
Pernod  Offline
Senior Member

Joined: Apr 2012
Posts: 171
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 Micro
#110097 - 07/02/17 03:58 PM Re: BBC Tube WIP [Re: Pernod]  
Joined: Jan 2012
Posts: 671
crazyc Offline
Senior Member
crazyc  Offline
Senior Member

Joined: Jan 2012
Posts: 671
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.

#110100 - 07/02/17 05:43 PM Re: BBC Tube WIP [Re: Pernod]  
Joined: Mar 2001
Posts: 15,677
R. Belmont Offline
R. Belmont  Offline

Very Senior Member

Joined: Mar 2001
Posts: 15,677
USA
Yeah, the 0x00ff mask should be correct.

#110102 - 07/02/17 06:20 PM Re: BBC Tube WIP [Re: crazyc]  
Joined: Apr 2012
Posts: 171
Pernod Offline
Senior Member
Pernod  Offline
Senior Member

Joined: Apr 2012
Posts: 171
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 Micro
#110104 - 07/02/17 06:38 PM Re: BBC Tube WIP [Re: Pernod]  
Joined: Jan 2012
Posts: 671
crazyc Offline
Senior Member
crazyc  Offline
Senior Member

Joined: Jan 2012
Posts: 671
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")

#110121 - 07/03/17 06:43 PM Re: BBC Tube WIP [Re: Pernod]  
Joined: Apr 2012
Posts: 171
Pernod Offline
Senior Member
Pernod  Offline
Senior Member

Joined: Apr 2012
Posts: 171
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 Micro
#110165 - 07/05/17 01:59 PM Re: BBC Tube WIP [Re: Pernod]  
Joined: Apr 2012
Posts: 171
Pernod Offline
Senior Member
Pernod  Offline
Senior Member

Joined: Apr 2012
Posts: 171
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 Micro
#110166 - 07/05/17 02:32 PM Re: BBC Tube WIP [Re: Pernod]  
Joined: Mar 2001
Posts: 15,677
R. Belmont Offline
R. Belmont  Offline

Very Senior Member

Joined: Mar 2001
Posts: 15,677
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.

#110205 - 07/07/17 11:19 AM Re: BBC Tube WIP [Re: R. Belmont]  
Joined: Apr 2012
Posts: 171
Pernod Offline
Senior Member
Pernod  Offline
Senior Member

Joined: Apr 2012
Posts: 171
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 Micro
#110206 - 07/07/17 12:07 PM Re: BBC Tube WIP [Re: Pernod]  
Joined: Mar 2001
Posts: 15,677
R. Belmont Offline
R. Belmont  Offline

Very Senior Member

Joined: Mar 2001
Posts: 15,677
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 2 1 2

Who's Online Now
5 registered members (palindrome, Duke, Luca Elia, Reznor007, B2K24), 20 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,400
Posts108,700
Members4,754
Most Online225
May 26th, 2014
Powered by UBB.threads™ PHP Forum Software 7.6.0
Page Time: 0.028s Queries: 14 (0.008s) Memory: 5.0173 MB (Peak: 5.2666 MB) Zlib enabled. Server Time: 2017-08-16 22:06:51 UTC