CSCS1320 C/C++ Programming

PROJECT: FUN WITH GAMES (fwg0)

OBJECTIVE

Obtain the latest stable release source code, or latest repository code, of the Vircon32 Fantasy Console, along with its DevTools, and modify the provided code to display an image, change the text, basically modify the code as given to some different state of output.

TASK

Obtain and install on your development system the latest stable release, or latest version of the repository code, of the Vircon32 Fantasy Console, along with its DevTools (C compiler).

NOTE: Do NOT add the source code or binary code to Vircon32 or DevTools to your repository! Process these outside of your repository. Once installed, your files specifically related to your modified code SHOULD be added to your repository.

There is a Readme.md file in the base directory of the Vircon32 ComputerSoftware directory that includes build instructions.

Verify that it works, by testing the project-supplied code in its initial state by ensuring the DevTools work when called (compile, assemble, and packrom), and of course running it in the Vircon32 emulator.

Then, modify the program according to the following criteria:

PROGRAM

You are to write a Vircon32 C program that does the following:

  • displays at least one image/sprite (region) to the screen
  • alters the default text in a meaningful way

NOTE: the first gamepad by default is mapped to the keyboard

URLs

The Vircon32 C API reference can be found here.

The code can be found on the Vircon32 ComputerSoftware GitHub repository

I would recommend against checking out the tutorials: too many have gotten into trouble being influenced by the code, running into issues trying to conform to project specifications.

CARTRIDGE BUILD PROCESS

All of these steps can be automated with the use of the provided Makefile simply by typing make at the prompt.

NOTE that with certain modifications, you'll first need to modify the XML file as appropriate.

COMPILE

First step is to compile the C code, which can be done with the following command from the Vircon32 developer tools C compiler (compile):

yoursystem:~/src/SEMESTER/cprog/fwg0$ compile fwg0.c -o fwg0.asm

This compiles, or translates, the C code into Vircon32 assembly language code, which will then need to be assembled to machine code:

ASSEMBLE

Once you've compiled your code successfully, you can use the Vircon32 assemble DevTool to assemble the assembly:

yoursystem:~/src/SEMESTER/cprog/fwg0$ assemble fwg0.asm -o fwg0.vbin

IMAGE CONVERSTION

Any PNG images you'd like to use need to be converted to Vircon32 texture format via the png2vircon tool:

yoursystem:~/src/SEMESTER/cprog/fwg0$ png2vircon background.png -o background.vtex
yoursystem:~/src/SEMESTER/cprog/fwg0$ png2vircon sprites.png -o sprites.vtex

Note that you'll also want to ensure the XML file has been updated to reference these textures:

  <binary path="fwg0.vbin" />
  <textures>
      <texture path="background.vtex" />
      <texture path="sprites.vtex" />
  </textures>

AUDIO CONVERSION

Should you have any WAV files you'd like to use need to be converted to the Vircon3 sound format via the wav2vircon tool:

yoursystem:~/src/SEMESTER/cprog/fwg0$ wav2vircon backgroundmusic.wav -o backgroundmusic.vsnd
yoursystem:~/src/SEMESTER/cprog/fwg0$ wav2vircon soundfx.wav -o soundfx.vsnd

Note that you'll also want to ensure the XML file has been updated to reference these sounds:

  <sounds>
      <sound path="backgroundmusic.vsnd" />
      <sound path="soundfx.vsnd" />
  </sounds>

PACKING THE ROM

Once all the components have been built, you can pack them together into a Vircon32 cartridge for use in the emulator via the packrom tool:

yoursystem:~/src/SEMESTER/cprog/fwg0$ packrom fwg0.xml

SUBMISSION

To be successful in this project, the following criteria (or their equivalent) must be met:

  • Project must be submit on time, by the deadline.
    • Late submissions will lose 33% credit per day, with the submission window closing on the 3rd day following the deadline.
  • Executed programs must display in a manner similar to provided output
    • output formatted, where applicable, must match that of project requirements
  • Processing must be correct based on input given and output requested
  • Output, if applicable, must be correct based on values input
  • Code must be nicely and consistently indented
  • Code must be consistently written, to strive for readability from having a consistent style throughout
  • Code must be commented
    • Any "to be implemented" comments MUST be removed
      • these "to be implemented" comments, if still present at evaluation time, will result in points being deducted.
      • Sufficient comments explaining the point of provided logic MUST be present
  • No global variables (without instructor approval), no goto statements, no calling of main()!
  • Track/version the source code in your private semester repository

To submit this project to me, make sure the Makefile and your completed fwg0.c file, fwg0.xml, and any associated asset files are placed in your private semester repository under cprog/fwg0/; do NOT track any .vbin or .v32 files.

RUBRIC

I'll be evaluating the project based on the following criteria:

156:fwg0:final tally of results (156/156)
*:fwg0:code modified to meet project specifications [52/52]
*:fwg0:screenshot or video posted to class DISCORD of CART running [26/26]
*:fwg0:source file, XML file, build script, and assets provided [26/26]
*:fwg0:code compiles, cartridge builds with no warning or error [26/26]
*:fwg0:committed project related changes to private semester repo [26/26]

Additionally:

  • Solutions not abiding by spirit of project will be subject to a 50% overall deduction
  • Solutions not utilizing descriptive why and how comments will be subject to a 25% overall deduction
  • Solutions not utilizing indentation to promote scope and clarity or otherwise maintaining consistency in code style and presentation will be subject to a 25% overall deduction
  • Solutions not organized and easy to read (assume a terminal at least 90 characters wide, 40 characters tall) are subject to a 25% overall deduction