Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

mem.c File Reference


Detailed Description

Memory management is done in this file. It controls shared acces to the memory structure via the CRITICAL_SECTION synchronization primitive. In trouble you can also uncomment the define DEBUG directive. It will create an out.txt file in which all accesses into memory will be written (except 0xA000 - 0xD000, but you can comment this)

Definition in file mem.c.#include "mem.h"
#include <memory.h>
#include <windows.h>
#include <stdio.h>

Go to the source code of this file.

Functions

unsigned char memgetb (UINT adr)
 memory reading function

void memsetb (UINT adr, unsigned char bset)
 memory writing function

void InitMem ()
 Zeroes memio and initializes CSMemory.

void SetIOFunc (pIOFunc piof, UINT loadr, UINT hiadr)
 Binds given io function to range of adresses.

void SetMemory (char *buf)
 Fills memory with given data.


Variables

unsigned char memory [MEMSIZE+4]
 Variable containing accessible memory +4 as pillow.

pIOFunc memio [IOHI-IOLO+1]
 IO part of memory.

CRITICAL_SECTION CSMemory
 A synchronization primitive used for shared acces to memory.


Function Documentation

void InitMem  
 

Zeroes memio and initializes CSMemory.

Definition at line 97 of file mem.c.

unsigned char memgetb UINT    adr
 

memory reading function

Calls iofunc when neccesary

See also:
memsetb

Definition at line 32 of file mem.c.

void memsetb UINT    adr,
unsigned char    byte
 

memory writing function

Calls iofunc when neccesary

See also:
memgetb

Definition at line 73 of file mem.c.

void SetIOFunc pIOFunc    piof,
UINT    loadr,
UINT    hiadr
 

Binds given io function to range of adresses.

Parameters:
piof  An io function which should service reading and writing to these adresses
loadr  Lower end of the range demanded
hiadr  Higher end of the range demanded

Definition at line 109 of file mem.c.

void SetMemory char *    buf
 

Fills memory with given data.

Definition at line 117 of file mem.c.


Variable Documentation

CRITICAL_SECTION CSMemory
 

A synchronization primitive used for shared acces to memory.

Definition at line 30 of file mem.c.

pIOFunc memio[IOHI - IOLO + 1]
 

IO part of memory.

Containins pointers to io functions of devices mapped into the io part of memory.

See also:
iofunc

Definition at line 28 of file mem.c.

unsigned char memory[MEMSIZE + 4]
 

Variable containing accessible memory +4 as pillow.

Definition at line 27 of file mem.c.


Generated on Fri Sep 6 18:32:15 2002 for Emu6502 by doxygen1.2.17