cscg22-gearboy

CSCG 2022 Challenge 'Gearboy'
git clone https://git.sinitax.com/sinitax/cscg22-gearboy
Log | Files | Refs | sfeed.txt

common.h (972B)


      1
      2#ifndef _COMMON_H
      3#define _COMMON_H
      4
      5enum {
      6    MBC_TYPE_NONE = 0,
      7    MBC_TYPE_MBC1 = 1,
      8    MBC_TYPE_MBC2 = 2,
      9    MBC_TYPE_MBC3 = 3,
     10    /* MBC4 doesn't exist */
     11    MBC_TYPE_MBC5 = 5,
     12
     13    MBC_TYPE_MIN = MBC_TYPE_MBC1,
     14    MBC_TYPE_MAX = MBC_TYPE_MBC5,
     15    MBC_TYPE_DEFAULT =  MBC_TYPE_NONE
     16};
     17
     18#define MAX_FILE_STR 2048
     19
     20#define BANK_NUM_UNASSIGNED   0xFFFFU
     21#define BANK_NUM_AUTO         255
     22#define BANK_NUM_ROM_MIN      1
     23#define BANK_NUM_ROM_MAX      255
     24#define BANK_ROM_TOTAL        256 // Banks 0-255
     25#define BANK_ROM_CALC_MAX     512 // Banks 0-512 (>256 not supported for auto-banking right now)
     26#define BANK_SIZE_ROM         0x4000U
     27
     28#define BANK_ITEM_COUNT_MAX 0xFFFF
     29
     30#define BANK_NUM_ROM_MAX_MBC1  127
     31#define BANK_NUM_ROM_MAX_MBC2  15
     32#define BANK_NUM_ROM_MAX_MBC3  127
     33#define BANK_NUM_ROM_MAX_MBC5  255 // 511 // TODO: support full MBC5 address range (currently 8 bit only)
     34
     35#define STRINGIFY(x) #x
     36#define TOSTR(x) STRINGIFY(x)
     37
     38#endif // _COMMON_H