File: EmRegsVZPalmM505.cpp

package info (click to toggle)
pose 3.5-1
  • links: PTS
  • area: contrib
  • in suites: woody
  • size: 13,108 kB
  • ctags: 29,485
  • sloc: cpp: 93,990; ansic: 62,838; sh: 1,970; perl: 1,891; python: 1,242; makefile: 616
file content (151 lines) | stat: -rw-r--r-- 4,546 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/* -*- mode: C++; tab-width: 4 -*- */
/* ===================================================================== *\
	Copyright (c) 2000-2001 Palm, Inc. or its subsidiaries.
	All rights reserved.

	This file is part of the Palm OS Emulator.

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.
\* ===================================================================== */

#include "EmCommon.h"
#include "EmRegsVZPalmM505.h"
#include "EmRegsVZPrv.h"

#include "EmBankRegs.h"			// EmBankRegs::DisableSubBank
#include "EmRegsSED1376.h"		// sed1376RegsAddr


// ---------------------------------------------------------------------------
//		 EmRegsVZPalmM505::EmRegsVZPalmM505
// ---------------------------------------------------------------------------

EmRegsVZPalmM505::EmRegsVZPalmM505 (void) :
	EmRegsVZPalmM500 ()
{
}


// ---------------------------------------------------------------------------
//		 EmRegsVZPalmM505::~EmRegsVZPalmM505
// ---------------------------------------------------------------------------

EmRegsVZPalmM505::~EmRegsVZPalmM505 (void)
{
}


// ---------------------------------------------------------------------------
//		 EmRegsVZPalmM505::SetSubBankHandlers
// ---------------------------------------------------------------------------

void EmRegsVZPalmM505::SetSubBankHandlers (void)
{
	// Install base handlers.

	EmRegsVZ::SetSubBankHandlers ();

	// Now add standard/specialized handers for the defined registers.

	this->SetHandler ((ReadFunction) &EmRegsVZ::StdRead,
		(WriteFunction) &EmRegsVZPalmM505::portFSelectWrite,
		addressof (portFSelect), sizeof (f68VZ328Regs.portFSelect));
}


// ---------------------------------------------------------------------------
//		 EmRegsVZ::portFSelectWrite
// ---------------------------------------------------------------------------

void EmRegsVZPalmM505::portFSelectWrite (emuptr address, int size, uint32 value)
{
	uint8	oldPortFSelect = READ_REGISTER (portFSelect);

	// Do a standard update of the register.

	EmRegsVZ::StdWrite (address, size, value);

	uint8	portFSelect = READ_REGISTER (portFSelect);

#define	hwrVZPortFBusClock				0x04		// (P) Bus Clock

	if (((portFSelect ^ oldPortFSelect) & hwrVZPortFBusClock) != 0)
	{
		if ((portFSelect & hwrVZPortFBusClock) != 0)
		{
			EmBankRegs::DisableSubBank (sed1376RegsAddr);
			EmBankRegs::DisableSubBank (sed1376VideoMemStart);
		}
		else
		{
			EmBankRegs::EnableSubBank (sed1376RegsAddr);
			EmBankRegs::EnableSubBank (sed1376VideoMemStart);
		}
	}
}


// ---------------------------------------------------------------------------
//		 EmRegsVZPalmM505::GetLCDScreenOn
// ---------------------------------------------------------------------------

Bool EmRegsVZPalmM505::GetLCDScreenOn (void)
{
	// Override the Dragonball version and let the SED 1376 handle it.

	return EmHALHandler::GetLCDScreenOn ();
}


// ---------------------------------------------------------------------------
//		 EmRegsVZPalmM505::GetLCDBacklightOn
// ---------------------------------------------------------------------------

Bool EmRegsVZPalmM505::GetLCDBacklightOn (void)
{
	// Override the Dragonball version and let the SED 1376 handle it.

	return EmHALHandler::GetLCDBacklightOn ();
}


// ---------------------------------------------------------------------------
//		 EmRegsVZPalmM505::GetLCDHasFrame
// ---------------------------------------------------------------------------

Bool EmRegsVZPalmM505::GetLCDHasFrame (void)
{
	// Override the Dragonball version and let the SED 1376 handle it.

	return EmHALHandler::GetLCDHasFrame ();
}


// ---------------------------------------------------------------------------
//		 EmRegsVZPalmM505::GetLCDBeginEnd
// ---------------------------------------------------------------------------

void EmRegsVZPalmM505::GetLCDBeginEnd (emuptr& begin, emuptr& end)
{
	// Override the Dragonball version and let the SED 1376 handle it.

	EmHALHandler::GetLCDBeginEnd (begin, end);
}


// ---------------------------------------------------------------------------
//		 EmRegsVZPalmM505::GetLCDScanlines
// ---------------------------------------------------------------------------

void EmRegsVZPalmM505::GetLCDScanlines (EmScreenUpdateInfo& info)
{
	// Override the Dragonball version and let the SED 1376 handle it.

	EmHALHandler::GetLCDScanlines (info);
}