Skip to content

Commit a7be30e

Browse files
committed
Compactacion de codigo, partes temporales a carpeta Temp, iniciacion de desarrollo ventana de dialogo por Sprites
1 parent eb412e5 commit a7be30e

44 files changed

Lines changed: 653 additions & 139 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
out/
2-
temp/

inc/global.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define _GLOBAL_H
33
//------------------------------------------------------------------------------------------
44
#include "../res/basicos.h"//fuente, pinguno jug, cursor,
5-
//#include "../res/musica.h"
5+
//#include "../res/musica.h" //toda coleccion de musicas vgm
66
//-----------------------------------------------
77

88
u8 ScreenY; //27/29
@@ -15,7 +15,8 @@ u8 pad6; //JOY_getJoypadType(JOY_1);
1515
u8 padraton; //JOY_getPortType(PORT_2);
1616

1717
u16 BUTTONS[13];
18-
18+
bool gat;
19+
1920
s16 readedX;
2021
s16 readedY;
2122
Vect2D_s16 joypos;
@@ -29,6 +30,7 @@ char char_salida[8];
2930
void VDP_drawInt(s32,u8,u8,u8);
3031

3132
//void play_music(u8);
33+
//u8 old_musica;
3234

3335
u8 randU8(u8,u8);
3436

@@ -37,7 +39,9 @@ u16 paleta64[64];
3739
//void TITUTLO();
3840
void ZoneMap();
3941

