Author Topic: X-MEM, a new memory expansion for all CPC.  (Read 111364 times)

0 Members and 1 Guest are viewing this topic.

Offline Ast

  • 6128 Plus
  • ******
  • Posts: 1.017
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 807
  • Likes Given: 689
Re: X-MEM, a new memory expansion for all CPC.
« Reply #550 on: 16:08, 15 August 15 »
@Ast: Please can you post a photo of Roudoudoduodu's asm demo running on your plus with x-mem?
Sorry, i can't. I ´m on holidays during one week. You must wait for my return...
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"


Amstrad Plus French Forum

All friends are welcomed !

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.332
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2247
  • Likes Given: 3477
Re: X-MEM, a new memory expansion for all CPC.
« Reply #551 on: 16:12, 15 August 15 »
does the asic not assert ramdis when asic ram is active? some ram expansions use diodes, but could they use pullups to handle the two way signal?
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.428
  • Liked: 1004
  • Likes Given: 251
Re: X-MEM, a new memory expansion for all CPC.
« Reply #552 on: 16:17, 15 August 15 »
does the asic not assert ramdis when asic ram is active? some ram expansions use diodes, but could they use pullups to handle the two way signal?
Ramdis has to be asserted by the extension to prevent access to internal ram.
The asic assert RAMOEn when reading RAM (be it internal base/extension or external)

Offline Ast

  • 6128 Plus
  • ******
  • Posts: 1.017
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 807
  • Likes Given: 689
Re: X-MEM, a new memory expansion for all CPC.
« Reply #553 on: 16:32, 15 August 15 »
So to eradicate this bug, you just had to Reset bank by putting #c0 to port #7f before to connect Asic i/o page, am i right ?
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"


Amstrad Plus French Forum

All friends are welcomed !

Offline gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.428
  • Liked: 1004
  • Likes Given: 251
Re: X-MEM, a new memory expansion for all CPC.
« Reply #554 on: 17:15, 15 August 15 »
So to eradicate this bug, you just had to Reset bank by putting #c0 to port #7f before to connect Asic i/o page, am i right ?
Yes

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.332
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2247
  • Likes Given: 3477
Re: X-MEM, a new memory expansion for all CPC.
« Reply #555 on: 17:17, 15 August 15 »
Ramdis has to be asserted by the extension to prevent access to internal ram.
The asic assert RAMOEn when reading RAM (be it internal base/extension or external)
yes.

ram expansion assert ramdis, but they also listen to ramdis and do not activate if they see it? in this way ram expansion can take priority.

the asic does asset ramdis to block all external and internal ram when asic ram is active?
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.428
  • Liked: 1004
  • Likes Given: 251
Re: X-MEM, a new memory expansion for all CPC.
« Reply #556 on: 17:37, 15 August 15 »
yes.

ram expansion assert ramdis, but they also listen to ramdis and do not activate if they see it? in this way ram expansion can take priority.

the asic does asset ramdis to block all external and internal ram when asic ram is active?
I don't think any ram expansion listen to ramdis since they have to assert it during an access.
If you look at a 464/6128 schematic, you will see that RAMDIS only disable the buffer that drive the Z80 bus. The ram is read, but the result is just ignored.
On the 6128 PAL, RAMDIS also prevent write to the memory when asserted. This is missing on a 464 and requires some trick for the expansion to work.
RAMDIS is an input with a pulldown resistor. Extension should drive it in a wired or connection (hence the diode).

Basically, if you put multiple ram extension that maps to the same bank, all will be written and all will drive the bus during read. But this is not a problem as data should be the same.

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.332
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2247
  • Likes Given: 3477
Re: X-MEM, a new memory expansion for all CPC.
« Reply #557 on: 23:20, 15 August 15 »
I will need to double check it, but I've implemented this "feature" in arnold wip on the "extraram" branch. it will be merged into the trunk tomorrow.

to test:

fossil update extraram

then build using one of the shell scripts.

if asic ram is enabled it accepts writes. if expansion ram asserts ramdis, then it will be written to. write through will happen.
if expansion ram doesn't assert ramdis, asic assumes internal ram or the 64kb ram it knows about (6128 plus) and no write through will happen.

Implementing this actually cleaned up some code! :)
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline remax

  • 6128 Plus
  • ******
  • Posts: 1.071
  • Country: fr
  • Liked: 381
  • Likes Given: 419
Re: X-MEM, a new memory expansion for all CPC.
« Reply #558 on: 23:46, 15 August 15 »
Strange that problem not exist 6128plus with its 64K expansion. (and no user see it before)
When has occurred? using 128K or more?
If we can find a way to fix the problem I will send a new CPLD for plus users.

And perhaps to CRTC4 users :p (all this remid me of the problems i have my CPC ad the X-Mem).

Offline Ast

  • 6128 Plus
  • ******
  • Posts: 1.017
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 807
  • Likes Given: 689
