diff options
Diffstat (limited to 'gba/source')
-rw-r--r-- | gba/source/main.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/gba/source/main.c b/gba/source/main.c index 49cf2a1..d3782a6 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.3\n"); | 59 | iprintf("\x1b[9;2HGBA Link Cable Dumper v1.4\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; |
@@ -66,7 +66,7 @@ int main(void) { | |||
66 | //clear out previous messages | 66 | //clear out previous messages |
67 | REG_HS_CTRL |= JOY_RW; | 67 | REG_HS_CTRL |= JOY_RW; |
68 | while (1) { | 68 | while (1) { |
69 | if((REG_HS_CTRL&JOY_READ)) | 69 | if(REG_HS_CTRL&JOY_READ) |
70 | { | 70 | { |
71 | REG_HS_CTRL |= JOY_RW; | 71 | REG_HS_CTRL |= JOY_RW; |
72 | s32 gamesize = getGameSize(); | 72 | s32 gamesize = getGameSize(); |
@@ -199,6 +199,32 @@ int main(void) { | |||
199 | } | 199 | } |
200 | REG_JOYTR = 0; | 200 | REG_JOYTR = 0; |
201 | } | 201 | } |
202 | else if(REG_HS_CTRL&JOY_WRITE) | ||
203 | { | ||
204 | REG_HS_CTRL |= JOY_RW; | ||
205 | u32 choseval = REG_JOYRE; | ||
206 | if(choseval == 4) | ||
207 | { | ||
208 | //disable interrupts | ||
209 | u32 prevIrqMask = REG_IME; | ||
210 | REG_IME = 0; | ||
211 | //dump BIOS | ||
212 | for (i = 0; i < 0x4000; i+=4) | ||
213 | { | ||
214 | // the lower bits are inaccurate, so just get it four times :) | ||
215 | u32 a = MidiKey2Freq((WaveData *)(i-4), 180-12, 0) * 2; | ||
216 | u32 b = MidiKey2Freq((WaveData *)(i-3), 180-12, 0) * 2; | ||
217 | u32 c = MidiKey2Freq((WaveData *)(i-2), 180-12, 0) * 2; | ||
218 | u32 d = MidiKey2Freq((WaveData *)(i-1), 180-12, 0) * 2; | ||
219 | REG_JOYTR = ((a>>24<<24) | (d>>24<<16) | (c>>24<<8) | (b>>24)); | ||
220 | while((REG_HS_CTRL&JOY_READ) == 0) ; | ||
221 | REG_HS_CTRL |= JOY_RW; | ||
222 | } | ||
223 | //restore interrupts | ||
224 | REG_IME = prevIrqMask; | ||
225 | } | ||
226 | REG_JOYTR = 0; | ||
227 | } | ||
202 | Halt(); | 228 | Halt(); |
203 | } | 229 | } |
204 | } | 230 | } |