Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
display.c File Reference
#include "engine/game.h"
#include <libgs.h>
#include <libetc.h>
#include <libsnd.h>
Include dependency graph for display.c:

Go to the source code of this file.

Functions

void vsyncCallback (void)
 Every vsync: advances the time counters and the play time, runs GFX.vsyncFunc, shows the finished buffer and ticks the music.
 
void startVSyncCallback (void)
 Installs vsyncCallback.
 
void drawFrame (s32 draw)
 Ends a frame: lets the layers run their draw callbacks, waits for the GPU and for the vsync that shows the finished buffer, then sends every layer of that buffer and clears the ones of the next.
 
s32 getFrameCount (void)
 The frames drawn since boot.
 
s32 getTime (void)
 The vsyncs since boot (in 60 Hz frames)
 
s32 getFrameTime (void)
 The vsyncs the last frame took (in 60 Hz frames)
 
void resetGraphics (void)
 Destroys every layer and clears the packet buffers' state; the first call just picks the buffers.
 
void allocPrimBuffers (s32 size)
 Allocates the two GPU packet buffers, size bytes each, at the end of the heap.
 
void * getPrim (void)
 The next free byte of the packet buffer being drawn.
 
void setPrim (void *next)
 Moves the packet buffer's free pointer past the primitives just written.
 
void freePrimBuffers (void)
 Frees the two packet buffers.
 
void setDisplayMode (s32 w, s32 h, s32 hires, s32 interlace)
 Sets up the two display buffers: side by side in hi-res (interlaced 320x480 24-bit), else one above the other.
 
void setDisplayArea (s32 x, s32 y, s32 w, s32 h)
 Shows the same VRAM area from both display buffers.
 

Variables

static s32 GFX_STARTED = 0
 Small variables, addressed through $gp (see the Makefile)
 
static s32 FLIP_PENDING
 
GfxState GFX
 GFX: the graphics state and its methods.
 

Function Documentation

◆ vsyncCallback()

void vsyncCallback ( void  )

Every vsync: advances the time counters and the play time, runs GFX.vsyncFunc, shows the finished buffer and ticks the music.

Definition at line 14 of file display.c.

Referenced by startVSyncCallback().

Here is the caller graph for this function:

◆ startVSyncCallback()

void startVSyncCallback ( void  )

Installs vsyncCallback.

Definition at line 42 of file display.c.

Here is the call graph for this function:

◆ drawFrame()

void drawFrame ( s32  draw)

Ends a frame: lets the layers run their draw callbacks, waits for the GPU and for the vsync that shows the finished buffer, then sends every layer of that buffer and clears the ones of the next.

Definition at line 51 of file display.c.

◆ getFrameCount()

s32 getFrameCount ( void  )

The frames drawn since boot.

Definition at line 106 of file display.c.

◆ getTime()

s32 getTime ( void  )

The vsyncs since boot (in 60 Hz frames)

Definition at line 111 of file display.c.

◆ getFrameTime()

s32 getFrameTime ( void  )

The vsyncs the last frame took (in 60 Hz frames)

Definition at line 116 of file display.c.

◆ resetGraphics()

void resetGraphics ( void  )

Destroys every layer and clears the packet buffers' state; the first call just picks the buffers.

Definition at line 123 of file display.c.

◆ allocPrimBuffers()

void allocPrimBuffers ( s32  size)

Allocates the two GPU packet buffers, size bytes each, at the end of the heap.

< the current mode's: freed by main whenever the mode task ends

< the current mode's: freed by main whenever the mode task ends

Definition at line 142 of file display.c.

◆ getPrim()

void * getPrim ( void  )

The next free byte of the packet buffer being drawn.

Definition at line 150 of file display.c.

◆ setPrim()

void setPrim ( void *  next)

Moves the packet buffer's free pointer past the primitives just written.

Definition at line 155 of file display.c.

◆ freePrimBuffers()

void freePrimBuffers ( void  )

Frees the two packet buffers.

Definition at line 160 of file display.c.

◆ setDisplayMode()

void setDisplayMode ( s32  w,
s32  h,
s32  hires,
s32  interlace 
)

Sets up the two display buffers: side by side in hi-res (interlaced 320x480 24-bit), else one above the other.

Definition at line 175 of file display.c.

◆ setDisplayArea()

void setDisplayArea ( s32  x,
s32  y,
s32  w,
s32  h 
)

Shows the same VRAM area from both display buffers.

Definition at line 203 of file display.c.

Variable Documentation

