-
Notifications
You must be signed in to change notification settings - Fork 60
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
IPad Version #233
base: master
Are you sure you want to change the base?
IPad Version #233
Changes from all commits
60d961b
959572f
d747371
4121758
a5096a9
3849468
63652d9
7a3d955
ecc4f3e
9aeaca5
1b15411
db61af8
0fc098f
576bb6e
041239f
ae4c52c
4b3f531
025238b
f00391e
8fb50d3
6d8f9ca
d4ee804
3b5322c
9a592d8
e017546
084588e
c87e7f1
ceb1bb8
f9e4ec2
e593549
18c9bf1
04fc141
815ff05
aab246a
b65c0dd
6918058
e814d94
53bf65e
9ba3b23
7e7376a
eed3b69
6e29c55
fa36e1e
061f343
54587ac
3f5a64e
b828b1c
a1b8f68
cd4cec2
2c33f6a
d03b928
3a3b73b
c02231d
b38b33b
8d11a35
5e45a08
fe1063f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
#include <stdint.h> | ||
#include <stdio.h> | ||
#include <SDL.h> | ||
|
||
#include "glue.h" | ||
#include "via.h" | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
#if __APPLE__ | ||
#include <TargetConditionals.h> | ||
#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE | ||
#include "ios_functions.h" | ||
#endif | ||
#endif | ||
|
||
#include <SDL.h> | ||
|
||
void handle_keyboard(bool down, SDL_Keycode sym, SDL_Scancode scancode); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,16 @@ | |
#include <dirent.h> | ||
#include <unistd.h> | ||
#include "glue.h" | ||
|
||
#include "memory.h" | ||
|
||
#include "video.h" | ||
#include "rom_symbols.h" | ||
|
||
#if __APPLE__ | ||
#include <TargetConditionals.h> | ||
#endif | ||
|
||
#define MIN(a,b) (((a)<(b))?(a):(b)) | ||
#define MAX(a,b) (((a)>(b))?(a):(b)) | ||
|
||
|
@@ -51,7 +57,17 @@ create_directory_listing(uint8_t *data) | |
*data++ = 'C'; | ||
*data++ = 0; | ||
|
||
if (!(dirp = opendir("."))) { | ||
#if __APPLE__ && (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You do this concatening a few times in this file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 thanks I'll take a look. |
||
char filename[255]; | ||
//use correct file location for ios | ||
strcpy(filename,getenv("HOME")); | ||
//concatenating the path string returned from HOME | ||
strcat(filename,"/Documents/."); | ||
#else | ||
const char *filename = "."; | ||
#endif | ||
|
||
if (!(dirp = opendir(filename))) { | ||
return 0; | ||
} | ||
while ((dp = readdir(dirp))) { | ||
|
@@ -132,7 +148,19 @@ LOAD() | |
RAM[STATUS] = 0; | ||
a = 0; | ||
} else { | ||
FILE *f = fopen(filename, "rb"); | ||
#if __APPLE__ && (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) | ||
//use correct file location for ios | ||
char full_filename[255]; | ||
//concatenating the path string returned from HOME | ||
strcpy(full_filename, getenv("HOME")); | ||
strcat(full_filename, "/Documents/"); | ||
strcat(full_filename, filename); | ||
#else | ||
char *full_filename = filename; | ||
#endif | ||
|
||
FILE *f = fopen(full_filename, "rb"); | ||
|
||
if (!f) { | ||
a = 4; // FNF | ||
RAM[STATUS] = a; | ||
|
@@ -209,8 +237,20 @@ SAVE() | |
a = 0; | ||
return; | ||
} | ||
//use correct file location for ios | ||
#if __APPLE__ && (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) | ||
//use correct file location for ios | ||
char full_filename[255]; | ||
//concatenating the path string returned from HOME | ||
strcpy(full_filename, getenv("HOME")); | ||
strcat(full_filename, "/Documents/"); | ||
strcat(full_filename, filename); | ||
#else | ||
char *full_filename = filename; | ||
#endif | ||
|
||
FILE *f = fopen(full_filename, "wb"); | ||
|
||
FILE *f = fopen(filename, "wb"); | ||
if (!f) { | ||
a = 4; // FNF | ||
RAM[STATUS] = a; | ||
|
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.
Indenting is incorrect.