Home Download Musics Developers
API Sources Tools File Format Technicals

mem68.h File Reference


Detailed Description

68k memory and IO manager header.

Author:
Benjamin Gerard <ben@sashipa.com>
Date:
1999/03/13
Id
mem68.h,v 2.2 2003/10/29 06:50:41 benjihan Exp

#include "emu68/struct68.h"

Go to the source code of this file.

Memory access flags for reg68.chk (debug mode only).

#define READ_68   1
 Memory location has been read.

#define WRITTEN_68   2
 Memory location has been written.

#define EXECUTED_68   4
 Memory location has been executed.

#define BREAKED_68   8
 Memory location has emulator-breakpoint.


Memory/IO quick access tables.

#define ISIO68(ADDR)   ((ADDR)&0x800000)
 Test for direct memory access or IO quick table access.

memrfunc68_t read_mem_jmp_l [256]
 Read long.

memrfunc68_t read_mem_jmp_w [256]
 Read word.

memrfunc68_t read_mem_jmp_b [256]
 Read byte.

memwfunc68_t write_mem_jmp_l [256]
 Write long.

memwfunc68_t write_mem_jmp_w [256]
 Write word.

memwfunc68_t write_mem_jmp_b [256]
 Write byte.


68K onboard memory access.

#define read_B(ADDR)   read_68000mem_b(ADDR)
 Read memory byte.

#define read_W(ADDR)   read_68000mem_w(ADDR)
 Read memory word.

#define read_L(ADDR)   read_68000mem_l(ADDR)
 Read memory long.

#define write_B(ADDR, VAL)   write_68000mem_b(ADDR,VAL)
 Write memory byte.

#define write_W(ADDR, VAL)   write_68000mem_w(ADDR,VAL)
 Write memory word.

#define write_L(ADDR, VAL)   write_68000mem_l(ADDR,VAL)
 Write memory long.

u32 read_68000mem_b (u32 addr)
 Read memory byte.

u32 read_68000mem_w (u32 addr)
 Read memory word.

u32 read_68000mem_l (u32 addr)
 Read memory long.

void write_68000mem_b (u32 addr, u32 v)
 Write memory byte.

void write_68000mem_w (u32 addr, u32 v)
 Write memory word.

void write_68000mem_l (u32 addr, u32 v)
 Write memory long.


Instruction read.

s32 get_nextw (void)
 Decode word and update PC.

s32 get_nextl (void)
 Decode long and update PC.


Stack access.

void pushl (s32 v)
 Push long.

void pushw (s32 v)
 Push word.

s32 popl (void)
 Pop long.

s32 popw (void)
 Pop word.


Functions

void EMU68memory_init (void)
 Init memory quick access table.

void EMU68memory_reset (void)
 Reset memory quick access table.

void EMU68memory_new_area (u8 area, memrfunc68_t *read_bwl, memwfunc68_t *write_bwl)
 Add a new memory access control area (for new IO).

void EMU68memory_reset_area (u8 area)
 Reset memory access control area to default state.