Cxbx-reloaded: Move non-kernel code outside CxbxKrnl folder

Created on 20 Jan 2018  路  6Comments  路  Source: Cxbx-Reloaded/Cxbx-Reloaded

Currently, things like hardware emulation and other non-kernel code, resides in the CxbxKrnl folder. Partly, this is due to the fact some functions reside in kernel-implementation files (EmuKrnl*.c). Partly, it's because files were already there historically, or placed there to keep everything emulation-related together.

Let's improve that, by moving functions and entire files to a sane file and folder.
One good example is how MAME organizes it's files.

For this issue, seek code that isn't in a logical location, decide where it should reside, move it, make sure everything keeps compiling (release AND debug builds), and submit it in small increments.

NOTE: Do NOT change functionallity! The only changes allowed are those required to move code!

enhancement good-for-beginners help wanted request

Most helpful comment

https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/pull/884 moved hardware devices to src\devices and all video-related hardware files to src\devices\video.

All 6 comments

The CxbxKrnl folder is purely a remnant when Cxbx contained only the GUI and all emulator code was contained in an external DLL, back when Cxbx used to generate EXE files rather than launch Xbe files directly.

Nowadays the whole project structure could be much better.

We no longer need a Cxbx and CxbxKrnl folder, instead we should structure it based on usage.

I propose having a folder for GUI, a folder for Hardware, a folder for HLE (containing the HLE implementations for XDK libraries such as D3D, DSOUND and XAPI) and also a HLEKernel folder, containing the HLE Xboxkrnl implementation.

The above structure mostly exists already in the MSVC solution, but the physical location of the files don't follow the same structure.

A first step could be to rename CxbxKrnl into HLE/kernel
Then, move any file not belonging there to is righteous location

For historical reasons the files should be moved correctly under git, not just copy-pasted into a new folder!

@x1nixmzeng from http://www.syntevo.com/doc/plugins/servlet/mobile?contentId=3113202#content/view/3113079 :

Moving/Renaming Files

In general, Git's move/rename tracking happens always on-the-fly, e.g. when logging or blaming a file. Hence, there is no need for an explicit聽move聽operation: just move your files with your favorite tools (IDE, file explorer, from command line).

Still, Git offers a聽git move聽command for convenience which performs a normal file system move and then stages the removed and the newly added file to the聽Index. For a GUI client like SmartGit, providing such an operation is not necessary. Still, because users are frequently confused about the missing move operation, SmartGit provides聽Local|Rename.

Contrary to聽git status聽SmartGit's status display does not denote聽moved聽files; on-the-fly moves will only be calculated for history-related functions like聽Log聽or聽Blame.

https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/pull/884 moved hardware devices to src\devices and all video-related hardware files to src\devices\video.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Margen67 picture Margen67  路  3Comments

PatrickvL picture PatrickvL  路  3Comments

gandalfthewhite19890404 picture gandalfthewhite19890404  路  4Comments

LukeUsher picture LukeUsher  路  3Comments

PatrickvL picture PatrickvL  路  3Comments