User Tools

Site Tools


notes:cprog:fall2024:projects:fwg0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:cprog:fall2024:projects:fwg0 [2024/10/07 21:06] – [displaying text] tkastne1notes:cprog:fall2024:projects:fwg0 [2024/10/10 02:15] (current) – [processing textures and regions] tkastne1
Line 8: Line 8:
  
   *This repository has .zip and .tar.gz files containing all necessary source code   *This repository has .zip and .tar.gz files containing all necessary source code
 +
 +The list of C header files for Vircon32 is here [[https://www.vircon32.com/api.html|https://www.vircon32.com/api.html]]
 +
 +  *Functions specific to Vircon32 are defined here, including video.h
 =====Build from Source===== =====Build from Source=====
  
 The aforementioned archive files contain a README detailing the build process. The aforementioned archive files contain a README detailing the build process.
 =====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 <code> bash Make.sh </code> The <wrap hi> .sh </wrap> represents that it is a shell script file.
 ====compile==== ====compile====
 +First we need to compile the C code, which can be done with the following command from the Vircon32 developer tools:  
 +<code>compile CODE.c -o obj/CODE.asm || abort_build</code>  
 +Where <wrap hi>CODE</wrap> is the name of your file, which may be preceded with "Tutorial" if you're keeping the same name as the demo file.
 ====assemble==== ====assemble====
 +Once you've compiled your code successfully, you can use the following Vircon32 tool to assemble the ASM code:  
 +<code>assemble obj/CODE.asm -o obj/CODE.vbin || abort_build</code> 
 +Where, again, <wrap hi>CODE</wrap> is whatever you decided to name this project. 
 ====image processing==== ====image processing====
 +To use the images we want with the Vircon32 console/emulator, we have to first use one of the development tools provided to us. This tool is called png2vircon, and if you have it in your path you should be able to use it as such: <code> png2vircon IMAGE.png </code> where IMAGE is the file name of your png. 
 ====packing the ROM==== ====packing the ROM====
  
Line 32: Line 40:
 The print() method draws text using the drawing point as the uppermost left part of the text 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/creates a region that is used by other functions (like define_region)
  
 +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/.png/.vtex to be used for many sprites/regions 
 ====displaying a region at location==== ====displaying a region at location====
  
notes/cprog/fall2024/projects/fwg0.1728335206.txt.gz · Last modified: 2024/10/07 21:06 by tkastne1