File: Bank_ROM.h

package info (click to toggle)
pose 3.0a3-3
  • links: PTS
  • area: contrib
  • in suites: potato
  • size: 15,500 kB
  • ctags: 20,548
  • sloc: ansic: 72,579; cpp: 50,198; perl: 1,336; python: 1,242; sh: 363; makefile: 290
file content (71 lines) | stat: -rw-r--r-- 2,510 bytes parent folder | download
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
/* -*- mode: C++; tab-width: 4 -*- */
/* ================================================================================== */
/* Copyright (c) 1998-1999 3Com Corporation or its subsidiaries. All rights reserved. */
/* ================================================================================== */

#ifndef _BANK_ROM_H_
#define _BANK_ROM_H_

class StreamHandle;
class SessionFile;

const uae_u32	kROMMemoryStart = 0x10C00000;

class ROMBank
{
	public:
		static void				Initialize		(StreamHandle& hROM);
		static void				Reset			(void);
		static void				Save			(SessionFile&);
		static void				Load			(SessionFile&);
		static void				Dispose			(void);

		static void				SetBankHandlers	(void);

		static uae_u32			GetLong			(uaecptr iAddress);
		static uae_u32			GetWord			(uaecptr iAddress);
		static uae_u32			GetByte			(uaecptr iAddress);
		static void				SetLong			(uaecptr iAddress, uae_u32 iLongValue);
		static void				SetWord			(uaecptr iAddress, uae_u32 iWordValue);
		static void				SetByte			(uaecptr iAddress, uae_u32 iByteValue);
		static int				ValidAddress	(uaecptr iAddress, uae_u32 iSize);
		static uae_u8*			GetRealAddress	(uaecptr iAddress);
		static uae_u8*			GetMetaAddress	(uaecptr iAddress);
		static void				AddOpcodeCycles	(void);

		static uaecptr			GetMemoryStart	(void) { return kROMMemoryStart; }
		static int				IsPCInRAM		(void) { return m68k_getpc () < GetMemoryStart (); }
		static int				IsPCInROM		(void) { return m68k_getpc () >= GetMemoryStart (); }

	private:
		static void				InvalidAccess	(uaecptr iAddress, long size, Bool forRead);
		static void				LoadROM			(StreamHandle& hROM);
};


class FlashBank
{
	public:
		static void				Initialize		(void);
		static void				Reset			(void);
		static void				Save			(SessionFile&);
		static void				Load			(SessionFile&);
		static void				Dispose			(void);

		static uae_u32			GetLong			(uaecptr iAddress);
		static uae_u32			GetWord			(uaecptr iAddress);
		static uae_u32			GetByte			(uaecptr iAddress);
		static void				SetLong			(uaecptr iAddress, uae_u32 iLongValue);
		static void				SetWord			(uaecptr iAddress, uae_u32 iWordValue);
		static void				SetByte			(uaecptr iAddress, uae_u32 iByteValue);
		static int				ValidAddress	(uaecptr iAddress, uae_u32 iSize);
		static uae_u8*			GetRealAddress	(uaecptr iAddress);
		static uae_u8*			GetMetaAddress	(uaecptr iAddress);
		static void				AddOpcodeCycles	(void);

		static uaecptr			GetMemoryStart	(void) { return kROMMemoryStart; }
};


#endif /* _BANK_ROM_H_ */