mirror of
https://gitlab.com/octospacc/MultiSpaccSDK
synced 2025-04-17 12:17:19 +02:00
[NDS] Fix console print (but temporarily break SDL), more secure Makefile
This commit is contained in:
parent
fcdd9fe1ba
commit
0364ead98b
2
.gitignore
vendored
2
.gitignore
vendored
@ -2,4 +2,4 @@
|
|||||||
*.exe
|
*.exe
|
||||||
*.run
|
*.run
|
||||||
*.tmp
|
*.tmp
|
||||||
Build/*
|
Build/
|
||||||
|
@ -51,29 +51,17 @@ Normal: $(Objects)
|
|||||||
$(CC) $^ $(LdFlags) -o $(AppName)$(ExeSuffix)
|
$(CC) $^ $(LdFlags) -o $(AppName)$(ExeSuffix)
|
||||||
|
|
||||||
NDS:
|
NDS:
|
||||||
#mkdir -p ./Build/NDS/Examples
|
|
||||||
#cp -rT . ./Build/NDS/Examples/$(shell basename $(CURDIR)) || true
|
|
||||||
#rm -rf ./Build/NDS/Examples/$(shell basename $(CURDIR))/Build
|
|
||||||
#cp -rT ../../LibMultiSpacc ./Build/NDS/LibMultiSpacc
|
|
||||||
#cp ../NDS.mk ./Build/NDS/Examples/$(shell basename $(CURDIR))/Makefile
|
|
||||||
#ln -s $(wildcard ../../LibMultiSpacc/*.* ../../LibMultiSpacc/NDS/*.*) ./Build/NDS/Examples/$(shell basename $(CURDIR))/
|
|
||||||
#cd ./Build/NDS/Examples/$(shell basename $(CURDIR)); make
|
|
||||||
#$(eval VirtualBuildDir = ./Build/NDS/$(shell basename $(CURDIR)))
|
|
||||||
#mkdir -p $(VirtualBuildDir)/source/LibMultiSpacc
|
|
||||||
$(eval VirtualBuildDir = ./Build/NDS)
|
$(eval VirtualBuildDir = ./Build/NDS)
|
||||||
mkdir -p $(VirtualBuildDir)/source/.tmp
|
mkdir -p $(VirtualBuildDir)/source/.tmp
|
||||||
cp ../NDS.mk $(VirtualBuildDir)/Makefile
|
cp ../NDS.mk $(VirtualBuildDir)/Makefile
|
||||||
#cp $(wildcard *) $(VirtualBuildDir)/source/
|
|
||||||
#cp $(Sources) $(wildcard ../../LibMultiSpacc/*.* ../../LibMultiSpacc/NDS/*.*) $(VirtualBuildDir)/source/
|
|
||||||
cp $(Sources) $(VirtualBuildDir)/source/
|
cp $(Sources) $(VirtualBuildDir)/source/
|
||||||
cp $(wildcard ../../LibMultiSpacc/*.*) $(VirtualBuildDir)/source/.tmp/
|
cp $(wildcard ../../LibMultiSpacc/*.*) $(VirtualBuildDir)/source/.tmp/
|
||||||
cd $(VirtualBuildDir)/source/.tmp; for i in *; do mv $$i ../LibMultiSpacc_$$i; done
|
cd $(VirtualBuildDir)/source/.tmp; for i in *; do mv $$i ../LibMultiSpacc_$$i; done
|
||||||
cp $(wildcard ../../LibMultiSpacc/NDS/*.*) $(VirtualBuildDir)/source/.tmp/
|
cp $(wildcard ../../LibMultiSpacc/NDS/*.*) $(VirtualBuildDir)/source/.tmp/
|
||||||
cd $(VirtualBuildDir)/source/.tmp; for i in *; do mv $$i ../LibMultiSpacc_NDS_$$i; done
|
cd $(VirtualBuildDir)/source/.tmp; for i in *; do mv $$i ../LibMultiSpacc_NDS_$$i; done
|
||||||
#cp -rT ../../LibMultiSpacc $(VirtualBuildDir)/source/LibMultiSpacc
|
for i in $(VirtualBuildDir)/source/*; do sed -i 's|#include[ \t]"../../LibMultiSpacc/|#include "LibMultiSpacc_|g' $$i; done
|
||||||
for i in $(VirtualBuildDir)/source/*; do sed -i 's|"../../LibMultiSpacc/|"LibMultiSpacc_|g' $$i; done
|
for i in $(VirtualBuildDir)/source/*; do sed -i 's|#include[ \t]"../MultiSpacc|#include "LibMultiSpacc_MultiSpacc|g' $$i; done
|
||||||
for i in $(VirtualBuildDir)/source/*; do sed -i 's|"../MultiSpacc|"LibMultiSpacc_MultiSpacc|g' $$i; done
|
for i in $(VirtualBuildDir)/source/*; do sed -i 's|#include[ \t]"NDS/|#include "LibMultiSpacc_NDS_|g' $$i; done
|
||||||
for i in $(VirtualBuildDir)/source/*; do sed -i 's|"NDS/|"LibMultiSpacc_NDS_|g' $$i; done
|
|
||||||
cd $(VirtualBuildDir); make
|
cd $(VirtualBuildDir); make
|
||||||
|
|
||||||
Run run: All
|
Run run: All
|
||||||
|
Binary file not shown.
@ -2,31 +2,46 @@
|
|||||||
|
|
||||||
#define AppName "Hello World"
|
#define AppName "Hello World"
|
||||||
|
|
||||||
int main( int argc, char *args[] )
|
//MultiSpacc_Window consoleInnit(MultiSpacc_Window console){
|
||||||
|
// consoleSelect(&console);
|
||||||
|
// PrintConsole *consolePtr = consoleInit(&console, 3, BgType_Text4bpp, BgSize_T_256x256, 31, 0, false, true);
|
||||||
|
// consoleSelect(&console);
|
||||||
|
// consoleSelect(consolePtr);
|
||||||
|
// return *consolePtr;
|
||||||
|
//return *consoleInit(&Window, 3, BgType_Text4bpp, BgSize_T_256x256, 31, 0, false, true);
|
||||||
|
//}
|
||||||
|
|
||||||
|
int main( void )
|
||||||
{
|
{
|
||||||
MultiSpacc_SurfaceConfig WindowConfig = { .Width = 320, .Height = 240, .Bits = 16 };
|
MultiSpacc_SurfaceConfig WindowConfig = { .Width = 320, .Height = 240, .Bits = 16 };
|
||||||
MultiSpacc_Window *Window = MultiSpacc_SetWindow( WindowConfig );
|
MultiSpacc_Window Window = MultiSpacc_SetWindow( WindowConfig );
|
||||||
MultiSpacc_Surface *Screen = MultiSpacc_GetWindowSurface( Window );
|
MultiSpacc_Surface *Screen = MultiSpacc_GetWindowSurface( &Window );
|
||||||
|
|
||||||
if( Screen == NULL )
|
/* if( Screen == NULL )
|
||||||
{
|
{
|
||||||
printf("[E] Error Initializing Video System.\n");
|
printf("[E] Error Initializing Video System.\n");
|
||||||
return -1;
|
return -1;
|
||||||
};
|
};*/
|
||||||
|
|
||||||
MultiSpacc_SetAppTitle( Window, AppName );
|
//MultiSpacc_SetAppTitle( Window, AppName );
|
||||||
|
|
||||||
|
//PrintConsole bottomScreen;
|
||||||
|
//consoleInit(&Window, 3, BgType_Text4bpp, BgSize_T_256x256, 31, 0, false, true);
|
||||||
|
//Window = consoleInnit(Window);
|
||||||
|
//consoleSelect(&Window);
|
||||||
|
|
||||||
// Bitmap font borrowed from: <https://github.com/nesdoug/01_Hello/blob/master/Alpha.chr>
|
// Bitmap font borrowed from: <https://github.com/nesdoug/01_Hello/blob/master/Alpha.chr>
|
||||||
// Copyright (c) 2018 Doug Fraker www.nesdoug.com (MIT)
|
// Copyright (c) 2018 Doug Fraker www.nesdoug.com (MIT)
|
||||||
//MultiSpacc_Surface *TilesImg = MultiSpacc_LoadImage( "Tiles.png", Screen, NULL );
|
//MultiSpacc_Surface *TilesImg = MultiSpacc_LoadImage( "Tiles.png", Screen, NULL );
|
||||||
|
MultiSpacc_PrintText( "Hello, World!", NULL, WindowConfig, 4, 4, NULL );
|
||||||
|
|
||||||
//MultiSpacc_PrintText( "Hello, World!", Screen, WindowConfig.Width, WindowConfig.Height, 4, 4, TilesImg );
|
while(1){ swiWaitForVBlank(); }
|
||||||
|
|
||||||
if( MultiSpacc_UpdateWindowSurface( Window ) != 0 )
|
/*if( MultiSpacc_UpdateWindowSurface( Window ) != 0 )
|
||||||
{
|
{
|
||||||
printf("[E] Error Updating Screen.\n");
|
printf("[E] Error Updating Screen.\n");
|
||||||
return -1;
|
return -1;
|
||||||
};
|
};*/
|
||||||
|
|
||||||
MultiSpacc_Sleep( 3000 );
|
MultiSpacc_Sleep( 3000 );
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -25,7 +25,7 @@ typedef struct MultiSpacc_SurfaceConfig {
|
|||||||
Uint32 Flags;
|
Uint32 Flags;
|
||||||
} MultiSpacc_SurfaceConfig;
|
} MultiSpacc_SurfaceConfig;
|
||||||
|
|
||||||
MultiSpacc_Window *MultiSpacc_SetWindow( MultiSpacc_SurfaceConfig WindowConfig );
|
MultiSpacc_Window MultiSpacc_SetWindow( MultiSpacc_SurfaceConfig WindowConfig );
|
||||||
MultiSpacc_Surface *MultiSpacc_GetWindowSurface( MultiSpacc_Window *Window );
|
MultiSpacc_Surface *MultiSpacc_GetWindowSurface( MultiSpacc_Window *Window );
|
||||||
|
|
||||||
void MultiSpacc_SetAppTitle( MultiSpacc_Window *Window, const char Title[] );
|
void MultiSpacc_SetAppTitle( MultiSpacc_Window *Window, const char Title[] );
|
||||||
@ -36,4 +36,4 @@ int MultiSpacc_SetColorKey( MultiSpacc_Surface *Surface, bool Flag, Uint32 Key )
|
|||||||
|
|
||||||
int MultiSpacc_PollEvent( MultiSpacc_Event *Event );
|
int MultiSpacc_PollEvent( MultiSpacc_Event *Event );
|
||||||
|
|
||||||
void MultiSpacc_PrintText( char Text[], MultiSpacc_Surface *Surface, int ScreenWidth, int ScreenHeight, int x, int y, MultiSpacc_Surface *Tiles /*, int FontSize, int Color */ ); // WIP
|
void MultiSpacc_PrintText( char Text[], MultiSpacc_Surface *Surface, MultiSpacc_SurfaceConfig WindowConfig, int x, int y, MultiSpacc_Surface *Tiles /*, int FontSize, int Color */ ); // WIP
|
||||||
|
@ -1,15 +1,34 @@
|
|||||||
#include "../MultiSpacc.h"
|
#include "../MultiSpacc.h"
|
||||||
|
|
||||||
MultiSpacc_Window *MultiSpacc_SetWindow( MultiSpacc_SurfaceConfig WindowConfig )
|
MultiSpacc_Window MultiSpacc_SetWindow( MultiSpacc_SurfaceConfig WindowConfig )
|
||||||
{
|
{
|
||||||
MultiSpacc_Window *wip;
|
//PrintConsole topScreen;
|
||||||
return wip;
|
PrintConsole bottomScreen;
|
||||||
|
//PrintConsole *bottomScreenPtr;
|
||||||
|
|
||||||
|
//videoSetMode(MODE_0_2D);
|
||||||
|
videoSetModeSub(MODE_0_2D);
|
||||||
|
|
||||||
|
//vramSetBankA(VRAM_A_MAIN_BG);
|
||||||
|
vramSetBankC(VRAM_C_SUB_BG);
|
||||||
|
|
||||||
|
//consoleInit(&topScreen, 3, BgType_Text4bpp, BgSize_T_256x256, 31, 0, true, true);
|
||||||
|
//bottomScreenPtr = consoleInit(&bottomScreen, 3, BgType_Text4bpp, BgSize_T_256x256, 31, 0, false, true);
|
||||||
|
|
||||||
|
//consoleSelect(&bottomScreen);
|
||||||
|
//return *bottomScreenPtr;
|
||||||
|
|
||||||
|
|
||||||
|
PrintConsole *bottomScreenPtr = consoleInit(&bottomScreen, 3, BgType_Text4bpp, BgSize_T_256x256, 31, 0, false, true);
|
||||||
|
bottomScreen = *bottomScreenPtr;
|
||||||
|
consoleSelect(&bottomScreen);
|
||||||
|
return bottomScreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
MultiSpacc_Surface *MultiSpacc_GetWindowSurface( MultiSpacc_Window *Window )
|
MultiSpacc_Surface *MultiSpacc_GetWindowSurface( MultiSpacc_Window *Window )
|
||||||
{
|
{
|
||||||
MultiSpacc_Surface *wip;
|
consoleSelect(Window);
|
||||||
return wip;
|
return Window;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MultiSpacc_SetAppTitle( MultiSpacc_Window *Window, const char Title[] ){}
|
void MultiSpacc_SetAppTitle( MultiSpacc_Window *Window, const char Title[] ){}
|
||||||
@ -19,7 +38,7 @@ int MultiSpacc_UpdateWindowSurface( MultiSpacc_Window *Window )
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MultiSpacc_PrintText( char Text[], MultiSpacc_Surface *Surface, int ScreenWidth, int ScreenHeight, int x, int y, MultiSpacc_Surface *Tiles /*, int FontSize, int Color */ )
|
void MultiSpacc_PrintText( char Text[], MultiSpacc_Surface *Surface, MultiSpacc_SurfaceConfig WindowConfig, int x, int y, MultiSpacc_Surface *Tiles /*, int FontSize, int Color */ )
|
||||||
{
|
{
|
||||||
|
iprintf(Text);
|
||||||
}
|
}
|
@ -8,8 +8,8 @@
|
|||||||
#include <nds.h>
|
#include <nds.h>
|
||||||
|
|
||||||
#define Uint32 int32
|
#define Uint32 int32
|
||||||
#define MultiSpacc_Window PrintConsole
|
|
||||||
#define MultiSpacc_Surface PrintConsole
|
#define MultiSpacc_Surface PrintConsole
|
||||||
|
#define MultiSpacc_Window PrintConsole
|
||||||
#define MultiSpacc_Sleep {}
|
#define MultiSpacc_Sleep {}
|
||||||
|
|
||||||
typedef struct MultiSpacc_Event {
|
typedef struct MultiSpacc_Event {
|
||||||
|
@ -32,7 +32,7 @@ MultiSpacc_Surface *MultiSpacc_LoadImage( char FilePath[], MultiSpacc_Surface *S
|
|||||||
return Final;
|
return Final;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MultiSpacc_PrintText( char Text[], MultiSpacc_Surface *Surface, int ScreenWidth, int ScreenHeight, int x, int y, MultiSpacc_Surface *Tiles /*, int FontSize, int Color */ )
|
void MultiSpacc_PrintText( char Text[], MultiSpacc_Surface *Surface, MultiSpacc_SurfaceConfig WindowConfig, int x, int y, MultiSpacc_Surface *Tiles /*, int FontSize, int Color */ )
|
||||||
{
|
{
|
||||||
for( int i = 0; i < strlen( Text ); i++ )
|
for( int i = 0; i < strlen( Text ); i++ )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user