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

0 Members and 3 Guests 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 #525 on: 23:47, 14 August 15 »
It's possible... I have to see my source code!
_____________________

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


Amstrad Plus French Forum

All friends are welcomed !

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 #526 on: 23:59, 14 August 15 »
Here is a sample of my own code used in "r'n i coop"


Code: [Select]

ld bc,#7fb8:out (c),c
ld hl,#6400 ; copy anciennes couleurs
ld de,oldcol ; dans oldco
ld bc,#20
ldir
;
ld hl,#6000 ; Raz position/zoom Sprite Hard
ld de,#6001
ld bc,#7c
ld (hl),l
ldir
;
call sproff ; on planque les sprites hard derriere
; le plastique du moniteur (x=-64)






hop ld hl,tbout2:call tbout
ld hl,color1
ld de,color1+1
ld bc,32
ld (hl),0:ldir
ld bc,#7fa0:out (c),c
call clearinit
fininit
;
ei
ld bc,#7fc7:out (c),c
call intro


So after seeing the code, i can affirm that :


Asic i/O on
...blabla...
Asic i/O off
Bank x connected
...
Asic i/O on
... Blabla 2...
Asic i/O off
Bank y connected
..etc...
_____________________

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 #527 on: 00:04, 15 August 15 »
Small question, is your demo code reading from the ASIC ram while extension RAM is also selected ?
I see writes to the soft scroll and split screen.. and that the crtc is reading from &4000-&7fff.

For split screen it loads a new address into the crtc so it should read from base 64kb.

expansion ram active, asic registers active, split screen at &4000.  :D

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 #528 on: 00:06, 15 August 15 »
What do you mean exactly?
_____________________

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 #529 on: 00:16, 15 August 15 »
What do you mean exactly?
I am thinking of another thing to test.

I looked at your demo in arnold's debugger. I could be wrong with these facts:

when the logo is moving I think you make this using asic split screen and asic soft scroll register I think. asic ram is active so you can access the registers.

I think, split screen is pointing to pixels at &4000-&7fff.

I don't know if the extra ram is also active at this time.

I am thinking that the x-mem ram causes problems (or the asic has a bug) and the asic reads pixels from the extra ram and not the base 64kb of ram. So you get pixels in the wrong place? I think the photo of your monitor is showing repeated graphics for the logo?

I will write a test  tomorrow to try this idea.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Online gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.434
  • Liked: 1005
  • Likes Given: 251
Re: X-MEM, a new memory expansion for all CPC.
« Reply #530 on: 00:30, 15 August 15 »
My question was to check if we could have a clash between the active exp ram and the mapped asic ram during a read.
This would happen if the RAMRDn signal is active during this access (and the signal should not be active).

expansion ram active, asic registers active, split screen at &4000.  :D
Well, the video access should not do any harm, the demo works well without the external expansion RAM.

I am thinking that the x-mem ram causes problems (or the asic has a bug) and the asic reads pixels from the extra ram and not the base 64kb of ram. So you get pixels in the wrong place? I think the photo of your monitor is showing repeated graphics for the logo?
That's not possible at all. The ASIC would need to be able to drive the Z80 address/contril bus to do so.


I don't know if the extra ram is also active at this time.
This is something you need to add to the debugger  ;)


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 #531 on: 00:46, 15 August 15 »
Normally, the RLL technic i used in this demo is nearby rvi without exceptions. So I use asic pri, sscr and ssa to display the good line at the good position, but, but, but.... no extra ram seems to be connected in the same time...
Code is like that :


Code: [Select]
ld bc,#7fb8 : out (c),c
call rll ; Rvi Plus Emulation
ld bc,#7fa0 : out (c),c
;
ld bc,#7fC7 : out (c),c
...do what you want...

_____________________

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


Amstrad Plus French Forum

All friends are welcomed !

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 #532 on: 01:28, 15 August 15 »
That's not possible at all. The ASIC would need to be able to drive the Z80 address/contril bus to do so.


Maybe it can do that. It was Amstrads idea, but never worked well, so they didn't use it. Now it's undocumented.

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

Offline CraigsBar

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.280
  • Country: ie
  • The party ain't over yet
    • index.php?action=treasury
  • Liked: 1171
  • Likes Given: 79
