This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
notes:cprog:fall2024:projects:fwg0 [2024/03/14 08:57] – created - external edit 127.0.0.1 | notes:cprog:fall2024:projects:fwg0 [2024/10/10 02:15] (current) – [processing textures and regions] tkastne1 | ||
---|---|---|---|
Line 3: | Line 3: | ||
=====URLs===== | =====URLs===== | ||
- | The GitHub repository for Vircon32 and DevTools Can be found at: [[https://github.com/ | + | The main Virocon32 site is [[https://www.vircon32.com/|vircon32.com]] |
- | This site will provide zip files for both and how to install them. | + | The list of Releases can be found on the Vircon32 GitHub repository here: [[https:// |
- | =====Build from Source===== | + | |
- | Install the Emulator and the DevTools outside the Lab46 repository. | + | *This repository |
- | ''< | + | The list of C header files for Vircon32 |
- | ''< | + | *Functions specific to Vircon32 |
+ | =====Build from Source===== | ||
- | Unzip these files which provide | + | The aforementioned archive |
- | + | ||
- | ''< | + | |
- | + | ||
- | ''< | + | |
- | + | ||
- | To install these use the following commands: | + | |
- | + | ||
- | < | + | |
- | sudo dpkg -i vircon32-emulator_24.3.2_armhf.deb | + | |
- | sudo apt-get install -f | + | |
- | + | ||
- | sudo dpkg -i vircon32-devtools_24.2.4_armhf.deb | + | |
- | </ | + | |
- | + | ||
- | The base path for the install is ''/ | + | |
- | + | ||
- | To run the Vircun32 API, change to the emulator directory and run '' | + | |
- | + | ||
- | There' | + | |
=====Cartridge build process===== | =====Cartridge build process===== | ||
+ | All of the following steps can be simplified by using the Make.sh that is already made for us. It's worth looking within the file to see how it operates. To use this file you can type < | ||
====compile==== | ====compile==== | ||
+ | First we need to compile the C code, which can be done with the following command from the Vircon32 developer tools: | ||
+ | < | ||
+ | Where <wrap hi> | ||
====assemble==== | ====assemble==== | ||
+ | Once you've compiled your code successfully, | ||
+ | < | ||
+ | Where, again, <wrap hi> | ||
====image processing==== | ====image processing==== | ||
+ | To use the images we want with the Vircon32 console/ | ||
====packing the ROM==== | ====packing the ROM==== | ||
Line 47: | Line 32: | ||
====displaying text==== | ====displaying text==== | ||
- | + | Text can be displayed with the set_drawing_point() and print() methods | |
- | A basic way of displaying text would be to set the ( x, y ) coordinates of the starting point, followed by printing your text. Below is the example from the Hello World tutorial. | + | |
< | < | ||
- | // draw our text near the top-left of the screen | + | set_drawing_point(0, 0); |
- | | + | print(" |
- | print( "Hello, World!" ); | + | |
</ | </ | ||
+ | |||
+ | The print() method draws text using the drawing point as the uppermost left part of the text | ||
====processing textures and regions==== | ====processing textures and regions==== | ||
+ | select_texture(int texture_id) | ||
+ | *"Sets the selected texture to the given texture ID. All texture functions will apply to that texture from that moment" | ||
+ | *Selects a .vtex texture that will be used for other functions (like select_region) | ||
+ | |||
+ | select_region(int region_id) | ||
+ | *"Sets the selected texture region to the given texture ID. All region functions will apply to that region ID from the selected texture" | ||
+ | *Selects/ | ||
+ | define_region(int min_x, int min_y, int max_x, int max_y, int hotspot_x, int hotspot_y) | ||
+ | *Defines the currently selected texture region, as a rectangle within the selected texture. All arguments are given in pixel coordinates within the selected texture | ||
+ | *Defines the bounds of the region, used for other function (like draw_region_at | ||
+ | *Allows a specific portion of a texture to be used as a sprite | ||
+ | *Allows a single texture/ | ||
====displaying a region at location==== | ====displaying a region at location==== | ||