~ubuntu-branches/ubuntu/trusty/vice/trusty

« back to all changes in this revision

Viewing changes to src/h6809regs.h

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2013-07-28 20:38:23 UTC
  • mfrom: (1.1.10) (9.2.7 sid)
  • Revision ID: package-import@ubuntu.com-20130728203823-1h8s6bcv22oundul
Tags: 2.4.dfsg-1
* New upstream release (closes: #693065, #693641).
* Drop vice-ffmpeg.patch , applied upstream.
* Disable architecture specific compilation (closes: #686400, #714136).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * h6809regs.h
 
3
 *
 
4
 * Written by
 
5
 *  Olaf Seibert <rhialto@falu.nl>
 
6
 *
 
7
 * This file is part of VICE, the Versatile Commodore Emulator.
 
8
 * See README for copyright notice.
 
9
 *
 
10
 *  This program is free software; you can redistribute it and/or modify
 
11
 *  it under the terms of the GNU General Public License as published by
 
12
 *  the Free Software Foundation; either version 2 of the License, or
 
13
 *  (at your option) any later version.
 
14
 *
 
15
 *  This program is distributed in the hope that it will be useful,
 
16
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
 *  GNU General Public License for more details.
 
19
 *
 
20
 *  You should have received a copy of the GNU General Public License
 
21
 *  along with this program; if not, write to the Free Software
 
22
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
23
 *  02111-1307  USA.
 
24
 *
 
25
 */
 
26
 
 
27
#ifndef VICE_H6809REGS_H
 
28
#define VICE_H6809REGS_H
 
29
 
 
30
#include "types.h"
 
31
 
 
32
typedef struct h6809_regs_s {
 
33
    WORD reg_x;
 
34
    WORD reg_y;
 
35
    WORD reg_u;
 
36
    WORD reg_s;
 
37
    WORD reg_pc;
 
38
    BYTE reg_dp;
 
39
    BYTE reg_cc;
 
40
    BYTE reg_a;
 
41
    BYTE reg_b;
 
42
} h6809_regs_t;
 
43
 
 
44
extern h6809_regs_t h6809_regs;
 
45
 
 
46
#define H6809_REGS_GET_X(reg_ptr)  ((reg_ptr)->reg_x)
 
47
#define H6809_REGS_GET_Y(reg_ptr)  ((reg_ptr)->reg_y)
 
48
#define H6809_REGS_GET_U(reg_ptr)  ((reg_ptr)->reg_u)
 
49
#define H6809_REGS_GET_S(reg_ptr)  ((reg_ptr)->reg_s)
 
50
#define H6809_REGS_GET_PC(reg_ptr) ((reg_ptr)->reg_pc)
 
51
#define H6809_REGS_GET_DP(reg_ptr) ((reg_ptr)->reg_dp)
 
52
#define H6809_REGS_GET_CC(reg_ptr) ((reg_ptr)->reg_cc)
 
53
#define H6809_REGS_GET_A(reg_ptr)  ((reg_ptr)->reg_a)
 
54
#define H6809_REGS_GET_B(reg_ptr)  ((reg_ptr)->reg_b)
 
55
#define H6809_REGS_GET_D(reg_ptr)  (((reg_ptr)->reg_a << 8) | (reg_ptr)->reg_b)
 
56
 
 
57
#define H6809_REGS_TEST_E(reg_ptr) ((reg_ptr)->reg_cc & 0x80)
 
58
#define H6809_REGS_TEST_F(reg_ptr) ((reg_ptr)->reg_cc & 0x40)
 
59
#define H6809_REGS_TEST_H(reg_ptr) ((reg_ptr)->reg_cc & 0x20)
 
60
#define H6809_REGS_TEST_I(reg_ptr) ((reg_ptr)->reg_cc & 0x10)
 
61
#define H6809_REGS_TEST_N(reg_ptr) ((reg_ptr)->reg_cc & 0x08)
 
62
#define H6809_REGS_TEST_Z(reg_ptr) ((reg_ptr)->reg_cc & 0x04)
 
63
#define H6809_REGS_TEST_V(reg_ptr) ((reg_ptr)->reg_cc & 0x02)
 
64
#define H6809_REGS_TEST_C(reg_ptr) ((reg_ptr)->reg_cc & 0x01)
 
65
 
 
66
#define H6809_REGS_SET_X(reg_ptr, val)  ((reg_ptr)->reg_x  = (val))
 
67
#define H6809_REGS_SET_Y(reg_ptr, val)  ((reg_ptr)->reg_y  = (val))
 
68
#define H6809_REGS_SET_U(reg_ptr, val)  ((reg_ptr)->reg_u  = (val))
 
69
#define H6809_REGS_SET_S(reg_ptr, val)  ((reg_ptr)->reg_s  = (val))
 
70
#define H6809_REGS_SET_PC(reg_ptr, val) ((reg_ptr)->reg_pc = (val))
 
71
#define H6809_REGS_SET_DP(reg_ptr, val) ((reg_ptr)->reg_dp = (val))
 
72
#define H6809_REGS_SET_CC(reg_ptr, val) ((reg_ptr)->reg_cc = (val))
 
73
#define H6809_REGS_SET_A(reg_ptr, val)  ((reg_ptr)->reg_a  = (val))
 
74
#define H6809_REGS_SET_B(reg_ptr, val)  ((reg_ptr)->reg_b  = (val))
 
75
#define H6809_REGS_SET_D(reg_ptr, val)  do { \
 
76
                                        (reg_ptr)->reg_a  = ((val) >> 8); \
 
77
                                        (reg_ptr)->reg_b = (val) & 0xFF;  \
 
78
                                        } while (0);
 
79
 
 
80
#endif
 
81