pyboy 2.7.0__tar.gz → 2.7.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. {pyboy-2.7.0/pyboy.egg-info → pyboy-2.7.1}/PKG-INFO +1 -1
  2. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/__main__.py +1 -0
  3. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/bootrom.py +3 -4
  4. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/bootrom_cgb.bin +0 -0
  5. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/cpu.pxd +4 -2
  6. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/cpu.py +3 -3
  7. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/interaction.pxd +2 -0
  8. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/lcd.pxd +65 -30
  9. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/lcd.py +146 -141
  10. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/mb.pxd +7 -3
  11. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/mb.py +158 -91
  12. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/ram.pxd +1 -2
  13. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/ram.py +0 -10
  14. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/serial.pxd +5 -0
  15. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/serial.py +13 -3
  16. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/sound.pxd +5 -2
  17. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/timer.pxd +3 -0
  18. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/base_plugin.pxd +3 -5
  19. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/base_plugin.py +15 -16
  20. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/debug.pxd +1 -1
  21. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/debug.py +3 -3
  22. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/debug_prompt.pxd +0 -1
  23. pyboy-2.7.1/pyboy/plugins/debug_prompt.py +120 -0
  24. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/window_glfw.py +2 -0
  25. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/window_open_gl.py +2 -0
  26. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/window_openal.pxd +7 -1
  27. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/window_openal.py +21 -10
  28. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/window_sdl2.pxd +1 -1
  29. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/window_sdl2.py +1 -0
  30. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/pyboy.pxd +2 -0
  31. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/pyboy.py +88 -36
  32. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/utils.py +4 -2
  33. {pyboy-2.7.0 → pyboy-2.7.1/pyboy.egg-info}/PKG-INFO +1 -1
  34. {pyboy-2.7.0 → pyboy-2.7.1}/pyproject.toml +1 -1
  35. pyboy-2.7.0/pyboy/plugins/debug_prompt.py +0 -117
  36. {pyboy-2.7.0 → pyboy-2.7.1}/LICENSE.md +0 -0
  37. {pyboy-2.7.0 → pyboy-2.7.1}/MANIFEST.in +0 -0
  38. {pyboy-2.7.0 → pyboy-2.7.1}/README.md +0 -0
  39. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/__init__.py +0 -0
  40. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/api/__init__.py +0 -0
  41. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/api/constants.py +0 -0
  42. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/api/gameshark.pxd +0 -0
  43. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/api/gameshark.py +0 -0
  44. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/api/memory_scanner.pxd +0 -0
  45. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/api/memory_scanner.py +0 -0
  46. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/api/screen.pxd +0 -0
  47. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/api/screen.py +0 -0
  48. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/api/sound.pxd +0 -0
  49. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/api/sound.py +0 -0
  50. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/api/sprite.pxd +0 -0
  51. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/api/sprite.py +0 -0
  52. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/api/tile.pxd +0 -0
  53. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/api/tile.py +0 -0
  54. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/api/tilemap.pxd +0 -0
  55. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/api/tilemap.py +0 -0
  56. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/conftest.py +0 -0
  57. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/__init__.py +0 -0
  58. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/bootrom.pxd +0 -0
  59. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/bootrom_dmg.bin +0 -0
  60. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/cartridge/__init__.py +0 -0
  61. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/cartridge/base_mbc.pxd +0 -0
  62. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/cartridge/base_mbc.py +0 -0
  63. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/cartridge/cartridge.pxd +0 -0
  64. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/cartridge/cartridge.py +0 -0
  65. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/cartridge/mbc1.pxd +0 -0
  66. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/cartridge/mbc1.py +0 -0
  67. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/cartridge/mbc2.pxd +0 -0
  68. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/cartridge/mbc2.py +0 -0
  69. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/cartridge/mbc3.pxd +0 -0
  70. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/cartridge/mbc3.py +0 -0
  71. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/cartridge/mbc5.pxd +0 -0
  72. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/cartridge/mbc5.py +0 -0
  73. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/cartridge/rtc.pxd +0 -0
  74. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/cartridge/rtc.py +0 -0
  75. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/interaction.py +0 -0
  76. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/opcodes.pxd +0 -0
  77. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/opcodes.py +0 -0
  78. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/opcodes_gen.py +0 -0
  79. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/sound.py +0 -0
  80. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/core/timer.py +0 -0
  81. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/default_rom.gb +0 -0
  82. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/logging/__init__.py +0 -0
  83. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/logging/_logging.py +0 -0
  84. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/logging/logging.pxd +0 -0
  85. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/logging/logging.pyx +0 -0
  86. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/__init__.py +0 -0
  87. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/auto_pause.pxd +0 -0
  88. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/auto_pause.py +0 -0
  89. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/font.txt +0 -0
  90. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/game_wrapper_kirby_dream_land.pxd +0 -0
  91. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/game_wrapper_kirby_dream_land.py +0 -0
  92. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/game_wrapper_pokemon_gen1.pxd +0 -0
  93. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/game_wrapper_pokemon_gen1.py +0 -0
  94. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/game_wrapper_pokemon_pinball.pxd +0 -0
  95. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/game_wrapper_pokemon_pinball.py +0 -0
  96. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/game_wrapper_super_mario_land.pxd +0 -0
  97. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/game_wrapper_super_mario_land.py +0 -0
  98. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/game_wrapper_tetris.pxd +0 -0
  99. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/game_wrapper_tetris.py +0 -0
  100. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/manager.pxd +0 -0
  101. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/manager.py +0 -0
  102. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/manager_gen.py +0 -0
  103. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/record_replay.pxd +0 -0
  104. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/record_replay.py +0 -0
  105. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/rewind.pxd +0 -0
  106. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/rewind.py +0 -0
  107. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/screen_recorder.pxd +0 -0
  108. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/screen_recorder.py +0 -0
  109. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/screenshot_recorder.pxd +0 -0
  110. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/screenshot_recorder.py +0 -0
  111. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/window_glfw.pxd +0 -0
  112. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/window_null.pxd +0 -0
  113. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/window_null.py +0 -0
  114. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/plugins/window_open_gl.pxd +0 -0
  115. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy/utils.pxd +0 -0
  116. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy.egg-info/SOURCES.txt +0 -0
  117. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy.egg-info/dependency_links.txt +0 -0
  118. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy.egg-info/entry_points.txt +0 -0
  119. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy.egg-info/not-zip-safe +0 -0
  120. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy.egg-info/requires.txt +0 -0
  121. {pyboy-2.7.0 → pyboy-2.7.1}/pyboy.egg-info/top_level.txt +0 -0
  122. {pyboy-2.7.0 → pyboy-2.7.1}/setup.cfg +0 -0
  123. {pyboy-2.7.0 → pyboy-2.7.1}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyboy
