22# distutils: libraries = gambatte
33# cython: language_level=3
44
5+ from enum import IntFlag
56from libcpp.string cimport string
67from libc.stdint cimport uint32_t, int16_t
78from _libgambatte cimport GB as C_GB
89
10+ class LoadFlag (IntFlag ):
11+ CGB_MODE = 1 # Treat the ROM as having CGB support regardless of what its header advertises.
12+ GBA_FLAG = 2 # Use GBA intial CPU register values when in CGB mode.
13+ RESERVED_FLAG = 4 # Previously a multicart heuristics enable. Reserved for future use.
14+ SGB_MODE = 8 # Treat the ROM as having SGB support regardless of what its header advertises.
15+ READONLY_SAV = 16 # Prevent implicit saveSavedata calls for the ROM.
16+ NO_BIOS = 32 # Use heuristics to boot without a BIOS.
17+
918
1019cdef unsigned c_getinput(void * context) noexcept nogil:
1120 cdef unsigned int * value_ptr = < unsigned int * > context
@@ -15,12 +24,13 @@ cdef class GB:
1524 cdef C_GB c_gb
1625 cdef unsigned int c_input
1726
27+ LoadFlag = LoadFlag
28+
1829 def __cinit__ (self ):
1930 self .c_gb.setInputGetter(& c_getinput, & self .c_input)
2031
21- def load (self , str rom_file , unsigned flags = 0 ):
22- no_bios_flags = 32
23- return self .c_gb.load(rom_file.encode(), flags | no_bios_flags)
32+ def load (self , str rom_file , unsigned int flags = 0 ):
33+ return self .c_gb.load(rom_file.encode(), flags)
2434
2535 def run_for (
2636 self ,
0 commit comments