- Timestamp:
- 08/20/2017 08:09:56 PM (7 years ago)
- Branches:
- master
- Children:
- 657abdf
- Parents:
- b48c8a5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
emu/vid.c
rb48c8a5 ra9861f3 250 250 int32_t odtba = mem[REG_ODTBA] & 0xffc0; 251 251 252 if (SDL_LockMutex(cpu_mutex) < 0) {253 fail("SDL_LockMutex() failed: %s", SDL_GetError());254 }255 256 252 n_bm_objs = 0; 257 253 … … 320 316 } 321 317 322 if (SDL_UnlockMutex(cpu_mutex) < 0) {323 fail("SDL_UnlockMutex() failed: %s", SDL_GetError());324 }325 326 318 SDL_AtomicAdd(&frame, 1); 327 319 return false; … … 338 330 } 339 331 340 uint32_t res;341 342 if (SDL_LockMutex(cpu_mutex) < 0) {343 fail("SDL_LockMutex() failed: %s", SDL_GetError());344 }345 346 332 if (off16 >= reg_off && off16 < reg_off + 16) { 347 res = mem[off16 - reg_off]; 348 } 349 else { 350 res = mem[bank * WIN_SZ_W + off16]; 351 } 352 353 if (SDL_UnlockMutex(cpu_mutex) < 0) { 354 fail("SDL_UnlockMutex() failed: %s", SDL_GetError()); 355 } 356 357 return res; 333 return mem[off16 - reg_off]; 334 } 335 336 return mem[bank * WIN_SZ_W + off16]; 358 337 } 359 338 … … 366 345 if (sz != 2 || bank >= N_BANKS || off % 2 != 0 || (off16 >= WIN_SZ_W && off16 != PAL_OFF)) { 367 346 fail("invalid vid wr %d %u:%d", bank, off, sz * 8); 368 }369 370 if (SDL_LockMutex(cpu_mutex) < 0) {371 fail("SDL_LockMutex() failed: %s", SDL_GetError());372 347 } 373 348 … … 384 359 385 360 pal[i_pal] = (r << 24) | (g << 16) | (b << 8) | 0xff; 386 } 387 else if (off16 >= reg_off && off16 < reg_off + 16) { 361 return; 362 } 363 364 if (off16 >= reg_off && off16 < reg_off + 16) { 388 365 mem[off16 - reg_off] = (uint16_t)val; 389 } 390 else { 391 mem[bank * WIN_SZ_W + off16] = (uint16_t)val; 392 } 393 394 if (SDL_UnlockMutex(cpu_mutex) < 0) { 395 fail("SDL_UnlockMutex() failed: %s", SDL_GetError()); 396 } 397 } 366 return; 367 } 368 369 mem[bank * WIN_SZ_W + off16] = (uint16_t)val; 370 }
Note:
See TracChangeset
for help on using the changeset viewer.