-
Notifications
You must be signed in to change notification settings - Fork 0
/
flash.h
37 lines (28 loc) · 1.45 KB
/
flash.h
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
//---------------------------------------------------------------------------
// 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. See also the license.txt file for
// additional informations.
//---------------------------------------------------------------------------
//
// Flash chip emulation by Flavor
// with ideas from Koyote (who originally got ideas from Flavor :)
// for emulation of NGPC carts
//
#define NO_COMMAND 0x00
#define COMMAND_BYTE_PROGRAM 0xA0
#define COMMAND_BLOCK_ERASE 0x30
#define COMMAND_CHIP_ERASE 0x10
#define COMMAND_INFO_READ 0x90
extern unsigned char currentCommand;//what command are we currently on (if any)
void flashChipWrite(unsigned long addr, unsigned char data);
void vectFlashWrite(unsigned char chip, unsigned int to, unsigned char *fromAddr, unsigned int numBytes);
void vectFlashErase(unsigned char chip, unsigned char blockNum);
void vectFlashChipErase(unsigned char chip);
void setFlashSize(unsigned long romSize);
void flashShutdown();
unsigned char flashReadInfo(unsigned long addr);
extern unsigned char needToWriteFile;
void writeSaveGameFile();
#define WRITE_SAVEGAME_IF_DIRTY if(needToWriteFile) writeSaveGameFile();//we found a dirty one, so write the file