◆ GFX_STARTED

s32 GFX_STARTED = 0
static

Small variables, addressed through $gp (see the Makefile)

Definition at line 7 of file display.c.

Referenced by resetGraphics().

◆ FLIP_PENDING

s32 FLIP_PENDING
static

Definition at line 8 of file display.c.

Referenced by drawFrame(), and vsyncCallback().

◆ GFX

GfxState GFX
Initial value:
= {
.funcs = {
},
}
void * getPrim(void)
The next free byte of the packet buffer being drawn.
Definition display.c:150
void allocPrimBuffers(s32 size)
Allocates the two GPU packet buffers, size bytes each, at the end of the heap.
Definition display.c:142
void freePrimBuffers(void)
Frees the two packet buffers.
Definition display.c:160
void setDisplayArea(s32 x, s32 y, s32 w, s32 h)
Shows the same VRAM area from both display buffers.
Definition display.c:203
void drawFrame(s32 draw)
Ends a frame: lets the layers run their draw callbacks, waits for the GPU and for the vsync that show...
Definition display.c:51
void resetGraphics(void)
Destroys every layer and clears the packet buffers' state; the first call just picks the buffers.
Definition display.c:123
s32 getTime(void)
The vsyncs since boot (in 60 Hz frames)
Definition display.c:111
void setPrim(void *next)
Moves the packet buffer's free pointer past the primitives just written.
Definition display.c:155
void setDisplayMode(s32 w, s32 h, s32 hires, s32 interlace)
Sets up the two display buffers: side by side in hi-res (interlaced 320x480 24-bit),...
Definition display.c:175
s32 getFrameCount(void)
The frames drawn since boot.
Definition display.c:106
s32 getFrameTime(void)
The vsyncs the last frame took (in 60 Hz frames)
Definition display.c:116
void startVSyncCallback(void)
Installs vsyncCallback.
Definition display.c:42
Layer * getLayer(s32 id)
The layer with id id, or NULL.
Definition layer.c:7
s32 destroyLayer(s32 id)
Frees the layer with id id; 0 if there is none.
Definition layer.c:71
Layer * createLayer(RECT *rect, s32 otShift, s32 id)
A new layer drawing to rect, with an OT of OT_LENGTHS[otShift - 1] entries; NULL when all are in use.
Definition layer.c:58
void moveLayer(s32 id, s32 targetId, s32 delta)
Moves a layer to the position of another one (plus delta) in the draw order.
Definition layer.c:86

GFX: the graphics state and its methods.

Definition at line 209 of file display.c.

