Mortal Kombat Plus
Documentação gerada automaticamente com Doxygen
Carregando...
Procurando...
Nenhuma entrada encontrado
main.c
Ir para a documentação desse arquivo.
1#include <genesis.h>
2
3#include "game_vars.h"
4#include "fighters.h"
5#include "estruturas.h"
6#include "cenarios.h"
7#include "input_system.h"
8#include "gfx.h"
9#include "sprites.h"
10#include "anima_system.h"
11
12// -- DECLARACAO DE VARIAVEIS -- //
13u16 gDistancia; // Distancia entre os Players
14s16 gMeioDaTela = 0; // MEio da Câmera em X
15s16 camPosX = 0; // Posicao da Camera
16s16 camPosXanterior = 0; // Posicao da Camera no frame Anterior
19
21void CLEAR_VDP();
22
23int main(bool hardReset)
24{
25 SPR_init();
26 VDP_setScreenWidth320();
27 VDP_setScreenHeight224();
28 // VDP_setHilightShadow(TRUE);
29
30 debugEnabled = FALSE;
31 gRoom = TELA_DEMO_INTRO;
32 gFrames = 0;
33 gInd_tileset = 0;
34 player[0].id = JOHNNY_CAGE;
35
36 if (!hardReset)
37 {
38 SYS_hardReset();
39 }
40
42
43 while (TRUE)
44 {
46
47 if (TELA_DEMO_INTRO == gRoom)
48 {
50 }
51
52 if (TELA_START == gRoom)
53 {
55 }
56
57 if (SELECAO_PERSONAGENS == gRoom)
58 {
60 }
61
62 if(BONUS_STAGE == gRoom)
63 {
65 }
66
67 if (PALACE_GATES == gRoom)
68 {
69 if (gFrames == 1)
70 CLEAR_VDP();
71
73
74 player[0].sprite = SPR_addSprite(&spr_subzero, 24, 96, TILE_ATTR(PAL2, 0, FALSE, FALSE));
75 PAL_setPalette(PAL2, spr_subzero.palette->data, DMA);
76
77 player[1].sprite = SPR_addSprite(&spr_reptile, 168, 96, TILE_ATTR(PAL3, 0, FALSE, TRUE));
78 PAL_setPalette(PAL3, spr_reptile.palette->data, DMA);
79
80 player[0].id = SUBZERO;
81 player[1].id = REPTILE;
82 player[0].state = PARADO;
83 player[1].state = PARADO;
84 player[0].paleta = PAL2;
85 player[1].paleta = PAL3;
86
87 scrollOffset += 1;
88 VDP_setScrollingMode(HSCROLL_LINE, VSCROLL_COLUMN);
89
90 for (int i = 0; i < 48; i++)
91 {
93 }
94
95 VDP_setHorizontalScrollLine(BG_B, 0, scrollValues, 48, CPU);
96 }
97
98 // -- DEBUG -- //
99 if (debugEnabled)
100 {
101 char str[64];
102 sprintf(str, "tiles nos BGs: %d", gInd_tileset);
103 VDP_drawText(str, 1, 1);
104 sprintf(str, "contagem de frames: %ld", gFrames);
105 VDP_drawText(str, 1, 2);
106 }
107
108 // -- FINALIZAÇÕES -- //
109 // VDP_showFPS(1, 1, 1);
110 SPR_update(); // Atualização dos sprites na tela
111 SYS_doVBlankProcess(); // Sincroniza com o VBlank
112 }
113
114 return 0;
115}
116
118{
119 SYS_disableInts();
120 SPR_reset();
121 VDP_resetSprites();
122 VDP_releaseAllSprites();
123 SPR_defragVRAM();
124 VDP_clearPlane(BG_A, TRUE);
125 VDP_clearPlane(BG_B, TRUE);
126 // VDP_setTextPlane(BG_B);
127 // VDP_setHorizontalScroll(BG_B, 0);
128 // VDP_setVerticalScroll(BG_B, 0);
129 // VDP_setHorizontalScroll(BG_A, 0);
130 // VDP_setVerticalScroll(BG_A, 0);
131 VDP_setBackgroundColor(0);
132 VDP_resetScreen();
133 // PAL_setColors(0, palette_black, 64, DMA);
134 SYS_enableInts();
135 gInd_tileset = 0;
136}
137
139{
140 for (int ind = 0; ind < 25; ind++)
141 {
142 if (GE[ind].sprite)
143 {
144 SPR_releaseSprite(GE[ind].sprite);
145 GE[ind].sprite = NULL;
146 }
147 }
148}
void processBonusStage()
void processSelecaoPersonagens()
Player player[2]
Definição game_vars.c:24
u8 gRoom
Definição game_vars.c:10
u32 gFrames
Definição game_vars.c:16
GraphicElement GE[25]
Definição game_vars.c:23
u16 gInd_tileset
Definição game_vars.c:12
bool debugEnabled
Definição game_vars.c:8
void inputSystem()
Definição input_system.c:4
void processIntro()
u16 gDistancia
Definição main.c:13
s16 gMeioDaTela
Definição main.c:14
s16 camPosXanterior
Definição main.c:16
s16 scrollValues[48]
Definição main.c:18
s16 scrollOffset
Definição main.c:17
void CLEAR_VDP()
Definição main.c:117
s16 camPosX
Definição main.c:15
void resetGraphicElements()
Definição main.c:138
int main(bool hardReset)
Definição main.c:23
void initPalaceGatesRoom(void)
void processPressStart()