Mercurial > vba-clojure
diff src/gb/gbMemory.h @ 1:f9f4f1b99eed
importing src directory
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Mar 2012 10:31:27 -0600 |
parents | |
children |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/gb/gbMemory.h Sat Mar 03 10:31:27 2012 -0600 1.3 @@ -0,0 +1,142 @@ 1.4 +#ifndef VBA_GB_MEMORY_H 1.5 +#define VBA_GB_MEMORY_H 1.6 + 1.7 +#if _MSC_VER > 1000 1.8 +#pragma once 1.9 +#endif // _MSC_VER > 1000 1.10 + 1.11 +#include "../Port.h" 1.12 + 1.13 +struct mapperMBC1 1.14 +{ 1.15 + int32 mapperRAMEnable; 1.16 + int32 mapperROMBank; 1.17 + int32 mapperRAMBank; 1.18 + int32 mapperMemoryModel; 1.19 + int32 mapperROMHighAddress; 1.20 + int32 mapperRAMAddress; 1.21 +}; 1.22 + 1.23 +struct mapperMBC2 1.24 +{ 1.25 + int32 mapperRAMEnable; 1.26 + int32 mapperROMBank; 1.27 +}; 1.28 + 1.29 +struct mapperMBC3 1.30 +{ 1.31 + int32 mapperRAMEnable; 1.32 + int32 mapperROMBank; 1.33 + int32 mapperRAMBank; 1.34 + int32 mapperRAMAddress; 1.35 + int32 mapperClockLatch; 1.36 + int32 mapperClockRegister; 1.37 + int32 mapperSeconds; 1.38 + int32 mapperMinutes; 1.39 + int32 mapperHours; 1.40 + int32 mapperDays; 1.41 + int32 mapperControl; 1.42 + int32 mapperLSeconds; 1.43 + int32 mapperLMinutes; 1.44 + int32 mapperLHours; 1.45 + int32 mapperLDays; 1.46 + int32 mapperLControl; 1.47 + //time_t mapperLastTime; 1.48 + u32 mapperLastTime; 1.49 +}; 1.50 + 1.51 +struct mapperMBC5 1.52 +{ 1.53 + int32 mapperRAMEnable; 1.54 + int32 mapperROMBank; 1.55 + int32 mapperRAMBank; 1.56 + int32 mapperROMHighAddress; 1.57 + int32 mapperRAMAddress; 1.58 + int32 isRumbleCartridge; 1.59 +}; 1.60 + 1.61 +struct mapperMBC7 1.62 +{ 1.63 + int32 mapperRAMEnable; 1.64 + int32 mapperROMBank; 1.65 + int32 mapperRAMBank; 1.66 + int32 mapperRAMAddress; 1.67 + int32 cs; 1.68 + int32 sk; 1.69 + int32 state; 1.70 + int32 buffer; 1.71 + int32 idle; 1.72 + int32 count; 1.73 + int32 code; 1.74 + int32 address; 1.75 + int32 writeEnable; 1.76 + int32 value; 1.77 +}; 1.78 + 1.79 +struct mapperHuC1 1.80 +{ 1.81 + int32 mapperRAMEnable; 1.82 + int32 mapperROMBank; 1.83 + int32 mapperRAMBank; 1.84 + int32 mapperMemoryModel; 1.85 + int32 mapperROMHighAddress; 1.86 + int32 mapperRAMAddress; 1.87 +}; 1.88 + 1.89 +struct mapperHuC3 1.90 +{ 1.91 + int32 mapperRAMEnable; 1.92 + int32 mapperROMBank; 1.93 + int32 mapperRAMBank; 1.94 + int32 mapperRAMAddress; 1.95 + int32 mapperAddress; 1.96 + int32 mapperRAMFlag; 1.97 + int32 mapperRAMValue; 1.98 + int32 mapperRegister1; 1.99 + int32 mapperRegister2; 1.100 + int32 mapperRegister3; 1.101 + int32 mapperRegister4; 1.102 + int32 mapperRegister5; 1.103 + int32 mapperRegister6; 1.104 + int32 mapperRegister7; 1.105 + int32 mapperRegister8; 1.106 +}; 1.107 + 1.108 +extern mapperMBC1 gbDataMBC1; 1.109 +extern mapperMBC2 gbDataMBC2; 1.110 +extern mapperMBC3 gbDataMBC3; 1.111 +extern mapperMBC5 gbDataMBC5; 1.112 +extern mapperHuC1 gbDataHuC1; 1.113 +extern mapperHuC3 gbDataHuC3; 1.114 + 1.115 +void mapperMBC1ROM(u16, u8); 1.116 +void mapperMBC1RAM(u16, u8); 1.117 +void mapperMBC2ROM(u16, u8); 1.118 +void mapperMBC2RAM(u16, u8); 1.119 +void mapperMBC3ROM(u16, u8); 1.120 +void mapperMBC3RAM(u16, u8); 1.121 +u8 mapperMBC3ReadRAM(u16); 1.122 +void mapperMBC5ROM(u16, u8); 1.123 +void mapperMBC5RAM(u16, u8); 1.124 +void mapperMBC7ROM(u16, u8); 1.125 +void mapperMBC7RAM(u16, u8); 1.126 +u8 mapperMBC7ReadRAM(u16); 1.127 +void mapperHuC1ROM(u16, u8); 1.128 +void mapperHuC1RAM(u16, u8); 1.129 +void mapperHuC3ROM(u16, u8); 1.130 +void mapperHuC3RAM(u16, u8); 1.131 +u8 mapperHuC3ReadRAM(u16); 1.132 + 1.133 +//extern void (*mapper)(u16,u8); 1.134 +//extern void (*mapperRAM)(u16,u8); 1.135 +//extern u8 (*mapperReadRAM)(u16); 1.136 + 1.137 +extern void memoryUpdateMapMBC1(); 1.138 +extern void memoryUpdateMapMBC2(); 1.139 +extern void memoryUpdateMapMBC3(); 1.140 +extern void memoryUpdateMapMBC5(); 1.141 +extern void memoryUpdateMapMBC7(); 1.142 +extern void memoryUpdateMapHuC1(); 1.143 +extern void memoryUpdateMapHuC3(); 1.144 + 1.145 +#endif // VBA_GB_MEMORY