~akheon23/pose/origin

« back to all changes in this revision

Viewing changes to SrcShared/Hardware/EmRegsEZPrv.h

  • Committer: Christopher Werkshage
  • Date: 2014-12-27 12:51:57 UTC
  • Revision ID: git-v1:cc9410eb6ec5b4e23248dc175d142202f86be8e8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: C++; tab-width: 4 -*- */
 
2
/* ===================================================================== *\
 
3
        Copyright (c) 2000-2001 Palm, Inc. or its subsidiaries.
 
4
        All rights reserved.
 
5
 
 
6
        This file is part of the Palm OS Emulator.
 
7
 
 
8
        This program is free software; you can redistribute it and/or modify
 
9
        it under the terms of the GNU General Public License as published by
 
10
        the Free Software Foundation; either version 2 of the License, or
 
11
        (at your option) any later version.
 
12
\* ===================================================================== */
 
13
 
 
14
#ifndef EmRegsEZPrv_h
 
15
#define EmRegsEZPrv_h
 
16
 
 
17
#include "EmRegsPrv.h"
 
18
 
 
19
// Location and range of registers
 
20
 
 
21
const uint32    kMemoryStart    = 0xFFFFF000;
 
22
const uint32    kMemorySize             = sizeof (HwrM68EZ328Type);
 
23
 
 
24
 
 
25
// Macro to return the DragonballEZ address of the specified register
 
26
 
 
27
#define addressof(x)    (kMemoryStart + offsetof(HwrM68EZ328Type, x))
 
28
 
 
29
 
 
30
// Macros for reading/writing DragonballEZ registers.
 
31
 
 
32
#define READ_REGISTER(reg) \
 
33
        _get_reg (&f68EZ328Regs.reg)
 
34
 
 
35
#define WRITE_REGISTER(reg, value)      \
 
36
        _put_reg (&f68EZ328Regs.reg, value)
 
37
 
 
38
 
 
39
// Macro for installing DragonballEZ register handlers
 
40
 
 
41
#define INSTALL_HANDLER(read, write, reg) \
 
42
        this->SetHandler ((ReadFunction) &EmRegsEZ::read, (WriteFunction) &EmRegsEZ::write, addressof (reg), sizeof (f68EZ328Regs.reg))
 
43
 
 
44
 
 
45
#endif  /* EmRegsEZPrv_h */