3
- Version: 2.7.0
3
+ Version: 2.7.1
4
4
  Summary: Game Boy emulator written in Python
5
5
  Author-email: Mads Ynddal <mads@ynddal.dk>
6
6
  License-Expression: LGPL-3.0-only
@@ -187,6 +187,7 @@ The other controls for the emulator:
187
187
  | X | Load state |
188
188
  | I | Toggle screen recording |
189
189
  | O | Save screenshot |
190
+ | C | Cycle DMG palette |
190
191
  | , | Rewind backwards |
191
192
  | . | Rewind forward |
192
193
  | J | Memory Window + 0x100 |
@@ -10,16 +10,15 @@ import struct
10
10
 
11
11
  class BootROM:
12
12
  def __init__(self, bootrom_file, cartridge_cgb):
13
+ self.cgb = False
13
14
  if bootrom_file is None:
14
15
  # Default to PyBoy boot ROM
15
16
  rom = "/bootrom_cgb.bin" if cartridge_cgb else "/bootrom_dmg.bin"
16
17
  bootrom_file = os.path.dirname(os.path.realpath(__file__)) + rom
18
+ self.cgb = cartridge_cgb
17
19
 
18
20
  with open(bootrom_file, "rb") as f:
19
21
  rom = f.read()
20
22
 
21
23
  self.bootrom = array.array("B", struct.unpack("%iB" % len(rom), rom))
22
- self.cgb = len(rom) > 0x100
23
-
24
- # def getitem(self, addr):
25
- # return
24
+ self.cgb |= len(rom) > 0x100
@@ -23,7 +23,7 @@ cdef int16_t FLAGC, FLAGH, FLAGN, FLAGZ
23
23
  cdef uint8_t INTR_VBLANK, INTR_LCDC, INTR_TIMER, INTR_SERIAL, INTR_HIGHTOLOW
24
24
 
25
25
 
26
-
26
+ @cython.final
27
27
  cdef class CPU:
28
28
  cdef bint interrupt_master_enable, interrupt_queued, halted, stopped, bail
29
29
 
@@ -32,6 +32,8 @@ cdef class CPU:
32
32
  cdef int64_t cycles
33
33
 
34
34
  cdef inline int check_interrupts(self) noexcept nogil
35
+
36
+ @cython.final
35
37
  cdef void set_interruptflag(self, int) noexcept nogil
