ImportError PyBoy on termux
I tried to test my work on my phone using Termux Debian emulator. After uninstalling the pyboy module and cloning my repository, I get an import error inside your module. I don't understand what is wrong.
[Thank you]
```
Successfully uninstalled pyboy-2.6.0...
Brainstorming: adapting lcd.py to android
Hi everyone!š
I've made some progress adapting pyboy to android using kivy/buildozer.
It works perfectly on some games, but unfortunately not on the one im interested, which is pokemon crystal.
I get consistent crashes on the same frames everytime. For example, on the loading screen when suicune is running and you have to press start....

Help on Debugging a Bot for Pokemon Red
Hi guys, I'm new here. Also, programming is a hobby, so please don't evaluate the code as a real programmer. Attached is the code and requirements I'm using to create a bot so I can accelerate the speed of leveling up.
In summary, the code reads the flags from text files where I toggle "y" to activate the features. The main feature is the training, where the character goes from left to right in a zone where there are wild pokemon. If HP or PP are zero for the 1st pokemon in the party, then it goes to the pokemon center. The path to pokemon center was previously recorded based on X, Y and Map ID and saved in another log file.
Issue: the bot works as expected (levels up ~10 levels) until some point where it gets stuck after PP=0. Instead of going to the pokemon center, it goes left, hit the wall, and there is this infinite loop. I tried the best I could to debug what could happen, but I think it is time to get some help from experts. Any hint on what I could do different, I'll appreciate....
Exploration AI in Pokemon Red - Is there an easy way to skip battles?
Hi, Iām new here and Iāve only been using PyBoy for about two months. Iāve already done some research and created small projects, like automatic exploration using Q-learning or battling with randomly chosen buttons.
Ok, now to the point. Iāve started a somewhat more complex project using Double Deep Q-learning for exploration and Iād like to make it as effective as possible. I need help with one thing:
Is there an easy way to skip battles? I know thereās a special flag that indicates whether a battle is occurring, but is there a simple method to automatically run away or just skip it? In the worst case, is there some tuning I can apply to make running away 100% successful? That way I could have the AI run every time, even if that might be overly optimized....
Is there a way to convert a pyboy .state file to an mgba save state?
The Gemini Plays Pokemon dev uses mGBA. It'd be convenient if I could give him my pyboy save states for play testing.
How can I access PyBoy.mb from within a subclass.
This has probably been asked before but I wanted to try to get local link support working in PyBoy
I felt it would be easier to modify if I made it a subclass of PyBoy.
Here is a small snippet of my code:
```...
Cant get Bootrom tests to pass
I am setting up a new install after not having touched this project in a while, I believe i have all the correct roms in the secrets folder but the bootrom tests arent getting some of the screenshots i guess? im not exactly sure whats being tested here but it bugs the hell out of me to have failing tests before i even begin. All other tests are passing except the bootrom ones and the open gl test but idc about that
```
/home/nicole-demera/PyBoy/tests/test_bootroms.py::test_all_modes[any_rom_cgb-boot_rom-270-None] failed: cgb = None, _bootrom = 'test_roms/secrets/dmg_boot.bin', frames = 270
rom = 'test_roms/secrets/Pokemon - Crystal Version (UE) (V1.0) [C]!.gbc'
any_rom_cgb = 'test_roms/secrets/Pokemon - Crystal Version (UE) (V1.0) [C]!.gbc'...

Is it possible to write to tilemaps?
I've been using PyBoy to successfully read from the background tilemap and the window tilemap. I was wondering, is it possible to write to these tilemaps?
.sav file not being picked up
Moving the thread here:
dumb question: I have a pokemon blue ".gb" file and ".sav" file. But when I start pyboy from the terminal with
python3 -m pyboy "Pokemon - Blue Version (USA, Europe) (SGB Enhanced).gb"...
Can Pyboy load save files?
Hello (yes again), If I were to say make a save file in PokƩmon crystal. Would I be able to access that save file on a new instance of emulator?
Issue asserting Cartridge title SML
I am having some difficulty running the SML land Rom in pyboy. I am under the impression that pyboy will use the cartridge title (from the header) to determine which game wrapper to use, and this is why the sample code includes the assert pyboy.cartridge_title == "SUPER MARIOLAN".
Right now my code fails this assertion, and when I made some code to read the header, it says the title should be "SUPER MARIOLAND"
with the "D" at the end. Well, modifying the assert statement to reflect this additional D did not help.
...
Save states not functioning properly when sound flag is used
Hello, I've been testing out Pyboy with Pokemon Crystal, and was using the
--sound
flag to enable the sound. I used Z to store the save state which it did. But when I came back around and tried reloading it with the --sound
flag. the sound was gone and an error was presentProblems with Alleyway and Adam's Family
I have been trying for 1 hour to fix this but for some reason there are games that doesn't work well on my end.
Alleyway (the game starts on its own, paddle appears on the left and the game is paused, I can unpause and pause and pressing "a" I can throw the ball, arrows doesn't work)
Adam's Family ( Stuck after the main menu )...
Loading ROM doesn't work with library
I installed 2.4.1 on my laptop, attempting to load metroid2 with the pyboy binary works fine, but when attempting to load the same ROM in a python file fails:
```python
from pyboy import PyBoy
pyboy = PyBoy("metroid2.gb")...
Extracting score from memory
Hi, I'm trying to make an RL agent for gameboy tennis. I need a way to get the score after each point. One method is by processing the pixel data but I thought it would be more efficient/reliable to read it directly from memory. I'm not really sure where to start. I've installed visualboyadvance-m which has a memory viewer but a lot of values change so no idea how to narrow it down. Any help would be appreciated.
[Solved] PyBoy Keyboard mapping
Update: I just saw the keymappings are in the installation page on https://github.com/Baekalfen/PyBoy/wiki/Installation#starting-pyboy
I skipped over that page, because I just used pip install and it worked.
--------
...
ROM file game_rom.gb was not found
hi im trying to run pyboy, just as outlined in the github but it keeps coming up with this error
FileNotFoundError: ROM file game_rom.gb was not found!
i tried it on terminal as well and got the same issue :((...

Memory view into PyBoy [Example]
How do I get a memory view from PyBoy? When I take a slice like this
pyboy.memory[0xFF00:0xFFFF]
, it doesn't change when the special registers update.