diff options
author | FIX94 <fix94.1@gmail.com> | 2016-07-21 23:54:13 +0200 |
---|---|---|
committer | FIX94 <fix94.1@gmail.com> | 2016-07-21 23:54:13 +0200 |
commit | 004575f7cec14946c1936aceca6efee38b7f8a74 (patch) | |
tree | e9e62982feec63d93980088299498daf0d70ee40 /gba/source | |
parent | c8cb99e4acc2308afb484c8d032997271a116343 (diff) | |
download | gen3uploader-004575f7cec14946c1936aceca6efee38b7f8a74.tar.gz gen3uploader-004575f7cec14946c1936aceca6efee38b7f8a74.tar.bz2 gen3uploader-004575f7cec14946c1936aceca6efee38b7f8a74.zip |
-added the ability to clear the save on the gba cartridge directly
Diffstat (limited to 'gba/source')
-rw-r--r-- | gba/source/main.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/gba/source/main.c b/gba/source/main.c index f309db2..ee94c35 100644 --- a/gba/source/main.c +++ b/gba/source/main.c | |||
@@ -56,7 +56,7 @@ int main(void) { | |||
56 | // ansi escape sequence to set print co-ordinates | 56 | // ansi escape sequence to set print co-ordinates |
57 | // /x1b[line;columnH | 57 | // /x1b[line;columnH |
58 | u32 i; | 58 | u32 i; |
59 | iprintf("\x1b[9;2HGBA Link Cable Dumper v1.5\n"); | 59 | iprintf("\x1b[9;2HGBA Link Cable Dumper v1.6\n"); |
60 | iprintf("\x1b[10;4HPlease look at the TV\n"); | 60 | iprintf("\x1b[10;4HPlease look at the TV\n"); |
61 | // disable this, needs power | 61 | // disable this, needs power |
62 | SNDSTAT = 0; | 62 | SNDSTAT = 0; |
@@ -156,15 +156,24 @@ int main(void) { | |||
156 | REG_HS_CTRL |= JOY_RW; | 156 | REG_HS_CTRL |= JOY_RW; |
157 | } | 157 | } |
158 | } | 158 | } |
159 | else if(choseval == 3) | 159 | else if(choseval == 3 || choseval == 4) |
160 | { | 160 | { |
161 | REG_JOYTR = savesize; | 161 | REG_JOYTR = savesize; |
162 | //receive the save | 162 | if(choseval == 3) |
163 | for(i = 0; i < savesize; i+=4) | ||
164 | { | 163 | { |
165 | while((REG_HS_CTRL&JOY_WRITE) == 0) ; | 164 | //receive the save |
166 | REG_HS_CTRL |= JOY_RW; | 165 | for(i = 0; i < savesize; i+=4) |
167 | *(vu32*)(save_data+i) = REG_JOYRE; | 166 | { |
167 | while((REG_HS_CTRL&JOY_WRITE) == 0) ; | ||
168 | REG_HS_CTRL |= JOY_RW; | ||
169 | *(vu32*)(save_data+i) = REG_JOYRE; | ||
170 | } | ||
171 | } | ||
172 | else | ||
173 | { | ||
174 | //clear the save | ||
175 | for(i = 0; i < savesize; i+=4) | ||
176 | *(vu32*)(save_data+i) = 0; | ||
168 | } | 177 | } |
169 | //disable interrupts | 178 | //disable interrupts |
170 | u32 prevIrqMask = REG_IME; | 179 | u32 prevIrqMask = REG_IME; |
@@ -203,7 +212,7 @@ int main(void) { | |||
203 | { | 212 | { |
204 | REG_HS_CTRL |= JOY_RW; | 213 | REG_HS_CTRL |= JOY_RW; |
205 | u32 choseval = REG_JOYRE; | 214 | u32 choseval = REG_JOYRE; |
206 | if(choseval == 4) | 215 | if(choseval == 5) |
207 | { | 216 | { |
208 | //disable interrupts | 217 | //disable interrupts |
209 | u32 prevIrqMask = REG_IME; | 218 | u32 prevIrqMask = REG_IME; |