36
38
  cdef bint handle_interrupt(self, uint8_t, uint16_t) noexcept nogil
37
39
 
@@ -52,4 +54,4 @@ cdef class CPU:
52
54
 
53
55
  cdef pyboy.core.mb.Motherboard mb
54
56
 
55
- cdef str dump_state(self, str) with gil
57
+ cdef str dump_state(self, list) with gil
@@ -68,9 +68,9 @@ class CPU:
68
68
  self.interrupts_flag_register = f.read()
69
69
  if state_version >= 12:
70
70
  self.cycles = f.read_64bit()
71
- logger.debug("State loaded: %s", self.dump_state(""))
71
+ logger.debug("State loaded: %s", self.dump_state([""]))
72
72
 
73
- def dump_state(self, sym_label):
73
+ def dump_state(self, sym_labels):
74
74
  opcode_data = [
75
75
  self.mb.getitem(self.mb.cpu.PC + n) for n in range(3)
76
76
  ] # Max 3 length, then we don't need to backtrack
@@ -87,7 +87,7 @@ class CPU:
87
87
  "\n"
88
88
  f"A: {self.mb.cpu.A:02X}, F: {self.mb.cpu.F:02X}, B: {self.mb.cpu.B:02X}, "
89
89
  f"C: {self.mb.cpu.C:02X}, D: {self.mb.cpu.D:02X}, E: {self.mb.cpu.E:02X}, "
90
- f"HL: {self.mb.cpu.HL:04X}, SP: {self.mb.cpu.SP:04X}, PC: {self.mb.cpu.PC:04X} ({sym_label})\n"
90
+ f"HL: {self.mb.cpu.HL:04X}, SP: {self.mb.cpu.SP:04X}, PC: {self.mb.cpu.PC:04X} ({', '.join(sym_labels)})\n"
91
91
  f"{opcode_str} "
92
92
  f"Interrupts - IME: {self.mb.cpu.interrupt_master_enable}, "
93
93
  f"IE: {self.mb.cpu.interrupts_enabled_register:08b}, "
@@ -3,6 +3,7 @@
3
3
  # GitHub: https://github.com/Baekalfen/PyBoy
4
4
  #
5
5
 
6
+ from cython cimport final
6
7
  from libc.stdint cimport uint8_t
7
8
 
8
9
  from pyboy.logging.logging cimport Logger
@@ -16,6 +17,7 @@ cdef uint8_t reset_bit(uint8_t, uint8_t) noexcept
16
17
  cdef uint8_t set_bit(uint8_t, uint8_t) noexcept
17
18
 
18
19
 
20
+ @final
19
21
  cdef class Interaction:
20
22
  cdef uint8_t directional, standard
21
23
  cdef bint key_event(self, WindowEvent) noexcept
@@ -4,6 +4,7 @@
4
4
  #
5
5
 
6
6
  import cython
7
+ from cython cimport final
7
8
 
8
9
  from cpython.array cimport array
9
10
  from libc.stdint cimport int16_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t
@@ -25,6 +26,7 @@ cdef Logger logger
25
26
  @cython.locals(a=uint32_t, r=uint32_t, g=uint32_t, b=uint32_t)
26
27
  cpdef uint32_t rgb_to_bgr(uint32_t) noexcept
27
28
 
29
+ @final
28
30
  cdef class LCD:
29
31
  cdef bint disable_renderer
30
32
  cdef uint8_t[8 * 1024] VRAM0
@@ -34,6 +36,7 @@ cdef class LCD:
34
36
  cdef uint8_t SCX
35
37
  cdef uint8_t WY
36
38
  cdef uint8_t WX
39
+ cdef uint8_t object_priority_mode
37
40
  cdef uint8_t next_stat_mode
38
41
  cdef bint frame_done
39
42
  cdef bint first_frame
@@ -52,21 +55,29 @@ cdef class LCD:
52
55
  cdef uint64_t last_cycles
53
56
  cdef int64_t _cycles_to_interrupt, _cycles_to_frame
54
57
 
58
+ @final
59
+ cdef void switch_cgb(self, bint) noexcept with gil
60
+
61
+ @final
55
62
  @cython.locals(interrupt_flag=uint8_t,bx=int,by=int,wx=int,wy=int)
56
63
  cdef uint8_t tick(self, uint64_t) noexcept nogil
57
64
 
65
+ @final
58
66
  cdef void set_lcdc(self, uint8_t) noexcept nogil
59
67
 
68
+ @final
60
69
  cdef int64_t cycles_to_mode0(self) noexcept nogil
61
70
 
