-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NDSi] Port Vanilla-Conquer to the Nintendo DSi #821
base: vanilla
Are you sure you want to change the base?
[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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same goes for libraries by using target_link_libraries.
@@ -80,6 +90,10 @@ bool Find_File_Data_Posix::FindNextWithFilter() | |||
|
|||
bool Find_File_Data_Posix::FindFirst(const char* fname) | |||
{ | |||
#ifdef _NDS | |||
DS_Filesystem_Init(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be called on every attempt to find a file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -11,14 +11,14 @@ | |||
|
|||
extern WWMouseClass* WWMouse; | |||
|
|||
#ifdef SDL2_BUILD | |||
#if defined(SDL2_BUILD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the style change?
@@ -240,10 +240,11 @@ AircraftClass::AircraftClass(AircraftType classid, HousesType house) | |||
** 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.