no message

This commit is contained in:
BADIM-PC\Vadim 2017-10-20 10:16:38 +03:00
parent bf93beb4c4
commit 280828548e
3 changed files with 14 additions and 8 deletions

View File

@ -1131,6 +1131,11 @@ static void onStudioEvent(Map* map, StudioEvent event)
} }
} }
static void scanline(tic_mem* tic, s32 row)
{
memcpy(tic->ram.vram.palette.data, row < (TOOLBAR_SIZE-1) ? tic->config.palette.data : tic->cart.palette.data, sizeof(tic_palette));
}
void initMap(Map* map, tic_mem* tic) void initMap(Map* map, tic_mem* tic)
{ {
if(map->history) history_delete(map->history); if(map->history) history_delete(map->history);
@ -1171,6 +1176,7 @@ void initMap(Map* map, tic_mem* tic)
}, },
.history = history_create(&tic->cart.gfx.map, sizeof tic->cart.gfx.map), .history = history_create(&tic->cart.gfx.map, sizeof tic->cart.gfx.map),
.event = onStudioEvent, .event = onStudioEvent,
.scanline = scanline,
}; };
normalizeMap(&map->scroll.x, &map->scroll.y); normalizeMap(&map->scroll.x, &map->scroll.y);

View File

@ -80,6 +80,7 @@ struct Map
void(*tick)(Map*); void(*tick)(Map*);
void(*event)(Map*, StudioEvent); void(*event)(Map*, StudioEvent);
void(*scanline)(tic_mem* tic, s32 row);
}; };
void initMap(Map*, tic_mem*); void initMap(Map*, tic_mem*);

View File

@ -1411,7 +1411,7 @@ static void blit(u32* out, u32* bgOut, s32 pitch, s32 bgPitch)
const s32 pitchWidth = pitch/sizeof *out; const s32 pitchWidth = pitch/sizeof *out;
const s32 bgPitchWidth = bgPitch/sizeof *bgOut; const s32 bgPitchWidth = bgPitch/sizeof *bgOut;
u32* row = out; u32* row = out;
const u32* pal = srcPaletteBlit(studio.tic->cart.palette.data); const u32* pal = paletteBlit();
void(*scanline)(tic_mem* memory, s32 row) = NULL; void(*scanline)(tic_mem* memory, s32 row) = NULL;
@ -1423,6 +1423,9 @@ static void blit(u32* out, u32* bgOut, s32 pitch, s32 bgPitch)
case TIC_SPRITE_MODE: case TIC_SPRITE_MODE:
scanline = studio.sprite.scanline; scanline = studio.sprite.scanline;
break; break;
case TIC_MAP_MODE:
scanline = studio.map.scanline;
break;
default: default:
break; break;
} }
@ -2040,14 +2043,10 @@ static void renderStudio()
} }
studio.tic->api.tick_start(studio.tic, src); studio.tic->api.tick_start(studio.tic, src);
}
switch(studio.mode) if(studio.mode != TIC_RUN_MODE)
{
case TIC_RUN_MODE: break;
default:
useSystemPalette(); useSystemPalette();
}
}
switch(studio.mode) switch(studio.mode)
{ {