62
71
  cdef int save_state(self, IntIOInterface) except -1
63
72
  cdef int load_state(self, IntIOInterface, int) except -1
64
73
 
74
+ @final
65
75
  cdef inline (int, int) getwindowpos(self) noexcept nogil
76
+ @final
66
77
  cdef inline (int, int) getviewport(self) noexcept nogil
67
78
 
68
79
  # CGB
69
- cdef bint cgb
80
+ cdef bint cgb, _downgraded_to_dmg
70
81
  cdef uint8_t speed_shift
71
82
  cdef uint8_t[8 * 1024] VRAM1
72
83
  cdef VBKregister vbk
@@ -75,29 +86,40 @@ cdef class LCD:
75
86
  cdef PaletteIndexRegister ocps
76
87
  cdef PaletteColorRegister ocpd
77
88
 
78
-
89
+ @final
79
90
  cdef class PaletteRegister:
80
91
  cdef uint8_t value
81
92
  cdef uint32_t[4] lookup
82
93
  cdef uint32_t[4] palette_mem_rgb
83
94
 
95
+ @final
84
96
  @cython.locals(x=uint16_t)
85
97
  cdef bint set(self, uint64_t) noexcept nogil
98
+ @final
99
+ cdef inline void _update_lookup(self) noexcept nogil
100
+ @final
86
101
  cdef uint8_t get(self) noexcept nogil
102
+ @final
87
103
  cdef inline uint32_t getcolor(self, uint8_t) noexcept nogil
88
104
 
105
+ @final
89
106
  cdef class STATRegister:
90
107
  cdef uint8_t value
91
108
  cdef uint8_t _mode
109
+ @final
92
110
  cdef uint8_t set_mode(self, uint8_t) noexcept nogil
111
+ @final
93
112
  cdef uint8_t update_LYC(self, uint8_t, uint8_t) noexcept nogil
113
+ @final
94
114
  cdef void set(self, uint64_t) noexcept nogil
95
115
  cdef int save_state(self, IntIOInterface) except -1
96
116
  cdef int load_state(self, IntIOInterface, int) except -1
97
117
 
118
+ @final
98
119
  cdef class LCDCRegister:
99
120
  cdef uint8_t value
100
121
 
122
+ @final
101
123
  cdef void set(self, uint64_t) noexcept nogil
102
124
 
103
125
  cdef bint lcd_enable
@@ -113,7 +135,9 @@ cdef class LCDCRegister:
113
135
  cdef uint16_t backgroundmap_offset
114
136
  cdef uint16_t windowmap_offset
115
137
 
138
+ @final
116
139
  cdef class Renderer:
140
+ cdef LCD lcd
117
141
  cdef uint8_t[:] _tilecache_state, _spritecache_state
118
142
  cdef str color_format
119
143
  cdef tuple buffer_dims
@@ -131,9 +155,10 @@ cdef class Renderer:
131
155
 
132
156
  cdef int[10] sprites_to_render
133
157
  cdef int ly_window
158
+ cdef bint wy_activated_frame
134
159
  cdef void invalidate_tile(self, int, int) noexcept nogil
135
160
 
136
- cdef void blank_screen(self, LCD) noexcept nogil
161
+ cdef void blank_screen(self) noexcept nogil
137
162
 
138
163
  @cython.locals(
139
164
  bx=int,
@@ -152,16 +177,44 @@ cdef class Renderer:
152
177
  col0=uint8_t,
153
178
  pixel=uint32_t,
154
179
  )
155
- cdef void scanline(self, LCD, int) noexcept nogil
180
+ cdef void scanline(self, int) noexcept nogil
181
+ @cython.locals(
182
+ bx=int,
183
+ by=int,
184
+ wx=int,
185
+ wy=int,
186
+ palette=uint8_t,
187
+ vbank=bint,
188
+ horiflip=bint,
189
+ vertflip=bint,
190
+ bg_priority=bint,
191
+ xx=int,
192
+ yy=int,
193
+ tilecache=uint8_t[:,:],
194
+ bg_priority_apply=uint32_t,
195
+ col0=uint8_t,
196
+ pixel=uint32_t,
197
+ )
198
+ cdef void cgb_scanline(self, int) noexcept nogil
156
199
 
200
+ @cython.locals(
201
+ tile_num = uint8_t,
202
+ palette = uint8_t,
203
+ vbank = uint8_t,
204
+ horiflip = uint8_t,
205
+ vertflip = uint8_t,
206
+ bg_priority = uint8_t,
207
+ )
208
+ cdef inline (int, int, int, int, int) _cgb_get_background_map_attributes(self, LCD, int) noexcept nogil
157
209
  @cython.locals(tile_addr=uint64_t, tile=int)
