Changeset 8c8a883 in buchla-emu


Ignore:
Timestamp:
09/02/2017 02:04:45 PM (7 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
b6f5f64
Parents:
c1c1ca5
Message:

Don't keep NUL bytes in display memory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • emu/ser.c

    rc1c1ca5 r8c8a883  
    6060};
    6161
    62 static uint8_t mem[CON_H][CON_W + 1];
     62static uint8_t mem[CON_H][CON_W];
    6363
    6464static SDL_Window *win;
     
    8181static void scroll(void)
    8282{
    83         memmove(mem, mem + 1, (CON_H - 1) * (CON_W + 1));
     83        memmove(mem, mem + 1, (CON_H - 1) * CON_W);
    8484        memset(mem + (CON_H - 1), ' ', CON_W);
    8585}
     
    256256        for (int32_t y = 0; y < CON_H; ++y) {
    257257                char line[CON_W + 1];
     258                line[CON_W] = 0;
    258259
    259260                if (SDL_LockMutex(cpu_mutex) < 0) {
     
    261262                }
    262263
    263                 memcpy(line, mem[y], CON_W + 1);
     264                memcpy(line, mem[y], CON_W);
    264265
    265266                if (SDL_UnlockMutex(cpu_mutex) < 0) {
     
    515516                        mem[y][x] = ' ';
    516517                }
    517 
    518                 mem[y][CON_W] = 0;
    519518        }
    520519}
Note: See TracChangeset for help on using the changeset viewer.