Authors: Sahaj Singh, Bryce Leung
Reaction Time Based Game This game is written in ARM7 assembly instruction set for the Xilinx ZedBoard (The Zedboard is based on Zynq - 7000 EPP Development Kit)
FAS Track is a user reaction time game, where the users or users try to get their arrow onto the given finish mark. FAS Track utilizes the LEDs, switches, and OLED display on the ZedBoard. Written in the ARM7 assembly instruction set for the Xilinx ZedBoard, based on the Zynq – 7000 EPP development kit. Additionaly a few key concepts demonstrated through this project are timer interrupts, masking, oled display as well as FSMs.Through this document, you will gain a further understanding of how these components are utilized.
The OLED display is used for multiple display purposes for FAS Track. With the first row of the display displaying the current mode of the game and the other three rows being used as the play area. The first and third rows of the play area, are used to display moving arrows across the display. The movement of the arrows are done, using a printing function that increments the offset of the printing of the arrow that accounts for the end of the row. While the second row of the play area, is used to first print the dividing line between the two arrows. Additionally, it is used to display a randomly generated end point for the player or players to land on when a speed difficulty mode is running thus being in play.
The usage of LEDs for FAS Track is to indicate the switches that have been activated. When the game starts in base mode, the LEDs are active on the available switches that can be used.
LEDs At Base Mode Un-Flipped and LED Off When SW0 Is Flipped
When the player flips one of the available switches, the LEDs will represent the flip of the switch by turning off the LED of the switch below it.
Managing the difficulty speed of the game and being used as the input for the user or users to stop their arrow moving across the screen. Being detected through the utilization of masks, to identify the switch that has been flipped.
Below are the switches and their defined purpose as well as location on the board:
Switch | Switches Purpose |
---|---|
SW 0: | Setting the speed mode to easy |
SW 1: | Setting the speed mode to medium |
SW 2: | Setting the speed mode to hard |
SW 3: | Not In Use |
SW 4: | Not In Use |
SW 5: | Player 2 stops bottom arrow |
SW 6: | Not In Use |
SW 7: | Player 1 stops top arrow |
When either one of the switches from SW 0 to SW 1 are utilized, the following behavior
will be seen:
The Different Speed Modes Based On Switch Input
When either one or both of SW7 and SW 5 are utilized, associated arrows will pause printing on the OLED:
Players Arrow Stopping Switches Activated
The usage of switches also considers the necessary order of which switches must be used. As shown in the diagram below, the different modes and states ensure that there are no unexpected effects from an erroneous flip of a switch.
This behaviour can be seen in the following images, where either one or both users have chosen to stop their arrows. When the speed difficulty mode switches have been changed by accident, the game does not acknowledge the change as the users are still playing the game.