OSCR
Open Source Cartridge Reader
Loading...
Searching...
No Matches
N64.h
1#pragma once
2#if !defined(OSCR_CORE_N64_H_)
3# define OSCR_CORE_N64_H_
4
5# include "config.h"
6
7# if HAS_N64
8# include "syslibinc.h"
9# include "common/Types.h"
10
15{
16 void menu();
17 void cartMenu();
18 void menuSaveType();
19 void controllerMenu();
20
21 void openCRDB();
22 void closeCRDB();
23
24 void cartOn();
25 void cartOff();
26
27 void setupController();
28
29 inline void adOut();
30 inline void adIn();
31 inline void setAddress(uint32_t myAddress);
32
33 uint16_t readWord();
34 void writeWord(uint16_t myWord);
35
36 void sendJoyBus(uint8_t const * buffer, char length);
37 uint16_t recvJoyBus(uint8_t * output, uint8_t byte_count);
38 void get_button();
39
40 void resetController();
41 void checkController();
42 uint8_t readBlock(byte* output, uint16_t myAddress);
43 bool readMPK();
44 bool checkHeader(byte* buf);
45 bool writeMPK();
46
47 bool refreshCart();
48 bool getCartInfo();
49 void idCart();
50
51 bool readSave();
52 bool writeSave();
53
54 bool readEepromPageList(byte* output, uint8_t page_number, uint8_t page_count);
55 bool writeEeprom();
56 void resetEeprom();
57 void readEeprom();
58
59 bool readSaveData(uint32_t sramSize, bool isFlash);
60 bool verifySaveData(uint32_t maxAddress, uint16_t offset, uint16_t bufferSize, bool isFlash);
61
62 bool writeSRAM(uint32_t sramSize);
63 bool writeFRAM();
64
65 void sendFramCmd(uint32_t myCommand);
66 void initFRAM();
67
68 uint8_t waitForFram(uint8_t flashramType);
69 uint8_t getFramType();
70
71 void readRom();
72
73 uint32_t blankcheck(uint8_t flashramType);
74
75# if defined(ENABLE_CONTROLLERTEST)
76# ifdef ENABLE_SERIAL
77 void controllerTest_Serial();
78# endif /* ENABLE_SERIAL */
79
80# if ((HARDWARE_OUTPUT_TYPE == OUTPUT_OS12864) || defined(ENABLE_OLED))
81 void printSTR(String st, int x, int y);
82 void nextscreen();
83 void controllerTest_Display();
84# endif /* ENABLE_LCD || ENABLE_OLED */
85# endif /* ENABLE_CONTROLLERTEST */
86
87 void sendFlashromGamesharkCommand(uint16_t cmd);
88 bool flashGameshark();
89 void unlockGSAddressRanges();
90 bool idGameshark();
91 void resetGameshark();
92 void backupGameshark();
93 void eraseGameshark();
94 void writeGameshark();
95 uint32_t verifyGameshark();
96
97 void blankCheck();
98
99 void sendFlashromXplorerCommand(uint16_t cmd);
100 void flashXplorer();
101 bool idXplorer();
102 void resetXplorer();
103 void backupXplorer();
104 uint32_t unscramble(uint32_t addr);
105 uint32_t scramble(uint32_t addr);
106 void oddXPaddrWrite(uint32_t addr, uint16_t data);
107 void evenXPaddrWrite(uint32_t addr, uint16_t data);
108 void eraseXplorer();
109 void blankCheck_XP64();
110 void writeXplorer();
111 uint32_t verifyXplorer();
112
113# if HAS_FLASH
114 void flashRepro();
115 void sendFlashromCommand(uint32_t addr, uint8_t cmd);
116 void idFlashrom();
117
118 void resetFlashrom(uint32_t flashBase);
119 void eraseFlashrom();
120 void writeFlashrom(uint32_t sectorSize);
121
122 uint32_t verifyFlashrom();
123
124 void writeFlashBuffer(uint32_t sectorSize, uint8_t bufferSize);
125
126 void resetIntel4400();
127 void eraseIntel4400();
128 void writeIntel4400();
129
130 void resetMSP55LV100(uint32_t flashBase);
131 void eraseMSP55LV100();
132 void writeMSP55LV100(uint32_t sectorSize);
133
134 void eraseSector(uint32_t sectorSize);
135 bool blankcheckFlashrom();
136# endif /* HAS_FLASH */
137} /* namespace OSCR::Cores::N64 */
138
139# endif /* HAS_N64 */
140#endif /* OSCR_CORE_N64_H_ */
System core for the Nintendo 64.
Definition N64.h:15