Re: X-MEM, a new memory expansion for all CPC.
« Reply #533 on: 01:39, 15 August 15 »
At least it is not xmem only related, my own interface has the same problem.
@CraigsBar, can you test with your symbiface ?


OK


Created a Cart with NoCart as the 464 plus has no Disc interface.


tested the cart on the 464plus with no memory Expansion - "6128 plus required" message
tested the cart on the 464plus with the x-mem - Same errors as on the 4128plus and 6128plus with x-mem
tested the floppy on the 4128plus with SymbifaceII (As the C4CPC selector does not work with the Symbiface plugged in) - Same errors as with the x-mem and the 128k machines.


Looks like it affects all expanded memory machines the same
IRC:  #Retro4All on Freenode

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.466
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2636
  • Likes Given: 1565
Re: X-MEM, a new memory expansion for all CPC.
« Reply #534 on: 11:20, 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.
« Last Edit: 11:31, 15 August 15 by TotO »
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

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 #535 on: 11:54, 15 August 15 »
@CraigsBar: Thank you for testing :)

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

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 #536 on: 12:02, 15 August 15 »
I am thinking of two more things now:
1. the timing is altered with the expansion ram, perhaps an extra /wait, or something different. The timing then changes when the split screen and scroll values are used; and therefore the display will show the artifacts in the picture.
2. something with memory refresh; perhaps some ram inside plus is not being refreshed (arnold docs mention disturbances with memory refresh; split screen and soft scroll). memory starts to degrade, wrong value read, but not enough to crash it.

@Ast: thank you for the confirming the asic ram is not active.

@gerald: yes, something I will need to add to the debugger. My expansion implementation has simulated ROMDIS, RAMDIS, ROMEN and RAMEN, it seems I need to expose these into the debugger now and a way to determine which device is asserting them. Then it would be possible to see - if my emulation is correct which device is active.

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

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 #537 on: 13:32, 15 August 15 »
@Ast: Please can you post a photo of Roudoudoduodu's asm demo running on your plus with x-mem?
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

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 #538 on: 13:52, 15 August 15 »
One more idea!

@Ast: you had different results... one time the screen was bad, one time the sprites were bad??

So.. I had an idea.

Please try this to see if results are consistent.

1. Insert this disc
2. memory &9fff:load"ivr.bin",&a000:call &a000
3. now run your demo.

Is it fixed, or are the results always the same when you follow these steps?

The idea behind this demo:
- When interrupts are acknowledged, asic will use IVR and register I to put an address on the bus.
Maybe there is an interaction here, or a delay because IVR and I register are possibly not initialised, or are set to values which cause a problem.


« Last Edit: 13:56, 15 August 15 by arnoldemu »
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Online gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.434
  • Liked: 1005
  • Likes Given: 251
Re: X-MEM, a new memory expansion for all CPC.
« Reply #539 on: 14:12, 15 August 15 »
I've found what's wrong.
It looks you are writing to the ASIC ram while having the extension ram selected as well.
- When using the internal extension, the ASIC knows that the ASIC ram is active or not and will write either to its internal RAM or to the expansion ram.
- When using the external extension, the extension does not know anything about the ASIC ram configuration and does the write.

In fact the extension should monitor the write to IO 7Fxx for %10111ppp value and inhibit access.





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 #540 on: 14:45, 15 August 15 »
@gerald:
The write goes to asic ram AND to expansion ram?

Does the asic assert any signals to indicate it's a internal asic ram access?

Should ALL expansion rams will suffer from this problem?

Ast said that he used 7fc0 to restore base ram before he did asic writes?
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

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 #541 on: 14:53, 15 August 15 »
the test program should show the error gerald has discovered.

it enables extra ram.
it writes &aa to it
it then enables asic ram
it writes &55 to it
it then disables asic ram
it reads the value

if it's changed, then value has gone to asic and extra ram. pen 0 changes colour.
if pen 0 is black, no write through.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Online gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.434
  • Liked: 1005
  • Likes Given: 251
Re: X-MEM, a new memory expansion for all CPC.
« Reply #542 on: 14:57, 15 August 15 »
The write goes to asic ram AND to expansion ram?
Yes I guess. I will make some test to confirm.

Does the asic assert any signals to indicate it's a internal asic ram access?
There is no signal like this. Remember that the extension port did not change with the plus.

