mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-01-13 12:31:25 +00:00
Don't actually draw unless byte written to active page or page was swapped
- Avoids "flicker" in 80's apps that use double buffering - Possibly improves performance since we only take the render hit in page swap (or direct render to visible page)
This commit is contained in:
parent
37e5143d73
commit
090f5f4db4
@ -703,25 +703,33 @@ static inline void _draw_text(uint16_t ea, uint8_t b, int page, uint32_t sw, uin
|
|||||||
GLUE_C_WRITE(video__write_2e_text0)
|
GLUE_C_WRITE(video__write_2e_text0)
|
||||||
{
|
{
|
||||||
base_textwrt[ea] = b;
|
base_textwrt[ea] = b;
|
||||||
_draw_text(ea, b, 0, SS_TEXTWRT, SS_TEXT);
|
if (!(softswitches & SS_PAGE2)) {
|
||||||
|
_draw_text(ea, b, 0, SS_TEXTWRT, SS_TEXT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GLUE_C_WRITE(video__write_2e_text0_mixed)
|
GLUE_C_WRITE(video__write_2e_text0_mixed)
|
||||||
{
|
{
|
||||||
base_textwrt[ea] = b;
|
base_textwrt[ea] = b;
|
||||||
_draw_text(ea, b, 0, SS_TEXTWRT, (SS_TEXT|SS_MIXED));
|
if (!(softswitches & SS_PAGE2)) {
|
||||||
|
_draw_text(ea, b, 0, SS_TEXTWRT, (SS_TEXT|SS_MIXED));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GLUE_C_WRITE(video__write_2e_text1)
|
GLUE_C_WRITE(video__write_2e_text1)
|
||||||
{
|
{
|
||||||
base_ramwrt[ea] = b;
|
base_ramwrt[ea] = b;
|
||||||
_draw_text(ea, b, 1, SS_RAMWRT, SS_TEXT);
|
if (softswitches & SS_PAGE2) {
|
||||||
|
_draw_text(ea, b, 1, SS_RAMWRT, SS_TEXT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GLUE_C_WRITE(video__write_2e_text1_mixed)
|
GLUE_C_WRITE(video__write_2e_text1_mixed)
|
||||||
{
|
{
|
||||||
base_ramwrt[ea] = b;
|
base_ramwrt[ea] = b;
|
||||||
_draw_text(ea, b, 1, SS_RAMWRT, (SS_TEXT|SS_MIXED));
|
if (softswitches & SS_PAGE2) {
|
||||||
|
_draw_text(ea, b, 1, SS_RAMWRT, (SS_TEXT|SS_MIXED));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@ -991,49 +999,65 @@ static inline void _draw_hires_graphics(uint16_t ea, uint8_t b, bool is_even, ui
|
|||||||
GLUE_C_WRITE(video__write_2e_even0)
|
GLUE_C_WRITE(video__write_2e_even0)
|
||||||
{
|
{
|
||||||
base_hgrwrt[ea] = b;
|
base_hgrwrt[ea] = b;
|
||||||
_draw_hires_graphics(ea, b, /*even*/true, 0, SS_TEXT);
|
if (!(softswitches & SS_PAGE2)) {
|
||||||
|
_draw_hires_graphics(ea, b, /*even*/true, 0, SS_TEXT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GLUE_C_WRITE(video__write_2e_even0_mixed)
|
GLUE_C_WRITE(video__write_2e_even0_mixed)
|
||||||
{
|
{
|
||||||
base_hgrwrt[ea] = b;
|
base_hgrwrt[ea] = b;
|
||||||
_draw_hires_graphics(ea, b, /*even*/true, 0, (SS_TEXT|SS_MIXED));
|
if (!(softswitches & SS_PAGE2)) {
|
||||||
|
_draw_hires_graphics(ea, b, /*even*/true, 0, (SS_TEXT|SS_MIXED));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GLUE_C_WRITE(video__write_2e_odd0)
|
GLUE_C_WRITE(video__write_2e_odd0)
|
||||||
{
|
{
|
||||||
base_hgrwrt[ea] = b;
|
base_hgrwrt[ea] = b;
|
||||||
_draw_hires_graphics(ea, b, /*even*/false, 0, SS_TEXT);
|
if (!(softswitches & SS_PAGE2)) {
|
||||||
|
_draw_hires_graphics(ea, b, /*even*/false, 0, SS_TEXT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GLUE_C_WRITE(video__write_2e_odd0_mixed)
|
GLUE_C_WRITE(video__write_2e_odd0_mixed)
|
||||||
{
|
{
|
||||||
base_hgrwrt[ea] = b;
|
base_hgrwrt[ea] = b;
|
||||||
_draw_hires_graphics(ea, b, /*even*/false, 0, (SS_TEXT|SS_MIXED));
|
if (!(softswitches & SS_PAGE2)) {
|
||||||
|
_draw_hires_graphics(ea, b, /*even*/false, 0, (SS_TEXT|SS_MIXED));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GLUE_C_WRITE(video__write_2e_even1)
|
GLUE_C_WRITE(video__write_2e_even1)
|
||||||
{
|
{
|
||||||
base_ramwrt[ea] = b;
|
base_ramwrt[ea] = b;
|
||||||
_draw_hires_graphics(ea, b, /*even*/true, 1, SS_TEXT);
|
if (softswitches & SS_PAGE2) {
|
||||||
|
_draw_hires_graphics(ea, b, /*even*/true, 1, SS_TEXT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GLUE_C_WRITE(video__write_2e_even1_mixed)
|
GLUE_C_WRITE(video__write_2e_even1_mixed)
|
||||||
{
|
{
|
||||||
base_ramwrt[ea] = b;
|
base_ramwrt[ea] = b;
|
||||||
_draw_hires_graphics(ea, b, /*even*/true, 1, (SS_TEXT|SS_MIXED));
|
if (softswitches & SS_PAGE2) {
|
||||||
|
_draw_hires_graphics(ea, b, /*even*/true, 1, (SS_TEXT|SS_MIXED));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GLUE_C_WRITE(video__write_2e_odd1)
|
GLUE_C_WRITE(video__write_2e_odd1)
|
||||||
{
|
{
|
||||||
base_ramwrt[ea] = b;
|
base_ramwrt[ea] = b;
|
||||||
_draw_hires_graphics(ea, b, /*even*/false, 1, SS_TEXT);
|
if (softswitches & SS_PAGE2) {
|
||||||
|
_draw_hires_graphics(ea, b, /*even*/false, 1, SS_TEXT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GLUE_C_WRITE(video__write_2e_odd1_mixed)
|
GLUE_C_WRITE(video__write_2e_odd1_mixed)
|
||||||
{
|
{
|
||||||
base_ramwrt[ea] = b;
|
base_ramwrt[ea] = b;
|
||||||
_draw_hires_graphics(ea, b, /*even*/false, 1, (SS_TEXT|SS_MIXED));
|
if (softswitches & SS_PAGE2) {
|
||||||
|
_draw_hires_graphics(ea, b, /*even*/false, 1, (SS_TEXT|SS_MIXED));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
2
src/vm.c
2
src/vm.c
@ -136,6 +136,7 @@ GLUE_C_READ(iie_page2_off)
|
|||||||
}
|
}
|
||||||
|
|
||||||
video_setpage(0);
|
video_setpage(0);
|
||||||
|
video_redraw();
|
||||||
|
|
||||||
return floating_bus();
|
return floating_bus();
|
||||||
}
|
}
|
||||||
@ -160,6 +161,7 @@ GLUE_C_READ(iie_page2_on)
|
|||||||
} else {
|
} else {
|
||||||
softswitches |= SS_SCREEN;
|
softswitches |= SS_SCREEN;
|
||||||
video_setpage(1);
|
video_setpage(1);
|
||||||
|
video_redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
return floating_bus();
|
return floating_bus();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user