ECE291 Fall 1998 |
Computer Engineering II Final Project |
Jesse Chen Scott Mikula Long Truong Michael Urman |
Robo Rally
| Purpose |
Show off our programming ability by coding a good game. |
| Points |
[FINAL POINTS] |
| Due Date |
[FINAL DUE DATE] |
Introduction
For our final we bring to you a survival course for robots.
As the player you receive 9 of the 84 possible instructions. Of these
9 instructions you must choose 5 each round for your robot to execute
sequentially. In doing so, you must become the first to reach all
checkpoints in order, and finish at the last checkpoint.
The Details
This game is graphically intensive. As we need to fit a lot of easily
understood data onto the screen at once, we are using SVGA mode
640x480x256 colors. To finish the ambience, backgroud music will be
playing at all times, in the form of MIDIs. So that the
player can better tell what is happening as the game continues, sound
effects of the RIFF WAV form, also customizable, will be played.
As this is a multiplayer game in that you must be the first of the robots
to reach goals, you must have a worthy opponent built into the game. For
this, a computer AI will be used, and will offer multiple levels of
difficulty in order to not discourage beginners yet still offer a
challenge to more experienced players.
And what fun is a multiplayer game unless you can challenge your friends
and show them your awe inspiring ability in a networked environment?
Using netbios and our own specially designed information exchanging
protocol, you can play your best friend (now your worst enemy) head to
head on your LAN.
This game will be largely interrupt driven to keep our animations smooth
and our music running. Because of the sheer amount of information
required to play our music and single-buffer our screen, we will be using
both multiple predefined segments as well as dynamically requesting extra
segments to store our data. This has the side effect of potentially not
having enough memory to play your music, but still allowing the game to
play. Sounds like a good tradeoff in a tight memory situation.
Meanwhile the entire game system will be carefully monitored by Game
Control, making sure to provide you with the best gaming environment
possible.
Here is a screenshot:
Global Definitions
To make this game possible, we employ many global definitions. We also
use structures to maintain the readibility of many repeated data storage
needs:
- Definitions:
- String Terminates with 0, not '$'
- Direction Constants:
- LEFT EQU 0
- UP EQU 1
- RIGHT EQU 2
- DOWN EQU 3
- Map Constants:
- GRID_XSIZE EQU 20; width of the playing field
- GRID_YSIZE EQU 20; height of the playing field
- VOID EQU 0; unused
- EMPTY EQU 1; normal floor
- START EQU 2; start square
- PIT EQU 3; pit
- WRENCH EQU 4; wrench (repair site)
- SCREW EQU 5; screw (repair site)
- HWALL EQU 8; horizontal wall
- VWALL EQU 9; vertical wall
- URWALL EQU 10; upper right corner wall
- ULWALL EQU 11; upper left corner wall
- LRWALL EQU 12; lower right corner wall
- LLWALL EQU 13; lower left corner wall
- LCONVEY EQU 16; Conveyer belt left
- UCONVEY EQU 17; Conveyer belt up
- RCONVEY EQU 18; Conveyer belt right
- DCONVEY EQU 19; Conveyer belt down
- LLASER EQU 20; Laser aiming left
- ULASER EQU 21; Laser aiming up
- RLASER EQU 22; Laser aiming right
- DLASER EQU 23; Laser aiming down
- RGEAR EQU 24; Gear rotating clockwise
- LGEAR EQU 25; Gear rotating counter-clockwise
- Graphics Constants:
- MOVEROBOT EQU 0; player moved/pushed
- ROTATEROBOT EQU 1; player rotating
- DAMAGEROBOT EQU 2; player takes laser damage
- EXPLODEROBOT EQU 3; player is exploding
- PITROBOT EQU 4; player falling down pit
- HLASER EQU 0; Horizontal laser
- VLASER EQU 1; Vertical laser
- BLASER EQU 2; Crossing lasers
- Sound Effect Constants:
- LASER_S EQU 0; laser fire
- ROBOTMOVE_S EQU 1; robot moving
- CONVEYOR_S EQU 2; conveyor belt moving robot
- PIT_S EQU 3; falling into pit
- HIT_S EQU 4; robot hit by laser
- EXPLODE_S EQU 4; robot exploding
- WIN_S EQU 4; win game
- GEARS_S EQU 4; gears rotate robot
- COLLID_S EQU 4; robots collide with eachother
- WALL_S EQU 4; robot collides with wall
- PUSH_S EQU 4; robot moves, pushing another
- Variables
- Variables updated by GetGameSettings:
IsNetworkGame db 0 ; Is this game networked?
GridFile db 'filename.ext',0 ; Grid Data File
numPlayers db 0 ; Number of players
playerTable Player 8 dub(<>) ; Players
IsServer db 1 ; Is this the Server?
grid db (GRID_XSIZE*GRID_YSIZE) dup(?); Grid of floor tiles
turnlist dw 56 dup (?) ; player id, instruction
; 5 instructions, 1 option, 1 powerdown bool, * 8 players
- Variables Used by Graphics Routines:
stuff d ? ;
- Variables Used by Sound Routines:
SBIRQ dw 5 ; IRQ
SBIO dw 0220h ; IOBase
SBDMA dw 1 ; DMA
SoundSegs dw 4 dup(0) ; Sound Data segment pointers
; 1 bg, up to 3 effects
- Structures:
- The player structure:
This structure contains all important information for a player's
robot which includes position variables, cards in hand, options, etc.
Player Struct
name db 10 dup (?) ; Name limited to 10 characters
damage db 0 ; 0-10 damage, 10 currently dead
direction db 0 ; LEFT UP RIGHT or DOWN
lives db 3 ; player starts with 3 lives
options db 0 ;
XCoord db 0 ;
YCoord db 0 ;
hand db 9 dup (0) ; Cards in hand
instruct db 5 dup (0) ; Instructions to execute
lastX db 0 ; last checkpoint visited X
lastY db 0 ; ..and Y
virtual db 1 ; Is the robot virtual?
computer db 0 ; 0=>human, nonzero=>AI level
network db 0 ; indicates players computer id
; 0 indicates server.
checkpoint db 0 ; indicates last flag touched
powerdown db 0 ; is player powered down (healing)?
Player ends
Procedures
The actual modular implementation is dependant on a properly structured
set of functions. Here is the listing of needed public procedures, as
well as mentions of the more obvious private ones:
Game Control
- Game control is what keeps everything running. As such, it has some
administrative-style procedures and calls the public functions of the other
subsections.
- LoadGrid (Jesse)
- Purpose: Reset/load the game board grid
- Input: GridFile = filename of grid to use (null terminated)
- LoadDemo (Jesse)
- Purpose: Load a demo file to be played back by the game
- Inputs: demoFile = filename to be loaded (format: card (byte), player number (byte))
- Outputs: demoList = list of commands to be executed as a demo
- This function currently not being called in this compilation
- BringBackRobots (Jesse)
- Purpose: t the beginning of each round, dead robots come back to life, if they
- Inputs: playerTable
- Outputs: If a robot >= 10 damage, bring it back if it has lives left. Its coordinates are the lastX and lastY it was set to. It is brought in virtual with no damage
- InitRobots (Jesse)
- Purpose: Initialize robots at the very beginning of the game
- Inputs: playerTable
- Outputs: playerTable == All robots virtual, on start squares, with appropriate settings
- CheckVirtual (Jesse)
- Purpose: Check all virtual robots, make them "real" if possible
- Inputs: playerTable
- Outputs: playerTable == All robots on a square with only themselves becomes a "real" robot.
- ArrangeCards (Jesse)
- Purpose: Players and AIs arrange program cards for the round
- Inputs: playerTAble, thisComputer
- Outputs: All AIs and players on this computer choose their moves for the current round -- usually 5 move
- DoTurns (Jesse)
- Purpose: Play out turns in List -- recieved from server
- Inputs: DI = offset of List location to play from
- Outputs: Robots moving on the screen!
- Notes:
- MoveBoardElements (Jesse)
- Purpose: Board elemnts interact with robots. Move conveyer belts, rotate gears.
- Inputs: playerTable
- Outputs: all robots standing on belts or gears will be rotated/move. Appropriate sounds played. Appropiate graphics displayed.
- RobotsFireLasers (Jesse)
- Purpose: All robots fire lasers at the end of each turn (5 times per round)
- Inputs: playerTable, grid
- Outputs: Laser beams, sound effects, robots get damaged by shots
- BoardElementsFire (Jesse)
- Purpose: Board elements fire lasers after robots fire lasers
- Inputs: playerTable, grid
- Outputs: Robots get shot, sound effects, graphics, damage taken
- DoRobotDeath (Jesse)
- Purpose: If a robot has taken too much damage, blow it uup
- Inputs: playerTable
- Outputs: Robots blowing up, with graphics and sound effects
- DoCheckPoints (Jesse)
- Purpose: See if robots have touched flags
- Inputs: playerTable, grid
- Outputs: Players that touch appropriate flags get their flag counters updated and their lastX, lastY updated as well
- DoRepairSites (Jesse)
- Purpose: If a robot is parked on a repair site, repair it
- Inputs: playerTable, grid
- Outputs: Robots on wrenches get 2 points repair, screwdrivers = 1 point. Robots must not be virutal to benefit.
- DoPowerDown (Jesse)
- Purpose: Powerdown robot and heal damage
- Inputs: playerTable
- Outputs: If a player is powered down, get all hit points back
- DoCheckWinners (Jesse)
- Purpose: If someone wins, display message
- Inputs: playerTable
- Outputs: Winner message, and exit game
- GameLoop (Jesse)
- Purpose: Main game loop
- Inputs: Initialized robots, network settings, configuration of players
- Outputs: A RoboRally game!
General turn sequence:
1. Load the grid
2. Check virtual robots
3. Bring back dead robots
4. Get cards for this turn
5. Arrange cards
6. Send turns to server for processing
7. Receive turn List
8. Play out turn list for this round
a. Robots move (#1..8)
b. Board elements move
c. Check virtual
d. Robots fire lasers
e. Board elements fire lasers
f. Check for robot death
g. Check if someone hit a checkpoint
h. Check if someone hit a repair site
i. Check for winners
j. Repeat a..i 5 times (5 commands per round)
9. Do next round -> jump to step 1
===============================================================================
==
HELPER FUNCTIONS
================== CheckNumRobots ==========================
Purpose: Returns # of robots on a given square of the grid
Does not count virtual robots
Input: AH = XCoord, AL = YCoord
Output: AL = # robots on this square
DI = offset of robot
================== CheckTotalNumRobots =========================
Purpose: Returns # of robots on a given square of the grid
Does count virtual robots
Input: AH = XCoord, AL = YCoord
Output: AL = # robots on this square
================== CheckObstruction ===============================
Purpose: See what type of obstruction is on the square
INPUT: AH, AL = (x,y) on the grid
OUTPUT: AL = 0 if clear
1 if robot, DI = offset of player
2 if wall, AH = player number
AH = ? (blown away)
================== PushRobot ===============================
Purpose: Push a robot in a given direction if able
Inputs:
DI = offset of player to move
BH = player to move's number
BL = direction to move
Output:
RETURN DL = 1 success, DL = 0 fail
================== IsOnPit ===============================
Purpose: Check to see if a player is on a pit
Input SI = points to structure player to check
Output DL = 1 if player is on a pit
================== PlayerPitDeath ===============================
Purpose: Kill all players on pits by pit death
Input: playerTable, grid
Ouput: Falling robots, cool animation and sounds
Cycle through all players, check to see if on pit
================== GetNumber ===============================
Purpose: Get numerical input from keyboard
Output:
DL = # between 1..9 Refuses to exit until it gets a # between
1..9 or BS or enter -> mapped to back space
'q' exits program abruptly
================== getYesNo =============================
Purpose: Gets a yes/no answer from player (lower case)
Returns AL = 1 for yes, 0 for no
==================== tempDealCards ===============================
Purpose: Deal out program cards to all players
This procedure is only run by the server (or local machine)
Input: playerTable ready to receive cards
Output: playerTable with new cards for new turn
================== tempMakeList ============================
Purpose: Server has to package all cards into a turn List
Input: playerTable after cards are arranged by players
Output: List = list of moves in following fasion:
Player # (byte), Card # (byte)
================== CheckSquare ============================
Purpose: Return the value of the square of a robot
SI = offset of player to check
Output: AL = square we are on
================== FireLaser ============================
Purpose: Animate and calculate laser paths
Input:
AX = AH, AL = xcoord, y coord of source of laser
BL = direction to go
Ouput: Laser beams shooting across screens.
Stops when hits players or walls
Networking
Networking handles the communications with the other computers in a
multiplayer network game. Here are the public procedures:
- StartServer (Long)
- Purpose: Begins a network game. Handles interface with user
until either a game has been started or aborted.
- Inputs: None
- Outputs: Sets IsServer
- MakeRandNum (Long)
- Purpose: To get a random number between 0 and 83
- Inputs: None
- Outputs: A random number between 0 and 83 in AX
- Notes:
- JoinGame (Long)
- Purpose: Connects with a StartServer'd Network Game. Handles
interface with user until either a game has been started or aborted.
- Inputs: None
- Outputs: Sets IsNetworkGame , Network initialized, thisComputer and playerIndexnum variables set
- SendGameSettings (Long)
- Purpose: To send the game settings
- Inputs: None
- Outputs: Sends a datagram containing the entire playerTable
- SendList (Long)
- Purpose: To send a List of moves
- Inputs: None
- Outputs: Sends a datagram containing the entire List
- SendInstructions (Long)
- Purpose: To send an individuals player's instructions over the network
- Inputs: None
- Outputs: Sends a datagram containing the instructions over the network
- RecieveDatagramPost (Long)
- Purpose: Handles the reception of a datagram.
- Inputs: Data in RXBuffer
- Outputs: Processes data and places into various places.
- SendCards (Long)
- Purpose: To send the networked players cards from the server
rk
- Inputs: None
- Outputs: All Cards dealt, and packet sent over the network containing the client's card
- SendReady (Long)
- Purpose: To send an ACK from the client to the server, so the server knows that it can start the game.
rk
- Inputs: None
- Outputs: Packet with ACK sent over the network
Graphics
Segments
TileSeg SEGMENT 'DATA1'
Tiles db 65535 dup(?)
TileSeg ENDS
FontSeg SEGMENT 'DATA2'
Fontmap DB 65535 dup (?)
FontSeg ENDS
ScrSeg SEGMENT 'DATA3'
ScratchPad db 65535 dup(?)
ScrSeg ENDS
TileSeg holds the decompressed pcx file that contains the images
of all tiles and frames of animation used in the game.
FontSeg holds the decompressed pcx file of the font used to display
text in the game.
ScrSeg is a scratch segment that holds a compressed pcx file while
it is being decompressed.
Variables
TileFile ; filename of the pcx containing the tiles as a null terminated
string
FontFile ; filename of the pcx containing the fonts as a null terminated
string
PCXback ; filename of the pcx containing the game background as a null
terminated string
oldTimerV ; far pointer to the old timer interrupt vector
AnimateCount ; count of clock ticks since last Animate call
DoneAnimate ; flag that is 0 if an animation is running, 1 if all animation
s are done
AnimateFlags ; 8 byte table - one byte for each robot containing a flag sign
ifying what type of
; animation the robot is doing
FrameCount ; 8 byte table - one byte for each robot containing the number
of frames left in
; whatever animation it is doing, if any
LasersOn ; a flag that is 1 if lasers are being waited for
LaserCount ; the number of frames left to wait for the lasers
TempX ; a temporary animation variable, containing the x-coord to dra
w a tile at
TempY ; a temporary animation variable, containing the y-coord to dra
w a tile at
netMenu ; filename of the pcx containing the netowrk menu as a null ter
minated string
ThisCompMsg ; string: 'This computer'
NetworkMsg ; string: 'Network player'
AIMsg ; string: 'AI player'
PBuf ; 7 byte buffer for binasc
Procedures
- LoadPCX
- Owner: Scott Mikula
- Purpose: loads a pcx file into the ScrSeg segment and then decodes
the image into a segment pointed to by ax
- Inputs:
- ax = segment to write to
- dx = offset to null terminated string containing filename of the pcx
- Outputs: pcx in the segment pointed to by ax; palette set to that of
the pcx
- Notes: LoadPCX is only a slight variation on the example code in sec
tion 10.5.3
of the ECE291 lab manual.
- DrawScreen
- Owner: Scott Mikula
- Purpose: Draws a 640x480 PCX image to the screen
- Inputs:
- dx = offset to null terminated string containing the filename of the pc
x
- Outputs: PCX image on the screen
- Notes: Parts of DrawScreen are from the example code in section 10.5
.3 of the
ECE291 lab manual.
Also, DrawScreen does not load a palette, but rather uses the existing palette.
- InstTimer
- Owner: Scott Mikula
- Purpose: Installs a new timer interrupt handler
- Inputs: none
- Outputs:
- oldTimerV = far pointer to the old timer interrupt vector
- Notes: InstTimer is my code from MP3.
- DeInstTimer
- Owner: Scott Mikula
- Purpose: Restores the original timer interrupt handler
- Inputs:
- oldTimerV = far pointer to old timer interrupt vector
- Outputs: none
- Notes: DeInstTimer is my code from MP3.
- MyTimerHandler
- Owner: Scott Mikula
- Purpose: Handles timer interrupt, and calls Animate when necessary.
- Inputs:
- Outputs:
- Notes: This is what provides a consistent frame rate for animation.
Changing the value that AnimateCount counts up to can speed up or slow down
the animation.
- G_Init
- Owner: Scott Mikula
- Purpose: Sets the video mode to 640x480x256 SVGA mode, and loads gam
e graphics.
- Inputs: none
- Outputs:
- Graphics mode is SVGA
- TileSeg
- FontSeg
- Notes: The code to set the video mode is from Bryan Gran's example S
VGA code.
- G_Exit
- Owner: Scott Mikula
- Purpose: Resets the graphics mode to text mode video
- Inputs: none
- Outputs: Graphics in text mode video
- GetOffset
- Owner: Scott Mikula
- Purpose: Given a position on the screen, finds the bank and offset o
f the
position in video memory.
- Inputs:
- bx = x coordinate of pixel
- ax = y coordinate of pixel
- Outputs:
- ax = bank
- bx = offset of pixel
- GetTileOffset
- Owner: Scott Mikula
- Purpose: Gets the offset of a given tile withing TileSeg.
- Inputs:
- Outputs:
- si = offset to tile within TileSeg
- DispTile
- Owner: Scott Mikula
- Purpose: Displays a specified tile to the screen, with upper left co
rner at
given coordinates.
- Inputs:
- dl = tile type to display
- bx = x-coordinate of upper left corner
- ax = y-coordinate of upper left corner
- Outputs: Tile displayed on screen
- Notes: Palette entry 0 is considered transparent.
- DrawGrid
- Owner: Scott Mikula
- Purpose: Draws the grid of tiles, and then draws all living robots.
- Inputs:
- GridOffset = offset to the grid variable
- Outputs: grid and robots displayed
- DrawLaser
- Owner: Scott Mikula
- Purpose: Draws a laser on a single tile
- Inputs:
- X = tile column of laser
- Y = tile row of laser
- LaserType = 0 if horizontal, 1 if vertical
- Outputs: laser displayed on screen
- WaitForAnimation
- Owner: Scott Mikula
- Purpose: Loops until all animations are finished
- Inputs: none
- Outputs: none
- Notes: continually checks the value of DoneAnimate
- MoveConveyors
- Owner: Scott Mikula
- Purpose: Rotates palette to give conveyors the illusion of movement.
- Inputs: none
- Outputs: conveyor color entries rotated
- MoveGears
- Owner: Scott Mikula
- Purpose: Rotates palette to give gears the illusion of movement.
- Inputs: none
- Outputs: gear color entries rotated
- ResetGridSquare
- Owner: Scott Mikula
- Purpose: Redraws a square on the grid to erase any robot that has be
en
draw on top of it.
- Inputs:
- ah = x coordinate on grid
- al = y coordinate on grid
- Outputs: tile on grid redrawn
- AniGetCoords
- Owner: Scott Mikula
- Purpose: Given a player number, gets its pixel x and y coords, and r
esets the tile
- Inputs:
- Outputs:
- bx = x pixel coordinate
- ax = y pixel coordinate
- Notes: Calls ResetGridSquare
- DrawRobot
- Owner: Scott Mikula
- Purpose: Draws a robot at a given position, with proper coloring
- Inputs:
- bx = x coordinate for upper left corner of robot tile
- ax = y coordinate for upper left corner of robot tile
- dh = robot number
- dl = tile type
- Outputs: Robot to screen
- Notes: DrawRobot is essentially DrawTile except that it replaces the
color for robot 0
with the color of the robot specified when drawing the tile.
- SetAnimation
- Owner: Scott Mikula
- Purpose: Sets the animation flags and frame count variables so that
Animate knows what
animations are running.
- Inputs:
- Plyr = player to set the animation for
- dir = direction to move/rotate (if applicable)
- aniType = type of animation
- Outputs:
- AnimateFlags[Plyr] = flag
- FrameCount[Plyr] = number of frames in animation
- DoneAnimate set to 0
- Animate
- Owner: Scott Mikula
- Purpose: Moves conveyors, gears, then checks animation flags and cal
ls routines for all
active animations, then check if animations are done and if so sets the DoneAni
mate flag
- Inputs:
- Outputs:
- DoneAnimate = 0 if there are animations running, or 1 if there are anim
ations unfinished
- AnimateLasers
- Owner: Scott Mikula
- Purpose: Lets lasers be on for a delay.
- Inputs:
- Outputs:
- AnimateExplode
- Owner: Scott Mikula
- Purpose: Displays the next frame of an exploding robot.
- Inputs:
- Outputs: next frame of exploding robot
- AnimateFall
- Owner: Scott Mikula
- Purpose: Displays next frame of a falling robot
- Inputs:
- Outputs: next frame of falling robot
- AnimateMove
- Owner: Scott Mikula
- Purpose: Displays next frame of a moving robot
- Inputs:
- bx = robot to animate
- AnimateFlags[bx] = flag specifying direction to move
- Outputs: next frame of moving robot
- AnimateRotation
- Owner: Scott Mikula
- Purpose: Displays next frame of a rotating robot
- Inputs:
- bx = robot to animate
- AnimateFlags[bx] = flag specifying direction to rotate
- Outputs: next frame of rotating robot
- DrawNetworkMenu
- Owner: Scott Mikula
- Purpose: Draws the network menu to the screen, including the current
type of
each player
- Inputs:
- InitTable, where InitTable[i] = type of player i
- Outputs: Menu and status of players on screen
- DrawCardXY
- Owner: Scott Mikula
- Purpose: Draws a specified card to the screen with upper left corner
at given coordinates
- Inputs:
- dl = card to display
- bx = x coordinate of upper left corner
- ax = y coordinate of upper left corner
- Outputs: card displayed on screen
- GetCardType
- Owner: Scott Mikula
- Purpose:
- Inputs:
- Outputs:
- cl = card type
- ch = 80h if card should be crossed out, 0 if not
- Notes: There are multiple cards of the same type. This function tak
es a specific card
(specified by the card id) and determines what type it is.
- DrawCards
- Owner: Scott Mikula
- Purpose: Displays all nine cards in specified players hand, and then
the number under each
that is pressed to select it
- Inputs:
- Plyr = player to display cards for
- Outputs: cards drawn on screen
- DrawCharacter
- Owner: Scott Mikula
- Purpose: Draws a character to the screen
- Inputs:
- bx = x coordinate on screen
- ax = y coordinate on screen
- dl = ascii code of character to draw
- dh = palette index of color to display character in
- Outputs: character drawn on screen
- DrawString
- Owner: Scott Mikula
- Purpose: draws a text string to the screen
- Inputs:
- StrOffset = offset to null terminated string to display
- X = x coordinate of upper left corner of string on screen
- Y = y coordinate of upper left corner of string on screen
- Color = palette index of color to display string in
- Outputs: string displayed to screen
- DrawNumber
- Owner: Scott Mikula
- Purpose: draws a number to the screen
- Inputs:
- NUM = number to display
- X = x coordinate of upper left corner of string on screen
- Y = y coordinate of upper left corner of string on screen
- Outputs: number displayed to screen
- PrintStats
- Owner: Scott Mikula
- Purpose: prints statistics on the right side of the screen
- Inputs:
- playerTable (contains the statistics)
- Outputs: statistics displayed on screen
Sound
What is a game these days without an aural atmosphere? These are the
routines that allow our wondeful music to be heard:
-
SoundInit
- Owner: Michael Urman
- Purpose: Initialize Sound card for wav playing
- Inputs: None
- Outputs: SUCCESS or FAIL
-
SoundExit
- Owner: Michael Urman
- Purpose: Return Sound card to previous state, set volume to 0
- Inputs: None
- Outpus: None
-
DelayWav
- Owner: Michael Urman
- Purpose: Let a sound finish before any other activity occurs
- Input: Number of (11kHz mono 8bit) samples
- Output: None
-
PlayEffect
- Owner: Michael Urman
- Purpose: Play a sound effect
- Input: Numbered Sound effect
- Output: FAIL or size of wav data
-
StartBG
- Owner: Michael Urman
- Purpose: Play a background midi
- Input: Which midi file (only one available, however)
- Output: FAIL or SUCCESS
-
StopBG
- Owner: Michael Urman
- Purpose: Stop a playing midi
- Input: None
- Output: None
-
GetBGStatus
- Owner: Michael Urman
- Purpose: Allow main loop to know if a midi is playing so it can be looped
- Input: None
- Output: TRUE or FALSE
-
StopEffects
- Owner: Michael Urman
- Purpose: Stop all wav effects
- Inputs: None
- Outputs: None
-
SetVolume
- Owner: Michael Urman
- Purpose: Set Volume in the mixer to chosen settings
- Inputs: volume (byte)
- Outputs: None
-
OnSamePage
- Owner: Michael Urman
- Purpose: Verify if a buffer is on one page for DMA use
- Input: Segment, size
- Output: TRUE or FALSE
-
LoadWav
- Owner: Michael Urman
- Purpose: Loads a wave into the DMA buffer and plays it
- Input: Filename offset
- Output: FAIL or Size of wav data
-
ResetDSP
- Owner: Michael Urman
- Purpose: Initialize DSP and get DSP Version
- Inputs: None
- Outputs: SUCCESS or FAIL
-
DMAInit
- Owner: Michael Urman
- Purpose: initialize the DMA to the beginning of the non-page border
crossing buffer, ready to transfer to the DSP
- Inputs: DMA and Size, as well as page, offset from memory
- OutPuts: None
-
SetDMABufTranfer
- Owner: Michael Urman
- Purpose: Set the DSP to look for a DMA transfer of given size
- Inputs: Wav header (in memory)
- Outpus: None
-
FillDMABuf
- Owner: Michael Urman
- Purpose: Read wav information from the file to the DMA buffer
- Inputs: Wav header in memory
- Outpus: None