Skip to content

Commit

Permalink
Merge branch 'ntrboothax'
Browse files Browse the repository at this point in the history
  • Loading branch information
d3m3vilurr committed Aug 13, 2017
2 parents 638fecf + 9e422cd commit 821e395
Show file tree
Hide file tree
Showing 16 changed files with 272 additions and 854 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.elf
*.nds
build/
binaries/
include/binaries.h
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "external/flashcart_core"]
path = external/flashcart_core
url = https://github.com/kitling/flashcart_core
5 changes: 5 additions & 0 deletions .vimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
let g:syntastic_cpp_compiler = $DEVKITARM.'/bin/arm-none-eabi-g++'
let g:syntastic_cpp_compiler_options = "-DARM9"
let g:syntastic_cpp_include_dirs = [".", "include", "external", $DEVKITPRO."/libnds/include"]
set colorcolumn=80

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ include $(DEVKITARM)/ds_rules
#---------------------------------------------------------------------------------
TARGET := $(shell basename $(CURDIR))
BUILD := build
SOURCES := source
SOURCES := source external/flashcart_core external/flashcart_core/devices
DATA := data
INCLUDES := include
INCLUDES := include external

#---------------------------------------------------------------------------------
# options for code generation
Expand Down
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## NDS version NTRBOOTHAX flasher
Only tested NDSL + AK2I

DO NOT USE THIS ON NDSI

### Known issues
* Probably cannot use with non AK2I cart.

We should make NDSI mode instead NDS. But that mode cannot use cartridge
swap, and probably lost flashcart feature until someone provide restore
image.

* Removed restore feature, I don't know reason, flasher occur cartridge brick.

But, AK2I will work as flashcart whenever flashed or not.
So, just feature blocked.

### Build
1. copy these 4 binaries to `binaries` directory.
- `blowfish_dev.bin`
- `blowfish_retail.bin`
- `boot9strap_ntr_dev.firm`
- `boot9strap_ntr.firm`
2. `python extract_binaries.py`
3. then `make`

### Credits
* [Normmatt][normmatt] - Original implement 3DS version ntrcardhax flasher
* [SciresM][sciresm] - Parent of `boot9strap`
* [kitling][kitling] - Made `flashcart_core`
* [hedgeberg][hedgeberg] - RE Cartridge
Empty file added binaries/EMPTY
Empty file.
1 change: 1 addition & 0 deletions external/flashcart_core
Submodule flashcart_core added at ad5d12
35 changes: 35 additions & 0 deletions extract_binaries.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import os.path
import glob

strings = [
'#ifndef BINARIES_H\n',
'#define BINARIES_H\n',
'#ifdef __cplusplus\n',
'extern "C" {\n',
'#endif\n',
]

for fn in glob.glob('binaries/*'):
basename = os.path.basename(fn)
var_name = basename.replace('.', '_')
with open(fn, 'rb') as r:
strings.append('uint8_t %s[] = {\n' % var_name);
buf = r.read()

for idx, x in enumerate(buf):
strings.append('0x%02X, ' % ord(x))
if (idx and ((idx + 1) % 16) == 0):
strings.append('\n')
strings.append('};\n');
strings.append('uint32_t %s_size = 0x%X;\n' % (var_name, len(buf)))

strings += [
'#ifdef __cplusplus\n',
'}\n',
'#endif\n',
'#endif\n',
]

with open('include/binaries.h', 'wb') as w:
w.write(''.join(strings))

12 changes: 0 additions & 12 deletions extract_orig_header.py

This file was deleted.

7 changes: 7 additions & 0 deletions include/DrawCharacter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef DISPLAY_H
#define DISPLAY_H
#define TOP_SCREEN 0

void ShowProgress(char screen, uint32_t curr, uint32_t total);

#endif
6 changes: 6 additions & 0 deletions include/delay.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef DELAY_H
#define DELAY_H

#define ioDelay(...) while(0)

#endif
Empty file added include/gamecart/protocol.h
Empty file.
5 changes: 5 additions & 0 deletions include/gamecart/protocol_ntr.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#ifndef PROTOCOL_NTR_H
#define PROTOCOL_NTR_H
void Cart_NTRInit();
void NTR_SendCommand(const uint8_t *command, uint32_t length, uint32_t flags, uint8_t *destination);
#endif
Loading

0 comments on commit 821e395

Please sign in to comment.