News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Bryce

Memory Check.

Started by Bryce, 15:21, 22 October 11

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bryce

Hi All,
      I'm just experimenting with some RAM expansions and was wondering whether there is a quick way to report how much RAM is connected to the CPC. It needs to be on a disk (ie: not a ROM routine) because there isn't / can't be any ROM expansion connected to the CPC while I am performing certain tests.

Bryce.

SyX

#1
I have made a miniprogram that will report how many banks of expansion ram DK'Tronics compatible has your CPC, the sizes reported are 0, 64, 128, 256 or 512.

If you need page (16 KBs pages) accuracy instead of bank accuracy (64 KBs banks), only tell me ;)

PD:The DSK with the ram test is fixed now, sorry again ;)

Bryce

Wow, thanks, "Bank acurracy" is enough for what I am doing :) I'll try it out tomorrow.

Bryce.

SyX

You are welcome Sir Bryce :D

Bryce

Hi SyX,
     somethings not quite right with the RAM test program. If I connect a 64K DKTronics expansion to the CPC, the program reports 512K, the same when I connect 256K. And it always crashes after reporting the RAM (strange flickering dots in top left corner of screen) except for when no expansion is connected.

Bryce.

SyX

#5
Upss, ok, i'll review it, i only has tested in WinApe (with its multiples ram expansion emulation worked great) and my CPC6128s without ram expansions (that showed the message 64 KBs of ram expansion), but i don't think it would be any problem, sorry.

PD: Fixed, only worked in my CPC by pure miracle :P

PD2: I will add the support to Silicon Disk Expansions, because now it could show wrong sizes in those ;)

CanonMan

I had the same problem running it on WinAPE too.

I had a look at the code using the debugger and noticed that the bank switching codes weren't being sent to port &7f00. I'm surprised it worked at all.

SyX

Only worked for the ghosting in the I/O ports, that is be lucky XDDD

arnoldemu

This is the code I used for Batman Begins:
http://www.cpctech.org.uk/source/memcheck.html

it stores a list of the configurations that can be used, so you can count these up and multiply by 16 to give the total size in extra K.
This may be useful?
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

TFM

Quote from: Bryce on 15:21, 22 October 11
Hi All,
      I'm just experimenting with some RAM expansions and was wondering whether there is a quick way to report how much RAM is connected to the CPC. It needs to be on a disk (ie: not a ROM routine) because there isn't / can't be any ROM expansion connected to the CPC while I am performing certain tests.

Bryce.

Look here:
http://www.cpcwiki.eu/imgs/4/44/4_MB_E-RAM_Test.zip
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

SyX

I have finished the Expansion RAM Checker, include support for DK'Tronics Silicon Disk (and every standard ram expansion until 512 KB), page accuracy and a memory test (fill the ram in 4 passes with the values $00, $55, $AA, $FF and check the values) with a "gui" similar to the Atari 800 ram test.

As you can see in the picture:
White: Ram Page Detected.
Grey: There is not ram in this page.
Red: Ram page failed test.
Green: Ram page pass test.

TODO: Add support for ram expansions bigger 512KBs, it's easy but i'm lazy and except FutureOS i don't know what programs make use of those monstrous ram sizes :P

Any feedback will be well received :)

PD: I have included a tape version, too ;)

Phi2x

#11
.

arnoldemu

Quote from: phi2x on 18:28, 24 October 11
That's a very cool tool!

It will be a nice addition to the stress tests I use:

       
  • RAM: Expansion RAM Checker
  • CRTC & GA: Lots of demos  ;D
  • CPU: Z80 Tests Suite, Zexall
  • ASIC: Arnold V test cartridge
  • VDU, Z80, CRTC & ASIC: Plus test
And now, what about a FDC tests suite? ;) Something that would check the different commands, examining the FDC flags state, the returned values and the timings.
It would be tremendously useful for us emulator authors. The FDC is sadly the most neglected chip at the moment :/

http://www.cpctech.org.uk/download/fdctest.zip

A test program I wrote a while ago.
Tests quite a lot of things, but after writing the loader, I found there was some things I had missed.

At this time, I am writing my own ppi, psg and memory testing programs.
I have found that it is possible to detect different versions of the ppi.
Not much use, but possible to know which is inside the cpc.

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

SyX

#13
Quote from: phi2x on 18:28, 24 October 11And now, what about a FDC tests suite? ;) Something that would check the different commands, examining the FDC flags state, the returned values and the timings.
It would be tremendously useful for us emulator authors. The FDC is sadly the most neglected chip at the moment :/
I agreed totally with you, the last weekend i was breaking my head why the original version of Basun (an horrendous game :P ) doesn't work in emulators, but works perfectly in the real machine.

Well, the problem is when the loader finish to load everything, stop the disk drive motor, send the header to the track 38, wait to receive the acknowledge of this operation (the emulators enter in a infinite loop here, while waiting), restart the motor again, read the track 39 (a dummy read, because this track is a normal formatted track, only has $E5), stop the motor and launch the game.

It looks that the emulators stop immediately the disk drive motor and the program never receive the confirmation of the seek track 38; while in the real CPC take a time, in this time the seek track 38 is made and the FDC signal the operation was made correctly.

.
.
.
Although there is hope ;) , arnoldemu has made a lot of work studying the FDC, he's the author of the disk loader of Batman Begins, and he promise that when he finish a few of his projects, he will publish the sources of the loader and a lot of the secrets of the FDC will be disclosed  :)

PD: While i was writting this, arnoldemu has answered you ;)

PD2: If somebody wants the sources of the memory tester, only ask ;)

arnoldemu

I see it's relying on the disc motor taking time to slow down.
Discology does something similar, it times how long it takes for the disc to stop, and uses that to calibrate it's writing.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Phi2x

#15
.

