coverting beeb adres to electron adres

discussion of beeb/electron applications, languages, utils and educational s/w
Post Reply
duikkie
Posts: 2953
Joined: Fri Feb 07, 2014 3:28 pm
Contact:

coverting beeb adres to electron adres

Post by duikkie » Tue Apr 26, 2016 7:03 am

i know i can look in books , but maybe someone here
has instant knowlegde and peace of cake to convert the following adress

i have &FEE0 on beeb >>>> electron &FCE0 i think

for my usbcmd &FEF0 and &FEF1>>>> electron &FCF0 and &FCF1

i have a sysvia at the beeb at &FE40 , i don't know but i think no such thing in electron ( set and reset leds)

i have romsel at &FE30 at beeb ...... ?????????? electron ?????

maybe there are more adress i must know ?? or osbyte calls ??

User avatar
hoglet
Posts: 8355
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: coverting beeb adres to electron adres

Post by hoglet » Tue Apr 26, 2016 7:28 am

Hi Duikkie,

Why not keep a single thread for this project? Starting a new thread for every question makes it very hard for people to help you, as they don't see the bigger picture.

This is a good reference for Acorn machines' memory maps (edited by Jonathan):
http://mdfs.net/Docs/Comp/BBC/AllMem

This is the best reference I found for the Electron registers (edited by Thomas Harte):
https://web.archive.org/web/20060206155 ... chinfo.htm

The ROM latch is the lower 4 bits of &FE05, but please read the above page as it works a bit differently to the Beeb.

There is no 6522 in the electron.

Dave

duikkie
Posts: 2953
Joined: Fri Feb 07, 2014 3:28 pm
Contact:

Re: coverting beeb adres to electron adres

Post by duikkie » Tue Apr 26, 2016 9:12 am

i know , i know , when i have finished my project i will explain what i have been doning , but it contants many faults
the software i started for my beeb , with the well know acorn 0.90 dfs , i don't know if that rom will startup in the electron.
i understand that the plus3 has only adfs. for the smart-usb i do not need a 6522. only adress lines , datalines , a sort of 2 mhz r/nw and nFC. it works fine on my beeb , where it is hanging on the tube.

i never had a electron , and i will not use it. i found it to compact.

the big picture has it's problems, maybe some people think o not for me, ( but then there are not many people here , who do not have the knowledge of them all. electron,beeb,master)

small parts for me is better to understand then the whole thing together. i still have troubles to understand the electron and its signals. first there was the exp board hard to find a double sided one , then the troubles with only dots and wires.
then i had to modify the plus1 prom holder to check my eeprom. now the eeprom is working in the slot. i do know that it is not the eeprom , next step is the software, the 74ls139 thing is allso new. then the ch375b board , i think nobody has it here. so all over i don't think i will has many followers :)

