-
-
Notifications
You must be signed in to change notification settings - Fork 300
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
UI: XMU Settings #1315
Merged
Merged
UI: XMU Settings #1315
Changes from 25 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
96157f6
Added XMU Settings to the Input Screen
faha223 766409f
Added Peripherals to config
faha223 3f9b265
Prevent overwriting existing XMUs
faha223 8e3296b
Added blockdev.h to try to fix the MacOS build
faha223 51fe070
Merge pull request #12 from xemu-project/master
faha223 21d467a
Merge pull request #15 from xemu-project/master
faha223 b1f9085
Fixed some issues that antangelo pointed out
faha223 a9747a0
Moved the peripheralType and param vars into the loop
faha223 ac3b36d
Merge branch 'master' into xmu-settings2
faha223 485cb9c
Moved fatx.h and fatx.c to ui\thirdparty\fatx
faha223 bd1e773
Merge branch 'xmu-settings2' of https://github.com/faha223/xemu into …
faha223 bc80676
Added Validation for Peripheral Settings
faha223 1e0595e
Fixed some nits that were pointed out
faha223 f397226
Merge pull request #18 from xemu-project/master
faha223 8423130
Merge branch 'xmu-settings2' into master
faha223 70881db
Merge pull request #19 from faha223/master
faha223 afe5146
don't pass NULL into xemu_settings_set_string
faha223 5def7ad
Changes following Matt's recommendations
faha223 f966217
Changes to XMU FilePicker
faha223 3167c43
XMU image auto-bind logic refactor
faha223 8889047
renamed peripheralType to peripheral_type
faha223 85b7071
removed unnecessary calls to g_strdup_printf and g_free
faha223 32fe45a
Cleaned up some comments, removed an unnecessary variable
faha223 a7f9905
handle overwrite prompt in Windows
faha223 e372b5a
Merge branch 'master' into xmu-settings2
faha223 498a44a
Fixed some code format and style inconsistencies
faha223 e74066e
More formatting fixes
faha223 97d37c0
Fixed a few memory leaks
faha223 93fc4a0
qemu_access: check for Read and Write access
faha223 a8a9678
Merge branch 'master' of https://github.com/xemu-project/xemu into xm…
faha223 9d43196
Run clang-format
antangelo 51422f0
Remove unused xemu_new_xmu declaration
antangelo 60c2362
Merge remote-tracking branch 'upstream/master' into xmu-settings2
antangelo 4677199
Fix use after free in rebind code
antangelo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
pfiles = [ | ||
'controller_mask.png', | ||
'xmu_mask.png', | ||
'logo_sdf.png', | ||
'xemu_64x64.png', | ||
'abxy.ttf', | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#include "fatx.h" | ||
#include "qemu/bswap.h" | ||
|
||
#define FATX_SIGNATURE 0x58544146 | ||
|
||
// This is from libfatx | ||
#pragma pack(1) | ||
struct fatx_superblock { | ||
uint32_t signature; | ||
uint32_t volume_id; | ||
uint32_t sectors_per_cluster; | ||
uint32_t root_cluster; | ||
uint16_t unknown1; | ||
uint8_t padding[4078]; | ||
}; | ||
#pragma pack() | ||
|
||
bool create_fatx_image(const char* filename, unsigned int size) | ||
{ | ||
unsigned int empty_fat = cpu_to_le32(0xfffffff8); | ||
unsigned char zero = 0; | ||
|
||
FILE *fp = qemu_fopen(filename, "wb"); | ||
if (fp != NULL) | ||
{ | ||
struct fatx_superblock superblock; | ||
memset(&superblock, 0xff, sizeof(struct fatx_superblock)); | ||
|
||
superblock.signature = cpu_to_le32(FATX_SIGNATURE); | ||
superblock.sectors_per_cluster = cpu_to_le32(4); | ||
superblock.volume_id = (uint32_t)rand(); | ||
superblock.root_cluster = cpu_to_le32(1); | ||
superblock.unknown1 = 0; | ||
|
||
// Write the fatx superblock. | ||
fwrite(&superblock, sizeof(superblock), 1, fp); | ||
|
||
// Write the FAT | ||
fwrite(&empty_fat, sizeof(empty_fat), 1, fp); | ||
|
||
fseek(fp, size-sizeof(unsigned char), SEEK_SET); | ||
fwrite(&zero, sizeof(unsigned char), 1, fp); | ||
|
||
fflush(fp); | ||
fclose(fp); | ||
|
||
return true; | ||
} | ||
|
||
return false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef FATX_H | ||
#define FATX_H | ||
|
||
#include "qemu/osdep.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
bool create_fatx_image(const char* filename, unsigned int size); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 implementation depends on host byte order being little endian. Can you rework it so it will also work on BE hosts?
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.
I have changed the code to use cpu_to_le32(u32) on the unsigned integers that were being written to the superblock. I think that will work but I don't have a BE machine to test on. It doesn't break this functionality on my machine.