arnoldemu

Quote from: phi2x on 19:42, 24 October 11
Very interesting. I didn't know there was already a FDC test suite.
And it looks nice too.

Some remarks though:
The test suite doesn't really indicate what each test is about.
I see there are some brief explanations in the asm code, but it would be even better if there was a small txt file explaining each one of these tests and what are the correct values to satisfy it.
true, I don't have time to update this test at the moment.

Quote from: phi2x on 19:42, 24 October 11
I have bad news too. :( I have converted the dsk to an hfe file and ran it on my real CPC. The tests don't want to execute on it. Just after launching test.bas, the HxC goes crazy and then the Basic returns a "Drive A: read fail. Retry, Ignore or Cancel?".
Bad news. I ran the tests on a 6128plus. RUn one disc, then use that to format and make the test disc in another drive.
then run the tests on that created disc.
The test disc does have some special format tracks.

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

Phi2x

#17
.

TFM

If somebody has questions (precisely, not general. For general use a book) about the FDC or RAM programming then you can ask me here. Will be my pleasure to share what I know.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Bryce

Hi SyX,
     I just did some intensive testing of your RAMTest dsk and there is still a minor error in the program. If I connect a 256K RAM expansion (tested on a 6128+), which is mapped to Banks 0 to 3, the test claims that I have 320K total and Banks 0 to 4 are populated. Which definitely isn't the case. If I connect 512K it correctly reports Banks 0 to 7 are populated and if I connect 256K mapped to Banks 4 to 7 it also works correctly.

Otherwise a seriously cool program, reminds me of the Atari XL RAM Test :)

Bryce. 

TFM

#20
Quote from: Bryce on 17:33, 31 October 11
Hi SyX,
     I just did some intensive testing of your RAMTest dsk and there is still a minor error in the program. If I connect a 256K RAM expansion (tested on a 6128+), which is mapped to Banks 0 to 3, the test claims that I have 320K total and Banks 0 to 4 are populated. Which definitely isn't the case.

Have you done the test on a CPC6128? In this case you have 64 KB (internal E-RAM) + 256 KB = 320 KB.

Now, you can connect 256 KB in two ways. It can target the lower part (&7FCx, Dx) or the upper part (&7FEx, Fx) of the expansion RAM address range.

If the 256 KB are connected to the lower part, then the total expansion RAM ist 256 KB. The 256 KB overwrite the 64 KB of internal exp.RAM.

If the 256 KB are connected to the upper part, then the total expansion RAM (E-RAM) is 320 KB. 64 KB from the 6128 and 256 KB external E-RAM.

You can use also the FutureOS tool "OS Infos" to get a graphic map of the first 512 KB E-RAM. Then it's pretty obvious what I'm talking about. If not please let me know.



Every square is a block of 16 KB expansion RAM (E-RAM). The hex number in the upper, left corner of each square it the value for port &7Fxx to select that particular E-RAM.

Free = RAM is connected and free.
Not.c = RAM is not connected, does not exist.
DIR = RAM is used as DIRectory buffer, so it does exist
KZS = RAM used as buffer, so it also exists.

320 KB expansion RAM are shown :-)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Bryce

I don't know which mode SyXs software uses, so I can't tell you how it's being banked. But no matter how it is banked, Bank 4 should be empty if only 256K external RAM is connected, shouldn't it?

Bryce.

TFM

Quote from: Bryce on 19:02, 31 October 11
I don't know which mode SyXs software uses, so I can't tell you how it's being banked. But no matter how it is banked, Bank 4 should be empty if only 256K external RAM is connected, shouldn't it?

Bryce.

I can't tell you neither how SyX's soft works, therefore I suggest to use "OS Infos" from the FutureOS utility disc. This one will clearly show you which blocks are occupied in reality. It's easy:

- Start "OS Infos"
- Press "1"
- Press Space
Now you see the semi-graphic map of the first 512 KB expansion RAM. :)

You find a disc image here:
http://www.colorado-boys-muenchen.de/users/futureos/files/FutureOS_Utilities.zip
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

SyX

Thanks Bryce for your nice words :D

It's strange that bug, because my program is founding the internal 64 KBs expansion ram of the 6128+, and then, of course, the 4 banks of your 256 KBs expansion ram. Are you sure that the internal expansion ram is disabled?

With respect at the order how the ram are paged, it's easy:Bank 0 -> $C4 $C5 $C6 $C7 (internal expansion ram in 6128, if it's not disabled)
Bank 1 -> $CC $CD $CE $CF
Bank 2 -> $D4 $D5 $D6 $D7
Bank 3 -> $DC $DD $DE $DF
Bank 4 -> $E4 $E5 $E6 $E7
Bank 5 -> $EC $ED $EE $EF
Bank 6 -> $F4 $F5 $F6 $F7
Bank 7 -> $FC $FD $FE $FF

Are there any emulator that support this memory expansion configuration? WinApe doesn't let me to use 128 KBs + 256 Ram Expansion, only 64 + 256 or 128 + 256 Silicon Disks (Banks 4 - 7).

Sorry for the delay in answer, this afternoon i have been very busy finishing my Halloween costume (HalloGrease  ;D ), i'll review the program tomorrow if i return alive  :P

Go, greased lightnin', you're burnin' up the quarter mile
Greased lightnin', go greased lightnin'... Pivas allá voy!!! xDDDD

TFM

WinApe offers at least banks 4-7 (256 Silicon disc). Also Caprice can be used for 320 KB expansion RAM.

Solution: Check 128 KB and check box at 256 KB Silicon disc. Then you have RAM banks 0, 4-7. This makes the 320 KB expansion RAM. I checked that with my tool, WinApe works fine.

Cool picture! Have fun tonight :-)))
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Powered by SMFPacks Menu Editor Mod