Panasonic FS-A1F and 128kb RAM upgrade

Page 5/8
1 | 2 | 3 | 4 | | 6 | 7 | 8

By sdsnatcher73

Prophet (3533)

sdsnatcher73's picture

23-09-2022, 05:36

Like I have said before this has nothing to do with the modification. An unmodified A1F also has this issue and the software also detects a bigger mapper.

By ro

Scribe (4758)

ro's picture

23-09-2022, 08:19

sd_snatcher wrote:
Manuel wrote:

So, can someone please figure out which detection method is used in these programs?

The programs that are detecting 512KB of RAM are doing the quick and dirt detection method that is prone to failure. They're just checking the amount of bits active in the Memory Mapper registers (5bits, in this case).

Nope.i know for a fact, cuz I wrote the functions for umax and fuzz stuff. A simple ram check on memmap segments.
Sort of like that basic listing shown earlier.but with restoration of altered ram ofcourse.

I will meet up with retrofan today and gonna inspect the machine.

By gdx

Enlighted (5706)

gdx's picture

23-09-2022, 10:41

Following program shows what size?

https://msxpen.com/codes/-NCdTJDAdsZl2r6n-3Uj

I must be save as "MAPSIZE.BAS".

EDIT: I used MSXpen to put the listing because it is modified by using the code tag. MSXpen cannot run this program.

By Retrofan

Paragon (1322)

Retrofan's picture

23-09-2022, 11:52

Hi gdx, thanks for the BASIC listing. I removed line 15 so line 10 will be executed first, otherwise it will be line 1510 and you will get a Syntax error in 30.

The program shows the incorrect size of 2032 kB unfortunately. However, the BASIC listing posted earlier on page 4 in this thread does display the correct size of 128kB.

Let's find the differences! ;-)

Anyway, one difference I already see: &H8000 is used instead of &H8100. &H8000 isn't menioned in the other BASIC listing which reports 128kB of RAM. Maybe that's the issue?

I combined line 10 of both listings so the program will load itself if needed and no syntax error will appear anymore.

By ro

Scribe (4758)

ro's picture

23-09-2022, 11:42

Hai the listing pointed out by GDX does exactly the same as the earlier listing with the added function of restoring the RAM. And this is exactly what my function does, as well. In my opinion also the most trusty way of checking if there is RAM on a page. One minor thing; the value put on the segment to test while reading back could also already be present at that value which could indicate a false positive. I added this in an earlier RAMtest function, it first tests if the value of the RAM location is equal to the test value. If so, i'll put in the negative value of that and read that back.

Either way, both basic listings do the same in function. As long as you use any address within the 16K segment. In these cases it's page 2: #8000-#BFFF. And to switch page 2 segments, you first have to move BASIC to another page. That's what line 10 does, in both cases. Smile

The plot thickens as I'm leaning towards hardware failure.

By sdsnatcher73

Prophet (3533)

sdsnatcher73's picture

23-09-2022, 11:57

Retrofan wrote:

Hi gdx, thanks for the BASIC listing. I removed line 15 so line 10 will be executed first, otherwise it will be line 1510 and you will get a Syntax error in 30.

The program shows the incorrect size of 2032 kB unfortunately. However, the BASIC listing posted earlier on page 4 in this thread does display the correct size of 128kB.

Let's find the differences! ;-)

Anyway, one difference I already see: &H8000 is used instead of &H8100. &H8000 isn't menioned in the other BASIC listing which reports 128kB of RAM. Maybe that's the issue?

I combined line 10 of both listings so the program will load itself if needed and no syntax error will appear anymore.

Address &H8000 is also where TESTMAP fails. maybe the machine incorrectly has a register in this address?

By Retrofan

Paragon (1322)

Retrofan's picture

23-09-2022, 12:12

Thanks ro, I will visit you later today to do some more tests.

@sdsnatcher73: good point! who knows, could be. If this is indeed a hardware failure, we need to know if other machines have this issue as well and more important we need fixes so the software will also work on these machines expanded to 128kB. You said earlier when using the MFR SCC+ SD 512K it runs okay on the FS-A1F, right? That's a possible workaround then.

By gdx

Enlighted (5706)