40-
//u8 old_musica;
42+
43+
44+
4145
//-----------------------------------
4246
typedef struct {
4347
const bool const PlanA;

res/DiagBoxD.png

166 Bytes
Loading

res/DiagBoxF.png

418 Bytes
Loading

res/basicos.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33

44
extern const SpriteDefinition penguin;
55
extern const SpriteDefinition cursor;
6+
extern const SpriteDefinition dig_marco1;
7+
extern const SpriteDefinition dig_marco2;
68

79
#endif // _RES_BASICOS_H_

res/basicos.res

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
//TILESET font1 "font_1c.png" BEST NONE
22
SPRITE penguin "pingu1.png" 3 4 BEST
3-
SPRITE cursor "cursor.png" 1 1 BEST
3+
SPRITE cursor "cursor.png" 1 1 BEST
4+
SPRITE dig_marco1 "DiagBoxF.png" 28 8 BEST
5+
SPRITE dig_marco2 "DiagBoxD.png" 24 4 BEST

res/cursor.png

-32 Bytes
Loading

res/font_1b.png

1.57 KB
Loading

src/main.c

Lines changed: 21 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -13,78 +13,54 @@ static void inputHandler(u16,u16,u16);
1313
void main(u16 hard){
1414
if(!hard){
1515
SYS_hardReset(); //si se hace Soft-Reset, probocamos limpieza total de la RAM!
16-
KLog("RESET!");
16+
KLog("Soft RESET!");
1717
}
1818

19-
if(IS_PALSYSTEM){
20-
KLog("PAL-240");
19+
if(IS_PALSYSTEM){ //KLog("PAL-240");
2120
VDP_setScreenHeight240();//29(30) tiles x8 (Solo para PAL = 50FPS) NTSC No puede usar este modo!
2221
ScreenY=29;
2322
ScreTile8=8;
2423
}
25-
else {
26-
KLog("NTSC-224");
24+
else { //KLog("NTSC-224");
2725
ScreenY=27;
2826
ScreTile8=0;
2927
}
30-
31-
//KLog_U1("ScreenY:",ScreenY);
32-
//KLog_S1("fixAlturaY:",fixAlturaY);
3328
ScreenTY=8+(ScreenY*8);//224/240
3429
ScreenMY=ScreenTY/2;//112/120
35-
36-
//KLog_U1("ScreenTY:",ScreenTY);
37-
//KLog_U1("ScreenMY:",ScreenMY);
3830
//--------------------------------------
39-
//KLog("---------------");
40-
41-
padtipo=JOY_getPortType(PORT_1);//13 =
42-
//padtipo=15;//NINGUNO
43-
//padtipo=13;//PAD3,6
44-
//padtipo=0;//MOUSE
4531

32+
padtipo=JOY_getPortType(PORT_1);
4633
padraton=JOY_getPortType(PORT_2);
47-
if(padraton==PORT_TYPE_MOUSE) JOY_setSupport(PORT_2, JOY_SUPPORT_MOUSE); //3
48-
//padraton=15;//NINGUNO
49-
//padraton=13;//PAD3,6
50-
//padraton=3;//MOUSE
51-
52-
SYS_doVBlankProcess(); // Renderizamos la pantalla
53-
34+
if(padraton==PORT_TYPE_MOUSE) JOY_setSupport(PORT_2, JOY_SUPPORT_MOUSE);
35+
SYS_doVBlankProcess(); // Necesario para detecte el JoypadType
5436
pad6=JOY_getJoypadType(JOY_1);
55-
//0=3 botones
56-
//1=6 botones
57-
//15=NINGUNO
58-
5937
JOY_setEventHandler(&inputHandler);
6038

6139
//TITUTLO();
6240

63-
//PAL_setColors(0,palette_black,64,CPU);
41+
42+
VDP_setWindowVPos(1,ScreenY-2);// 27max vertical Windows
43+
VDP_setTextPlane(WINDOW);//Textos "normales SGDK" se pintan en Window es temporal
44+
PAL_setColors(0,palette_black,64,CPU);//para iniciacion Debug
45+
6446
ZoneMap();
6547

6648
}
6749

68-
/*
69-
void play_music(u8 indice){
70-
switch(indice){
71-
case 1:XGM_startPlay(M_titulo);break;
72-
case 2:XGM_startPlay(M_zone1);break;
73-
default: XGM_stopPlay();
74-
}
75-
}
76-
*/
7750

7851
//https://github.com/diegomtassis/yamd-library/blob/master/src/fwk/commons.c#L40
7952
u8 randU8(u8 lower, u8 higher) {
8053
return lower + random() % (higher + 1 - lower);
8154
}
8255

56+
//https://danibus.wordpress.com/2019/08/29/99-aventuras-en-megadrive-debug/
57+
//PROBLEMAS DE CONVERSIÓN CON SPRINTF -> ¿Y si quiero usar variables de 32 bits?
8358
void VDP_drawInt(s32 valor,u8 ceros,u8 x, u8 y){
8459
intToStr(valor,char_salida,ceros); //MIN -500.000.000 - MAX 500.000.000
8560
VDP_drawText(char_salida,x,y);
8661
}
8762

63+
8864
/**
8965
* Manejador de entrada
9066
* joy-> Indica el mando que ha activado la entrada
@@ -103,21 +79,24 @@ void inputHandler(u16 joy, u16 state, u16 changed){
10379
BUTTONS[4]=changed & BUTTON_RIGHT;
10480

10581
BUTTONS[8]=changed & BUTTON_START;
106-
//if(pad6==1){
82+
if(pad6==1){
10783
BUTTONS[9]=changed & BUTTON_X;
10884
BUTTONS[10]=changed & BUTTON_Y;
10985
BUTTONS[11]=changed & BUTTON_Z;
11086
BUTTONS[12]=changed & BUTTON_MODE;
111-
//}
87+
}
11288
}
113-
89+
//necesario para que el mouse puerto 2 funcione los 3 botones
11490
BUTTONS[5]=changed & BUTTON_A;//Boton Central
11591
BUTTONS[6]=changed & BUTTON_B;//Boton Izquiero
11692
BUTTONS[7]=changed & BUTTON_C;//Boton Derecho
11793

11894
}
11995

120-
96+
/* Bug Hunt - https://github.com/moon-watcher/BugHuntMD
97+
* @CODE: => Mun | Twitter: @MoonWatcherMD
98+
* @CODE-ASSISTANT: => Jack Nolddor | Twitter: @nolddor, Mail to:
99+
*/
121100
void _JOYsetXY ( s16 x, s16 y )
122101
{
123102
readedX = JOY_readJoypadX(JOY_2);
@@ -127,7 +106,6 @@ void _JOYsetXY ( s16 x, s16 y )
127106
joypos.y = y;
128107
}
129108

130-
131109
void _JOYupdateMouse ()
132110
{
133111
s16 readX = JOY_readJoypadX(JOY_2);

0 commit comments

Comments
 (0)