### Enable and Start Docker Service Source: https://github.com/alekmaul/pvsneslib/blob/master/docker/Readme.md Commands to enable the Docker service to start on boot and then start it immediately. These are essential steps after installing Docker. ```bash sudo systemctl enable docker sudo systemctl start docker ``` -------------------------------- ### Example gfx4snes Conversion Command Source: https://github.com/alekmaul/pvsneslib/blob/master/tools/gfx4snes/readme.md An example command demonstrating various options for converting a PNG image. This includes specifying output colors, tile size, palette entry, output format, map generation, blank tile management, and input file. ```bash gfx4snes -o 16 -s 8 -c 16 -e 0 -f png -p -m -b -i myimage.png ``` -------------------------------- ### Update PVSnesLib Path in c_cpp_properties.json (Linux Example) Source: https://github.com/alekmaul/pvsneslib/blob/master/vscode-template/README.md Update the `pvsneslibPath` in `c_cpp_properties.json` to your PVSneslib installation directory on Linux. The `/**` suffix is crucial for the include paths to work correctly. ```json "pvsneslibPath": ["/path/to/pvsneslib/include/**","/path/to/pvsneslib/devkitsnes/include"] ``` -------------------------------- ### Update PVSnesLib Path in c_cpp_properties.json (Windows Example) Source: https://github.com/alekmaul/pvsneslib/blob/master/vscode-template/README.md Modify the `pvsneslibPath` in `c_cpp_properties.json` to reflect your PVSneslib installation directory on Windows. Ensure the path includes `/**` for correct include resolution. ```json "pvsneslibPath": ["c:/snesdev/pvsneslib/include/**","c:/snesdev/pvsneslib/devkitsnes/include"] ``` -------------------------------- ### Manual BRR Encoding Examples Source: https://github.com/alekmaul/pvsneslib/blob/master/tools/snesbrr/readme.txt These examples show the raw BRR block data for simple waveforms at a pitch rate of 0x1000, demonstrating manual encoding principles. ```plaintext 1000 Hz Square Wave: B0 77 77 77 77 77 77 77 77 B3 99 99 99 99 99 99 99 99 ``` ```plaintext 1000 Hz Triangle Wave: B0 01 23 45 67 76 54 32 10 B3 FE DC BA 98 89 AB CD EF ``` ```plaintext 1000 Hz Sawtooth Wave: B0 00 11 22 33 44 55 66 77 B3 88 99 AA BB CC DD EE FF ``` -------------------------------- ### Example SNESMOD Song Message Source: https://github.com/alekmaul/pvsneslib/blob/master/pvsneslib/pvsneslib_snesmod.txt An example of a song message containing SNESMOD commands for echo and filter settings. ```SNESMOD [[SNESMOD]] edl 6 efb 127 evol 31 -31 efir 127 0 0 0 0 0 0 0 eon 1 2 3 ``` -------------------------------- ### Display dockerrun.sh Help Source: https://github.com/alekmaul/pvsneslib/blob/master/docker/Readme.md Shows the usage instructions for the `dockerrun.sh` script, detailing available options for building and releasing PVSNESLIB within Docker containers. ```bash ./dockerrun.sh -h ``` -------------------------------- ### Load Map into Buffer and Initialize Map Engine Source: https://github.com/alekmaul/pvsneslib/blob/master/snes-examples/maps/mapbuffer/mapbufferextension.md Loads a map into the map buffer and then initializes the map engine using this buffer. This is the first step to enable runtime map manipulation. ```c #include "mapbufferextension.h" ... //load map into wram mapbuffersLoad((u8 *)&mapmario, (&mapmario_end- &mapmario)); //map engine gets the buffer instead mapLoad((u8 *)&mapbuffer, (u8 *)&tilesetdef, (u8 *)&tilesetatt); ``` -------------------------------- ### gfx4snes Command Line Usage Source: https://github.com/alekmaul/pvsneslib/blob/master/tools/gfx4snes/readme.md Basic command line syntax for using gfx4snes. Specify image files and desired output format. ```bash gfx4snes [options] png/bmp filename ... ``` -------------------------------- ### Compile and Create Release for Ubuntu Source: https://github.com/alekmaul/pvsneslib/blob/master/docker/Readme.md Uses `dockerrun.sh` to compile PVSNESLIB for Ubuntu and then create a release package. The resulting release file will be located in the 'release' directory. ```bash docker/scripts/dockerrun.sh -d ubuntu -r ``` -------------------------------- ### Compiling SPC700 Driver with bass Assembler Source: https://github.com/alekmaul/pvsneslib/blob/master/devkitsnes/readme.txt This snippet shows how to compile the sm_spc.asm file using the bass assembler (TA) and the TXCONV tool. It includes steps for assembling, converting, and cleaning up intermediate files. ```makefile sm_spc.asm : ../snesmod/sm_spc.as7 $(TA) -07 -b -l $< sm_spc.obj sm_spc.lst $(TXCONV) -ca sm_spc.obj @rm sm_spc.obj ``` -------------------------------- ### Update VRAM - Slow Method Source: https://github.com/alekmaul/pvsneslib/blob/master/snes-examples/maps/mapbuffer/mapbufferextension.md Sets a map tile in the buffer and flags the map as dirty to update the entire screen to VRAM. Use this when frame rate is not critical. ```c mapbuffer[123] = 0x0001; mapdirty = 1; ``` -------------------------------- ### Define Dynamic Tile Buffer and Queue Sizes Source: https://github.com/alekmaul/pvsneslib/blob/master/snes-examples/maps/mapbuffer/mapbufferextension.md Sets the maximum number of entries for the dynamic tile buffer and the dynamic tile queue. These are configuration settings for the assembly part of the extension. ```assembly ;mapbufferextensionA.asm: .DEFINE DTBUFFER_MAX 32 .DEFINE DTQUEUE_MAX 32 ``` -------------------------------- ### Encode WAV to BRR Source: https://github.com/alekmaul/pvsneslib/blob/master/tools/snesbrr/readme.txt Use the --encode option to convert a WAV file to a BRR file. The --loop-start option can be used to specify a loop point. ```bash snesbrr --encode input.wav output.brr ``` ```bash snesbrr --encode --loop-start 100 input.wav output.brr ``` -------------------------------- ### Transcode WAV to BRR and back to WAV Source: https://github.com/alekmaul/pvsneslib/blob/master/tools/snesbrr/readme.txt The --transcode option allows for a direct conversion from WAV to BRR and then back to WAV, useful for previewing or testing encoding parameters. ```bash snesbrr --transcode input.wav output.wav ``` -------------------------------- ### Compile for Ubuntu Distribution Source: https://github.com/alekmaul/pvsneslib/blob/master/docker/Readme.md Executes the `dockerrun.sh` script to compile PVSNESLIB code specifically for the Ubuntu distribution within a Docker container. This script must be run from the project's root directory. ```bash docker/scripts/dockerrun.sh -d ubuntu ``` -------------------------------- ### Define Dynamic Tile Buffer Max Size in Header Source: https://github.com/alekmaul/pvsneslib/blob/master/snes-examples/maps/mapbuffer/mapbufferextension.md Defines the maximum size for the dynamic tile buffer in the C header file. This value must match the one defined in the assembly file. ```c //mapbufferextension.h: #define DTBUFFER_MAX 32 // same value like in the asm file! ``` -------------------------------- ### Decode BRR to WAV Source: https://github.com/alekmaul/pvsneslib/blob/master/tools/snesbrr/readme.txt Use the --decode option to convert a BRR file back to a WAV file. Options like --pitch and --enable-gauss can modify the decoding process. ```bash snesbrr --decode input.brr output.wav ``` ```bash snesbrr --decode --pitch 0x1234 --enable-gauss input.brr output.wav ``` -------------------------------- ### Set Echo Delay (EDL) Source: https://github.com/alekmaul/pvsneslib/blob/master/pvsneslib/pvsneslib_snesmod.txt Use the EDL command in the song message to set the echo delay value. The delay time is calculated as delay value * 16 milliseconds. Each 16ms of delay consumes 2KB of SPC memory. ```text "EDL 5" ``` -------------------------------- ### Enable Echo Channels Source: https://github.com/alekmaul/pvsneslib/blob/master/pvsneslib/pvsneslib_snesmod.txt Enables echo for the specified channels. Channels are 1-indexed. ```SNESMOD EON 1 3 4 5 ``` ```SNESMOD eon 1 2 3 ``` -------------------------------- ### Define WRAM Bank for Dynamic Tile Buffer Source: https://github.com/alekmaul/pvsneslib/blob/master/snes-examples/maps/mapbuffer/mapbufferextension.md Sets the default bank for the dynamic tile buffer. This is a configuration setting for the assembly part of the extension. ```assembly ;mapbufferextensionA.asm: .DEFINE DTBUFFERBANK $7F ``` -------------------------------- ### Run dockerrun.sh in Batch Mode Source: https://github.com/alekmaul/pvsneslib/blob/master/docker/Readme.md Executes the `dockerrun.sh` script in batch mode for Ubuntu compilation, suppressing progress bars for cleaner logs. This is useful for automated or non-interactive environments. ```bash ./dockerrun -d ubuntu -b ``` -------------------------------- ### Add User to Docker Group Source: https://github.com/alekmaul/pvsneslib/blob/master/docker/Readme.md Command to add the current user to the 'docker' group, allowing them to run Docker commands without sudo. A system restart is required for this change to take effect. ```bash sudo usermod -aG docker ${USER} ``` -------------------------------- ### Configure VS Code Terminal for MSYS2 UCRT on Windows Source: https://github.com/alekmaul/pvsneslib/blob/master/vscode-template/README.md Add this block to your user settings to enable the MSYS2 UCRT profile in the integrated terminal. This is required for building PVSneslib projects on Windows. ```json "terminal.integrated.profiles.windows": { "MSYS2 UCRT": { "path": "cmd.exe", "args": [ "/c", "C:\\msys64\\msys2_shell.cmd -defterm -here -no-start -ucrt64" ] } }, ``` -------------------------------- ### Set FIR Filter Coefficients Source: https://github.com/alekmaul/pvsneslib/blob/master/pvsneslib/pvsneslib_snesmod.txt Specifies coefficients for an 8-tap FIR filter applied to echo output. Default coefficients are provided if fewer than 8 values are given. ```SNESMOD EFIR 64 -32 16 ``` ```SNESMOD efir 127 0 0 0 0 0 0 0 ```