Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Baekalfen/PyBoy
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.1.0
Choose a base ref
...
head repository: Baekalfen/PyBoy
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 12,035 additions and 4,595 deletions.
  1. +1 −0 .github/ISSUE_TEMPLATE/config.yml
  2. +12 −0 .github/ISSUE_TEMPLATE/issue-template.md
  3. +28 −11 .github/workflows/pr-test.yml
  4. +7 −15 .pre-commit-config.yaml
  5. +14 −5 Makefile
  6. +7 −7 README.md
  7. +3 −3 docs/api/constants.html
  8. +507 −0 docs/api/gameshark.html
  9. +2,014 −4 docs/api/index.html
  10. +52 −38 docs/api/memory_scanner.html
  11. +40 −43 docs/api/screen.html
  12. +576 −0 docs/api/sound.html
  13. +10 −7 docs/api/sprite.html
  14. +29 −30 docs/api/tile.html
  15. +23 −19 docs/api/tilemap.html
  16. +643 −186 docs/index.html
  17. +97 −109 docs/plugins/base_plugin.html
  18. +31 −28 docs/plugins/game_wrapper_kirby_dream_land.html
  19. +17 −27 docs/plugins/game_wrapper_pokemon_gen1.html
  20. +351 −208 docs/plugins/game_wrapper_pokemon_pinball.html
  21. +293 −86 docs/plugins/game_wrapper_super_mario_land.html
  22. +46 −47 docs/plugins/game_wrapper_tetris.html
  23. +11 −12 docs/plugins/index.html
  24. BIN docs/plugins/supermarioland.png
  25. +530 −56 docs/utils.html
  26. +11 −11 extras/bootrom/bootrom_common.asm
  27. +2 −2 extras/bootrom/logo_to_tiles.py
  28. +1 −1 extras/default_rom/default_rom.asm
  29. +1 −0 extras/default_rom/default_rom.sym
  30. +1 −0 extras/default_rom/default_rom_cgb.sym
  31. +5 −5 extras/examples/gamewrapper_kirby.py
  32. +3 −3 extras/examples/gamewrapper_mario.py
  33. +7 −7 extras/examples/gamewrapper_tetris.py
  34. +4 −4 extras/font/makefont.py
  35. +2 −2 pyboy/__init__.py
  36. +67 −11 pyboy/__main__.py
  37. +9 −1 pyboy/api/__init__.py
  38. +24 −0 pyboy/api/gameshark.pxd
  39. +158 −0 pyboy/api/gameshark.py
  40. +1 −1 pyboy/api/memory_scanner.pxd
  41. +17 −11 pyboy/api/memory_scanner.py
  42. +2 −3 pyboy/api/screen.pxd
  43. +13 −13 pyboy/api/screen.py
  44. +17 −0 pyboy/api/sound.pxd
  45. +171 −0 pyboy/api/sound.py
  46. +4 −2 pyboy/api/sprite.py
  47. +4 −4 pyboy/api/tile.pxd
  48. +12 −15 pyboy/api/tile.py
  49. +10 −8 pyboy/api/tilemap.py
  50. +37 −28 pyboy/conftest.py
  51. +0 −2 pyboy/core/__init__.py
  52. +1 −0 pyboy/core/bootrom.pxd
  53. +3 −22 pyboy/core/bootrom.py
  54. +3 −5 pyboy/core/cartridge/__init__.py
  55. +8 −7 pyboy/core/cartridge/base_mbc.pxd
  56. +41 −32 pyboy/core/cartridge/base_mbc.py
  57. +1 −1 pyboy/core/cartridge/cartridge.pxd
  58. +12 −11 pyboy/core/cartridge/cartridge.py
  59. +8 −12 pyboy/core/cartridge/mbc1.py
  60. +2 −3 pyboy/core/cartridge/mbc2.py
  61. +0 −1 pyboy/core/cartridge/mbc3.py
  62. +1 −2 pyboy/core/cartridge/mbc5.py
  63. +2 −2 pyboy/core/cartridge/rtc.pxd
  64. +17 −15 pyboy/core/cartridge/rtc.py
  65. +9 −9 pyboy/core/cpu.pxd
  66. +61 −62 pyboy/core/cpu.py
  67. +2 −2 pyboy/core/interaction.pxd
  68. +1 −2 pyboy/core/interaction.py
  69. +60 −42 pyboy/core/lcd.pxd
  70. +445 −310 pyboy/core/lcd.py
  71. +5 −6 pyboy/core/mb.pxd
  72. +223 −168 pyboy/core/mb.py
  73. +597 −525 pyboy/core/opcodes.py
  74. +368 −205 pyboy/core/opcodes_gen.py
  75. +2 −2 pyboy/core/ram.pxd
  76. +2 −2 pyboy/core/ram.py
  77. +99 −77 pyboy/core/sound.pxd
  78. +669 −322 pyboy/core/sound.py
  79. +6 −6 pyboy/core/timer.pxd
  80. +27 −23 pyboy/core/timer.py
  81. +9 −3 pyboy/logging/__init__.py
  82. +1 −1 pyboy/logging/_logging.py
  83. +8 −9 pyboy/plugins/__init__.py
  84. +2 −2 pyboy/plugins/auto_pause.py
  85. +13 −10 pyboy/plugins/base_plugin.pxd
  86. +53 −54 pyboy/plugins/base_plugin.py
  87. +8 −8 pyboy/plugins/debug.pxd
  88. +82 −72 pyboy/plugins/debug.py
  89. +1 −1 pyboy/plugins/debug_prompt.pxd
  90. +4 −6 pyboy/plugins/debug_prompt.py
  91. +0 −15 pyboy/plugins/disable_input.pxd
  92. +0 −15 pyboy/plugins/disable_input.py
  93. +12 −12 pyboy/plugins/game_wrapper_kirby_dream_land.py
  94. +6 −12 pyboy/plugins/game_wrapper_pokemon_gen1.py
  95. +1 −2 pyboy/plugins/game_wrapper_pokemon_pinball.pxd
  96. +173 −161 pyboy/plugins/game_wrapper_pokemon_pinball.py
  97. +2 −3 pyboy/plugins/game_wrapper_super_mario_land.pxd
  98. +139 −36 pyboy/plugins/game_wrapper_super_mario_land.py
  99. +1 −4 pyboy/plugins/game_wrapper_tetris.pxd
  100. +18 −20 pyboy/plugins/game_wrapper_tetris.py
  101. +3 −5 pyboy/plugins/manager.pxd
  102. +28 −27 pyboy/plugins/manager.py
  103. +75 −14 pyboy/plugins/manager_gen.py
  104. +7 −4 pyboy/plugins/record_replay.py
  105. +10 −16 pyboy/plugins/rewind.py
  106. +2 −3 pyboy/plugins/screen_recorder.py
  107. +1 −3 pyboy/plugins/screenshot_recorder.py
  108. +1 −0 pyboy/plugins/window_null.pxd
  109. +2 −1 pyboy/plugins/window_null.py
  110. +2 −6 pyboy/plugins/window_open_gl.pxd
  111. +38 −25 pyboy/plugins/window_open_gl.py
  112. +16 −5 pyboy/plugins/window_sdl2.pxd
  113. +113 −27 pyboy/plugins/window_sdl2.py
  114. +22 −13 pyboy/pyboy.pxd
  115. +413 −147 pyboy/pyboy.py
  116. +4 −3 pyboy/utils.pxd
  117. +189 −44 pyboy/utils.py
  118. +23 −20 pyproject.toml
  119. +2 −1 requirements_tests.txt
  120. +19 −12 setup.py
  121. +75 −27 tests/conftest.py
  122. +1 −1 tests/test_acid_cgb.py
  123. +1 −1 tests/test_acid_dmg.py
  124. +180 −72 tests/test_basics.py
  125. +39 −0 tests/test_benchmark.py
  126. +78 −82 tests/test_blargg.py
  127. +41 −0 tests/test_bootroms.py
  128. +12 −12 tests/test_breakpoints.py
  129. +4 −4 tests/test_examples.py
  130. +199 −256 tests/test_external_api.py
  131. +68 −35 tests/test_game_wrapper.py
  132. +5 −19 tests/test_game_wrapper_mario.py
  133. +20 −35 tests/test_game_wrapper_pokemon_pinball.py
  134. +63 −0 tests/test_gameshark.py
  135. +386 −0 tests/test_lcd.py
  136. +1 −1 tests/test_magen.py
  137. +7 −4 tests/test_mario_rl.py
  138. +7 −9 tests/test_memoryscanner.py
  139. +90 −29 tests/test_memoryview.py
  140. +3 −5 tests/test_mooneye.py
  141. +8 −7 tests/test_pokemon_rl.py
  142. +0 −129 tests/test_pyboy_lcd.py
  143. +14 −8 tests/test_replay.py
  144. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_align.gb.png
  145. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_align_cpu.gb.png
  146. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_delay.gb.png
  147. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_duty.gb.png
  148. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_duty_delay.gb.png
  149. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_extra_length_clocking-cgb0B.gb.png
  150. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_freq_change.gb.png
  151. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_freq_change_timing-A.gb.png
  152. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_freq_change_timing-cgb0BC.gb.png
  153. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_freq_change_timing-cgbDE.gb.png
  154. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_nrx2_glitch.gb.png
  155. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_nrx2_speed_change.gb.png
  156. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_restart.gb.png
  157. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_restart_nrx2_glitch.gb.png
  158. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_stop_div.gb.png
  159. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_stop_restart.gb.png
  160. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_sweep.gb.png
  161. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_sweep_restart.gb.png
  162. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_sweep_restart_2.gb.png
  163. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_volume.gb.png
  164. BIN tests/test_results/SameSuite/apu/channel_1/channel_1_volume_div.gb.png
  165. BIN tests/test_results/SameSuite/apu/channel_2/channel_2_align.gb.png
  166. BIN tests/test_results/SameSuite/apu/channel_2/channel_2_align_cpu.gb.png
  167. BIN tests/test_results/SameSuite/apu/channel_2/channel_2_delay.gb.png
  168. BIN tests/test_results/SameSuite/apu/channel_2/channel_2_duty.gb.png
  169. BIN tests/test_results/SameSuite/apu/channel_2/channel_2_duty_delay.gb.png
  170. BIN tests/test_results/SameSuite/apu/channel_2/channel_2_extra_length_clocking-cgb0B.gb.png
  171. BIN tests/test_results/SameSuite/apu/channel_2/channel_2_freq_change.gb.png
  172. BIN tests/test_results/SameSuite/apu/channel_2/channel_2_nrx2_glitch.gb.png
  173. BIN tests/test_results/SameSuite/apu/channel_2/channel_2_nrx2_speed_change.gb.png
  174. BIN tests/test_results/SameSuite/apu/channel_2/channel_2_restart.gb.png
  175. BIN tests/test_results/SameSuite/apu/channel_2/channel_2_restart_nrx2_glitch.gb.png
  176. BIN tests/test_results/SameSuite/apu/channel_2/channel_2_stop_div.gb.png
  177. BIN tests/test_results/SameSuite/apu/channel_2/channel_2_stop_restart.gb.png
  178. BIN tests/test_results/SameSuite/apu/channel_2/channel_2_volume.gb.png
  179. BIN tests/test_results/SameSuite/apu/channel_2/channel_2_volume_div.gb.png
  180. BIN tests/test_results/SameSuite/apu/channel_3/channel_3_and_glitch.gb.png
  181. BIN tests/test_results/SameSuite/apu/channel_3/channel_3_delay.gb.png
  182. BIN tests/test_results/SameSuite/apu/channel_3/channel_3_extra_length_clocking-cgb0.gb.png
  183. BIN tests/test_results/SameSuite/apu/channel_3/channel_3_extra_length_clocking-cgbB.gb.png
  184. BIN tests/test_results/SameSuite/apu/channel_3/channel_3_first_sample.gb.png
  185. BIN tests/test_results/SameSuite/apu/channel_3/channel_3_freq_change_delay.gb.png
  186. BIN tests/test_results/SameSuite/apu/channel_3/channel_3_restart_delay.gb.png
  187. BIN tests/test_results/SameSuite/apu/channel_3/channel_3_restart_during_delay.gb.png
  188. BIN tests/test_results/SameSuite/apu/channel_3/channel_3_restart_stop_delay.gb.png
  189. BIN tests/test_results/SameSuite/apu/channel_3/channel_3_shift_delay.gb.png
  190. BIN tests/test_results/SameSuite/apu/channel_3/channel_3_shift_skip_delay.gb.png
  191. BIN tests/test_results/SameSuite/apu/channel_3/channel_3_stop_delay.gb.png
  192. BIN tests/test_results/SameSuite/apu/channel_3/channel_3_stop_div.gb.png
  193. BIN tests/test_results/SameSuite/apu/channel_3/channel_3_wave_ram_dac_on_rw.gb.png
  194. BIN tests/test_results/SameSuite/apu/channel_3/channel_3_wave_ram_locked_write.gb.png
  195. BIN tests/test_results/SameSuite/apu/channel_3/channel_3_wave_ram_sync.gb.png
  196. BIN tests/test_results/SameSuite/apu/channel_4/channel_4_align.gb.png
  197. BIN tests/test_results/SameSuite/apu/channel_4/channel_4_delay.gb.png
  198. BIN tests/test_results/SameSuite/apu/channel_4/channel_4_equivalent_frequencies.gb.png
  199. BIN tests/test_results/SameSuite/apu/channel_4/channel_4_extra_length_clocking-cgb0B.gb.png
  200. BIN tests/test_results/SameSuite/apu/channel_4/channel_4_freq_change.gb.png
  201. BIN tests/test_results/SameSuite/apu/channel_4/channel_4_frequency_alignment.gb.png
  202. BIN tests/test_results/SameSuite/apu/channel_4/channel_4_lfsr.gb.png
  203. BIN tests/test_results/SameSuite/apu/channel_4/channel_4_lfsr15.gb.png
  204. BIN tests/test_results/SameSuite/apu/channel_4/channel_4_lfsr_15_7.gb.png
  205. BIN tests/test_results/SameSuite/apu/channel_4/channel_4_lfsr_7_15.gb.png
  206. BIN tests/test_results/SameSuite/apu/channel_4/channel_4_lfsr_restart.gb.png
  207. BIN tests/test_results/SameSuite/apu/channel_4/channel_4_lfsr_restart_fast.gb.png
  208. BIN tests/test_results/SameSuite/apu/channel_4/channel_4_volume_div.gb.png
  209. BIN tests/test_results/SameSuite/apu/div_trigger_volume_10.gb.png
  210. BIN tests/test_results/SameSuite/apu/div_write_trigger.gb.png
  211. BIN tests/test_results/SameSuite/apu/div_write_trigger_10.gb.png
  212. BIN tests/test_results/SameSuite/apu/div_write_trigger_volume.gb.png
  213. BIN tests/test_results/SameSuite/apu/div_write_trigger_volume_10.gb.png
  214. BIN tests/test_results/TurtleTest/window_y_trigger.gb.png
  215. BIN tests/test_results/TurtleTest/window_y_trigger_wx_offscreen.gb.png
  216. BIN tests/test_results/all_modes/cgbrom_False_DMG_ROM.bin.png
  217. BIN tests/test_results/all_modes/cgbrom_False_None.png
  218. BIN tests/test_results/all_modes/cgbrom_None_CGB_ROM.bin.png
  219. BIN tests/test_results/all_modes/cgbrom_None_DMG_ROM.bin.png
  220. BIN tests/test_results/all_modes/cgbrom_None_None.png
  221. BIN tests/test_results/all_modes/cgbrom_True_CGB_ROM.bin.png
  222. +0 −3 tests/test_results/all_modes/cgbrom_True_DMG_ROM.bin.png
  223. BIN tests/test_results/all_modes/cgbrom_True_None.png
  224. BIN tests/test_results/all_modes/cgbrom_cgb_CGB_ROM.bin.png
  225. BIN tests/test_results/all_modes/cgbrom_cgb_DMG_ROM.bin.png
  226. BIN tests/test_results/all_modes/cgbrom_cgb_None.png
  227. BIN tests/test_results/all_modes/cgbrom_dmg_CGB_ROM.bin.png
  228. BIN tests/test_results/all_modes/cgbrom_dmg_DMG_ROM.bin.png
  229. BIN tests/test_results/all_modes/cgbrom_dmg_None.png
  230. BIN tests/test_results/all_modes/dmgrom_False_DMG_ROM.bin.png
  231. BIN tests/test_results/all_modes/dmgrom_False_None.png
  232. BIN tests/test_results/all_modes/dmgrom_None_CGB_ROM.bin.png
  233. BIN tests/test_results/all_modes/dmgrom_None_DMG_ROM.bin.png
  234. BIN tests/test_results/all_modes/dmgrom_None_None.png
  235. +0 −2 tests/test_results/all_modes/dmgrom_True_CGB_ROM.bin.png
  236. BIN tests/test_results/all_modes/dmgrom_True_DMG_ROM.bin.png
  237. BIN tests/test_results/all_modes/dmgrom_True_None.png
  238. BIN tests/test_results/all_modes/dmgrom_cgb_CGB_ROM.bin.png
  239. BIN tests/test_results/all_modes/dmgrom_cgb_DMG_ROM.bin.png
  240. BIN tests/test_results/all_modes/dmgrom_cgb_None.png
  241. BIN tests/test_results/all_modes/dmgrom_dmg_CGB_ROM.bin.png
  242. BIN tests/test_results/all_modes/dmgrom_dmg_DMG_ROM.bin.png
  243. BIN tests/test_results/all_modes/dmgrom_dmg_None.png
  244. +13 −13 tests/test_results/blargg.json
  245. BIN tests/test_results/cgb_whichboot.gb.png
  246. BIN tests/test_results/dmg_which.gb.png
  247. BIN tests/test_results/dmg_whichboot.gb.png
  248. BIN tests/test_results/sound_swoosh_nosampling.png
  249. BIN tests/test_results/sound_swoosh_oddsampling.png
  250. BIN tests/test_results/sound_swoosh_sampling.png
  251. +15 −11 tests/test_rewind.py
  252. +1 −1 tests/test_rtc3test.py
  253. +4 −5 tests/test_samesuite.py
  254. +8 −7 tests/test_shonumi.py
  255. +140 −0 tests/test_sound.py
  256. +316 −34 tests/test_states.py
  257. +3 −4 tests/test_tetris_ai.py
  258. +42 −0 tests/test_turtle.py
  259. +67 −0 tests/test_utils.py
  260. +16 −0 tests/test_vectroid.py
  261. +1 −1 tests/test_which.py
  262. +4 −5 tests/test_whichboot.py
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/issue-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Issue template
about: Default template
title: ''
labels: ''
assignees: ''

