Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is is possible to implement the solidisk sideways ram ? #70

Open
RobertAWAR opened this issue Dec 14, 2020 · 14 comments
Open

Is is possible to implement the solidisk sideways ram ? #70

RobertAWAR opened this issue Dec 14, 2020 · 14 comments

Comments

@RobertAWAR
Copy link

Hi,
The solidisk sideways ram had a number of sw ram banks, which were selected by bits 3:0 of the user port B,
which was located in memory at address $FE60 ( DRB ) and address $FE62 DDRB.
By loading $0F in the DDRB register, the bits 3:0 were set to output .
By then setting the output register to x0, bank 0 was selected, setting to x1, bank 01 was selected,
and so on till $xF, which selected bank $0F ( if available ).
I had the ADE+ macro assembler and the MMU, memory management unit, both intended for use in SW Ram.
I loaded the 2 files in SW ram using a !Boot file like this:
?&FE62=15 -user via bit 3:0 = output
?&FE60=08 -select bank 8
*LOAD ADE+ 8000 -load desired rom
?&FE60=09 -select bank 9
*LOAD MMU 8000 -load the next rom

One could setup ADE+ to use more or less of the sw ram as buffer for the source file,
to handle large files, and / or use an amount as printerbuffer.
The MMU took care of this, using the user via to select the used sw bank.

At present, this is not possible.
Ofcourse I can load the rom images, using the rom config editor, but ADE cannot use the swr to its full extend.

Any ideas if and how this can be implemented?

@chrisn
Copy link
Collaborator

chrisn commented Dec 29, 2020

In principle it can be implemented - I can give a few pointers if you're interested to work on it. Or do you have some links to documentation where I can find out more?

@RobertAWAR
Copy link
Author

Hi,
unfortunately I depend fully on the programming skills of others: I have no knowledge of C at all. I have a manual, but it is large.
However it can be found here: http://chrisacorns.computinghistory.org.uk/docs/Solidisk/Solidisk_SidewaysRAM_8407.pdf
Also on many other places there is info, like: https://stardot.org.uk/forums/viewtopic.php?t=3007
I copied 1 part of a document that says it all:
1.5.4 READING AND WRITING INTO SIDEWAYS RAMS
Under normal circumstances you should not be concerned with reading or
writing into Sideways RAMs. This job can be left to the MOS alone. You
simply select the program/software and it loads (writes) itself in one or two
seconds. Unlike having a ROM extension board, you lose one second each
time, but there is no limit to the number of programs you can use.
The built-in hardware to select any one of the Sideways RAM is the pair
&F4-&FE30 for reading, &FE62-&FE60 for writing. This dual selection
allows one Sideways RAM or ROM to load software into another Sideways
RAM.
If you are writing your own system software the rule is simple:
to load software into a particular Sideways RAM, store number 15 into &FE62
and the Sideways RAM number into &FE60. To read out the contents of any
ROM or RAM store the Sideways RAM number into &F4 and &FE30.
For more technical details please refer to section 3.2.5 or the SOLIDISK TECHNICAL MANUAL.
Does this help ?

@chrisn
Copy link
Collaborator

chrisn commented Mar 1, 2021

So it seems BeebEm may already emulate the Solidisk Sideways RAM. The Help pages say this about the Hardware -> SW RAM Board On/Off menu option:

Enables Solidisk SW RAM board emulation. The RAM bank that is enabled for writing is selected via the User VIA port B. Set port B bits 0-3 to output (e.g. ?&FE62=15) and select the bank via port B (e.g. ?&FE60=4).

@monkeyman79
Copy link
Contributor

I think that Solidisk Sideways RAM might be implemented incorrectly. According to the manual, writes always go the bank selected by the User VIA, so that in particular one RAM can load software into another RAM, but current implementation of BeebWriteMem only uses &FE60 value if the bank selected by &FE30 is not writable. This doesn't allow software in one RAM bank to load contents into another bank.

@richard-broadhurst
Copy link

FYI, This all applies to the early Solidisk Sideways RAM, there later ones did it differently.

