Skip to content

Commit 44308bb

Browse files
committed
Preparacion, desactivar objetos sprites, apagar textos debug de colisiones
1 parent 1658562 commit 44308bb

4 files changed

Lines changed: 45 additions & 38 deletions

File tree

inc/global.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ void ZoneMap();
2020

2121

2222
typedef struct {
23+
const bool const PlanA;
2324
const u8 const musica;
2425
const u8 const *casillas;
2526
const u8 const top_blxpri;

src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void main(){
1515
//--------------------------------------
1616
JOY_setEventHandler(&inputHandler);
1717

18-
TITUTLO();
18+
//TITUTLO();
1919

2020
ZoneMap();
2121

src/zona1dat.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,20 @@ const u16 const blxpri_0[] = {
2525

2626
const t_zona zona1dat[TOP_ZONAS] = {
2727
{
28-
2, //musica
28+
TRUE, //PlanA
29+
2, //musica
2930
casillas_0, //casillas
3031
9, //top_blxpri
3132
blxpri_0 //blockpri
33+
3234
},
3335
{
34-
0,//ancho
36+
FALSE, //PlanA
37+
2,//musica
3538
0,//casillas /* 0 = null*/
36-
0,
37-
0
39+
0,//top_blxpri
40+
0 //blockpri
41+
3842
}
3943
};
4044

src/zone-jugpri.c

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,16 @@ static void jug2diso();
4949
static void jugpenguin();
5050

5151
//------------------------------------------------------------------------------------------
52-
#define top_object2D 3
52+
53+
/*#define top_object2D 3
5354
struct t_object2D {
5455
Sprite* sprt;
5556
u16 x, y;
5657
};
5758
struct t_object2D object2D[top_object2D];
5859
//------------------------------------------------------------------------------------------
5960
static void object2D_maker(SpriteDefinition sprited,u8 , u8, u16 , u16 , bool , bool );
60-
61+
*/
6162
//--------------------------------------------------------------------------------------------
6263

6364

@@ -111,7 +112,7 @@ void ZoneMap(){
111112

112113
loadzona();pintarAB();
113114

114-
SPR_update();SYS_doVBlankProcess();//fix (60Hrz) pintarAB Se necesita ciclos de procesamiento para pintar Sprites
115+
SYS_doVBlankProcess();//fix (60Hrz) pintarAB Se necesita ciclos de procesamiento para pintar Sprites
115116
SPR_update();
116117

117118
SPR_ACT=FALSE;
@@ -122,29 +123,27 @@ void ZoneMap(){
122123

123124
//SYS_showFrameLoad(TRUE);
124125

125-
126126
bool gat=TRUE;
127127
while(1){//LOOP BASICO(NUNCA SE SALE!)
128128

129129
jugpenguin();
130130

131131
//VDP_drawInt(move_scroll,0,0,26);
132-
if(move_scroll){pintarAB();SPR_update();}
132+
if(move_scroll) pintarAB();
133133

134-
VDP_drawInt(SYS_getCPULoad(),2,38,27);
135134

136135

137-
if(!gat){
138-
136+
if(!gat){
139137

140138
if(BUTTONS[8]){ gat=TRUE;
141139
jugcontrol++;if(jugcontrol==4)jugcontrol=0;
142140
VDP_drawInt(jugcontrol,0,39,26);
143141
}
144-
142+
145143
}else if(!BUTTONS[0]) gat=FALSE;
146144

147145

146+
VDP_drawInt(SYS_getCPULoad(),2,38,27);
148147
SYS_doVBlankProcess(); // Renderizamos la pantalla
149148

150149
if(BUTTONS[8] && BUTTONS[5]) SYS_hardReset();
@@ -153,7 +152,7 @@ void ZoneMap(){
153152
}
154153

155154

156-
155+
/*
157156
static void object2D_maker(SpriteDefinition sprited, u8 num_obj , u8 pal , u16 X, u16 Y, bool v, bool h){
158157
159158
object2D[num_obj].x= STARTXT+(X-Y) +160;
@@ -168,6 +167,7 @@ static void object2D_maker(SpriteDefinition sprited, u8 num_obj , u8 pal , u16 X
168167
}
169168
}
170169
}
170+
171171
object2D[num_obj].x-=12;object2D[num_obj].y-=26;
172172
173173
object2D[num_obj].sprt=SPR_addSprite(&sprited, object2D[num_obj].x-posX, object2D[num_obj].y-posY, TILE_ATTR(pal,tempbol,v,h));
@@ -176,30 +176,32 @@ static void object2D_maker(SpriteDefinition sprited, u8 num_obj , u8 pal , u16 X
176176
SPR_setFrame(object2D[num_obj].sprt,1);//parado
177177
178178
}
179+
*/
180+
179181

180182
static void pintarAB(){
181183

182184
//VDP_drawInt(posX,3,5,26);VDP_drawInt(posY,3,5,27);
183-
MAP_scrollTo(bgb,posX,posY);MAP_scrollTo(bga,posX,posY);
185+
MAP_scrollTo(bgb,posX,posY);
186+
187+
if(zona1dat[0].PlanA) MAP_scrollTo(bga,posX,posY);
184188
move_scroll=FALSE;
185189

186190
u8 i;
187191
//-----------------------------------------------------------
188-
for(i=0;i<3;i++){
192+
/*for(i=0;i<3;i++){
189193
SPR_setPosition(object2D[i].sprt,object2D[i].x-posX,object2D[i].y-posY);
190-
}
194+
}*/
191195

192196
///////////////////////////////////////////////////
193197

194-
195198
SPR_setDepth(penguinsp,-posY);
196199
//VDP_drawInt(-posY,3,0,27);
197200

198-
posXt=posX+160;posYt=posY+112;//centro de la pantalla
199-
//VDP_drawInt(posXt,3,10,26);VDP_drawInt(posYt,3,10,27);
200-
201201
jugpri=TRUE;
202202
if(zona1dat[0].top_blxpri>0){
203+
posXt=posX+160;posYt=posY+112;//centro de la pantalla
204+
//VDP_drawInt(posXt,3,10,26);VDP_drawInt(posYt,3,10,27);
203205
for(i=0;i<zona1dat[0].top_blxpri;i+=2){
204206
if(posXt+48>zona1dat[0].blockpri[i] && posXt-48<zona1dat[0].blockpri[i] && posYt+48>zona1dat[0].blockpri[i+1] && posYt<=zona1dat[0].blockpri[i+1]){
205207
jugpri=FALSE; break;
@@ -211,7 +213,7 @@ static void pintarAB(){
211213
SPR_setPriorityAttribut(penguinsp,jugpri);
212214
}
213215

214-
216+
SPR_update();
215217
}
216218

217219
static void loadzona(){
@@ -225,16 +227,16 @@ static void loadzona(){
225227
bgb=MAP_create(zona1[0],BG_B,ind);
226228
ind+=zona1[0]->tileset->numTile;
227229

228-
229-
VDP_loadTileSet(zona1b[0]->tileset,ind,DMA);
230-
bga=MAP_create(zona1b[0],BG_A,TILE_ATTR_FULL(0,1,0,0,ind));//PLANO B SIEMPRE PRIORIDAD ALTA!
231-
ind+=zona1b[0]->tileset->numTile;
232-
230+
if(zona1dat[0].PlanA){
231+
VDP_loadTileSet(zona1b[0]->tileset,ind,DMA);
232+
bga=MAP_create(zona1b[0],BG_A,TILE_ATTR_FULL(0,1,0,0,ind));//PLANO A SIEMPRE PRIORIDAD ALTA!
233+
//ind+=zona1b[0]->tileset->numTile;
234+
}
233235

234236
//-------------------------------------------
235-
for(u8 i=1;i<4;i++){
237+
/*for(u8 i=1;i<4;i++){
236238
object2D_maker(penguin,i-1,i,32*(i+2),32*(i+2),0,randU8(0,1));
237-
}
239+
}*/
238240
//--------------------------------------------
239241

240242
}
@@ -326,39 +328,39 @@ static void jugpenguin(){
326328

327329
PX32=(PX+16)/32;PY32=(PY+16)/32;//division 32
328330

329-
VDP_drawInt(PX32,0,10,26);VDP_drawInt(PY32,0,12,26);
330-
VDP_drawInt(zona1dat[0].casillas[PX32+(PY32*8)],0,0,27);
331+
//VDP_drawInt(PX32,0,10,26);VDP_drawInt(PY32,0,12,26);
332+
//VDP_drawInt(zona1dat[0].casillas[PX32+(PY32*8)],0,0,27);
331333

332334
switch(pdircm){
333335
case 1:
334336
if(PY>0){ PY-=VELPING;
335337
if(PY>15){ PY32--;
336-
VDP_drawInt(zona1dat[0].casillas[PX32+(PY32*8)],0,2,27);
338+
//VDP_drawInt(zona1dat[0].casillas[PX32+(PY32*8)],0,2,27);
337339
if(zona1dat[0].casillas[PX32+(PY32*8)]!=1 && PY-(PY32*32)<32) PY=PYC;
338340
}
339341
}
340342
break;
341343
case 2:
342344
PY+=VELPING;PY32++;
343-
VDP_drawInt(zona1dat[0].casillas[PX32+(PY32*8)],0,2,27);
345+
//VDP_drawInt(zona1dat[0].casillas[PX32+(PY32*8)],0,2,27);
344346
if(zona1dat[0].casillas[PX32+(PY32*8)]!=1 && (PY32*32)-PY<32) PY=PYC;
345347
break;
346348
case 3:
347349
if(PX>0){ PX-=VELPING;
348350
if(PX>15){ PX32--;
349-
VDP_drawInt(zona1dat[0].casillas[PX32+(PY32*8)],0,2,27);
351+
//VDP_drawInt(zona1dat[0].casillas[PX32+(PY32*8)],0,2,27);
350352
if(zona1dat[0].casillas[PX32+(PY32*8)]!=1 && PX-(PX32*32)<32) PX=PXC;
351353
}
352354
}
353355
break;
354356
case 4:
355357
PX+=VELPING;PX32++;
356-
VDP_drawInt(zona1dat[0].casillas[PX32+(PY32*8)],0,2,27);
358+
//VDP_drawInt(zona1dat[0].casillas[PX32+(PY32*8)],0,2,27);
357359
if(zona1dat[0].casillas[PX32+(PY32*8)]!=1 && (PX32*32)-PX<32) PX=PXC;
358360
}
359361

360-
VDP_drawInt(PX32,0,10,26);VDP_drawInt(PY32,0,12,26);
361-
VDP_drawInt(PX+16,3,20,26);VDP_drawInt(PY+16,3,20,27);
362+
//VDP_drawInt(PX32,0,10,26);VDP_drawInt(PY32,0,12,26);
363+
//VDP_drawInt(PX+16,3,20,26);VDP_drawInt(PY+16,3,20,27);
362364

363365
jug2diso();
364366

0 commit comments

Comments
 (0)