aboutsummaryrefslogtreecommitdiff
path: root/SrcShared/Hardware/EmRegsSED1376.h
blob: 62a1c565b9c7e3cf85657070daebc934627e38ef (plain)
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
/* -*- 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.
\* ===================================================================== */

#ifndef EmRegsSED1376_h
#define EmRegsSED1376_h

#include "EmHAL.h"				// EmHALHandler
#include "EmPalmStructs.h"
#include "EmRegs.h"
#include "EmStructs.h"			// RGBList

class SessionFile;
class EmScreenUpdateInfo;


#define sed1376RegsAddr			(0x1FF80000)
#define sed1376VideoMemStart	(0x1FFA0000)
#define sed1376VideoMemSize		(80 * 1024L)


class EmRegsSED1376 : public EmRegs, public EmHALHandler
{
	public:
								EmRegsSED1376				(emuptr baseRegsAddr,
															 emuptr baseVideoAddr);
		virtual					~EmRegsSED1376				(void);

			// EmRegs overrides
		virtual void			Initialize					(void);
		virtual void			Reset						(Bool hardwareReset);
		virtual void			Save						(SessionFile&);
		virtual void			Load						(SessionFile&);
		virtual void			Dispose						(void);

		virtual void			SetSubBankHandlers			(void);
		virtual uint8*			GetRealAddress				(emuptr address);
		virtual emuptr			GetAddressStart				(void);
		virtual uint32			GetAddressRange				(void);

			// EmHAL overrides
		virtual Bool			GetLCDScreenOn				(void);
		virtual Bool			GetLCDBacklightOn			(void);
		virtual Bool			GetLCDHasFrame				(void);
		virtual void			GetLCDBeginEnd				(emuptr& begin, emuptr& end) = 0;
		virtual void			GetLCDScanlines				(EmScreenUpdateInfo& info) = 0;

	private:
		uint32					powerSaveConfigurationRead	(emuptr address, int size);

		void 					invalidateWrite				(emuptr address, int size, uint32 value);
		void 					lutWriteAddressWrite		(emuptr address, int size, uint32 value);
		void 					lutReadAddressWrite			(emuptr address, int size, uint32 value);

	protected:
		void					PrvGetPalette				(RGBList& thePalette);

	protected:
		emuptr					fBaseRegsAddr;
		emuptr					fBaseVideoAddr;
		EmProxySED1376RegsType	fRegs;
		RGBType					fClutData[256];
};


class EmRegsSED1376VisorPrism : public EmRegsSED1376
{
	public:
								EmRegsSED1376VisorPrism		(emuptr baseRegsAddr,
															 emuptr baseVideoAddr);
		virtual					~EmRegsSED1376VisorPrism	(void);

		virtual void			SetSubBankHandlers			(void);

		virtual void			GetLCDBeginEnd				(emuptr& begin, emuptr& end);
		virtual void			GetLCDScanlines				(EmScreenUpdateInfo& info);

	private:
		void 					reservedWrite				(emuptr address, int size, uint32 value);

	private:
		int32					PrvGetLCDDepth				(void);
};


class EmRegsSED1376PalmGeneric : public EmRegsSED1376
{
	public:
								EmRegsSED1376PalmGeneric	(emuptr baseRegsAddr,
															 emuptr baseVideoAddr);
		virtual					~EmRegsSED1376PalmGeneric	(void);

		virtual void			GetLCDBeginEnd				(emuptr& begin, emuptr& end);
		virtual void			GetLCDScanlines				(EmScreenUpdateInfo& info);
};

#endif	/* EmRegsSED1376_h */