---

Describe in detail how to reproduce the bug you're reporting. Preferably with a short code example to reproduce the bug.

If you're seeking help for a project, then Discord is a better place to go https://discord.gg/wUbag3KNqQ
39 changes: 28 additions & 11 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: [3.8, 3.9, "3.10", 3.11, 3.12]
python-version: [3.9, "3.10", 3.11, 3.12, 3.13]

steps:
- uses: actions/checkout@v3
@@ -33,8 +33,10 @@ jobs:
pip install --prefer-binary -r requirements_tests.txt
- name: Doctest
if: ${{ !contains(matrix.os, 'windows') }}
env:
PYTEST_SECRETS_KEY: ${{ secrets.PYTEST_SECRETS_KEY }}
run: |
python -m pytest pyboy/ -n auto
python -m pytest pyboy/ -v
- name: Build PyBoy
run: |
python setup.py build_ext -j $(getconf _NPROCESSORS_ONLN) --inplace
@@ -46,10 +48,17 @@ jobs:
- name: Run PyTest
env:
PYTEST_SECRETS_KEY: ${{ secrets.PYTEST_SECRETS_KEY }}
TEST_CI: 1
TEST_VERBOSE_IMAGES: 0
TEST_NO_UI: 1
run: |
python -m pytest tests/ -n auto -v
- name: Run PyTest Benchmark
env:
PYTEST_SECRETS_KEY: ${{ secrets.PYTEST_SECRETS_KEY }}
TEST_VERBOSE_IMAGES: 0
TEST_NO_UI: 1
run: |
python -m pytest tests/test_benchmark.py --benchmark-enable --benchmark-min-rounds=10
- name: Build wheel
run: |
echo "Building wheel"
@@ -106,12 +115,14 @@ jobs:
pypy3 -m pip install --prefer-binary -r requirements_tests.txt
- name: Doctest
if: ${{ !contains(matrix.os, 'windows') }}
env:
PYTEST_SECRETS_KEY: ${{ secrets.PYTEST_SECRETS_KEY }}
run: |
pypy3 -m pytest pyboy/ -n auto
pypy3 -m pytest pyboy/ -v
- name: Run PyTest
env:
PYTEST_SECRETS_KEY: ${{ secrets.PYTEST_SECRETS_KEY }}
TEST_CI: 1
TEST_VERBOSE_IMAGES: 0
TEST_NO_UI: 1
run: |
pypy3 -m pytest tests/ -n auto -v
@@ -122,7 +133,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['cp38-cp38', 'cp39-cp39', 'cp310-cp310', 'cp311-cp311', 'cp312-cp312']
python-version: ['cp39-cp39', 'cp310-cp310', 'cp311-cp311', 'cp312-cp312', 'cp313-cp313']
manylinux-version: ['manylinux_2_28_x86_64', 'musllinux_1_2_x86_64'] # GHA doesn't support manylinux_2_24_aarch64