Referenced by addNewDigimon(), advanceStageFade(), allocPrimBuffers(), cardDrawerDraw(), cardDrawerSetLayer(), CARDGAME_animateSprite(), CARDGAME_chooseDeck(), CARDGAME_countDown(), CARDGAME_discardHand(), CARDGAME_discardPickedCard(), CARDGAME_discardPrevCard(), CARDGAME_drawBackground(), CARDGAME_drawDeckWindow(), CARDGAME_drawFader(), CARDGAME_drawFirstPlayer(), CARDGAME_drawFromDeck(), CARDGAME_drawMarker(), CARDGAME_drawNewCards(), CARDGAME_drawPanel(), CARDGAME_drawSpriteEffect(), CARDGAME_flipSlotCard(), CARDGAME_flipSprite(), CARDGAME_flySprite(), CARDGAME_holdSprite(), CARDGAME_holdSpriteThenBlink(), CARDGAME_jitterSprite(), CARDGAME_moveBlinker(), CARDGAME_moveSprite(), CARDGAME_removeMarkedSlots(), CARDGAME_returnUsedCards(), CARDGAME_shakeSprite(), CARDGAME_showPlayedCard(), CARDGAME_slidePanel(), CARDGAME_stepChooseCards(), CARDGAME_stepFader(), CARDGAME_stepPlayCard(), CARDGAME_stepPulseCard(), CARDGAME_stepRoundEnd(), CARDGAME_stepSlotTotal(), CARDGAME_stepStart(), CARDGAME_stepSwap(), CARDGAME_stepTally(), CARDGAME_stepTotals(), CARDGAME_stepYesNo(), CARDGAME_updateDeckWindow(), CARDGAME_updateGauge(), CARDGAME_updateMarker(), CARDGAME_updateMenuWindow(), CARDGAME_updateMessageWindow(), CARDGAME_updatePanelIcon(), CARDGAME_updateScene(), CARDGAME_updateScreen(), CARDGAME_updateWindow(), CARDGAME_waitFor(), CNTY_SEL_drawFade(), CNTY_SEL_stepAnimation(), CNTY_SEL_tickScreen(), countRoundWin(), createLayer(), destroyLayer(), drawBackground(), drawByteAnims(), drawEffectNames(), drawEntryPanel(), drawFader(), drawFlyerGate(), drawFrame(), drawGauge(), drawKeyboard(), drawMessageBoxArrow(), drawScreenFade(), drawTalkBoxArrow(), drawTalkBoxFrame(), drawTimer(), drawZoomBox(), endBattleOnKnockOut(), FIELDSTG_animateActor(), FIELDSTG_closeField(), FIELDSTG_drawActor(), FIELDSTG_drawBannerBox(), FIELDSTG_drawCover(), FIELDSTG_drawCoverBlock(), FIELDSTG_drawMapTiles(), FIELDSTG_drawStream(), FIELDSTG_findOldestStream(), FIELDSTG_isTileFree(), FIELDSTG_playBattleTransition(), FIELDSTG_playCutsceneAnim(), FIELDSTG_runGauge(), FIELDSTG_runMapStreamer(), FIELDSTG_scrollCamera(), FIELDSTG_showSpotHint(), FIELDSTG_stepBalloonAnim(), FIELDSTG_stepEffectAnim(), FIELDSTG_toScreenPos(), FIELDSTG_touchStream(), FIELDSTG_updateActor(), FIELDSTG_updateActorIcon(), FIELDSTG_updateBalloon(), FIELDSTG_updateBanner(), FIELDSTG_updateEffect(), FIELDSTG_updateField(), FIELDSTG_updateHiddenSpots(), FIELDSTG_updateLift(), FIELDSTG_updateMapObjects(), FIELDSTG_updateSpotEffect(), FIELDSTG_updateStream(), FIELDSTG_waitScriptTime(), FIGHTSTG_applyCamera(), FIGHTSTG_countFrames(), FIGHTSTG_drawConfusedMessageBox(), FIGHTSTG_drawCursorSprites(), FIGHTSTG_drawHud(), FIGHTSTG_drawItemMenu(), FIGHTSTG_drawMesh(), FIGHTSTG_drawMeshWireframe(), FIGHTSTG_drawMessageBox(), FIGHTSTG_drawPageArrows(), FIGHTSTG_drawShadedQuad(), FIGHTSTG_drawTechMenu(), FIGHTSTG_drawWhiteFlash(), FIGHTSTG_fadeLights(), FIGHTSTG_fadeStage(), FIGHTSTG_finishMessage(), FIGHTSTG_queueMeshDraw(), FIGHTSTG_queueMeshWireframe(), FIGHTSTG_runScriptWait(), FIGHTSTG_stepConfusedMessage(), FIGHTSTG_stepHpTween(), FIGHTSTG_stepMessage(), FIGHTSTG_updateBattleCamera(), FIGHTSTG_updateCamera(), FIGHTSTG_updateCameraShots(), FIGHTSTG_updateCameraTurn(), FIGHTSTG_updateCursor(), FIGHTSTG_updateDigimonChange(), FIGHTSTG_updateEntrance(), FIGHTSTG_updateFace(), FIGHTSTG_updateHitEffect(), FIGHTSTG_updateHpTweens(), FIGHTSTG_updateLights(), FIGHTSTG_updatePartnerView(), FIGHTSTG_updateShotCamera(), FIGHTSTG_updateSpriteAnim(), FIGHTSTG_updateSwitchMenu(), FIGHTSTG_updateWhiteFlash(), findLayerSlot(), findOldestFile(), flyToDest(), freePrimBuffers(), getFrameCount(), getFrameTime(), getLayer(), getPrim(), getTime(), hidePile(), hidePlays(), hideSlots(), insertLayerSlot(), isFileLoading(), isOnScreen(), isOnScreen2(), layerClearOt(), layerDraw(), layerGetOt(), layerGetOtEntry(), layerGetOtEntryZ(), layerLoadLightMatrix(), layerLoadView(), layerSetKeepLightMatrix(), layerSetKeepView(), layerSkipEmptyOt(), loadFile(), main(), moveDisplay(), moveLayer(), moveTransitionTile(), moveWanderer(), moveWanderPair(), prepareStageModel(), readPadButtons(), removeLayerSlot(), requestFile(), resetGraphics(), returnToBattle(), runGauge(), runStopSlide(), runUsed(), setChangeClips(), setDisplayArea(), setDisplayMode(), setPrim(), setUpFieldScreen(), showPile(), showPlays(), showSlots(), slidePanelIn(), slidePanelOut(), SOUNDTST_updateSoundTest(), spinView(), spinViewBack(), spriteDrawerDraw(), spriteDrawerSetLayerId(), STAGSLCT_startStageSelect(), STCRDABM_drawAlbum(), STCRDABM_updateGrid(), STCRDDEK_drawEditor(), STCRDDEK_drawScreen(), STCRDDEK_stepEditor(), STCRDSHP_drawBuy(), STCRDSHP_drawPackOpen(), STCRDSHP_updateGrid(), STDGNAME_drawMenu(), STDGNAME_updateScene(), STDWTITL_drawEdgeFade(), STDWTITL_initDecEnv(), STDWTITL_stepTitle(), STDWTITL_tickMovie(), STDWTITL_tickMoviePlayer(), STDWTITL_tickScreen(), STDWTITL_tickSplash(), STDWTITL_tickSplashLoader(), stepAnimation(), stepAnimation2(), stepAnimationOnce(), stepAnimationOnce(), stepFallBody(), stepFieldMenuFade(), stepFloaterPart(), stepHeldAnimation(), stepLoopingAnimation(), stepMoverBody(), stepRiser(), stepTileAnimation(), stepTileAnimation(), stepTileAnimation(), stepTileAnimation2(), stepTileAnimation2(), stepTileAnimation3(), stepTileAnimation4(), stepTileLoop(), stepTileLoopAnimation(), stepTileSequences(), STFGTREP_drawPartner(), STFGTREP_drawReport(), STFGTREP_updateScene(), STGDGLAB_drawEntryList(), STGDGLAB_drawMenu(), STGDGLAB_drawPartyScreen(), STGDGLAB_drawRecipeScreen(), STGMCARD_drawSaves(), STGMCARD_updateInfo(), STGMCARD_updateMenu(), STGMCARD_updatePanel(), STGTRAIN_animatePartner(), STGTRAIN_drawMenu(), STGTRAIN_drawResult(), STGTRAIN_drawScreen(), STGTRAIN_drawSession(), STGTRAIN_updateRoot(), STGTRAIN_updateSprite(), STITSHOP_drawBuy(), STITSHOP_drawItemList(), STITSHOP_drawSell(), STPLNMET_drawChoice(), STPLNMET_drawConfirm(), STPLNMET_updateScene(), STPLNMET_updateScroll(), STPLNMET_updateShine(), STPLNMET_updateSparkles(), STPLNMET_updateWelcome(), STSTATUS_animateItemPortraits(), STSTATUS_animateSortPortraits(), STSTATUS_animateTechPortraits(), STSTATUS_drawCardScreen(), STSTATUS_drawDemoScreen(), STSTATUS_drawDigivolvePanel(), STSTATUS_drawEquipPanel(), STSTATUS_drawItemList(), STSTATUS_drawItemScreen(), STSTATUS_drawMapScreen(), STSTATUS_drawStatusScreen(), STSTATUS_drawTechScreen(), STSTATUS_stepItemCursor(), STSTATUS_stepSortArrow(), STSTATUS_stepSortCursor(), STSTATUS_stepStatusCursor(), STSTATUS_stepTechCursor(), textWindowDraw(), touchMarkedFiles(), turnAroundFighters(), turnInFlight(), updateActorMark(), updateByteAnims(), updateCursor(), updateDarkness(), updateEffect(), updateEvent1602(), updateEvent1604(), updateEvent1616(), updateEvent1618(), updateEvent9015(), updateFaller(), updateFarSprites(), updateFieldMenu(), updateFileCache(), updateFloater(), updateFloaterChain(), updateFlyer(), updateFlyerGate(), updateGlow(), updateHiding(), updateInnMenu(), updateListMenu(), updateMessageBoxFrame(), updateMover(), updateRisers(), updateScene(), updateScrollBar(), updateSpriteField(), updateSpritePair(), updateStageEffect(), updateTileLift(), updateTimer(), updateVibration(), vsyncCallback(), waitPhaseStep(), warpAway(), WFIGHTMN_endBattle(), WFIGHTMN_showWon(), WFIGHTMN_updateMenu(), WFIGHTTS_cameraList(), WFIGHTTS_fighterList(), WFIGHTTS_motionList(), WFIGHTTS_stageList(), wipeFromWireframe(), and wipeToWireframe().