Commit 1bb6c131 authored by mtufan's avatar mtufan

puae 2.3.2

parent 3085fa4b
?package(p-uae):command="/usr/bin/p-uae"\ ?package(p-uae):command="/usr/bin/p-uae"\
title="E-UAE"\ title="P-UAE"\
needs="X11"\ needs="X11"\
section="Apps/Emulators" section="Apps/Emulators"
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2947,7 +2947,7 @@ void init_custom (void) ...@@ -2947,7 +2947,7 @@ void init_custom (void)
update_mirrors(); update_mirrors();
create_cycle_diagram_table (); create_cycle_diagram_table ();
reset_drawing (); reset_drawing ();
init_hz (false); init_hz_full ();
calcdiw (); calcdiw ();
} }
...@@ -5866,7 +5866,7 @@ void custom_reset (int hardreset) ...@@ -5866,7 +5866,7 @@ void custom_reset (int hardreset)
diwstate = DIW_waiting_start; diwstate = DIW_waiting_start;
dmal = 0; dmal = 0;
init_hz (false); init_hz_full ();
vpos_lpen = -1; vpos_lpen = -1;
audio_reset (); audio_reset ();
......
...@@ -5828,7 +5828,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke ...@@ -5828,7 +5828,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke
goto error; goto error;
} }
if (hfd->cylinders * hfd->sectors * hfd->heads * blocksize > hfd->virtsize) if ((uae_u64)hfd->cylinders * hfd->sectors * hfd->heads * blocksize > hfd->virtsize)
write_log ("RDB: WARNING: end of partition > size of disk!\n"); write_log ("RDB: WARNING: end of partition > size of disk!\n");
err = 2; err = 2;
......
...@@ -660,7 +660,6 @@ static void ide_write_sectors (int flags) ...@@ -660,7 +660,6 @@ static void ide_write_sectors (int flags)
ide->data_offset = 0; ide->data_offset = 0;
ide->status |= IDE_STATUS_DRQ; ide->status |= IDE_STATUS_DRQ;
ide->data_size = nsec * ide->blocksize; ide->data_size = nsec * ide->blocksize;
ide->data_multi = 1;
} }
static void ide_do_command (uae_u8 cmd) static void ide_do_command (uae_u8 cmd)
......
...@@ -38,7 +38,7 @@ struct shmid_ds { ...@@ -38,7 +38,7 @@ struct shmid_ds {
char name[MAX_PATH]; char name[MAX_PATH];
void *attached; void *attached;
int mode; int mode;
void *natmembase; void *natmembase; /* if != NULL then shmem is shared from natmem */
}; };
static struct shmid_ds shmids[MAX_SHMID]; static struct shmid_ds shmids[MAX_SHMID];
...@@ -356,7 +356,7 @@ void *my_shmat (int shmid, void *shmaddr, int shmflg) ...@@ -356,7 +356,7 @@ void *my_shmat (int shmid, void *shmaddr, int shmflg)
unsigned int got = FALSE; unsigned int got = FALSE;
int p96special = FALSE; int p96special = FALSE;
#ifdef NATMEM_OFFSET //#ifdef NATMEM_OFFSET
unsigned int size = shmids[shmid].size; unsigned int size = shmids[shmid].size;
if (shmids[shmid].attached) if (shmids[shmid].attached)
...@@ -438,6 +438,7 @@ void *my_shmat (int shmid, void *shmaddr, int shmflg) ...@@ -438,6 +438,7 @@ void *my_shmat (int shmid, void *shmaddr, int shmflg)
filesysptr = xcalloc (uae_u8, size); filesysptr = xcalloc (uae_u8, size);
result = filesysptr; result = filesysptr;
shmids[shmid].attached = result; shmids[shmid].attached = result;
shmids[shmid].natmembase = NULL;
return result; return result;
} }
if(!_tcscmp (shmids[shmid].name, "custmem1")) { if(!_tcscmp (shmids[shmid].name, "custmem1")) {
...@@ -499,28 +500,31 @@ void *my_shmat (int shmid, void *shmaddr, int shmflg) ...@@ -499,28 +500,31 @@ void *my_shmat (int shmid, void *shmaddr, int shmflg)
got = TRUE; got = TRUE;
} }
} }
#endif //#endif
if (shmids[shmid].key == shmid && shmids[shmid].size) { if (shmids[shmid].key == shmid && shmids[shmid].size) {
shmids[shmid].mode = 0; shmids[shmid].mode = 0;
shmids[shmid].natmembase = natmem_offset;
write_log ("SHMAddr %s %p = %p - %p\n", shmids[shmid].name, (uae_u8*)shmaddr-natmem_offset, shmaddr, natmem_offset); // we have natmem -> we can share the memory from there
//here if ( ((shmaddr >= natmem_offset) && ((shmaddr + size) <= natmem_offset_end)) || ((p96mem_offset != NULL) && p96special) ) {
if (shmids[shmid].attached != NULL) shmids[shmid].natmembase = natmem_offset;
free (shmids[shmid].attached); shmids[shmid].attached = shmaddr;
result = valloc (/*shmaddr,*/ size); write_log ("SHMAddr: %08x = %08p - %08p %s from NATMEM %s\n", (uae_u8*)shmaddr-natmem_offset, shmaddr, natmem_offset, shmids[shmid].name, got ? "identified":"unknown");
if (result == NULL) { result = shmaddr;
result = (void*)-1;
write_log ("VirtualAlloc %08X - %08X %x (%dk) failed %d\n",
(uae_u8*)shmaddr - natmem_offset, (uae_u8*)shmaddr - natmem_offset + size,
size, size >> 10, errno);
} else { } else {
shmids[shmid].attached = result; // not natmem was allocated -> allocate own chunk here
write_log ("VirtualAlloc %08X - %08X %x (%dk) ok (%08X)%s\n", shmids[shmid].natmembase = NULL;
(uae_u8*)shmaddr - natmem_offset, (uae_u8*)shmaddr - natmem_offset + size, result = valloc (/*shmaddr,*/ size);
size, size >> 10, shmaddr, p96special ? " P96" : ""); if (result == NULL) {
result = (void*)-1;
write_log ("VirtualAlloc %08X - %08X %x (%dk) failed %d\n", (uae_u8*)shmaddr - natmem_offset, (uae_u8*)shmaddr - natmem_offset + size, size, size >> 10, errno);
} else {
shmids[shmid].attached = result;
write_log ("VirtualAlloc %08X - %08X %x (%dk) ok (%08X)%s\n", (uae_u8*)shmaddr - natmem_offset, (uae_u8*)shmaddr - natmem_offset + size, size, size >> 10, shmaddr, p96special ? " P96" : "");
}
} }
} }
return result; return result;
} }
...@@ -559,7 +563,7 @@ int my_shmget (key_t key, size_t size, int shmflg, const char *name) ...@@ -559,7 +563,7 @@ int my_shmget (key_t key, size_t size, int shmflg, const char *name)
// write_log ("key %d (%d), size %d, shmflg %d, name %s\n", key, IPC_PRIVATE, size, shmflg, name); // write_log ("key %d (%d), size %d, shmflg %d, name %s\n", key, IPC_PRIVATE, size, shmflg, name);
// if((key == IPC_PRIVATE) || ((shmflg & IPC_CREAT) && (find_shmkey (key) == -1))) { // if((key == IPC_PRIVATE) || ((shmflg & IPC_CREAT) && (find_shmkey (key) == -1))) {
write_log ("shmget of size %d (%dk) for %s\n", size, size >> 10, name); //write_log ("shmget of size %d (%dk) for %s\n", size, size >> 10, name);
if ((result = get_next_shmkey ()) != -1) { if ((result = get_next_shmkey ()) != -1) {
shmids[result].size = size; shmids[result].size = size;
_tcscpy (shmids[result].name, name); _tcscpy (shmids[result].name, name);
...@@ -582,12 +586,16 @@ int my_shmctl (int shmid, int cmd, struct shmid_ds *buf) ...@@ -582,12 +586,16 @@ int my_shmctl (int shmid, int cmd, struct shmid_ds *buf)
result = 0; result = 0;
break; break;
case IPC_RMID: case IPC_RMID:
free (shmids[shmid].attached); // shmem was not shared from natmem but allocated -> so free it now
if (shmids[shmid].natmembase == NULL) {
free (shmids[shmid].attached);
}
shmids[shmid].key = -1; shmids[shmid].key = -1;
shmids[shmid].name[0] = '\0'; shmids[shmid].name[0] = '\0';
shmids[shmid].size = 0; shmids[shmid].size = 0;
shmids[shmid].attached = 0; shmids[shmid].attached = 0;
shmids[shmid].mode = 0; shmids[shmid].mode = 0;
shmids[shmid].natmembase = NULL;
result = 0; result = 0;
break; break;
} }
......
...@@ -2973,7 +2973,7 @@ void init_hz_p96 (void) ...@@ -2973,7 +2973,7 @@ void init_hz_p96 (void)
if (p96vblank >= 300) if (p96vblank >= 300)
p96vblank = 300; p96vblank = 300;
p96syncrate = maxvpos * vblank_hz / p96vblank; p96syncrate = maxvpos * vblank_hz / p96vblank;
write_log ("P96FREQ: %d*%d = %d / %d = %d\n", maxvpos, vblank_hz, maxvpos_nom * vblank_hz, p96vblank, p96syncrate); write_log ("P96FREQ: %d * %g = %d / %d = %d\n", maxvpos, vblank_hz, maxvpos_nom * vblank_hz, p96vblank, p96syncrate);
} }
/* NOTE: Watch for those planeptrs of 0x00000000 and 0xFFFFFFFF for all zero / all one bitmaps !!!! */ /* NOTE: Watch for those planeptrs of 0x00000000 and 0xFFFFFFFF for all zero / all one bitmaps !!!! */
...@@ -3573,8 +3573,8 @@ static int flushpixels (void) ...@@ -3573,8 +3573,8 @@ static int flushpixels (void)
} else { } else {
long ps; long ps;
gwwcnt = gwwbufsize; gwwcnt = gwwbufsize;
//if (mman_GetWriteWatch (src_start, src_end - src_start, gwwbuf, &gwwcnt, &ps)) /*if (mman_GetWriteWatch (src_start, src_end - src_start, gwwbuf, &gwwcnt, &ps))
break; break;*/
} }
if (gwwcnt == 0) if (gwwcnt == 0)
...@@ -3655,7 +3655,7 @@ static int flushpixels (void) ...@@ -3655,7 +3655,7 @@ static int flushpixels (void)
if (doskip () && p96skipmode == 4) { if (doskip () && p96skipmode == 4) {
; ;
} else { } else {
DX_Invalidate (0, miny, picasso96_state.Width, maxy - miny); DX_Invalidate (miny, maxy);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment