minor updates from WinUAE

This commit is contained in:
Dimitris Panokostas 2020-08-12 15:26:35 +02:00
parent 41bac27715
commit 9c5a80c427
11 changed files with 166 additions and 118 deletions

View file

@ -410,6 +410,7 @@ static uae_u8 cdrom_command;
static uae_u8 cdrom_last_rx; static uae_u8 cdrom_last_rx;
static int cdrom_toc_counter; static int cdrom_toc_counter;
static uae_u32 cdrom_toc_crc;
static uae_u8 cdrom_toc_buffer[MAX_TOC_ENTRIES * 13]; static uae_u8 cdrom_toc_buffer[MAX_TOC_ENTRIES * 13];
static struct cd_toc_head cdrom_toc_cd_buffer; static struct cd_toc_head cdrom_toc_cd_buffer;
static uae_u8 qcode_buf[SUBQ_SIZE]; static uae_u8 qcode_buf[SUBQ_SIZE];
@ -695,6 +696,7 @@ static int get_cdrom_toc (void)
if (s->point >= 2 && s->point < 100 && (s->control & 0x0c) != 0x04 && !secondtrack) if (s->point >= 2 && s->point < 100 && (s->control & 0x0c) != 0x04 && !secondtrack)
secondtrack = addr; secondtrack = addr;
} }
cdrom_toc_crc = get_crc32 (cdrom_toc_buffer, cdrom_toc_cd_buffer.points * 13);
return 0; return 0;
} }
static bool is_valid_data_sector(int sector) static bool is_valid_data_sector(int sector)
@ -813,6 +815,13 @@ static int cdrom_command_led (void)
return 0; return 0;
} }
static int cdrom_command_idle_status (void)
{
cdrom_result_buffer[0] = 0x0a;
cdrom_result_buffer[1] = 0x70;
return 2;
}
static int cdrom_command_media_status (void) static int cdrom_command_media_status (void)
{ {
cdrom_result_buffer[0] = 0x0a; cdrom_result_buffer[0] = 0x0a;
@ -1798,13 +1807,17 @@ addrbank akiko_bank = {
ABFLAG_IO | ABFLAG_SAFE, S_READ, S_WRITE ABFLAG_IO | ABFLAG_SAFE, S_READ, S_WRITE
}; };
static const uae_u8 patchdata[]={0x0c,0x82,0x00,0x00,0x03,0xe8,0x64,0x00,0x00,0x46}; static const uae_u8 patchdata[] = { 0x0c, 0x82, 0x00, 0x00, 0x03, 0xe8, 0x64, 0x00, 0x00, 0x46 };
static const uae_u8 patchdata2[] = { 0x0c, 0x82, 0x00, 0x00, 0x03, 0xe8, 0x4e, 0x71, 0x4e, 0x71 };
static void patchrom(void) static void patchrom(void)
{ {
int i;
if (currprefs.cpu_model > 68020 || currprefs.cachesize || currprefs.m68k_speed != 0) { if (currprefs.cpu_model > 68020 || currprefs.cachesize || currprefs.m68k_speed != 0) {
uae_u8* p = extendedkickmem_bank.baseaddr; uae_u8 *p = extendedkickmem_bank.baseaddr;
if (p) { if (p) {
for (unsigned int i = 0; i < 524288 - sizeof patchdata; i++) { for (i = 0; i < 524288 - 512; i++) {
if (!memcmp(p + i, patchdata2, sizeof(patchdata2)))
return;
if (!memcmp(p + i, patchdata, sizeof(patchdata))) { if (!memcmp(p + i, patchdata, sizeof(patchdata))) {
protect_roms(false); protect_roms(false);
p[i + 6] = 0x4e; p[i + 6] = 0x4e;
@ -1859,6 +1872,7 @@ static int akiko_thread_do(int start)
static void akiko_reset(int hardreset) static void akiko_reset(int hardreset)
{ {
patchrom();
cdaudiostop_do (); cdaudiostop_do ();
nvram_read (); nvram_read ();
eeprom_reset(cd32_eeprom); eeprom_reset(cd32_eeprom);
@ -1931,7 +1945,6 @@ int akiko_init (void)
cdrom_playing = cdrom_paused = 0; cdrom_playing = cdrom_paused = 0;
cdrom_data_offset = -1; cdrom_data_offset = -1;
} }
patchrom ();
akiko_thread_do(1); akiko_thread_do(1);
gui_flicker_led (LED_HD, 0, -1); gui_flicker_led (LED_HD, 0, -1);
akiko_inited = true; akiko_inited = true;
@ -1996,7 +2009,7 @@ uae_u8 *save_akiko (int *len, uae_u8 *dstptr)
save_u8 (cdrom_speed); save_u8 (cdrom_speed);
save_u8 (cdrom_current_sector); save_u8 (cdrom_current_sector);
save_u32 (0); save_u32 (cdrom_toc_crc);
save_u8 (cdrom_toc_cd_buffer.points); save_u8 (cdrom_toc_cd_buffer.points);
save_u32 (cdrom_toc_cd_buffer.lastaddress); save_u32 (cdrom_toc_cd_buffer.lastaddress);

View file

@ -1057,10 +1057,11 @@ void action_replay_cia_access(bool write)
return; return;
if (action_replay_flag == ACTION_REPLAY_INACTIVE) if (action_replay_flag == ACTION_REPLAY_INACTIVE)
return; return;
int delay = currprefs.cpu_cycle_exact ? 1 : 0;
if ((armode_write & ARMODE_ACTIVATE_BFE001) && !write) { if ((armode_write & ARMODE_ACTIVATE_BFE001) && !write) {
event2_newevent_xx(-1, 0, write, action_replay_cia_access_delay); event2_newevent_xx(-1, delay, write, action_replay_cia_access_delay);
} else if ((armode_write & ARMODE_ACTIVATE_BFD100) && write) { } else if ((armode_write & ARMODE_ACTIVATE_BFD100) && write) {
event2_newevent_xx(-1, 0, write, action_replay_cia_access_delay); event2_newevent_xx(-1, delay, write, action_replay_cia_access_delay);
} }
} }
@ -1255,6 +1256,18 @@ static uae_u8* get_checksum_location (void)
return (uae_u8*)checksum_end; return (uae_u8*)checksum_end;
} }
/* Replaces the existing cart checksum with a correct one. */
/* Useful if you want to patch the rom. */
static void action_replay_fixup_checksum (uae_u32 new_checksum)
{
uae_u32* checksum = (uae_u32*)get_checksum_location();
if (checksum)
do_put_mem_long (checksum, new_checksum);
else
write_log (_T("Unable to locate Checksum in ROM.\n"));
return;
}
/* Longword search on word boundary /* Longword search on word boundary
* the search_value is assumed to already be in the local endian format * the search_value is assumed to already be in the local endian format
* return 0 on failure * return 0 on failure
@ -1418,6 +1431,7 @@ int action_replay_unload (int in_memory_reset)
static int superiv_init (struct romdata *rd, struct zfile *f) static int superiv_init (struct romdata *rd, struct zfile *f)
{ {
uae_u32 chip = currprefs.chipmem_size - 0x10000; uae_u32 chip = currprefs.chipmem_size - 0x10000;
int subtype = rd->id;
int flags = rd->type & ROMTYPE_MASK; int flags = rd->type & ROMTYPE_MASK;
const TCHAR *memname1, *memname2, *memname3; const TCHAR *memname1, *memname2, *memname3;

View file

@ -1,11 +1,11 @@
/* /*
* xDMS v1.3 - Portable DMS archive unpacker - Public Domain * xDMS v1.3 - Portable DMS archive unpacker - Public Domain
* Written by Andre Rodrigues de la Rocha <adlroc@usa.net> * Written by Andre Rodrigues de la Rocha <adlroc@usa.net>
* *
* Handles the processing of a single DMS archive * Handles the processing of a single DMS archive
* *
*/ */
#define HEADLEN 56 #define HEADLEN 56
@ -51,7 +51,7 @@ UCHAR *dms_text;
static void log_error(int track) static void log_error(int track)
{ {
write_log (_T("DMS: Ignored error on track %d!\n"), track); write_log (_T("DMS: Ignored error on track %d!\n"), track);
} }
static void addextra(const TCHAR *name, struct zfile **extra, uae_u8 *p, int size) static void addextra(const TCHAR *name, struct zfile **extra, uae_u8 *p, int size)
@ -131,10 +131,10 @@ USHORT DMS_Process_File(struct zfile *fi, struct zfile *fo, USHORT cmd, USHORT o
to = (USHORT) ((b1[18]<<8) | b1[19]); /* Highest track in archive. May be incorrect if archive is "appended" */ to = (USHORT) ((b1[18]<<8) | b1[19]); /* Highest track in archive. May be incorrect if archive is "appended" */
if (part && from < 30) { if (part && from < 30) {
free(b1); free(b1);
free(b2); free(b2);
free(dms_text); free(dms_text);
return DMS_FILE_END; return DMS_FILE_END;
} }
pkfsize = (ULONG) ((((ULONG)b1[21])<<16) | (((ULONG)b1[22])<<8) | (ULONG)b1[23]); /* Length of total packed data as in archive */ pkfsize = (ULONG) ((((ULONG)b1[21])<<16) | (((ULONG)b1[22])<<8) | (ULONG)b1[23]); /* Length of total packed data as in archive */
@ -231,8 +231,8 @@ USHORT DMS_Process_File(struct zfile *fi, struct zfile *fo, USHORT cmd, USHORT o
write_log (_T(" ------ ------- ------- ------ ---- ---- ---- -----\n")); write_log (_T(" ------ ------- ------- ------ ---- ---- ---- -----\n"));
} }
// if (((cmd==CMD_UNPACK) || (cmd==CMD_SHOWBANNER)) && (geninfo & 2) && (!pwd)) // if (((cmd==CMD_UNPACK) || (cmd==CMD_SHOWBANNER)) && (geninfo & 2) && (!pwd))
// return ERR_NOPASSWD; // return ERR_NOPASSWD;
ret=NO_PROBLEM; ret=NO_PROBLEM;
@ -259,7 +259,7 @@ USHORT DMS_Process_File(struct zfile *fi, struct zfile *fo, USHORT cmd, USHORT o
} }
} }
if ((cmd == CMD_VIEWFULL) || (cmd == CMD_SHOWDIZ) || (cmd == CMD_SHOWBANNER)) write_log(_T("\n")); if ((cmd == CMD_VIEWFULL) || (cmd == CMD_SHOWDIZ) || (cmd == CMD_SHOWBANNER)) write_log (_T("\n"));
if (ret == DMS_FILE_END) ret = NO_PROBLEM; if (ret == DMS_FILE_END) ret = NO_PROBLEM;
@ -295,14 +295,14 @@ static USHORT Process_Track(struct zfile *fi, struct zfile *fo, UCHAR *b1, UCHAR
} }
/* "TR" identifies a Track Header */ /* "TR" identifies a Track Header */
if ((b1[0] != 'T')||(b1[1] != 'R')) if ((b1[0] != 'T')||(b1[1] != 'R'))
return ERR_NOTTRACK; return ERR_NOTTRACK;
/* Track Header CRC */ /* Track Header CRC */
hcrc = (USHORT)((b1[THLEN-2] << 8) | b1[THLEN-1]); hcrc = (USHORT)((b1[THLEN-2] << 8) | b1[THLEN-1]);
if (dms_CreateCRC(b1,(ULONG)(THLEN-2)) != hcrc) if (dms_CreateCRC(b1,(ULONG)(THLEN-2)) != hcrc)
return ERR_THCRC; return ERR_THCRC;
number = (USHORT)((b1[2] << 8) | b1[3]); /* Number of track */ number = (USHORT)((b1[2] << 8) | b1[3]); /* Number of track */
pklen1 = (USHORT)((b1[6] << 8) | b1[7]); /* Length of packed track data as in archive */ pklen1 = (USHORT)((b1[6] << 8) | b1[7]); /* Length of packed track data as in archive */
@ -329,15 +329,15 @@ static USHORT Process_Track(struct zfile *fi, struct zfile *fo, UCHAR *b1, UCHAR
write_log (_T("%5d %5d %s %04X %04X %04X %0d\n"), pklen1, unpklen, modes[cmode], usum, hcrc, dcrc, flags); write_log (_T("%5d %5d %s %04X %04X %04X %0d\n"), pklen1, unpklen, modes[cmode], usum, hcrc, dcrc, flags);
} }
if ((pklen1 > TRACK_BUFFER_LEN) || (pklen2 >TRACK_BUFFER_LEN) || (unpklen > TRACK_BUFFER_LEN)) if ((pklen1 > TRACK_BUFFER_LEN) || (pklen2 >TRACK_BUFFER_LEN) || (unpklen > TRACK_BUFFER_LEN))
return ERR_BIGTRACK; return ERR_BIGTRACK;
if (zfile_fread(b1,1,(size_t)pklen1,fi) != pklen1) if (zfile_fread(b1,1,(size_t)pklen1,fi) != pklen1)
return ERR_SREAD; return ERR_SREAD;
if (dms_CreateCRC(b1,(ULONG)pklen1) != dcrc) { if (dms_CreateCRC(b1,(ULONG)pklen1) != dcrc) {
log_error (number); log_error (number);
crcerr = 1; crcerr = 1;
} }
/* track 80 is FILEID.DIZ, track 0xffff (-1) is Banner */ /* track 80 is FILEID.DIZ, track 0xffff (-1) is Banner */
/* and track 0 with 1024 bytes only is a fake boot block with more advertising */ /* and track 0 with 1024 bytes only is a fake boot block with more advertising */
@ -347,7 +347,7 @@ static USHORT Process_Track(struct zfile *fi, struct zfile *fo, UCHAR *b1, UCHAR
normaltrack = false; normaltrack = false;
if ((cmd == CMD_UNPACK) && (number<80) && (unpklen>2048)) { if ((cmd == CMD_UNPACK) && (number<80) && (unpklen>2048)) {
memset(b2, 0, unpklen); memset(b2, 0, unpklen);
if (!crcerr) { if (!crcerr) {
Unpack_Track(b1, b2, pklen2, unpklen, cmode, flags, number, pklen1, usum, dmsflags & DMSFLAG_ENCRYPTED); Unpack_Track(b1, b2, pklen2, unpklen, cmode, flags, number, pklen1, usum, dmsflags & DMSFLAG_ENCRYPTED);
} }
@ -372,21 +372,21 @@ static USHORT Process_Track(struct zfile *fi, struct zfile *fo, UCHAR *b1, UCHAR
} }
if (crcerr) if (crcerr)
return NO_PROBLEM; return NO_PROBLEM;
if (number == 0xffff) { if (number == 0xffff) {
if (extra){ if (extra){
Unpack_Track(b1, b2, pklen2, unpklen, cmode, flags, number, pklen1, usum, dmsflags & DMSFLAG_ENCRYPTED); Unpack_Track(b1, b2, pklen2, unpklen, cmode, flags, number, pklen1, usum, dmsflags & DMSFLAG_ENCRYPTED);
addextra(_T("Banner"), extra, b2, unpklen); addextra(_T("Banner"), extra, b2, unpklen);
} }
//printbandiz(b2,unpklen); //printbandiz(b2,unpklen);
} }
if (number == 80) { if (number == 80) {
if (extra) { if (extra) {
Unpack_Track(b1, b2, pklen2, unpklen, cmode, flags, number, pklen1, usum, dmsflags & DMSFLAG_ENCRYPTED); Unpack_Track(b1, b2, pklen2, unpklen, cmode, flags, number, pklen1, usum, dmsflags & DMSFLAG_ENCRYPTED);
addextra(_T("FILEID.DIZ"), extra, b2, unpklen); addextra(_T("FILEID.DIZ"), extra, b2, unpklen);
} }
//printbandiz(b2,unpklen); //printbandiz(b2,unpklen);
} }
@ -467,67 +467,67 @@ static void dms_decrypt(UCHAR *p, USHORT len, UCHAR *src){
static USHORT Unpack_Track(UCHAR *b1, UCHAR *b2, USHORT pklen2, USHORT unpklen, UCHAR cmode, UCHAR flags, USHORT number, USHORT pklen1, USHORT usum1, int enc) static USHORT Unpack_Track(UCHAR *b1, UCHAR *b2, USHORT pklen2, USHORT unpklen, UCHAR cmode, UCHAR flags, USHORT number, USHORT pklen1, USHORT usum1, int enc)
{ {
USHORT r, err = NO_PROBLEM; USHORT r, err = NO_PROBLEM;
static USHORT pass; static USHORT pass;
int maybeencrypted; int maybeencrypted;
int pwrounds; int pwrounds;
UCHAR *tmp; UCHAR *tmp;
USHORT prevpass = 0; USHORT prevpass = 0;
if (passfound) { if (passfound) {
if (number != 80) if (number != 80)
dms_decrypt(b1, pklen1, b1); dms_decrypt(b1, pklen1, b1);
r = Unpack_Track_2(b1, b2, pklen2, unpklen, cmode, flags); r = Unpack_Track_2(b1, b2, pklen2, unpklen, cmode, flags);
if (r == NO_PROBLEM) { if (r == NO_PROBLEM) {
if (usum1 == dms_Calc_CheckSum(b2,(ULONG)unpklen)) if (usum1 == dms_Calc_CheckSum(b2,(ULONG)unpklen))
return NO_PROBLEM; return NO_PROBLEM;
} }
log_error(number); log_error(number);
if (passretries <= 0) if (passretries <= 0)
return ERR_CSUM; return ERR_CSUM;
} }
passretries--; passretries--;
pwrounds = 0; pwrounds = 0;
maybeencrypted = 0; maybeencrypted = 0;
tmp = (unsigned char*)malloc (pklen1); tmp = (unsigned char*)malloc (pklen1);
memcpy (tmp, b1, pklen1); memcpy (tmp, b1, pklen1);
memset(b2, 0, unpklen); memset(b2, 0, unpklen);
for (;;) { for (;;) {
r = Unpack_Track_2(b1, b2, pklen2, unpklen, cmode, flags); r = Unpack_Track_2(b1, b2, pklen2, unpklen, cmode, flags);
if (r == NO_PROBLEM) { if (r == NO_PROBLEM) {
if (usum1 == dms_Calc_CheckSum(b2,(ULONG)unpklen)) { if (usum1 == dms_Calc_CheckSum(b2,(ULONG)unpklen)) {
passfound = maybeencrypted; passfound = maybeencrypted;
if (passfound) if (passfound)
write_log (_T("DMS: decryption key = 0x%04X\n"), prevpass); write_log (_T("DMS: decryption key = 0x%04X\n"), prevpass);
err = NO_PROBLEM; err = NO_PROBLEM;
pass = prevpass; pass = prevpass;
break; break;
} }
} }
if (number == 80 || !enc) { if (number == 80 || !enc) {
err = ERR_CSUM; err = ERR_CSUM;
break; break;
} }
maybeencrypted = 1; maybeencrypted = 1;
prevpass = pass; prevpass = pass;
PWDCRC = pass; PWDCRC = pass;
pass++; pass++;
dms_decrypt(b1, pklen1, tmp); dms_decrypt(b1, pklen1, tmp);
pwrounds++; pwrounds++;
if (pwrounds == 65536) { if (pwrounds == 65536) {
err = ERR_CSUM; err = ERR_CSUM;
passfound = 0; passfound = 0;
break; break;
} }
} }
free (tmp); free (tmp);
return err; return err;
} }
static void printbandiz(UCHAR *m, USHORT len){ static void printbandiz(UCHAR *m, USHORT len){
UCHAR *i,*j; UCHAR *i,*j;
i=j=m; i=j=m;
while (i<m+len) { while (i<m+len) {

View file

@ -25,7 +25,7 @@
#include "kjmp2.h" #include "kjmp2.h"
#ifdef _MSC_VER_ #ifdef _MSC_VER
#define FASTCALL __fastcall #define FASTCALL __fastcall
#else #else
#define FASTCALL #define FASTCALL

View file

@ -95,6 +95,9 @@ static uae_s32 ARCunsqueeze(struct zfile *in, struct zfile *out, struct rledata
{ {
numnodes = xadIOGetBitsLow(&io, 16); numnodes = xadIOGetBitsLow(&io, 16);
if (io.err)
return XADERR_ILLEGALDATA;
if(numnodes < 0 || numnodes >= ARCSQNUMVALS) if(numnodes < 0 || numnodes >= ARCSQNUMVALS)
err = XADERR_DECRUNCH; err = XADERR_DECRUNCH;
else else
@ -115,6 +118,9 @@ static uae_s32 ARCunsqueeze(struct zfile *in, struct zfile *out, struct rledata
while(i >= 0 && !io.err) while(i >= 0 && !io.err)
i = node[2*i + xadIOGetBitsLow(&io, 1)]; i = node[2*i + xadIOGetBitsLow(&io, 1)];
if (io.err)
return XADERR_ILLEGALDATA;
i = -(i + 1); /* decode fake node index to original data value */ i = -(i + 1); /* decode fake node index to original data value */
if(i != ARCSQSPEOF) if(i != ARCSQSPEOF)
@ -441,8 +447,12 @@ struct zfile *unwarp(struct zfile *zf)
{ {
int i; int i;
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
uae_u8 v = zfile_getc (zf); uae_s32 v = zfile_getc(zf);
putrle (v, tmpf, algo == 3 ? &rled : NULL); if (v == -1) {
err = XADERR_ILLEGALDATA;
break;
}
putrle((uae_u8)v, tmpf, algo == 3 ? &rled : NULL);
} }
} }
break; break;

View file

@ -1,16 +1,16 @@
/* /*
* UAE - The Un*x Amiga Emulator * UAE - The Un*x Amiga Emulator
* *
* Paula audio emulation * Paula audio emulation
* *
* Copyright 1995, 1996, 1997 Bernd Schmidt * Copyright 1995, 1996, 1997 Bernd Schmidt
* Copyright 1996 Marcus Sundberg * Copyright 1996 Marcus Sundberg
* Copyright 1996 Manfred Thole * Copyright 1996 Manfred Thole
* Copyright 2006 Toni Wilen * Copyright 2006 Toni Wilen
* *
* new filter algorithm and anti&sinc interpolators by Antti S. Lankila * new filter algorithm and anti&sinc interpolators by Antti S. Lankila
* *
*/ */
#include "sysconfig.h" #include "sysconfig.h"
#include "sysdeps.h" #include "sysdeps.h"

View file

@ -18,6 +18,7 @@
#include "autoconf.h" #include "autoconf.h"
#include "traps.h" #include "traps.h"
#include "threaddep/thread.h" #include "threaddep/thread.h"
#include "native2amiga.h"
#include "inputdevice.h" #include "inputdevice.h"
#include "devices.h" #include "devices.h"
@ -553,7 +554,12 @@ static uae_u32 REGPARAM2 uae_puts (TrapContext *ctx)
void rtarea_init_mem (void) void rtarea_init_mem (void)
{ {
need_uae_boot_rom(&currprefs); if (need_uae_boot_rom(&currprefs)) {
rtarea_bank.flags &= ~ABFLAG_ALLOCINDIRECT;
} else {
// not enabled and something else may use same address space
rtarea_bank.flags |= ABFLAG_ALLOCINDIRECT;
}
rtarea_bank.reserved_size = RTAREA_SIZE; rtarea_bank.reserved_size = RTAREA_SIZE;
rtarea_bank.start = rtarea_base; rtarea_bank.start = rtarea_base;
if (!mapped_malloc (&rtarea_bank)) { if (!mapped_malloc (&rtarea_bank)) {

View file

@ -1,6 +1,5 @@
#include "sysconfig.h" #include "sysconfig.h"
#include "sysdeps.h" #include "sysdeps.h"
#include "savestate.h"
#include "options.h" #include "options.h"
#include "custom.h" #include "custom.h"
#include "memory.h" #include "memory.h"

View file

@ -3,7 +3,6 @@
#include "options.h" #include "options.h"
#include "custom.h" #include "custom.h"
#include "memory.h" #include "memory.h"
#include "savestate.h"
#include "blitter.h" #include "blitter.h"
#include "blitfunc.h" #include "blitfunc.h"

View file

@ -14,9 +14,9 @@
#include "memory.h" #include "memory.h"
#include "custom.h" #include "custom.h"
#include "newcpu.h" #include "newcpu.h"
#include "savestate.h"
#include "blitter.h" #include "blitter.h"
#include "blit.h" #include "blit.h"
#include "savestate.h"
/* we must not change ce-mode while blitter is running.. */ /* we must not change ce-mode while blitter is running.. */
static int blitter_cycle_exact, immediate_blits; static int blitter_cycle_exact, immediate_blits;
@ -313,11 +313,11 @@ int blitter_channel_state (void)
return channel_state (blit_cyclecounter); return channel_state (blit_cyclecounter);
} }
STATIC_INLINE int canblit(int hpos) STATIC_INLINE int canblit (int hpos)
{ {
if (!dmaen(DMA_BLITTER)) if (!dmaen (DMA_BLITTER))
return -1; return -1;
if (is_bitplane_dma(hpos)) if (is_bitplane_dma (hpos))
return 0; return 0;
if (cycle_line[hpos] & CYCLE_MASK) { if (cycle_line[hpos] & CYCLE_MASK) {
return 0; return 0;
@ -1076,7 +1076,9 @@ void do_blitter (int hpos)
bltstate = BLT_done; bltstate = BLT_done;
blitter_cycle_exact = currprefs.blitter_cycle_exact;
immediate_blits = currprefs.immediate_blits; immediate_blits = currprefs.immediate_blits;
blt_info.got_cycle = 0;
last_blitter_hpos = hpos + 1; last_blitter_hpos = hpos + 1;
blit_firstline_cycles = blit_first_cycle = get_cycles (); blit_firstline_cycles = blit_first_cycle = get_cycles ();
blit_misscyclecounter = 0; blit_misscyclecounter = 0;
@ -1119,14 +1121,18 @@ void do_blitter (int hpos)
return; return;
} }
if (dmaen (DMA_BLITTER)) {
blt_info.got_cycle = 1;
}
if (immediate_blits) { if (immediate_blits) {
if (dmaen (DMA_BLITTER)) if (dmaen (DMA_BLITTER))
blitter_doit (); blitter_doit ();
return; return;
} }
blit_cyclecounter = cycles * (blit_dmacount2 + (blit_nod ? 0 : 1)); blit_cyclecounter = cycles * (blit_dmacount2 + (blit_nod ? 0 : 1));
event2_newevent (ev2_blitter, blit_cyclecounter, 0); event2_newevent (ev2_blitter, blit_cyclecounter, 0);
} }
void blitter_check_start (void) void blitter_check_start (void)
@ -1137,7 +1143,7 @@ void blitter_check_start (void)
bltstate = BLT_work; bltstate = BLT_work;
if (immediate_blits) { if (immediate_blits) {
blitter_doit (); blitter_doit ();
} }
} }
void maybe_blit2 (int hack) void maybe_blit2 (int hack)

View file

@ -9,6 +9,7 @@
#ifndef UAE_BLITTER_H #ifndef UAE_BLITTER_H
#define UAE_BLITTER_H #define UAE_BLITTER_H
#include "savestate.h"
#include "uae/types.h" #include "uae/types.h"
struct bltinfo { struct bltinfo {