ref: 28268df40e91e48637862a4428b01d5abae2ff0f
parent: aade38c733d0060be623525e50d2b24e718c7bee
author: Bryan Bishop <[email protected]>
date: Tue Jun 25 19:23:44 EDT 2013
remove extra whitespace in extras/vba.py
--- a/extras/vba.py
+++ b/extras/vba.py
@@ -119,9 +119,9 @@
def _check_java_library_path():
"""
- Returns the value of java.library.path.
-
- The vba-clojure library must be compiled
+ Returns the value of java.library.path.
+
+ The vba-clojure library must be compiled
and linked from this location.
"""
return System.getProperty("java.library.path")
@@ -159,8 +159,8 @@
def button_combiner(buttons):
"""
- Combines multiple button presses into an integer.
-
+ Combines multiple button presses into an integer.
+
This is used when sending a keypress to the emulator.
"""
result = 0
@@ -196,8 +196,8 @@
def load_rom(path=None):
"""
- Starts the emulator with a certain ROM.
-
+ Starts the emulator with a certain ROM.
+
Defaults to rom_path if no parameters are given.
"""
if path == None:
@@ -215,8 +215,8 @@
def shutdown():
"""
- Stops the emulator. Closes the window.
-
+ Stops the emulator. Closes the window.
+
The "opposite" of this is the load_rom function.
"""
Gb.shutdown()
@@ -251,8 +251,8 @@
def _create_byte_buffer(data):
"""
- Converts data into a ByteBuffer.
-
+ Converts data into a ByteBuffer.
+
This is useful for interfacing with the Gb class.
"""
buf = ByteBuffer.allocateDirect(len(data))
@@ -266,11 +266,11 @@
def set_state(state, do_step=False):
"""
- Injects the given state into the emulator.
-
- Use do_step if you want to call step(), which also allows
- SDL to render the latest frame. Note that the default is to
- not step, and that the screen (if it is enabled) will appear
+ Injects the given state into the emulator.
+
+ Use do_step if you want to call step(), which also allows
+ SDL to render the latest frame. Note that the default is to
+ not step, and that the screen (if it is enabled) will appear
as if it still has the last state loaded. This is normal.
"""
Gb.loadState(_create_byte_buffer(state))
@@ -289,8 +289,8 @@
def save_state(name, state=None, override=False):
"""
- Saves the given state to save_state_path.
-
+ Saves the given state to save_state_path.
+
The file format must be ".sav"
(and this will be appended to your string if necessary).
"""
@@ -313,8 +313,8 @@
def load_state(name):
"""
- Reads a state from file based on name.
-
+ Reads a state from file based on name.
+
Looks in save_state_path for a file
with this name (".sav" is optional).
"""
@@ -340,8 +340,8 @@
def get_root():
"""
- Loads the root state.
-
+ Loads the root state.
+
(Or restarts the emulator and creates a new root state.)
"""
try:
@@ -397,8 +397,8 @@
def set_memory(memory):
"""
- Sets memory in the emulator.
-
+ Sets memory in the emulator.
+
Use get_memory() to retrieve the current state.
"""
Gb.writeMemory(memory)
@@ -405,8 +405,8 @@
def get_pixels():
"""
- Returns a list of pixels on the screen display.
-
+ Returns a list of pixels on the screen display.
+
Broken, probably. Use screenshot() instead.
"""
sys.stderr.write("ERROR: seems to be broken on VBA's end? Good luck. Use"
@@ -418,9 +418,9 @@
def screenshot(filename, literal=False):
"""
- Saves a PNG screenshot to the file at filename.
-
- Use literal if you want to store it in the current directory.
+ Saves a PNG screenshot to the file at filename.
+
+ Use literal if you want to store it in the current directory.
Default is to save it to screenshots/ under the project.
"""
screenshots_path = os.path.join(project_path, "screenshots/")
@@ -453,9 +453,9 @@
def set_memory_at(address, value):
"""
- Sets a byte at a certain address in memory.
-
- This directly sets the memory instead of copying
+ Sets a byte at a certain address in memory.
+
+ This directly sets the memory instead of copying
the memory from the emulator.
"""
Gb.setMemoryAt(address, value)
@@ -462,8 +462,8 @@
def press(buttons, holdsteps=1, aftersteps=1):
"""
- Press a button.
-
+ Press a button.
+
Use steplimit to say for how many steps you want to press
the button (try leaving it at the default, 1).
"""
@@ -483,8 +483,8 @@
def get_buttons():
"""
- Returns the currentButtons[0] value
-
+ Returns the currentButtons[0] value
+
(an integer with bits set for which
buttons are currently pressed).
"""
@@ -773,11 +773,11 @@
@staticmethod
def walk_through_walls():
"""
- Lets the player walk all over the map.
-
- These values are probably reset by some of the map/collision
- functions when you move on to a new location, so this needs
- to be executed each step/tick if continuous walk-through-walls
+ Lets the player walk all over the map.
+
+ These values are probably reset by some of the map/collision
+ functions when you move on to a new location, so this needs
+ to be executed each step/tick if continuous walk-through-walls
is desired.
"""
set_memory_at(0xC2FA, 0)
@@ -793,7 +793,7 @@
def nstep(steplimit=500):
"""
Steps the CPU forward and calls some functions in between each step.
-
+
(For example, to manipulate memory.) This is pretty slow.
"""
for step_counter in range(0, steplimit):
@@ -848,9 +848,9 @@
@staticmethod
def menu_select(id=1):
"""
- Sets the cursor to the given pokemon in the player's party.
-
- This is under Start -> PKMN. This is useful for selecting a
+ Sets the cursor to the given pokemon in the player's party.
+
+ This is under Start -> PKMN. This is useful for selecting a
certain pokemon with fly or another skill.
This probably works on other menus.
@@ -936,8 +936,8 @@
@staticmethod
def get_text():
"""
- Returns alphanumeric text on the screen.
-
+ Returns alphanumeric text on the screen.
+
Other characters will not be shown.
"""
output = ""