it it all turns out and working , maybe i can find a designer here :) , who can make a pcb board with eeprom, 74ls139, tube connector and ch375b connector [-o<

maybe it is hard , but maybe i will never finish the project. (because i do not like the electron as computer. :shock: )
i will stike to my real beeb so easy to build something for that.
hoglet wrote:Hi Duikkie,

Why not keep a single thread for this project? Starting a new thread for every question makes it very hard for people to help you, as they don't see the bigger picture.

This is a good reference for Acorn machines' memory maps (edited by Jonathan):
http://mdfs.net/Docs/Comp/BBC/AllMem

This is the best reference I found for the Electron registers (edited by Thomas Harte):
https://web.archive.org/web/20060206155 ... chinfo.htm

The ROM latch is the lower 4 bits of &FE05, but please read the above page as it works a bit differently to the Beeb.

There is no 6522 in the electron.

Dave

duikkie
Posts: 2953
Joined: Fri Feb 07, 2014 3:28 pm
Contact:

Re: coverting beeb adres to electron adres

Post by duikkie » Tue Apr 26, 2016 9:31 am

i don't understand it at all ?? , i am to stupid for it :(

ROM Paging

Some logic is applied to the ROM paging in order to allow interrupt clearing without too much effort.

If roms 0-7 or 12-15 are currently paged, any value written to the paging part of this register will be honoured. If ROMs 8-11 are paged (as is normally the case), only values of 8-15 are honoured.

ROMs 8-11 are special because they are already occupied in the basic machine. ROMs 8 and 9 both map to the keyboard (both are equivalent), and ROMs 10 and 11 both map to the BASIC ROM (again, both values produce the same result).

When the keyboard 'ROM' is selected, and an address within the paged ROM memory region is read, the low 14 address bits are decoded to decide which keyline to read. A 0 in any of these bits causes the keyline in the below table to put the state of its keys on the data bus, a 1 signifying that a key is pressed. If more than one keyline is selected, the result is a logical OR of all the results.

Positions with no assigned key always return 0, and the high nibble of the result on one machine tested was always 0 and on another always &f. The keyboard layout looks like this :

User avatar
MartinB
Posts: 5229
Joined: Mon Mar 31, 2008 9:04 pm
Location: Obscurity
Contact:

Re: coverting beeb adres to electron adres

Post by MartinB » Tue Apr 26, 2016 9:48 am

If you always use the following to select roms on an Elk you should be ok...

Code: Select all

	LDA	#12		\dummy rom select to satisfy Elk quirkiness
	STA	$F4
	STA	$FE05
	LDA	tgtrom	\select actual target rom number
	STA	$F4
	STA	$FE05

User avatar
1024MAK
Posts: 9032
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: coverting beeb adres to electron adres

Post by 1024MAK » Tue Apr 26, 2016 9:50 am

Electron Memory Map

&0000-&7FFF RAM - This memory is shared between system memory and video RAM
&8000-&BFFF ROM - BBC Basic
&C000-&FBFF ROM - OS (1st of 2 parts)
&FC00-&FCFF Fred - Used for external hardware expansions
&FD00-&FDFF Jim - planned for memory expansions
&FE00-&FEFF Sheila - Electron internal hardware (ULA)
&FF00-&FFFF ROM - OS (2nd of 2 parts)

Page &FC (252) - FRED I/O Space
&FC18 to &FC1F Reserved for use by Acorn
&FC20 to &FC3F BeebSid
&FC28 to &FC2F Reserved for Econet use
&FC30 to &FC3F Reserved for use by Acorn
&FC40 to &FC5F IDE hard drives / CF cards
&FC60 to &FC6F ACIA Electron Serial
&FC70 Plus 1 - Analogue to digital converter
&FC71 Plus 1 - Parallel printer port
&FC72 Plus 1 - Status register
&FC73 Plus 1 - ROM scrolling / paging register
&FC78 to &FC7F Laser Disc
&FC80 to &FC8F Test Hardware
&FC90 to &FC9F Sound/Speech
&FCB0 to &FCBF 6522 VIA (EUP)
&FCC0 to &FCCF Floppy Disk Controller (Plus 3)
Plus 3 - drive control register is provided at FCC0
Plus 3 - WD1770 occupies the address range FCC4-FCC7
&FCDC to &FCDF PRES Battery-backed RAM

AP7:
&FCD8 Unlock Register - Low Bank
&FCD9 Lock Register - Low Bank
&FCDA Unlock Register - High Bank
&FCDB Lock Register - High Bank
ABR:
&FCDC Unlock Register - Slots 0&2
&FCDD Lock Register - Slots 0&2
&FCDE Unlock Register - Slots 1&3
&FCDF Lock Register - Slots 1&3

&FCE0 to &FCEF Electron Tube

DataCentre:
&FCF8 VNC1L Data Port
&FCF9 VNC1L Control Port
&FCFA NVRAM Data Port
&FCFB NVRAM Data Direction Register
&FCFC NVRAM Clock&FCFD NVRAM Write Protect *CLASH WITH AQR*
&FCFE Page RAM MSB *CLASH WITH AQR*
&FCFF Paged RAM LSB *CLASH WITH PAGED RAM Register*

AQR:
&FCFC Page Register *CLASH WITH DataCentre*
&FCFD Unlock Register *CLASH WITH DataCentre*
&FCFE Lock Register

&FCFF Paged RAM register *CLASH WITH DataCentre*

&FE00-&FEFF Sheila - Electron internal hardware (ULA)
&FE?0 (read/write) Interrupt Status and Control
&FE?2, &FE?3 (both write only) screen start address
&FE?4 (read/write) cassette data shift register
&FE?5 (write only) interrupt clear & paging
&FE?6 (write only) the counter
&FE?7 (write only) misc. control
&FE?8-&FE?F (write only) the palette

(where ? means "don't care", but by convention, software should use 0 [zero])
As a result of this incomplete address decoding, the 16 addresses (one not used) take up the entire page, as they repeat throughout the page.


The above information extracted from various helpful documents, a lot of which came from members here 8) =D>

Mark

User avatar
hoglet
Posts: 8355
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: coverting beeb adres to electron adres

Post by hoglet » Tue Apr 26, 2016 9:59 am

Here,s another example, similar to Martin's just above.....

On a Beeb Model B you might write a subroutine like:

Code: Select all

select_rom:
    SEI
    AND #&0F
    STA &F4
    STA &FE30
    CLI
    RTS
On the Electron it would be more complicated:

Code: Select all

select_rom:
    SEI
    PHA
    LDA #&0C
    STA &F4
    STA &FE05
    PLA
    AND #&0F
    STA &F4
    STA &FE05
    CLI
    RTS
i.e. in the general case, two writes are needed to the ROM latch.

Dave

User avatar
MartinB
Posts: 5229
Joined: Mon Mar 31, 2008 9:04 pm
Location: Obscurity
Contact:

Re: coverting beeb adres to electron adres

Post by MartinB » Tue Apr 26, 2016 10:12 am

Just for extra info, you don't have to disable interrupts (I didn't in my ditty) as long as you write to &F4 first because the OS preserves &F4 during interrupt processing and so will ensure that &FE05 (or &FE30 on a Beeb) is set to the same value as &F4 on return from the interrupt.

Also note that you can't do rom switching from within a rom or the code will 'get lost' - you have to jump out to ram somewhere to make the switch and correctly manage any handover.