steps:
@@ -145,16 +156,22 @@ jobs:
fi
cd /work
echo "Starting build"
echo "Preparing pip"
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
echo "Starting tests"
python -m pip install --prefer-binary -r requirements.txt
python -m pip install --prefer-binary -r requirements_tests.txt
echo "Starting Doctests"
PYTEST_SECRETS_KEY=${{ secrets.PYTEST_SECRETS_KEY }} python -m pytest pyboy/ -v
echo "Building PyBoy"
python setup.py build_ext -j $(getconf _NPROCESSORS_ONLN) --inplace
python -m pip install --prefer-binary -r requirements_tests.txt
PYTEST_SECRETS_KEY=${{ secrets.PYTEST_SECRETS_KEY }} TEST_CI=1 TEST_NO_UI=1 python -m pytest tests/ -n2 -v
echo "Starting pytests"
PYTEST_SECRETS_KEY=${{ secrets.PYTEST_SECRETS_KEY }} TEST_NO_UI=1 python -m pytest tests/ -n2 -v
echo "Building wheel"
python -m pip install wheel
@@ -170,10 +187,10 @@ jobs:
echo "Dists built:"
ls -lah dist/
- name: Set up Python 3.8 (just for PyPi upload)
- name: Set up Python 3.11 (just for PyPi upload)
uses: actions/setup-python@v3
with:
python-version: 3.8
python-version: 3.11
- name: Upload wheel
if: ${{ github.event_name == 'release' && github.event.action == 'published' && !github.event.release.prerelease }}
run: |
22 changes: 7 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
exclude: (opcodes.py|manager.py|manager.pxd)
repos:
- repo: https://github.com/myint/unify
rev: v0.5
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.0
hooks:
- id: unify
args: [--quote, '"', --in-place]
language: python
types: [python]
- repo: https://github.com/google/yapf
rev: 'v0.40.2'
hooks:
- id: yapf
additional_dependencies: [toml]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
# Run the linter.
- id: ruff
args: [--fix]
# Run the formatter.
- id: ruff-format
19 changes: 14 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