158
210
  cdef inline (int, int, uint16_t) _get_tile(self, uint8_t, uint8_t, uint16_t, LCD) noexcept nogil
211
+ cdef inline (int, int, uint8_t, bint, uint32_t, bint) _cgb_get_tile(self, uint8_t, uint8_t, uint16_t, LCD) noexcept nogil
159
212
  @cython.locals(col0=uint8_t)
160
213
  cdef inline void _pixel(self, int, uint32_t, int, int, int, int, uint32_t) noexcept nogil
161
- @cython.locals(tilecache=uint8_t[:,:])
162
214
  cdef int scanline_background(self, int, int, int, int, int, LCD) noexcept nogil
163
- @cython.locals(tilecache=uint8_t[:,:])
164
215
  cdef int scanline_window(self, int, int, int, int, int, LCD) noexcept nogil
216
+ cdef int cgb_scanline_background(self, int, int, int, int, int, LCD) noexcept nogil
217
+ cdef int cgb_scanline_window(self, int, int, int, int, int, LCD) noexcept nogil
165
218
  cdef int scanline_blank(self, int, int, int, LCD) noexcept nogil
166
219
 
167
220
  @cython.locals(
@@ -187,12 +240,13 @@ cdef class Renderer:
187
240
  bgmappriority=bint,
188
241
  sprite_cache_no=int,
189
242
  )
190
- cdef void scanline_sprites(self, LCD, int, uint32_t[:,:], uint8_t[:,:], bint) noexcept nogil
243
+ cdef void scanline_sprites(self, int, uint32_t[:,:], uint8_t[:,:], bint) noexcept nogil
191
244
  cdef void sort_sprites(self, int) noexcept nogil
192
245
 
193
246
  cdef void clear_cache(self) noexcept nogil
194
247
  cdef void clear_tilecache(self, int) noexcept nogil
195
248
  cdef void clear_spritecache(self, int) noexcept nogil
249
+ # @final
196
250
  @cython.locals(
197
251
  x=int,
198
252
  t=int,
@@ -204,6 +258,7 @@ cdef class Renderer:
204
258
  colorcode_high=uint64_t,
205
259
  )
206
260
  cdef void update_tilecache(self, int, LCD, int, int) noexcept nogil
261
+ # @final
207
262
  @cython.locals(
208
263
  x=int,
209
264
  t=int,
@@ -222,35 +277,14 @@ cdef class Renderer:
222
277
  cdef int save_state(self, IntIOInterface) except -1
223
278
  cdef int load_state(self, IntIOInterface, int) except -1
224
279
 
225
-
226
- cdef class CGBLCD(LCD):
227
- pass
228
- # cdef uint8_t[8 * 1024] VRAM1
229
- # cdef VBKregister vbk
230
- # cdef PaletteIndexRegister bcps
231
- # cdef PaletteColorRegister bcpd
232
- # cdef PaletteIndexRegister ocps
233
- # cdef PaletteColorRegister ocpd
234
-
235
- cdef class CGBRenderer(Renderer):
236
-
237
- @cython.locals(
238
- tile_num = uint8_t,
239
- palette = uint8_t,
240
- vbank = uint8_t,
241
- horiflip = uint8_t,
242
- vertflip = uint8_t,
243
- bg_priority = uint8_t,
244
- )
245
- cdef inline (int, int, int, int, int) _cgb_get_background_map_attributes(self, LCD, int) noexcept nogil
246
- cdef inline (int, int, uint8_t, bint, uint32_t, bint) _get_tile_cgb(self, uint8_t, uint8_t, uint16_t, LCD) noexcept nogil
247
-
280
+ @final
248
281
  cdef class VBKregister:
249
282
  cdef uint8_t active_bank
250
283
 
251
284
  cdef void set(self, uint8_t) noexcept nogil
252
285
  cdef uint8_t get(self) noexcept nogil
253
286
 
287
+ @final
254
288
  cdef class PaletteIndexRegister:
255
289
  cdef uint8_t value
256
290
  cdef int auto_inc
@@ -265,6 +299,7 @@ cdef class PaletteIndexRegister:
265
299
  cdef int save_state(self, IntIOInterface) except -1
266
300
  cdef int load_state(self, IntIOInterface, int) except -1
267
301
 
302
+ @final
268
303
  cdef class PaletteColorRegister:
269
304
  cdef uint16_t[8 * 4] palette_mem
270
305
  cdef uint32_t[8 * 4] palette_mem_rgb