Re: X-MEM, a new memory expansion for all CPC.
« Reply #559 on: 01:15, 16 August 15 »
Crtc 4 users can't have the same problem because you can't access to an eventual asic i/O page  :laugh:
Asic i/O page doesn't exist on Crtc type 4 ! Cpc Old Gen are not concerned.
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"


Amstrad Plus French Forum

All friends are welcomed !

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.332
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2247
  • Likes Given: 3477
Re: X-MEM, a new memory expansion for all CPC.
« Reply #560 on: 12:14, 16 August 15 »
To summarize all that has been found by Ast and gerald:

- This problem concerns all ram expansions when used on Plus

- This problem is not isolated to x-mem. All ram expansions will show this problem.

- The problem is seen when extra ram is paged into &4000-&7fff, asic registers are paged into &4000-&7fff and a write is done.

- The problem is not seen with the extra 64KB in the 6128Plus when used without ram expansions. The ASIC knows about it and controls it.

- The problem *is* seen if you connect a ram expansion to the 6128Plus. The expansion occupies c4-c7. The write will go to expansion the read will come from expansion.

- to avoid the problem (choose a ram configuration where expansion ram is not at &4000-&7fff. e.g.

ld bc,&7fc0
out (c),c
ld bc,&7fb8
out (c),c
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1976
  • Likes Given: 4650
Re: X-MEM, a new memory expansion for all CPC.
« Reply #561 on: 01:43, 17 August 15 »
Well, in the Dobbertin as in the Inicron RAM expansions the Bank &C4-&C7 can be switched on / off. So either CPC or expansion RAM is used.


So what actually is the problem? You bank in some exp. RAM like &CF and MM IO and then?

TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline Executioner

  • Supporter
  • 6128 Plus
  • *
  • Posts: 783
  • Country: au
  • WinAPE Developer
    • WinAPE
  • Liked: 391
  • Likes Given: 60
Re: X-MEM, a new memory expansion for all CPC.
« Reply #562 on: 05:47, 17 August 15 »
ld bc,&7fc0
out (c),c
ld bc,&7fb8
out (c),c

If you're not concerned about what's in lower ROM at the time (eg. if it's not enabled), then you can shorten that to:

ld bc,#7fc0
out (c),c
dec c
out (c),c

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.332
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2247
  • Likes Given: 3477
Re: X-MEM, a new memory expansion for all CPC.
« Reply #563 on: 11:05, 17 August 15 »
Well, in the Dobbertin as in the Inicron RAM expansions the Bank &C4-&C7 can be switched on / off. So either CPC or expansion RAM is used.


So what actually is the problem? You bank in some exp. RAM like &CF and MM IO and then?
It will be a problem for ALL ram expansions and ALL RAM configurations (c4-ff) (ok excluding c0 "mirrors").
So if you page in cc and mm io, a write will still go to ram.

The problem is that you page in expansion ram (any page), you page in mm io and do a memory write. Write goes to mm io AND expansion ram.

Only happens with expansions, asic knows about the extra 64kb 6128. So to test use ANY ram expansion.

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1976
  • Likes Given: 4650
Re: X-MEM, a new memory expansion for all CPC.
« Reply #564 on: 19:18, 17 August 15 »
Ok, the problem occurs when using expansion RAM between &CC and &FF. (And &C4-&C7 is hit too when using NOT the internal RAM of the 6128 Plus.) A write to MM IO in duplicate writes to the E-RAM. I will verify this with some exotic devices in December (sorry, can't access them before).


Seems that by accident I never felt into this pit when doing stuff for the Plus.

TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline Ast

  • 6128 Plus
  • ******
  • Posts: 1.017
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 807
  • Likes Given: 689
Re: X-MEM, a new memory expansion for all CPC.
« Reply #565 on: 14:00, 22 December 15 »
To summarize all that has been found by Ast and gerald:

- This problem concerns all ram expansions when used on Plus

- This problem is not isolated to x-mem. All ram expansions will show this problem.

- The problem is seen when extra ram is paged into &4000-&7fff, asic registers are paged into &4000-&7fff and a write is done.

- The problem is not seen with the extra 64KB in the 6128Plus when used without ram expansions. The ASIC knows about it and controls it.

- The problem *is* seen if you connect a ram expansion to the 6128Plus. The expansion occupies c4-c7. The write will go to expansion the read will come from expansion.

- to avoid the problem (choose a ram configuration where expansion ram is not at &4000-&7fff. e.g.

ld bc,&7fc0
out (c),c
ld bc,&7fb8
out (c),c
@Executioner : Do you think to add this to your new Winape version ?
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"


Amstrad Plus French Forum

All friends are welcomed !

Offline Executioner

  • Supporter
  • 6128 Plus
  • *
  • Posts: 783
  • Country: au
  • WinAPE Developer
    • WinAPE
  • Liked: 391
  • Likes Given: 60
Re: X-MEM, a new memory expansion for all CPC.
« Reply #566 on: 00:51, 23 December 15 »
@Executioner : Do you think to add this to your new Winape version ?

That may be a bit hard to emulate. If I read correctly, depending on the expansion, the write can go to both the exapnsion memory and ASIC RAM, but what does the read get? Are both the ASIC and expansion driving the bus?

Offline gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.428
  • Liked: 1004
  • Likes Given: 251
Re: X-MEM, a new memory expansion for all CPC.
« Reply #567 on: 10:02, 23 December 15 »
That may be a bit hard to emulate. If I read correctly, depending on the expansion, the write can go to both the exapnsion memory and ASIC RAM, but what does the read get? Are both the ASIC and expansion driving the bus?
A simple (half) way to emulate would be to have the write done on both ASIC ram and extension RAM. That is what happen on the real HW.
A complete emulation is not really possible as both ASIC and extension RAM return a value, the Z80 only seeing the result of the bus conflict.
You can either return garbage, ASIC, RAM or a mix of ASIC/RAM value. But ideally you could trigger some kind of emulator HW exception that will stop the emulator and enter the debugger like a breakpoint.

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.332
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2247
  • Likes Given: 3477
Re: X-MEM, a new memory expansion for all CPC.
« Reply #568 on: 11:11, 23 December 15 »
A simple (half) way to emulate would be to have the write done on both ASIC ram and extension RAM. That is what happen on the real HW.
I have implemented it this way :)

A complete emulation is not really possible as both ASIC and extension RAM return a value, the Z80 only seeing the result of the bus conflict.
You can either return garbage, ASIC, RAM or a mix of ASIC/RAM value. But ideally you could trigger some kind of emulator HW exception that will stop the emulator and enter the debugger like a breakpoint.
Ok I thought the read would only come from asic registers. I can implement this.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline Ast

  • 6128 Plus
  • ******
  • Posts: 1.017
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 807
  • Likes Given: 689
Re: X-MEM, a new memory expansion for all CPC.
« Reply #569 on: 11:47, 23 December 15 »
@Arnoldemu : Are you always working on Arnold ? Is window version ready ? Could you give us the link to download it, please ?
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"


Amstrad Plus French Forum

All friends are welcomed !

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.332
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2247
  • Likes Given: 3477
Re: X-MEM, a new memory expansion for all CPC.
« Reply #570 on: 11:52, 23 December 15 »
@Arnoldemu : Are you always working on Arnold ? Is window version ready ? Could you give us the link to download it, please ?
Yes.
Almost. A release is planned in a few days time.
Yes I will send you a pm.

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.428
  • Liked: 1004
  • Likes Given: 251
Re: X-MEM, a new memory expansion for all CPC.
« Reply #571 on: 17:28, 23 December 15 »
Ok I thought the read would only come from asic registers. I can implement this.
I need to double check that on HW, looking at the bus with a scope.
However, there is no reason the ASIC do not drive the bus as it is selected, and the RAM extension does not know anything about the ASIC and will drive the bus as well.

Offline OCT

  • 464 Plus
  • *****
  • Posts: 349
  • Liked: 42
  • Likes Given: 39
Re: gerald's own memory extension/interface
« Reply #572 on: 16:09, 02 January 16 »
Does not work with the XMEM nor my own memory extension.
Are you sure you only use C0-C7 memory banks (1st 64K block of extension RAM) and not others ? Without the XMEM you always reach the 1st 64k extension block, whatever you select.
At least it is not xmem only related, my own interface has the same problem.
@CraigsBar, can you test with your symbiface ?
Which is your own memory extension/interface referred to?

Offline gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.428
  • Liked: 1004
  • Likes Given: 251
Re: gerald's own memory extension/interface
« Reply #573 on: 16:29, 02 January 16 »
Which is your own memory extension/interface referred to?
Prototype visible here : CPC+ RAM extension ?
Final version had some instability on the compact flash side that need a redesign.
The RAM/ROM is fully functional.

Offline OCT

  • 464 Plus
  • *****
  • Posts: 349
  • Liked: 42
  • Likes Given: 39
Re: gerald's own memory extension/interface
« Reply #574 on: 17:24, 02 January 16 »
Prototype visible here : CPC+ RAM extension ?
Final version had some instability on the compact flash side that need a redesign.
The RAM/ROM is fully functional.
OIC, great to fill the void until SymbiFace3 Hardwareentwicklung | Dr. Zed's evil Lab
Hardwareentwicklung | Dr. Zed's evil Lab comes to life Really Soon Now, but not "commercialized" in light of TotO's X-MASS & X-MEM (BTW allowing 640kB on 6128s too?) ?

Since mentioned in the testing, does any of these provide an equivalent of the Cherry-T/Khany RAM bank swapper (unless someone has figured out how to replicate that on a CPC6128plus) for the first memory bank, which so often allows to capture 64k code with its defences down?  8)
an unpublished tip for pyradev users
an unpublished tip for pyradev users
File:Khany's BankSwapper.jpg - CPCWiki
File:Khany's BankSwapper.jpg - CPCWiki