44* @Author: Alicia Sanchez Martos "AliceSim1"
55***********************************************************************************/
66#include "../inc/global.h"
7- #define Version "24/6 "
7+ #define Version "1/7 "
88
99//res ficheros
1010#include "../res/logos.h"
1111#include "../res/titulo.h"
1212//-----------------------------------------------------
1313
14+ s16 vectorB [1 ];
1415
1516//Definiciones de las funciones---------------------------------------------------
1617static void SEGALOGO ();
1718static void SGDKlogo ();
1819static void ALICESIM1 ();
20+ static void Titulo_scrollLine ();
1921//----------------------------------------
2022
21-
23+
2224/////////////////////////////INICIO DE TODO//////////////////////////////////////////////////
2325void TITUTLO (){
2426 //--------------------------------------
2527 VDP_loadFont (& font1 ,DMA );
2628
27- VDP_drawImageEx (BG_B ,& disclaimer ,1 ,20 - 10 ,14 - 6 ,TRUE,TRUE);
29+ VDP_drawImageEx (BG_B ,& disclaimer ,1 ,20 - 10 ,14 - 6 + IS_PALSYSTEM ,TRUE,TRUE);
2830 JOY_waitPressBtnTime (900 );
2931 VDP_clearPlane (BG_B ,TRUE);
3032
@@ -44,58 +46,60 @@ void TITUTLO(){
4446 memcpy (& paleta64 [48 ],& palette_red , 16 * 2 );
4547
4648 //carga la imagen en VRAM y la dibuja en pantalla
47- VDP_drawImageEx (BG_B ,& fondogr ,TILE_ATTR_FULL (PAL1 ,FALSE,FALSE,FALSE,1 ),0 ,16 ,FALSE,TRUE);
49+ VDP_drawImageEx (BG_B ,& fondogr ,TILE_ATTR_FULL (PAL1 ,FALSE,FALSE,FALSE,1 ),0 ,16 + ( IS_PALSYSTEM * 2 ) ,FALSE,TRUE);
4850 //incrementa ind para 'apuntar' a una zona de VRAM libre para futuras tiles
4951 u16 ind = 1 + fondogr .tileset -> numTile ;
5052
51- VDP_drawImageEx (BG_A ,& titulo ,ind ,4 ,1 ,FALSE,TRUE);
53+ VDP_drawImageEx (BG_A ,& titulo ,ind ,4 ,1 + IS_PALSYSTEM ,FALSE,TRUE);
5254 ind += titulo .tileset -> numTile ;
5355
5456 bool gat2 = FALSE;
5557
56- s16 vectorB [ 1 ];
58+
5759 u8 contador2 = randU8 (10 ,50 );
5860 bool gat3 = FALSE;
59-
61+ u8 num_lin = 0 ;
6062 vectorB [0 ]= 240 ;
6163 vectorB [1 ]= - vectorB [0 ];
62- u8 num_lin ;
63- for ( num_lin = 9 ; num_lin < 120 ; num_lin += 2 ) VDP_setHorizontalScrollLine ( BG_A , num_lin , vectorB , 2 , CPU );
64+
65+ Titulo_scrollLine ( );
6466
6567 PAL_fadeInAll (paleta64 ,120 ,TRUE);
6668
6769 u16 i = 240 ;
6870 while (BUTTONS [0 ]< 10 && i > 0 ){
6971 i -= 3 ;vectorB [0 ]= i ;vectorB [1 ]= - i ;
70- for ( num_lin = 9 ; num_lin < 120 ; num_lin += 2 ) VDP_setHorizontalScrollLine ( BG_A , num_lin , vectorB , 2 , CPU );
72+ Titulo_scrollLine ( );
7173 SYS_doVBlankProcess ();
7274 }
7375
7476 vectorB [0 ]= vectorB [1 ]= 0 ;
75- for ( num_lin = 9 ; num_lin < 120 ; num_lin += 2 ) VDP_setHorizontalScrollLine ( BG_A , num_lin , vectorB , 2 , CPU );
77+ Titulo_scrollLine ( );
7678 if (BUTTONS [0 ]> 9 ){
7779 PAL_interruptFade ();
7880 PAL_setColors (0 ,& paleta64 [0 ],64 ,DMA );//restaura las paletas
7981 }
8082 PAL_setPalette (2 ,palette_black ,DMA );
8183
82- VDP_drawImageEx (BG_B ,& titush ,TILE_ATTR_FULL (PAL2 ,FALSE,FALSE,FALSE,ind ),3 ,0 ,FALSE,TRUE);
84+ VDP_drawImageEx (BG_B ,& titush ,TILE_ATTR_FULL (PAL2 ,FALSE,FALSE,FALSE,ind ),3 ,IS_PALSYSTEM ,FALSE,TRUE);
8385 ind += titulo .tileset -> numTile ;
8486
85- VDP_drawImageEx (BG_A ,& sgdk ,TILE_ATTR_FULL (PAL2 ,FALSE,FALSE,FALSE,ind ),31 ,24 ,FALSE,TRUE);
87+ VDP_drawImageEx (BG_A ,& sgdk ,TILE_ATTR_FULL (PAL2 ,FALSE,FALSE,FALSE,ind ),31 ,24 + IS_PALSYSTEM ,FALSE,TRUE);
8688
8789 VDP_setTextPalette (PAL2 );
88- VDP_drawText ("Power By" ,31 ,23 );
90+ VDP_drawText ("Power By" ,31 ,23 + IS_PALSYSTEM );
8991 VDP_drawText (Version ,36 ,0 );
9092
91- VDP_setTextPalette (PAL3 );VDP_drawText ("AliceSim1" ,9 ,22 );VDP_setTextPalette (PAL0 );VDP_drawText ("- 2020-2021" ,19 ,22 );
92- VDP_drawText ("Twitter: @Alice_Sim1" ,9 ,24 );
93+ VDP_setTextPalette (PAL3 );VDP_drawText ("AliceSim1" ,9 ,22 + IS_PALSYSTEM );VDP_setTextPalette (PAL0 );VDP_drawText ("- 2020-2021" ,19 ,22 + IS_PALSYSTEM );
94+ VDP_drawText ("Twitter: @Alice_Sim1" ,9 ,24 + IS_PALSYSTEM );
9395 u8 contador = 0 ;
9496 bool gat = FALSE;
9597
9698 bool gatS = TRUE;
9799 bool ok = FALSE;
98100
101+
102+
99103 do {
100104
101105 if (XGM_getElapsed ()> 1755 ) XGM_startPlay (M_titulo );
@@ -109,23 +113,23 @@ void TITUTLO(){
109113 contador ++ ;
110114 if (contador == 60 ){ contador = 0 ;
111115 if (!gat ){
112- VDP_setTextPalette (PAL0 );VDP_drawText ("PULSA BOTON" ,11 ,18 );
113- VDP_setTextPalette (PAL3 );VDP_drawText ("START!" ,23 ,18 );
116+ VDP_setTextPalette (PAL0 );VDP_drawText ("PULSA BOTON" ,11 ,18 + IS_PALSYSTEM );
117+ VDP_setTextPalette (PAL3 );VDP_drawText ("START!" ,23 ,18 + IS_PALSYSTEM );
114118 }
115- else VDP_clearText (11 ,18 ,18 );
119+ else VDP_clearText (11 ,18 + IS_PALSYSTEM ,18 );
116120 gat = !gat ;
117121 }
118122
119123 if (gat3 ){ gat3 = FALSE;
120124 vectorB [0 ]= 0 ;
121- VDP_setHorizontalScrollLine (BG_A ,num_lin ,vectorB ,1 ,CPU );
125+ VDP_setHorizontalScrollLine (BG_A ,num_lin + ScreTile8 ,vectorB ,1 ,DMA );
122126 }
123127
124128 contador2 -- ;
125129 if (contador2 == 0 ){ contador2 = randU8 (1 ,25 );
126130 vectorB [0 ]= randU8 (0 ,10 )- 5 ;
127131 num_lin = randU8 (10 ,112 );
128- VDP_setHorizontalScrollLine (BG_A ,num_lin ,vectorB ,1 ,CPU );
132+ VDP_setHorizontalScrollLine (BG_A ,num_lin + ScreTile8 ,vectorB ,1 ,DMA );
129133 gat3 = TRUE;
130134 }
131135
@@ -143,21 +147,23 @@ void TITUTLO(){
143147 VDP_setTextPalette (PAL0 );
144148 VDP_setScrollingMode (HSCROLL_PLANE ,VSCROLL_PLANE );
145149
146- // XGM_stopPlay();SYS_doVBlankProcess();//necesita VSync para parar la musica por completo
150+ XGM_stopPlay ();SYS_doVBlankProcess ();//necesita VSync para parar la musica por completo
147151
148152
149153}
150154
151155
152-
156+ static void Titulo_scrollLine (){
157+ for (u8 num_lin = 9 ;num_lin < 120 ;num_lin += 2 ) VDP_setHorizontalScrollLine (BG_A ,num_lin + ScreTile8 ,vectorB ,2 ,DMA );
158+ }
153159
154160static void SEGALOGO (){
155161
156162 u16 paleta16or [16 ];
157163 memcpy (& paleta16or [0 ],logosega .palette -> data , 16 * 2 );
158164 PAL_setPalette (0 ,palette_black ,DMA );
159165
160- VDP_drawImageEx (BG_B ,& logosega ,1 ,20 - 6 ,14 - 2 ,FALSE,TRUE);
166+ VDP_drawImageEx (BG_B ,& logosega ,1 ,20 - 6 ,14 - 2 + IS_PALSYSTEM ,FALSE,TRUE);
161167
162168 for (u8 i = 1 ;i < 13 ;i ++ ){
163169 PAL_fadeIn (i ,i ,& paleta16or [i ],3 ,TRUE);
@@ -181,7 +187,7 @@ static void SGDKlogo(){
181187 memcpy (& paleta16or [0 ],sgdklogo .palette -> data , 16 * 2 );
182188 PAL_setPalette (0 ,palette_black ,DMA );
183189
184- VDP_drawImageEx (BG_B ,& sgdklogo ,1 ,20 - 4 ,14 - 4 ,FALSE,TRUE);
190+ VDP_drawImageEx (BG_B ,& sgdklogo ,1 ,20 - 4 ,14 - 4 + IS_PALSYSTEM ,FALSE,TRUE);
185191 PAL_fadeIn (0 ,15 ,& paleta16or [0 ],10 ,TRUE);
186192
187193 if (BUTTONS [0 ]== 0 )JOY_waitPressBtnTime (750 );
@@ -203,7 +209,7 @@ static void ALICESIM1(){
203209 PAL_setPalette (1 ,palette_grey ,DMA );
204210 VDP_setTextPalette (PAL1 );
205211
206- VDP_drawImageEx (BG_B ,& alicesim1 ,1 ,20 - 11 ,14 - 4 ,FALSE,TRUE);
212+ VDP_drawImageEx (BG_B ,& alicesim1 ,1 ,20 - 11 ,14 - 4 + IS_PALSYSTEM ,FALSE,TRUE);
207213 //Volvemos a activar las interrupciones del VDP
208214
209215 u8 i ;
@@ -212,7 +218,7 @@ static void ALICESIM1(){
212218 do {SYS_doVBlankProcess ();}while (PAL_isDoingFade () && BUTTONS [0 ]== 0 );
213219 if (BUTTONS [0 ]> 9 )break ;
214220 }
215- VDP_drawText ("Alicia Sanchez Martos" ,10 ,22 );
221+ VDP_drawText ("Alicia Sanchez Martos" ,10 ,22 + IS_PALSYSTEM );
216222 if (BUTTONS [0 ]== 0 ){
217223 for (i = 0 ;i < 16 ;i += 2 ){
218224 PAL_fade (i ,i + 1 ,& paleta16or [i ],& colblank [0 ],1 ,FALSE);
0 commit comments