SASC
DVBSoftCAM

cMapRom Class Reference

#include <cpu.h>

Inheritance diagram for cMapRom:

List of all members.

Public Member Functions

 cMapRom (unsigned short Offset, const char *Filename, int InFileOffset=0)
virtual ~cMapRom ()
virtual unsigned char Get (unsigned short ea)
virtual void Set (unsigned short ea, unsigned char val)
virtual bool IsFine (void)
 cMapRom (unsigned short Offset, const char *Filename, int InFileOffset=0)
virtual ~cMapRom ()
virtual unsigned char Get (unsigned short ea)
virtual void Set (unsigned short ea, unsigned char val)
virtual bool IsFine (void)

Detailed Description

Definition at line 59 of file cpu.h.


Constructor & Destructor Documentation

cMapRom::cMapRom ( unsigned short  Offset,
const char *  Filename,
int  InFileOffset = 0 
)

Definition at line 64 of file cpu.c.

References cFileMap::Addr(), FILEMAP_DOMAIN, filemaps, cFileMaps::GetFileMap(), L_SYS_EMU, cFileMap::Map(), PRINTF, and cFileMap::Size().

{
  offset=Offset; addr=0;
  fm=filemaps.GetFileMap(Filename,FILEMAP_DOMAIN,false);
  if(fm && fm->Map()) {
    addr=fm->Addr()+InFileOffset;
    size=fm->Size()-InFileOffset;
    PRINTF(L_SYS_EMU,"maprom: new map off=%04x size=%04x",offset,size);
    }
}
cMapRom::~cMapRom ( ) [virtual]

Definition at line 75 of file cpu.c.

References cFileMap::Unmap().

{
  if(fm) fm->Unmap();
}
cMapRom::cMapRom ( unsigned short  Offset,
const char *  Filename,
int  InFileOffset = 0 
)
virtual cMapRom::~cMapRom ( ) [virtual]

Member Function Documentation

unsigned char cMapRom::Get ( unsigned short  ea) [virtual]

Implements cMap.

Definition at line 85 of file cpu.c.

{
  return (ea>=offset && ea<offset+size) ? addr[ea-offset] : 0;
}
virtual unsigned char cMapRom::Get ( unsigned short  ea) [virtual]

Implements cMap.

virtual bool cMapRom::IsFine ( void  ) [virtual]

Implements cMap.

bool cMapRom::IsFine ( void  ) [virtual]

Implements cMap.

Definition at line 80 of file cpu.c.

{
  return addr!=0 && size>0;
}
void cMapRom::Set ( unsigned short  ea,
unsigned char  val 
) [virtual]

Implements cMap.

Definition at line 90 of file cpu.c.

References LOGLBPUT.

{
  if(ea>=offset && ea<offset+size) LOGLBPUT("[ROM] ");
  // this is a ROM!
}
virtual void cMapRom::Set ( unsigned short  ea,
unsigned char  val 
) [virtual]

Implements cMap.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines