Difference between revisions of "A/V Control Commands"

From pinHeck Wiki
Jump to: navigation, search
Line 1: Line 1:
These are the commands you call from the main game kernel to control the Propeller A/V. Most commands do not return a value unless noted.
+
The PIC32 runs main game code, the Prop handles audio/video. They do not share RAM, thus the Prop only knows what you tell it via '''A/V Control Commands'''.
  
[[musicLoop(unsigned char whichChannel, unsigned long startingPoint, unsigned long loopingPoint, unsigned long jumpPoint)]]
+
These are the commands you call from the main game kernel to control the Propeller A/V. Most commands do not return a value unless noted.
  
[[videoControl(unsigned char whichLayer, unsigned char controlByte, unsigned char xPos, unsigned char yPos, unsigned long frameTarget)]]
 
  
[[layerLoad(unsigned char whichLayer, unsigned char v1, unsigned char v2, unsigned char v3, unsigned char vidAttributes, unsigned char controlByte, unsigned char xPos, unsigned char yPos, unsigned char vP, unsigned char DMDsearch)]]
+
== Audio ==
  
 
[[playSFX(which channel, which folder, clip0, clip1, priority)]]
 
[[playSFX(which channel, which folder, clip0, clip1, priority)]]
Line 12: Line 11:
  
 
[[stereoSFX(which channel, which folder, clip0, clip1, priority, left volume, right volume)]]
 
[[stereoSFX(which channel, which folder, clip0, clip1, priority, left volume, right volume)]]
 +
 +
[[playMusic(clip0, clip1)]]
 +
 +
[[playMusicOnce(clip0, clip1)]]
 +
 +
[[stopMusic()]]
 +
 +
[[volumeSFX(which channel, volume left, volume right)]]
 +
 +
[[fadeMusic(fade speed, fade target)]]
 +
 +
[[repeatMusic(what state)]]
 +
 +
[[musicLoop(whichChannel, startingPoint, loopingPoint, jumpPoint)]]
 +
 +
 +
 +
== Video ==
 +
 +
Note that pinHeck audio/video is NOT interleaved (contained in same file) This is because quite often you'll have the same video with several different random audio calls attached to it.
  
 
[[video(which folder, clip0, clip1, attributes, progressBar, priority)]]
 
[[video(which folder, clip0, clip1, attributes, progressBar, priority)]]
Line 18: Line 37:
  
 
[[killQ()]]
 
[[killQ()]]
 +
 +
[[stopVideo(what state)]]
  
 
[[videoPriority(new priority)]]
 
[[videoPriority(new priority)]]
  
[[stopVideo(what state)]]
+
[[videoControl(whichLayer, controlByte, xPos, yPos, frameTarget)]]
  
[[characterSprite(which number, sprite attribute, sprite X, sprite Y, sprite height, sprite value)]]
+
[[layerLoad(whichLayer, v1, v2, v3, vidAttributes, controlByte, xPos, yPos, vP, DMDsearch)]]
  
[[numbers(which number, number Type, number X, number Y, number value)]]
+
[[customScore(v1, v2, v3, vidAttributes)]]
  
[[numbersPriority(unsigned char whichNumber, unsigned char numType, unsigned char numX, unsigned char numY, unsigned long numValue, unsigned char matchPriority)]]
+
[[killCustomScore()]]
  
[[showProgressBar(which Graphic, bar brightness, x pos, y pos, length of bar, height of bar)]]
+
 
 +
 
 +
 
 +
== Graphics ==
 +
 
 +
 
 +
Graphics are anything on the display that isn't part of the video. This includes numbers, progress bars, Ball and Credit indicators, and sprites (character set graphics you can move around)
 +
 
 +
 
 +
[[numbers(which number, number Type, number X, number Y, number value)]]
 +
 
 +
[[numbersPriority(whichNumber, numType, numX, numY, numValue, matchPriority)]]
  
 
[[killNumbers()]]
 
[[killNumbers()]]
Line 37: Line 69:
 
[[killTimer(which number)]]
 
[[killTimer(which number)]]
  
[[addScore(score amount)]]
+
[[characterSprite(which number, sprite attribute, sprite X, sprite Y, sprite height, sprite value)]]
  
[[setScore(which player)]]
+
[[showValue(number value, flash time, score flag)]]
  
[[manualScore(unsigned char whichScore, unsigned long whatValue)]]
+
[[showProgressBar(which Graphic, bar brightness, x pos, y pos, length of bar, height of bar)]]
  
[[playMusic(clip0, clip1)]]
+
[[value(xpos, ypos, the value)]]
  
[[playMusicOnce(clip0, clip1)]]
+
[[text(xpos, ypos, the text string)]]
  
[[stopMusic()]]
+
[[graphicsMode(do what, the modifier)]]
  