@monkeyman79
Copy link
Contributor

FYI, This all applies to the early Solidisk Sideways RAM, there later ones did it differently.

Can you elaborate?

@monkeyman79
Copy link
Contributor

This manual from 1986 still talks about &FE60 register: http://chrisacorns.computinghistory.org.uk/docs/Solidisk/Solidisk_SidewaysRAM_8609.pdf
I understand that you are talking about bigger expansions mounted into CPU socket, they are indeed different beasts:
http://chrisacorns.computinghistory.org.uk/docs/Solidisk/Solidisk_2M4MRAMROMExpansions.pdf

@RobertAWAR
Copy link
Author

It took me a while to do some testing and in short:
It does not work as I hoped.

First, I don't know anything about the twomeg and the fourmeg expansions.
I only used the solidisks 128k SW RAM.
I used the BBC for develloping 6502 programs. For that I used the assembler
ADE and MMU provided on disk as 2 rom images.
They are supposed to run from 2 SWR banks, NOT as (EP)ROM
So when I use the Rom configuration tool, to load them into bank 0 and 1,
AND bank 2-10 are set to RAM, it LOOKS like they work, however they don't.
They HAVE to reside in SWR.
If I take a disc with these 2 ROM images and a simple boot file like:
?&FE62=&0F -user via bit 0-3 = output
?&FE60=0 -select bank 0
*LOAD ADE 8000 -load ADE
?&FE60=1 -select bank 1
*LOAD MMU 8000 -load MMU,
They DO load in the 2 SWR banks, but Pressing F12 and calling *ADE,
results in the emulator to hang.

It looks like something is not correctly implemented.

Hope someone can advise me, or knows if this is still a bug ?

@chrisn
Copy link
Collaborator

chrisn commented Mar 12, 2021

Can you share the disk image you use? We could try testing it against the fix that @monkeyman79 has added: #91

@RobertAWAR
Copy link
Author

Hi,
here is a disk image containing the 3 files.
ADE_MMU.zip

@chrisn
Copy link
Collaborator

chrisn commented Mar 13, 2021

Thank you! I think it's not working. In the ROM configuration, I set banks 0 to 10 to RAM, then boot the disk, press Ctrl+Break, then *ADE. At that point the cursor moves down the screen and it hangs.

@RobertAWAR
Copy link
Author

That is as far as I got. It should come with the option to set time, date or nothing,
followed by a list of available memory, input buffer, printerbuffer and what not.
Do you use exmon ? I noticed a strange behaviour when it comes to selecting SW rambanks

@RobertAWAR
Copy link
Author

I have been using EXMON to edit memory locations in the real BBC with SWR128 AND in Beebem.
And I found something strange in the behaviour of SWR in beebem.
I'II see if I can explain what happens, but using Exmon would help.
So if you have a copy of the EXMON rom, you can do the following:
First load exmon in bank C and set banks 8, 9,and A to RAM.
Then start Exmon and set location &FE62 to &0F. (User via bits 3:0 are now output).
Set location &FE60 to 08. SWR bank 08 is now selected. ( ONLY for writing to it).
Use the exmon command "!08" to set the SWR bank to read from. ( also bank 8 ).
Now edit loc &8000 and set it to &55. You see this location changes.
Now comes the interesting part.
Use !09 to select bank 09 ( to read from )
Again edit location &8000 and set it, lets say to &AA.
And you see it changes to &AA. Isn't that weird ? It shouldn't.
The bank to WRITE to has not been changed, it is still 08 (in &FE60)
Only the bank to read from was changed to 09.
It is obvious that the data was written to bank 09, which is wrong.

@monkeyman79
Copy link
Contributor

BeebEm - BBC Model B _ Master 128 Emulator 23 03 2021 23_15_16

I have managed to start it using patched beebem by loading MMU into bank &0F and ASM into bank &0E with BASIC in 07 and DNFS in 06.

Also EXMON test passes for me - memory writes go to the bank selected by user via.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants