[NDSi] Port Vanilla-Conquer to the Nintendo DSi#821
Conversation
The word `Keyboard` conflicts with the typedef `Keyboard` in libnds. So we have to rename it.
b80f212 to
eebd762
Compare
OmniBlade
left a comment
There was a problem hiding this comment.
This looks like a phenomenal amount of work put into this. I've only done a quick scan through and commented on a few things I've noticed so far. We probably also need to look at how we organise platform specific files as this PR adds a few port specific files in the form of arm assembly that maybe should be moved into their own sub directory.
| add_definitions(-DARM7 -D_NDS) | ||
|
|
||
| set(ARCH "-mthumb -mthumb-interwork -mcpu=arm7tdmi -mtune=arm7tdmi") | ||
| set(CMAKE_C_FLAGS "${ARCH} -g -fomit-frame-pointer -fno-rtti -fno-exceptions -ffast-math -fstack-protector-all") |
There was a problem hiding this comment.
You can avoid a lot of this redefintion of compiler flags by using target_compile_options instead to set different options on different targets.
| set(CMAKE_CXX_FLAGS_RELEASE "-Os") | ||
| set(CMAKE_EXE_LINKER_FLAGS "-specs=ds_arm7.specs -mthumb -mthumb-interwork -Wl,-Map,vanilla.map") | ||
|
|
||
| set(ARM7_SRC |
There was a problem hiding this comment.
The same goes for libraries by using target_link_libraries.
| bool Find_File_Data_Posix::FindFirst(const char* fname) | ||
| { | ||
| #ifdef _NDS | ||
| DS_Filesystem_Init(); |
There was a problem hiding this comment.
Does this need to be called on every attempt to find a file?
There was a problem hiding this comment.
Initialization only happens once. But I think I can refactor this to initialize the filesystem on some constructor. That will guarantee that it is initialized before main is even called.
| extern WWMouseClass* WWMouse; | ||
|
|
||
| #ifdef SDL2_BUILD | ||
| #if defined(SDL2_BUILD) |
| ** Keep count of the number of units created. Dont track cargo planes as they are created | ||
| ** automatically, not bought. | ||
| */ | ||
| #ifndef _NDS |
There was a problem hiding this comment.
Maybe we should gate these behind NETWORKING since they are pointless in none networking builds.
8180027 to
e6a34c7
Compare
This commit introduces a new target platform to Vanilla-Conquer:
The mighty Nintendo DSi.
It includes:
- A CMake toolchain file for devKitPro
- A video interface to the game graphical engine relying purely on libnds.
- A dedicated asynchronous sound engine running on the secondary ARM7.
- Fixing many unaligned accesses problems in the engine.
- Introduce ways of measuring how much RAM to allocate to BigShapeBuff.
- Optimized functions for the platform and a macro that can be used
by other developers to also change some functions optimizations
according to their needs.
e6a34c7 to
0b1ab51
Compare
This commit introduces a new target platform to Vanilla-Conquer:
The mighty Nintendo DSi.
It includes:
- A CMake toolchain file for devKitPro
- A video interface to the game graphical engine relying purely on libnds.
- A dedicated asynchronous sound engine running on the secondary ARM7.
- Fixing many unaligned accesses problems in the engine.
- Introduce ways of measuring how much RAM to allocate to BigShapeBuff.
- Optimized functions for the platform and a macro that can be used
by other developers to also change some functions optimizations
according to their needs.
DevKitARM and libnds and libfat is required to compile this port.