.PHONY: build clean run install test
.PHONY: build clean run install test benchmark docs

all: build

@@ -27,12 +27,17 @@ codecov: clean
${PY} setup.py test --codecov-trace
codecov

build:
@echo "Building..."
build_rom:
@echo "Building ROMs..."
cd ${ROOT_DIR}/extras/default_rom && $(MAKE)
cd ${ROOT_DIR}/extras/bootrom && $(MAKE)

build_pyboy:
@echo "Building PyBoy..."
CFLAGS=$(CFLAGS) ${PY} setup.py build_ext -j $(shell getconf _NPROCESSORS_ONLN) --inplace

build: build_rom build_pyboy

clean:
@echo "Cleaning..."
cd ${ROOT_DIR}/extras/default_rom && $(MAKE) clean
@@ -65,7 +70,7 @@ uninstall:
${PY} -m pip uninstall pyboy

test: export DEBUG=1
test: clean test_pypy test_cpython_doctest build test_cython
test: clean test_pypy test_cpython_doctest build test_cython benchmark

test_cpython_doctest:
${PY} -m pytest pyboy/ ${PYTEST_ARGS}
@@ -78,9 +83,13 @@ test_pypy:

test_all: test

benchmark:
${PY} -m pytest -m benchmark tests/test_benchmark.py --benchmark-enable --benchmark-min-rounds=10

