no message

This commit is contained in:
BADIM-PC\Vadim 2017-12-11 11:59:14 +03:00
parent 409564cdde
commit b13fc33aed
2 changed files with 27 additions and 26 deletions

View File

@ -357,7 +357,6 @@ static bool onConsoleLoadSectionCommand(Console* console, const char* param)
loadCart(console->tic, cart, data, size, true);
tic_mem* tic = console->tic;
// TODO: should load to the currena bank
switch(i)
{
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;
static const BinarySection BinarySections[] =
{
// TODO: fix banks loading here
{"PALETTE", 1, offsetof(tic_cartridge, palette.data), sizeof(tic_palette), false},
{"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},
@ -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};
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);
}
@ -1355,7 +1352,6 @@ static void injectMap(Console* console, const void* buffer, s32 size)
{
enum {Size = sizeof(tic_map)};
// TODO: should be current bank
SDL_memset(&console->tic->cart.bank.map, 0, Size);
SDL_memcpy(&console->tic->cart.bank.map, buffer, SDL_min(size, Size));
}

View File

@ -1539,17 +1539,22 @@ static double api_time(tic_mem* memory)
static void api_sync(tic_mem* tic, bool toCart)
{
// TODO: fix this
// if(toCart)
// {
// memcpy(&tic->cart.gfx, &tic->ram.gfx, sizeof tic->cart.gfx);
// memcpy(&tic->cart.sound, &tic->ram.sound, sizeof tic->cart.sound);
// }
// else
// {
// memcpy(&tic->ram.gfx, &tic->cart.gfx, sizeof tic->cart.gfx);
// memcpy(&tic->ram.sound, &tic->cart.sound, sizeof tic->cart.sound);
// }
if(toCart)
{
memcpy(&tic->cart.bank.tiles, &tic->ram.tiles, sizeof(tic_tiles));
memcpy(&tic->cart.bank.sprites, &tic->ram.sprites, sizeof(tic_tiles));
memcpy(&tic->cart.bank.map, &tic->ram.map, sizeof(tic_map));
memcpy(&tic->cart.bank.sfx, &tic->ram.sfx, sizeof(tic_sfx));
memcpy(&tic->cart.bank.music, &tic->ram.music, sizeof(tic_music));
}
else
{
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)