[[volumeSFX(which channel, volume left, volume right)]]
+
[[loadSprite(clip0, clip1, clip2, doLoad)]]
  
[[fadeMusic(fade speed, fade target)]]
+
[[sendSwitches()]]
  
[[repeatMusic(what state)]]
 
  
[[EOBnumbers(whichNumber, number value)]]
+
 
 +
== Scorekeeping ==
 +
 
 +
Again, the Propeller A/V processor has no clue what any scores are unless you tell it. Current player's score is always being changed, and all player scores / ball and credit numbers are updated at every drain cycle.
 +
 
  
 
[[Update(attract mode state)]]
 
[[Update(attract mode state)]]
 +
 +
[[addScore(score amount)]]
 +
 +
[[setScore(which player)]]
 +
 +
[[manualScore(whichScore, whatValue)]]
 +
 +
[[EOBnumbers(whichNumber, number value)]]
  
 
[[sendHighScores(which score)]]
 
[[sendHighScores(which score)]]
Line 63: Line 106:
 
[[sendInitials(which player, which character)]]
 
[[sendInitials(which player, which character)]]
  
[[value(x pos, y pos, the value)]]
 
  
[[text(x pis, y pos, the text string)]]
 
  
[[graphicsMode(do what, the modifier)]]
+
[[EEPROM Access]]
  
[[loadSprite(clip0, clip1, clip2, doLoad)]]
+
The PIC32 uses the top half of the removable Propeller EEPROM for data storage. It has many more rewrite cycles than the flash memory contained inside the PIC32.
  
[[sendSwitches()]]
 
  
 
[[writeEEPROM(which address, what value)]]
 
[[writeEEPROM(which address, what value)]]
  
 
[[readEEPROM(which address)]]
 
[[readEEPROM(which address)]]
 
[[showValue(number value, flash time, score flag)]]
 

Revision as of 15:15, 12 September 2015

The PIC32 runs main game code, the Prop handles audio/video. They do not share RAM, thus the Prop only knows what you tell it via A/V Control Commands.

These are the commands you call from the main game kernel to control the Propeller A/V. Most commands do not return a value unless noted.


Audio

playSFX(which channel, which folder, clip0, clip1, priority)

playSFXQ(which channel, which folder, clip0, clip1, priority)

stereoSFX(which channel, which folder, clip0, clip1, priority, left volume, right volume)

playMusic(clip0, clip1)

playMusicOnce(clip0, clip1)

stopMusic()

volumeSFX(which channel, volume left, volume right)

fadeMusic(fade speed, fade target)

repeatMusic(what state)

musicLoop(whichChannel, startingPoint, loopingPoint, jumpPoint)


Video

Note that pinHeck audio/video is NOT interleaved (contained in same file) This is because quite often you'll have the same video with several different random audio calls attached to it.

video(which folder, clip0, clip1, attributes, progressBar, priority)

videoQ(which folder, clip0, clip1, attributes, progressBar, priority)

killQ()

stopVideo(what state)

videoPriority(new priority)

videoControl(whichLayer, controlByte, xPos, yPos, frameTarget)

layerLoad(whichLayer, v1, v2, v3, vidAttributes, controlByte, xPos, yPos, vP, DMDsearch)

customScore(v1, v2, v3, vidAttributes)

killCustomScore()



Graphics

Graphics are anything on the display that isn't part of the video. This includes numbers, progress bars, Ball and Credit indicators, and sprites (character set graphics you can move around)


numbers(which number, number Type, number X, number Y, number value)

numbersPriority(whichNumber, numType, numX, numY, numValue, matchPriority)

killNumbers()

killScoreNumbers()

killTimer(which number)

characterSprite(which number, sprite attribute, sprite X, sprite Y, sprite height, sprite value)

showValue(number value, flash time, score flag)

showProgressBar(which Graphic, bar brightness, x pos, y pos, length of bar, height of bar)

value(xpos, ypos, the value)

text(xpos, ypos, the text string)

graphicsMode(do what, the modifier)

loadSprite(clip0, clip1, clip2, doLoad)

sendSwitches()


Scorekeeping

Again, the Propeller A/V processor has no clue what any scores are unless you tell it. Current player's score is always being changed, and all player scores / ball and credit numbers are updated at every drain cycle.


Update(attract mode state)

addScore(score amount)

setScore(which player)

manualScore(whichScore, whatValue)

EOBnumbers(whichNumber, number value)

sendHighScores(which score)

sendInitials(which player, which character)


EEPROM Access

The PIC32 uses the top half of the removable Propeller EEPROM for data storage. It has many more rewrite cycles than the flash memory contained inside the PIC32.


writeEEPROM(which address, what value)

readEEPROM(which address)