Stack trace: #0: line: if (unlikely(__pyx_get_slice_count(memview) <= 0)) context: static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno) { int last_time; struct __pyx_memoryview_obj *memview = memslice->memview; if (unlikely(!memview || (PyObject *) memview == Py_None)) { memslice->memview = NULL; return; } if (unlikely(__pyx_get_slice_count(memview) <= 0)) __pyx_fatalerror("Acquisition count is %d (line %d)", __pyx_get_slice_count(memview), lineno); last_time = __pyx_sub_acquisition_count(memview) == 1; memslice->data = NULL; if (unlikely(last_time)) { if (have_gil) { Py_CLEAR(memslice->memview); } else { PyGILState_STATE _gilstate = PyGILState_Ensure(); Py_CLEAR(memslice->memview); PyGILState_Release(_gilstate); } } else { memslice->memview = NULL; } } #1 line: __PYX_XDEC_MEMVIEW(&__pyx_v_tilecache, 1); context: /* "pyboy/core/lcd.py":936 * else: * self.update_tilecache0(lcd, bt, vbank) * tilecache = self._tilecache0 # <<<<<<<<<<<<<< * * if b_horiflip: */ if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_tilecache0"); __PYX_ERR(0, 936, __pyx_L1_error) } if (unlikely(!__pyx_v_self->__pyx_base._tilecache0.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 936, __pyx_L1_error)} __pyx_t_13 = __pyx_v_self->__pyx_base._tilecache0; __PYX_INC_MEMVIEW(&__pyx_t_13, 1); __PYX_XDEC_MEMVIEW(&__pyx_v_tilecache, 1); __pyx_v_tilecache = __pyx_t_13; __pyx_t_13.memview = NULL; __pyx_t_13.data = NULL; } __pyx_L8:; #2 line: (void)(((struct __pyx_vtabstruct_5pyboy_4core_3lcd_CGBRenderer *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.scanline_background(((struct context: /* "pyboy/core/lcd.py":966 * else: # background_enable doesn't exist for CGB. It works as master priority instead * # No window * self.scanline_background(y, x, bx, by, COLS, lcd) # <<<<<<<<<<<<<< * * if y == 143: */ /*else*/ { if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "scanline_background"); __PYX_ERR(0, 966, __pyx_L1_error) } (void)(((struct __pyx_vtabstruct_5pyboy_4core_3lcd_CGBRenderer *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.scanline_background(((struct __pyx_obj_5pyboy_4core_3lcd_Renderer *)__pyx_v_self), __pyx_v_y, __pyx_v_x, __pyx_v_bx, __pyx_v_by, __pyx_v_5pyboy_4core_3lcd_COLS, __pyx_v_lcd)); } __pyx_L4:; #3 line: ((struct __pyx_vtabstruct_5pyboy_4core_3lcd_Renderer *)__pyx_v_self->renderer->__pyx_vtab)->scanline(__pyx_v_self->renderer, __pyx_v_self, context: /* "pyboy/core/lcd.py":206 * self._scanlineparameters[self.LY][4] = self._LCDC.tiledata_select * * self.renderer.scanline(self, self.LY) # <<<<<<<<<<<<<< * self.renderer.scanline_sprites( * self, self.LY, self.renderer._screenbuffer, self.renderer._screenbuffer_attributes, False */ if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "renderer"); __PYX_ERR(0, 206, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_self->renderer) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "scanline"); __PYX_ERR(0, 206, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "LY"); __PYX_ERR(0, 206, __pyx_L1_error) } ((struct __pyx_vtabstruct_5pyboy_4core_3lcd_Renderer *)__pyx_v_self->renderer->__pyx_vtab)->scanline(__pyx_v_self->renderer, __pyx_v_self, __pyx_v_self->LY); #4 line: __pyx_v_lcd_interrupt = ((struct __pyx_vtabstruct_5pyboy_4core_3lcd_LCD *)__pyx_v_self->lcd->__pyx_vtab)->tick(__pyx_v_self->lcd, __pyx_v_self->cpu->cycles); context: /* "pyboy/core/mb.py":418 * return self.sound.get(i - 0xFF10) * elif 0xFF40 <= i <= 0xFF4B: * lcd_interrupt = self.lcd.tick(self.cpu.cycles) # <<<<<<<<<<<<<< * if lcd_interrupt: * self.cpu.set_interruptflag(lcd_interrupt) */ if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "lcd"); __PYX_ERR(0, 418, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_self->lcd) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "tick"); __PYX_ERR(0, 418, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "cpu"); __PYX_ERR(0, 418, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_self->cpu) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "cycles"); __PYX_ERR(0, 418, __pyx_L1_error) } __pyx_v_lcd_interrupt = ((struct __pyx_vtabstruct_5pyboy_4core_3lcd_LCD *)__pyx_v_self->lcd->__pyx_vtab)->tick(__pyx_v_self->lcd, __pyx_v_self->cpu->cycles); #5 #9 line: (void)(((struct __pyx_vtabstruct_5pyboy_4core_3cpu_CPU *)__pyx_v_self->cpu->__pyx_vtab)->tick(__pyx_v_self->cpu, __pyx_v_cycles_target)); context: /* "pyboy/core/mb.py":336 * if self.breakpoint_singlestep: * cycles_target = 4 * self.cpu.tick(cycles_target) # <<<<<<<<<<<<<< * * # TODO: Support General Purpose DMA */ if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "cpu"); __PYX_ERR(0, 336, __pyx_L1_error) } if (unlikely(((PyObject *)__pyx_v_self->cpu) == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "tick"); __PYX_ERR(0, 336, __pyx_L1_error) } (void)(((struct __pyx_vtabstruct_5pyboy_4core_3cpu_CPU *)__pyx_v_self->cpu->__pyx_vtab)->tick(__pyx_v_self->cpu, __pyx_v_cycles_target)); } __pyx_L5:;