gdx's picture

23-09-2022, 14:00

Retrofan wrote:

I removed line 15 so line 10 will be executed first, otherwise it will be line 1510 and you will get a Syntax error in 30.

I wonder where this 15 came from. Here is a link to a listing without it.
https://msxpen.com/codes/-NCeCxRpUnMH5THJPdBD

By ro

Scribe (4758)

ro's picture

25-09-2022, 11:39

Alrighty then!

Simon (Retrofan) I got together today and had a great time. We live in the same city, easy! First of all, here's proof we actually did
On the right is Simon holding his Panasonic fsa1f, on the left is yours truly

We got together to see if we could have a closer look at the memory mapper portion of this beautiful machine. I loaded up my dev environment on this machine and got cracking. And indeed found out some interesting stuff.

The gist of it, is that non existing segment mapping can result in a read-only mode (let's say ROM). The machine has main RAM in slots 3,0. That slot combo should never show ROM stuff, to start with.

I've been digging a bit and looked at the listings provided here earlier. We have to keep in mind, there's a difference in recognizing RAM and counting memory mapper segments. The first listing by Retrofan looks if a segment is RAM, the second by GFX counts segments.

A memory mapper works like this (*or should):
Mapping a RAM segment to a page (any) results in changing of RAM. It's a shadow RAM if you like. A segment is 16KB, so a machine with 128KB has 8 of them memory mapper segments. In that case, segments 0-7. You can access any of these segment by selecting the segment number on ports #FF (page 3), #FE (p2), #FD (p1), or #FC (p0). For example in BASIC, OUT(&HFE),3 will set memory mapper segment 3 on page 2 (#8000-#BFFF).

Here's the thing, when you set a segment higher than the max (in this case 7), say 8, it rotates and starts with segment 0 again. So segment 8 would be equal to segment 0, segment 9 = 1, etc. To count the memory mappers segments, we make use of that by checking segment 0 when writing to another segment. Say for example we write "1" to segment 8, then this actually writes to segment 0. If we encounter this, we know the segment count was reset. If we count the times we don't get the written value in segment 0, we know how many segment there are. That's what GFX his BASIC listing does, that's what I do too. We need to have the page set up to RAM beforehand, ofcourse.

Now, checking if a piece of memory (a page) is RAM is another matter. In that case, we write a value and read it back. If the read value differs from what we've written, it is not RAM. Simple.

So, back to the fsa1f machine.
This one has 128K, segment 0-7. But, when selecting segment 8 (which should be segment 0 again), it instead puts some ROM on the slots. Not expected behavior, for a memory mapper slot combo.
After some more checking, here's what I found on this 128K machine, setting memory mapper values:

0-7: RAM (mapper segments 0-7)
8-31: ROM
32-40 RAM (mapper segments 0-7)
41-63: ROM
etc

OR, 8 slots of RAM followed by 24 slots of ROM.
This is also the reason why a memory mapper counter will see 512 K. Because OUT #FE,32will result in segment 0 again (for the first time). The memory mapper checker will see the checksum value being written in segment 0 and knows the memory mapper cycle was reset, and counted 32vsegments. 32*16=512K

So, why did that listing Retrofan posted work? Well, because it checks for RAM and because segment 8 shows ROM it knows that there's just 8 pieces of 16K of RAM. This wil ONLY work on a machine that has this phenomena. Funny detail, on a turbo R in DRAM mode this will work too since the last four mappers are set in "ROM" mode then. But on any other machine it won't. So this basic listing was specially written for the ASF1 (check the link to see it was).

My conclusion: the machine has faulty behavior with memory mapper segment selection. Or, in other words, a hardware issue.

Can we work with that? Yes, in fact we can by combining the two search functions. So, during segment check we also need to check if it is actually RAM. In that case, all's fine.

I'll whip up a test case and send it to Simon later to test that theory.

By Briqunullus

Hero (567)

Briqunullus's picture

23-09-2022, 19:56

TLDR, The machine has a 512k mapper of which only 128k are used. The other 384k is unconnected. Which does behave the same as rom, but doesn't contain useful data. Great research.

Page 5/8
1 | 2 | 3 | 4 | | 6 | 7 | 8