Final Project: Zelda 291: Input


Introduction

Zelda 291 will accept information from both the keyboard and either a joystick or gamepad.

Problem Description

This part of the program is fairly straightfoward. It basically just uses a common keyboard interrupt and a standard joystick function. If two direction keys are pressed, the program will move in one direction and must "remember" the other direction in case the player releases the other key. A new aspect of this that was not done in the machine problems is that we will use press and release interrupts for the keyboard.

I also worked on various introduction screens. Perhaps the most difficult part of this was implementing a scrolling feature. It was also a challenge to display the scrolling file since it was 800 lines long and only 200 can be on the screen at once.

Keyboard

The gaming controls on the keyboard will be functional only when the joystick is on. The control keys will always be functional. The keyboard will accept the following commands:

Joystick/GamePad

The joystick will only become functional if the user presses the Y key at the intial screen. Some joysticks contain only two buttons (A and B). However, the Gravis Gamepad contains four buttons, two of which will be used. It will accept the following inputs:

Scrolling

The scrolling was implemented by first loading the screen with the first 64000 bytes of the uncompressed file. Then, to implement scrolling, each line on the screen was shifted up one row, and the last row was filled with the next block of data from the file.

Procedures