duikkie
Posts: 2953
Joined: Fri Feb 07, 2014 3:28 pm
Contact:

Re: coverting beeb adres to electron adres

Post by duikkie » Tue Apr 26, 2016 10:33 am

i see that &fcf0 and &fcf1 are still free for my smart-usb :D

User avatar
jgharston
Posts: 3591
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: coverting beeb adres to electron adres

Post by jgharston » Tue Apr 26, 2016 1:03 pm

duikkie wrote:i see that &fcf0 and &fcf1 are still free for my smart-usb :D
No, &FCF0/1 is MIDI. &FCF8/9 is USB. See FREDAddrs and SHEILAddrs.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

paulb
Posts: 811
Joined: Mon Jan 20, 2014 9:02 pm
Contact:

Re: coverting beeb adres to electron adres

Post by paulb » Tue Apr 26, 2016 1:24 pm

jgharston wrote:
duikkie wrote:i see that &fcf0 and &fcf1 are still free for my smart-usb :D
No, &FCF0/1 is MIDI. &FCF8/9 is USB. See FREDAddrs and SHEILAddrs.
duikkie should look in the range below "FC70-73 Electron expansion", I guess. The Plus 1 has support for decoding &FC73, but that's reserved for the ROM scrolling register. nINFC at least gives a quick way of detecting page FC accesses. Maybe nINFC7 would have been nice, Acorn. :wink:

User avatar
1024MAK
Posts: 9032
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: coverting beeb adres to electron adres

Post by 1024MAK » Tue Apr 26, 2016 1:35 pm

paulb wrote:
jgharston wrote:
duikkie wrote:i see that &fcf0 and &fcf1 are still free for my smart-usb :D
No, &FCF0/1 is MIDI. &FCF8/9 is USB. See FREDAddrs and SHEILAddrs.
duikkie should look in the range below "FC70-73 Electron expansion", I guess. The Plus 1 has support for decoding &FC73, but that's reserved for the ROM scrolling register. nINFC at least gives a quick way of detecting page FC accesses. Maybe nINFC7 would have been nice, Acorn. :wink:
One 8 bit digital comparator (74HC688) can select one address (or a slightly wider range depending on how many address bits you actually use) from the 8 lower address bits of the bus, the upper 8 bits having already been decoded by the Plus 1, so what's the problem?

Mark

paulb
Posts: 811
Joined: Mon Jan 20, 2014 9:02 pm
Contact:

Re: coverting beeb adres to electron adres

Post by paulb » Tue Apr 26, 2016 2:03 pm

1024MAK wrote:
paulb wrote:
jgharston wrote: No, &FCF0/1 is MIDI. &FCF8/9 is USB. See FREDAddrs and SHEILAddrs.
duikkie should look in the range below "FC70-73 Electron expansion", I guess. The Plus 1 has support for decoding &FC73, but that's reserved for the ROM scrolling register. nINFC at least gives a quick way of detecting page FC accesses. Maybe nINFC7 would have been nice, Acorn. :wink:
One 8 bit digital comparator (74HC688) can select one address (or a slightly wider range depending on how many address bits you actually use) from the 8 lower address bits of the bus, the upper 8 bits having already been decoded by the Plus 1, so what's the problem?
There's no problem. That's a handy IC and probably one I haven't seen before, not really knowing what kinds of decoders you can get or what names they've decided to use for them. (Or where/whether you can buy them.)

ThomasHarte
Posts: 475
Joined: Sat Dec 23, 2000 5:56 pm
Contact:

Re: coverting beeb adres to electron adres

Post by ThomasHarte » Fri Apr 29, 2016 5:38 pm

duikkie wrote:i don't understand it at all ?? , i am to stupid for it :(
As the original author, I'm not sure the problem is yours.

Having become better informed in the interim (credit to John Kortink), the ULA uses three bits of the four-bit paging value.

If the top bit is clear, it ignores the write.

If the top bit is set, the two bits below it update the paging state.

If the paging state is being updated and the middle bit is set, the ULA disables everything that might respond in the ROM area.

If paging state is being updated and the middle bit is not set, the ULA decides whether to page the BASIC ROM or the keyboard based on the low bit.

So, in pseudocode:

Code: Select all

func writeToFE05(byte value) {

    applyInterruptUpdates(value & $f0)
    
    if value & $08 {
        if value & $04 {
            disable both BASIC and the keyboard
        } else {
            if value & $02 {
                enable BASIC
            } else {
                enable the keyboard
            }
        }
    }
}
EDIT: which means, to page an external ROM, if you're not just letting the OS do it for you: if the device you want will respond as ROM 12 or above, just write that value to FE05. If it maps as 7 or below, write 000011xx (i.e. any of 12–15) to FE05 to ensure the ULA disconnects both BASIC and the keyboard, then write the actual ROM number; because the second write doesn't have the third bit set, the ULA will ignore it.

Standard bus rules apply so I guess that if you wrote e.g. 1010 then 0111 and had a ROM responding as 7, you'd then read the logical ANDs of the BASIC ROM and that ROM.

Post Reply