Should ALL expansion rams will suffer from this problem?
To not suffer from this problem, the extension need to decode the ASIC ram mapping register. And to to it properly, it also need to emulate the ASIC lock/unlock mechanism ...
So I guess that all memory extension made suffer from this problem.

Ast said that he used 7fc0 to restore base ram before he did asic writes?
I've seen the problematic write with a logic analyser. I cannot say for sure the ASIC RAM was enabled but writes clearly targeted ASIC register (sprite position &6000 and further), and the ram extension did the write as well.

Online gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.434
  • Liked: 1005
  • Likes Given: 251
Re: X-MEM, a new memory expansion for all CPC.
« Reply #543 on: 15:02, 15 August 15 »
the test program should show the error gerald has discovered.

it enables extra ram.
it writes &aa to it
it then enables asic ram
it writes &55 to it
it then disables asic ram
it reads the value

if it's changed, then value has gone to asic and extra ram. pen 0 changes colour.
if pen 0 is black, no write through.
Pen0 :
- black without external ram extension
- yellow with external ram extension

Problem confirmed !

Offline Prodatron

  • 6128 Plus
  • ******
  • Posts: 830
  • Country: de
  • Back on the Z80
    • index.php?action=treasury
    • SymbOS SYmbiosis Multitasking Based Operating System
  • Liked: 1059
  • Likes Given: 554
Re: X-MEM, a new memory expansion for all CPC.
« Reply #544 on: 15:04, 15 August 15 »
So I guess that all memory extension made suffer from this problem.
Wow, that explains a lot! Thanks so much for this finding!

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

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 #545 on: 15:17, 15 August 15 »
Pen0 :
- black without external ram extension
- yellow with external ram extension

Problem confirmed !
Great. One more test. 7fc0 is selected.

If this shows black, which I hope it does, then to work around the issue, 7fc0 must be selected before asic registers are enabled.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

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 #546 on: 15:21, 15 August 15 »
Yes I guess. I will make some test to confirm.
Perhaps it can be worked around?

There is no signal like this. Remember that the extension port did not change with the plus.
I hoped an existing signal would indicate it somehow.

To not suffer from this problem, the extension need to decode the ASIC ram mapping register. And to to it properly, it also need to emulate the ASIC lock/unlock mechanism ...
So I guess that all memory extension made suffer from this problem.
ouch!

So, lets look on the positive side:
1. we know about the problem now
2. we can detect it.
3. if we detect it, writes could be done to the unmapped area in asic ram, now we can keep asic ram open AND make writes to extra ram! BONUS!  :D

EDIT: What happens to the a memory read? Is it visible in the unmapped area exactly, does it conflict with read/write registers like sprite data...?

I can do some more tests to answer all of these :)

 
« Last Edit: 15:23, 15 August 15 by arnoldemu »
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.466
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2636
  • Likes Given: 1565
Re: X-MEM, a new memory expansion for all CPC.
« Reply #547 on: 15:33, 15 August 15 »
Is this "bug" should allow to exchange the sprites content by swapping the external expansion banks?  ;D
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Online gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.434
  • Liked: 1005
  • Likes Given: 251
Re: X-MEM, a new memory expansion for all CPC.
« Reply #548 on: 15:50, 15 August 15 »
So, lets look on the positive side:
1. we know about the problem now
2. we can detect it.
3. if we detect it, writes could be done to the unmapped area in asic ram, now we can keep asic ram open AND make writes to extra ram! BONUS!  :D

EDIT: What happens to the a memory read? Is it visible in the unmapped area exactly, does it conflict with read/write registers like sprite data...?
Read is not a problem. The ASIC is generating the RAMOEn signal that the extension should use, and Amstrad engineer did they work properly ! (I've already checked this)

Great. One more test. 7fc0 is selected.
If this shows black, which I hope it does, then to work around the issue, 7fc0 must be selected before asic registers are enabled.
This obviously work  ;)

Online gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.434
  • Liked: 1005
  • Likes Given: 251
Re: X-MEM, a new memory expansion for all CPC.
« Reply #549 on: 15:51, 15 August 15 »
Is this "bug" should allow to exchange the sprites content by swapping the external expansion banks?  ;D
no  ;D