docs: clean
bash -O extglob -c 'rm -rf -- ${ROOT_DIR}/docs/!(templates|CNAME)'
find ./docs -type f ! -path "./docs/templates/*" ! -path "./docs/CNAME" ! -name "*.png" -exec rm -rf {} +
mkdir -p ${ROOT_DIR}/docs/templates
cd ${ROOT_DIR}/pyboy/plugins && ${PY} manager_gen.py
pdoc --html --force -c latex_math=True -c sort_identifiers=False -c show_type_annotations=True --template-dir docs/templates pyboy
cp -r html/pyboy/ ${ROOT_DIR}/docs/
rm -rf html
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@
<img src="extras/README/pyboy.svg" width="480">
</p>

__If you have any questions, or just want to chat, [join us on Discord](https://discord.gg/Zrf2nyH).__
__If you have any questions, or just want to chat, [join us on Discord](https://discord.gg/wUbag3KNqQ).__

[![Discord](https://img.shields.io/discord/584149554132418570?style=for-the-badge&logo=Discord&label=PyBoy)](https://discord.gg/Zrf2nyH)
[![Discord](https://img.shields.io/discord/584149554132418570?style=for-the-badge&logo=Discord&label=PyBoy)](https://discord.gg/wUbag3KNqQ)

<!---
Generate GIF with the layout and captions
@@ -98,7 +98,7 @@ If you are looking to make a bot or AI, then these resources are a good place to
* [Example: Tetris](https://github.com/Baekalfen/PyBoy/wiki/Example-Tetris)
* [Example: Super Mario Land](https://github.com/Baekalfen/PyBoy/wiki/Example-Super-Mario-Land)
* [Code Examples](https://github.com/Baekalfen/PyBoy/tree/master/extras/examples)
* [Discord](https://discord.gg/Zrf2nyH)
* [Discord](https://discord.gg/wUbag3KNqQ)


When the emulator is running, you can easily access [PyBoy's API](https://baekalfen.github.io/PyBoy/index.html):
@@ -163,14 +163,14 @@ for _ in range(target):

```python
for _ in range(target//15):
pyboy.tick(15, True)
pyboy.tick(15)

```
</td>
<td >

```python
pyboy.tick(target)
pyboy.tick(target, False)

```
</td>
@@ -186,9 +186,9 @@ do 3160 hours of gameplay in 1 hour.

Contributing
============
Any contribution is appreciated. The currently known problems are tracked in [the Issues tab](https://github.com/Baekalfen/PyBoy/issues). Feel free to take a swing at any one of them. If you have something original in mind, come and [discuss it on on Discord](https://discord.gg/Zrf2nyH).
Any contribution is appreciated. The currently known problems are tracked in [the Issues tab](https://github.com/Baekalfen/PyBoy/issues). Feel free to take a swing at any one of them. If you have something original in mind, come and [discuss it on on Discord](https://discord.gg/wUbag3KNqQ).

[![Discord](https://img.shields.io/discord/584149554132418570?style=for-the-badge&logo=Discord&label=PyBoy)](https://discord.gg/Zrf2nyH)
[![Discord](https://img.shields.io/discord/584149554132418570?style=for-the-badge&logo=Discord&label=PyBoy)](https://discord.gg/wUbag3KNqQ)

For the more major features, there are the following that you can give a try. They are also described in more detail in the [project list in the Wiki](https://github.com/Baekalfen/PyBoy/wiki/Student-Projects):
* Hacking games
6 changes: 3 additions & 3 deletions docs/api/constants.html
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta name="generator" content="pdoc 0.10.0" />
<meta name="generator" content="pdoc 0.11.5" />
<title>pyboy.api.constants API documentation</title>
<meta name="description" content="Memory constants used internally to calculate tile and tile map addresses." />
<link href='https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.0/normalize.min.css' rel='stylesheet'>
@@ -184,9 +184,9 @@ <h1>Index</h1>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.10.0</a>.</p>
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.11.5</a>.</p>
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad()</script>
</body>
</html>
</html>
Loading