no message
This commit is contained in:
parent
409564cdde
commit
b13fc33aed
|
@ -357,7 +357,6 @@ static bool onConsoleLoadSectionCommand(Console* console, const char* param)
|
||||||
loadCart(console->tic, cart, data, size, true);
|
loadCart(console->tic, cart, data, size, true);
|
||||||
tic_mem* tic = console->tic;
|
tic_mem* tic = console->tic;
|
||||||
|
|
||||||
// TODO: should load to the currena bank
|
|
||||||
switch(i)
|
switch(i)
|
||||||
{
|
{
|
||||||
case 0: memcpy(&tic->cart.bank.tiles, &cart->bank.tiles, sizeof(tic_tiles)*2); break;
|
case 0: memcpy(&tic->cart.bank.tiles, &cart->bank.tiles, sizeof(tic_tiles)*2); break;
|
||||||
|
@ -603,7 +602,6 @@ static char* saveBinarySection(char* ptr, const char* comment, const char* tag,
|
||||||
typedef struct {char* tag; s32 count; s32 offset; s32 size; bool flip;} BinarySection;
|
typedef struct {char* tag; s32 count; s32 offset; s32 size; bool flip;} BinarySection;
|
||||||
static const BinarySection BinarySections[] =
|
static const BinarySection BinarySections[] =
|
||||||
{
|
{
|
||||||
// TODO: fix banks loading here
|
|
||||||
{"PALETTE", 1, offsetof(tic_cartridge, palette.data), sizeof(tic_palette), false},
|
{"PALETTE", 1, offsetof(tic_cartridge, palette.data), sizeof(tic_palette), false},
|
||||||
{"TILES", TIC_BANK_SPRITES, offsetof(tic_cartridge, bank.tiles), sizeof(tic_tile), true},
|
{"TILES", TIC_BANK_SPRITES, offsetof(tic_cartridge, bank.tiles), sizeof(tic_tile), true},
|
||||||
{"SPRITES", TIC_BANK_SPRITES, offsetof(tic_cartridge, bank.sprites), sizeof(tic_tile), true},
|
{"SPRITES", TIC_BANK_SPRITES, offsetof(tic_cartridge, bank.sprites), sizeof(tic_tile), true},
|
||||||
|
@ -1332,7 +1330,6 @@ static void onImportSprites(const char* name, const void* buffer, size_t size, v
|
||||||
tic_rgb rgb = {c->r, c->g, c->b};
|
tic_rgb rgb = {c->r, c->g, c->b};
|
||||||
u8 color = tic_tool_find_closest_color(console->tic->cart.palette.colors, &rgb);
|
u8 color = tic_tool_find_closest_color(console->tic->cart.palette.colors, &rgb);
|
||||||
|
|
||||||
// TODO: should be current bank
|
|
||||||
setSpritePixel(console->tic->cart.bank.tiles.data, x, y, color);
|
setSpritePixel(console->tic->cart.bank.tiles.data, x, y, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1355,7 +1352,6 @@ static void injectMap(Console* console, const void* buffer, s32 size)
|
||||||
{
|
{
|
||||||
enum {Size = sizeof(tic_map)};
|
enum {Size = sizeof(tic_map)};
|
||||||
|
|
||||||
// TODO: should be current bank
|
|
||||||
SDL_memset(&console->tic->cart.bank.map, 0, Size);
|
SDL_memset(&console->tic->cart.bank.map, 0, Size);
|
||||||
SDL_memcpy(&console->tic->cart.bank.map, buffer, SDL_min(size, Size));
|
SDL_memcpy(&console->tic->cart.bank.map, buffer, SDL_min(size, Size));
|
||||||
}
|
}
|
||||||
|
|
27
src/tic.c
27
src/tic.c
|
@ -1539,17 +1539,22 @@ static double api_time(tic_mem* memory)
|
||||||
|
|
||||||
static void api_sync(tic_mem* tic, bool toCart)
|
static void api_sync(tic_mem* tic, bool toCart)
|
||||||
{
|
{
|
||||||
// TODO: fix this
|
if(toCart)
|
||||||
// if(toCart)
|
{
|
||||||
// {
|
memcpy(&tic->cart.bank.tiles, &tic->ram.tiles, sizeof(tic_tiles));
|
||||||
// memcpy(&tic->cart.gfx, &tic->ram.gfx, sizeof tic->cart.gfx);
|
memcpy(&tic->cart.bank.sprites, &tic->ram.sprites, sizeof(tic_tiles));
|
||||||
// memcpy(&tic->cart.sound, &tic->ram.sound, sizeof tic->cart.sound);
|
memcpy(&tic->cart.bank.map, &tic->ram.map, sizeof(tic_map));
|
||||||
// }
|
memcpy(&tic->cart.bank.sfx, &tic->ram.sfx, sizeof(tic_sfx));
|
||||||
// else
|
memcpy(&tic->cart.bank.music, &tic->ram.music, sizeof(tic_music));
|
||||||
// {
|
}
|
||||||
// memcpy(&tic->ram.gfx, &tic->cart.gfx, sizeof tic->cart.gfx);
|
else
|
||||||
// memcpy(&tic->ram.sound, &tic->cart.sound, sizeof tic->cart.sound);
|
{
|
||||||
// }
|
memcpy(&tic->ram.tiles, &tic->cart.bank.tiles, sizeof(tic_tiles));
|
||||||
|
memcpy(&tic->ram.sprites, &tic->cart.bank.sprites, sizeof(tic_tiles));
|
||||||
|
memcpy(&tic->ram.map, &tic->cart.bank.map, sizeof(tic_map));
|
||||||
|
memcpy(&tic->ram.sfx, &tic->cart.bank.sfx, sizeof(tic_sfx));
|
||||||
|
memcpy(&tic->ram.music, &tic->cart.bank.music, sizeof(tic_music));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32 api_btnp(tic_mem* tic, s32 index, s32 hold, s32 period)
|
static u32 api_btnp(tic_mem* tic, s32 index, s32 hold, s32 period)
|
||||||
|
|
Loading…
Reference in New Issue