On Thu, 4 Mar 1999, Alwin Henseler wrote:

> Okay, just so that anyone can build this, or emulate it (oops...), 
> can you please fill in the details?

Yes, no problem. About emulation, BrMSX already emulates some Megaram
models.

> -IN xx,(8Eh) sets "write enable mode"
> -OUT (8Eh),xx  sets "block switch mode"

That's what I said!

> I suppose this can be made using a single 1-bit register, that 
> responds to access of I/O port 8Eh, and taking either read- or 
> write-signal as data input. D0-D7 lines are don't cares when 
> accessing this I/O port.

Exactly.

> -Is this a single I/O port (8Eh), or mirrored on other I/O-addresses? 
> 2? 4? 8 I/O ports?

Single I/O port (8Eh only).

> -If in "write enable mode", I suspect you can write to the current 
> selected blocks in certain memory ranges. Is this correct? Or just 
> one special block or so?

Yes, you're right. You can write to the current selected blocks.

> -What size blocks are switched? 8 KB? 16 KB? Smaller? Bigger?

Like most part of Konami Megaroms, Megaram uses 8kb blocs.

> -EXACTLY what memory ranges do these blocks occupy?

There are blocks in the area 4000h-5FFFh, 6000h-7FFFh, 8000h-9FFFh and
A000-BFFFh.

> -EXACTLY what memory ranges can be used to switch the blocks (if in 
> "block switch mode")?

Any memory position within the block can be used to switch the block. So:
        LD (4000h),A  or  LD (5FFFh),A
have exactly the same effect, when in block select mode.

Consequently, if you use:
        OUT (8Eh),A
        LD HL,00302h
        LD (9FFFh),HL
you'll select 2 blocks "simultaneously"! This trick is often used by T&E
Soft.

> (tells the hardware designer which address-bits are don't cares)

So, only the 3 highest bits of the address is used in "block select mode".

> -What block numbers are allowed (# of bits)?

Any 8-bit number! Suppose you have a 256kb Megaram. The blocks have 8kb,
then you have 32 blocks, numbered from 0 to 31. If you try to select block
32, you'll get block 0, and there's no problem.

> -How are unused bits in block numbers handled?
> Suppose you have 32 blocks (5 bit block numbers). What happens when 
> you try to access block numbers of 32 and above? Are higher blocks 
> 'empty'? Are unused bits in block numbers treated as don't cares?

This is a big story. The creator of Megaram (Ademir Carchano) had created
only the 256kb Megaram. In this model, the 3 highest bits of the block
number are simply discarded, so block 32, 64, 96, ... are exactly the same
as block 0. But other guys had copied his project, and produced Megaram
256kb, Megaram-Disk 256kb, Megaram-Disk 512kb and Megaram-Disk 768kb.

These newer Megarams were called Megaram-Disk because they have an
internal EPROM with a ramdisk software. This software is very near to a
normal disk interface ROM, but creates a new drive letter, where files are
stored directly in Megaram. So, it's a ramdisk.

The first question is: if it has a diskrom, how can the system treat it as
a disk interface? The default mode of Megaram-Disk is to not show the
Megaram contents, but show the EPROM contents in the area 4000-7FFFh.

The second question is: how can I access the RAM inside Megaram-Disk? Just
do a IN xx,(8Eh) or OUT (8Eh),xx. These commands weren't modified. And how
can I come back to "show EPROM mode"? Just do a IN xx,(8Fh) or a
OUT (8Fh),xx. Conclusion: the Megaram-Disk created a new port specific to
transform it in a disk interface simulator.

Back to your question, Megaram-Disk 768kb has 96 blocks, from 0 to 95. So,
7 bits are used, and the highest bit is discarded. But when you access
blocks from 96 to 127, what happens? That's the ugly part. Some models
discard bit 6, and it becomes equivalent to access blocks from 32 to 63.
Other models simply access no memory, putting the bus to a high impedance
state. Due to pull-up resistances present in the bus, you'll read FFh
bytes in these blocks. (why my MSX shows sometimes 7Fh instead FFh?)

The same problem happens with Megaram-Disk 512kb. There are some models
that simply discard the 2 highest bits, and other models have the blocks
from 63 to 127 accessing no memory, reading FFh again. This problem
appears to be shown by the last models of Megaram-Disk 256kb, having the
blocks from 32 to 127 accessing no memory. But the first models of
Megaram-Disk 256kb were completely equal to the "normal" Megaram 256kb,
discarding the 3 highest bits of the block number.

So, we have the following models of Megaram:
- Megaram 256kb
- Megaram-Disk 256kb
- Megaram-Disk 512kb
- Megaram-Disk 768kb

This mess happened because the first models of Megaram-Disk 256kb were a
simple extension of the "normal" Megaram 256kb (so, the 3 highest bits of
the block number were discarded). But, when the bigger Megaram-Disks were
created, they simply build a Megaram-Disk 768kb board and decided how many
memory IC's would be soldered in the board! Then, Megaram-Disk 256kb had
became a reduced RAM version of Megaram-Disk 768kb.

> -Can you read the selected block numbers back, or are these 
> write-only? (for instance: most ROM mappers: write only (mapper 
> registers, that is, not the ROM data ofcourse), normal memory mapper: 
> read & write block numbers)

Like standard Megaroms, they are write-only. When you read a byte from a
memory position in Megaram, you'll read the byte from the selected block,
whatever the current mode is "block select" or "write enable".

> -What's the power-on / reset state? Everything "don't know"? 
> Or blockswitch-mode, but currently selected blocks undefined? Or: 
> block xx in memory range yyy-zzzz, block ... in memory range .... 
> etc.?

For "normal" Megaram 256kb, everything is "don't know", and after a
software or hardware reset the selected blocks aren't changed. So, if you
load a Megarom game, and after the game be running you do a reset, the
game will be restarted.

For Megaram-Disk (of all sizes), after a software reset the state is not
changed, but after a hardware reset or a power-on, the "show EPROM mode"
is selected (because this is the way to the system recognise it as a disk
interface)

> Finally this: what software exists, that actually USES this MegaRAM?

Well, every Megarom games that is compatible with the Konami standard can
use Megaram. But also some softwares were created specially for Megaram in
Brazil. The most part of them was fast disk-copiers.

I created a very fast disk copier called SDC (Super Disk Copy) that uses
all models of Megaram, and can format and copy a 720kb disk (with normal
formatting) with no disk changes (of course you still need to remove the
source disk and put the destination disk, if you have only 1 drive)! But
you won't have it, because this software does direct access to the floppy
disk controller, and here in Brazil, the most part of the FDC's are port
based, and certainly people from Europe and Japan don't have a port based
FDC.

SDC version 1.1 can accuratedly detect the size of the Megaram connected
to the MSX. I plan to make new versions for the FDC's that your MSX uses,
but I can't find any documentation about it! If you have, or you know
where I can find, please tell me. I also plan to make versions that uses
Memory Mapper and detect the size (detecting systems with multiple
mappers, too!)

If you have more questions about Megaram or port based FDC, don't hesitate
to do it!

Greetings from Brazil!

-----------------------------------------------------------------
Marco Antonio Simon Dal Poz        http://www.lsi.usp.br/~mdalpoz
[EMAIL PROTECTED]   "Apple" (c) Copyright 1767, Sir Isaac Newton

    /"\
    \ / CAMPANHA DA FITA ASCII - CONTRA MAIL HTML
     X  ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
    / \


****
MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)
****

Reply via email to