Skip to content

Commit

Permalink
3ds build test
Browse files Browse the repository at this point in the history
  • Loading branch information
nesbox committed Jul 15, 2023
1 parent 68b94ee commit e12b032
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions build/n3ds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Requirements

* devkitARM (tested on release 54, please use latest) + the 3ds-dev meta package
* devkitARM (tested on release 60, please use latest) + the 3ds-dev meta package
* the following additional packages:
* devkitpro-pkgbuild-helpers
* 3ds-libpng
Expand All @@ -13,7 +13,7 @@

```
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=$DEVKITPRO/3ds.cmake -DN3DS=TRUE
cmake .. -DCMAKE_TOOLCHAIN_FILE=$DEVKITPRO/cmake/3DS.cmake -DN3DS=TRUE
make
```

Expand Down
2 changes: 1 addition & 1 deletion build/n3ds/elf_to_3dsx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
echo "[3DSX] Building metadata"
${DEVKITPRO}/tools/bin/smdhtool --create "TIC-80 tiny computer" "Fantasy computer for making, playing and sharing tiny games" "Nesbox" "n3ds/icon.png" tic80.smdh
echo "[3DSX] Building binary"
${DEVKITPRO}/tools/bin/3dsxtool bin/tic80_n3ds bin/tic80.3dsx --smdh=tic80.smdh --romfs=n3ds/romfs/
${DEVKITPRO}/tools/bin/3dsxtool bin/tic80_n3ds.elf bin/tic80.3dsx --smdh=tic80.smdh --romfs=n3ds/romfs/
6 changes: 3 additions & 3 deletions src/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#include "tic_assert.h"

#ifdef _3DS
#ifdef __3DS__
#include <3ds.h>
#endif

Expand Down Expand Up @@ -551,7 +551,7 @@ void tic_core_close(tic_mem* memory)
blip_delete(core->blip.left);
blip_delete(core->blip.right);

#ifdef _3DS
#ifdef __3DS__
linearFree(memory->product.screen);
#else
free(memory->product.screen);
Expand Down Expand Up @@ -742,7 +742,7 @@ tic_mem* tic_core_create(s32 samplerate, tic80_pixel_color_format format)
core->samplerate = samplerate;

memset(core->memory.ram, 0, sizeof(tic_ram));
#ifdef _3DS
#ifdef __3DS__
// To feed texture data directly to the 3DS GPU, linearly allocated memory is required, which is
// not guaranteed by malloc.
// Additionally, allocate TIC80_FULLHEIGHT + 1 lines to minimize glitches in linear scaling mode.
Expand Down
2 changes: 1 addition & 1 deletion src/studio/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "fs.h"
#include "net.h"

#if defined(BAREMETALPI) || defined(_3DS)
#if defined(BAREMETALPI) || defined(__3DS__)
#ifdef EN_DEBUG
#define dbg(...) printf(__VA_ARGS__)
#else
Expand Down
2 changes: 1 addition & 1 deletion src/studio/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void tic_net_close(tic_net* net)
free(net);
}

#elif defined(_3DS)
#elif defined(__3DS__)

#include <3ds.h>

Expand Down
7 changes: 5 additions & 2 deletions src/system/n3ds/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ void tic_sys_clipboard_set(const char* text)
platform.clipboard = NULL;
}

platform.clipboard = strdup(text);
if(text)
{
platform.clipboard = strdup(text);
}
}

bool tic_sys_clipboard_has()
Expand Down Expand Up @@ -576,7 +579,7 @@ int main(int argc, char **argv) {
romfsInit();

memset(&platform, 0, sizeof(platform));

n3ds_draw_init();
n3ds_keyboard_init(&platform.keyboard);

Expand Down

0 comments on commit e12b032

Please sign in to comment.