Align with latest TomB version 1.0.2 released in 27-oct

This commit is contained in:
Chips-fr 2015-11-16 22:32:10 +01:00
parent d7cfc9759b
commit a100ea0d9d
110 changed files with 8691 additions and 7697 deletions

View file

@ -304,7 +304,7 @@ bool CreateFilesysHardfile(void)
32, (size / 1024) + 1, 2, 512,
bp, 0, 0, 0);
if (uci)
hardfile_do_disk_change (uci->configoffset, 1);
hardfile_do_disk_change (uci, 1);
}
return dialogResult;

View file

@ -363,7 +363,7 @@ bool EditFilesysHardfile(int unit_no)
atoi(txtReserved->getText().c_str()), atoi(txtBlocksize->getText().c_str()),
bp, 0, 0, 0);
if (uci)
hardfile_do_disk_change (uci->configoffset, 1);
hardfile_do_disk_change (uci, 1);
}
return dialogResult;
}

View file

@ -63,7 +63,7 @@ class SavestateActionListener : public gcn::ActionListener
if (f)
{
fclose(f);
savestate_initsave(savestate_fname, 2);
savestate_initsave(savestate_fname, 2, 0);
savestate_state = STATE_DORESTORE;
gui_running = false;
}
@ -81,7 +81,7 @@ class SavestateActionListener : public gcn::ActionListener
//------------------------------------------
if(emulating)
{
savestate_initsave(savestate_fname, 2);
savestate_initsave(savestate_fname, 2, 0);
save_state (savestate_fname, "...");
savestate_state = STATE_DOSAVE; // Just to create the screenshot
delay_savestate_frame = 1;

View file

@ -4,8 +4,8 @@
.global TRACE_Start
.global TRACE_mem
.global pixcpy_swap16
.global pixcpy_swap32
.global copy_screen_16bit_swap
.global copy_screen_32bit_to_16bit_neon
.global ARM_doline_n1
.global NEON_doline_n2
.global NEON_doline_n3
@ -62,49 +62,66 @@ TRACE_Start:
@----------------------------------------------------------------
@ pixcpy_swap16
@ copy_screen_16bit_swap
@
@ r0: uae_u16 *dstp
@ r1: uae_u16 *srcp
@ r2: int cols
@ r0: uae_u8 *dst
@ r1: uae_u8 *src
@ r2: int bytes always a multiple of 128: even number of lines, 2 bytes per pixel, number of pixel per line is multiple of 32 (320, 640, 800, 1024, 1152, 1280)
@
@ void pixcpy_swap16(uae_u16 *dstp, uae_u16 *srcp, int cols);
@ void copy_screen_16bit_swap(uae_u8 *dst, uae_u8 *src, int bytes);
@
@----------------------------------------------------------------
pixcpy_swap16:
subs r2, r2, #1
bxmi lr
pixcpy_swap16_1:
ldrh r3, [r1], #2
rev16 r3, r3
strh r3, [r0], #2
subs r2, r2, #1
bge pixcpy_swap16_1
bx lr
copy_screen_16bit_swap:
pld [r1, #192]
vldmia r1!, {q8, q9}
vrev16.8 q8, q8
vldmia r1!, {q10}
vrev16.8 q9, q9
vldmia r1!, {q11}
vrev16.8 q10, q10
vldmia r1!, {q12}
vrev16.8 q11, q11
vldmia r1!, {q13}
vrev16.8 q12, q12
vldmia r1!, {q14}
vrev16.8 q13, q13
vldmia r1!, {q15}
vrev16.8 q14, q14
vrev16.8 q15, q15
subs r2, r2, #128 @ we handle 16 * 8 bytes per loop
vstmia r0!, {q8-q15}
bne copy_screen_16bit_swap
bx lr
@----------------------------------------------------------------
@ pixcpy_swap32
@ copy_screen_32bit_to_16bit_neon
@
@ r0: uae_u32 *dstp
@ r1: uae_u32 *srcp
@ r2: int cols
@ r0: uae_u8 *dst - Format (bits): rrrr rggg gggb bbbb
@ r1: uae_u8 *src - Format (bytes) in memory rgba
@ r2: int bytes
@
@ void pixcpy_swap32(uae_u32 *dstp, uae_u32 *srcp, int cols);
@ void copy_screen_32bit_to_16bit_neon(uae_u8 *dst, uae_u8 *src, int bytes);
@
@----------------------------------------------------------------
pixcpy_swap32:
subs r2, r2, #1
bxmi lr
pixcpy_swap32_1:
ldr r3, [r1], #4
rev r3, r3
str r3, [r0], #4
subs r2, r2, #1
bge pixcpy_swap32_1
bx lr
copy_screen_32bit_to_16bit_neon:
pld [r1, #192]
vld4.8 {d18-d21}, [r1]!
vld4.8 {d22-d25}, [r1]!
vswp d19, d22
vswp d21, d24 @ -> q9=r, q10=b, q11=g, q12=a
vsri.i8 q9, q11, #5 @ q9: rrrr rggg
vshr.u8 q8, q10, #3 @ q8: 000b bbbb
vshr.u8 q11, q11, #2 @ q11: 00gg gggg
vsli.i8 q8, q11, #5 @ q8: gggb bbbb
vswp d17, d18
subs r2, r2, #64 @ processd 4 (bytes per pixel) * 16 (pixel)
vst2.8 {d16-d17}, [r0]!
vst2.8 {d18-d19}, [r0]!
bne copy_screen_32bit_to_16bit_neon
bx lr
@----------------------------------------------------------------
@ ARM_doline_n1
@

View file

@ -36,6 +36,8 @@
#include "newcpu.h"
#include "traps.h"
#include "native2amiga.h"
#include "rtgmodes.h"
#include "uaeresource.h"
#include <SDL.h>
#include "gp2x.h"
@ -98,6 +100,7 @@ void reinit_amiga(void)
#endif
#ifdef FILESYS
rtarea_init ();
uaeres_install ();
hardfile_install();
#endif
@ -217,6 +220,8 @@ void target_default_options (struct uae_prefs *p, int type)
p->pandora_button2 = GP2X_BUTTON_A;
p->pandora_autofireButton1 = GP2X_BUTTON_B;
p->pandora_jump = -1;
p->picasso96_modeflags = RGBFF_R5G6B5 | RGBFF_R8G8B8A8;
}
@ -656,7 +661,7 @@ int main (int argc, char *argv[])
printf("Failed to set signal handler (SIGILL).\n");
abort();
}
alloc_AmigaMem();
RescanROMs();
real_main (argc, argv);
@ -905,7 +910,8 @@ void handle_events (void)
else
{
int mouseScale = currprefs.input_joymouse_multiplier / 2;
if(rEvent.motion.xrel > 20 || rEvent.motion.xrel < -20 || rEvent.motion.yrel > 20 || rEvent.motion.yrel < -20)
break;
lastmx += rEvent.motion.xrel * mouseScale;
lastmy += rEvent.motion.yrel * mouseScale;
if(rEvent.motion.x == 0)

View file

@ -17,10 +17,6 @@
#include <SDL_image.h>
#include <SDL_gfxPrimitives.h>
#include <sys/ioctl.h>
#include <linux/fb.h>
#include <linux/matroxfb.h>
#ifdef ANDROIDSDL
#include <android/log.h>
#endif
@ -39,11 +35,10 @@ static int y_size_table[MAX_SCREEN_MODES] = { 400, 480, 480, 768, 864, 960 };
static int red_bits, green_bits, blue_bits;
static int red_shift, green_shift, blue_shift;
int screen_is_picasso;
static int picasso_maxw = 0, picasso_maxh = 0;
static int bitdepth, bit_unit;
struct PicassoResolution *DisplayModes;
struct MultiDisplay Displays[MAX_DISPLAYS];
int screen_is_picasso = 0;
static int curr_layer_width = 0;
@ -74,18 +69,10 @@ static unsigned long previous_synctime = 0;
static unsigned long next_synctime = 0;
static int fbdevice = -1;
static inline void WaitForVSync(void)
{
int arg = 0;
if(fbdevice != -1)
ioctl(fbdevice, FBIO_WAITFORVSYNC, &arg);
}
int graphics_setup (void)
{
#ifdef PICASSO96
picasso_InitResolutions();
InitPicasso96();
#endif
return 1;
@ -110,11 +97,6 @@ void graphics_subshutdown (void)
{
SDL_FreeSurface(prSDLScreen);
prSDLScreen = NULL;
if(fbdevice != -1)
{
close(fbdevice);
fbdevice = -1;
}
}
@ -124,6 +106,7 @@ static void CalcPandoraWidth(struct uae_prefs *p)
int amigaHeight = p->gfx_size.height;
int pandHeight = 480;
p->gfx_resolution = p->gfx_size.width > 600 ? 1 : 0;
if(amigaWidth > 600)
amigaWidth = amigaWidth / 2; // Hires selected, but we calc in lores
int pandWidth = (amigaWidth * pandHeight) / amigaHeight;
@ -156,7 +139,10 @@ static void open_screen(struct uae_prefs *p)
}
else
{
snprintf(layersize, 20, "%dx%d", picasso_vidinfo.width, picasso_vidinfo.height);
if(picasso_vidinfo.height < 480)
snprintf(layersize, 20, "%dx480", picasso_vidinfo.width);
else
snprintf(layersize, 20, "%dx%d", picasso_vidinfo.width, picasso_vidinfo.height);
#ifndef WIN32
setenv("SDL_OMAP_LAYER_SIZE", layersize, 1);
#endif
@ -181,9 +167,7 @@ static void open_screen(struct uae_prefs *p)
}
else
{
prSDLScreen = SDL_SetVideoMode(picasso_vidinfo.width, picasso_vidinfo.height, 16, SDL_SWSURFACE|SDL_FULLSCREEN);
if(fbdevice == -1)
fbdevice = open("/dev/fb0", O_RDWR); // We have to wait for vsync by hand when no SDL_DOUBLEBUF...
prSDLScreen = SDL_SetVideoMode(picasso_vidinfo.width, picasso_vidinfo.height, 16, SDL_HWSURFACE|SDL_FULLSCREEN|SDL_DOUBLEBUF);
}
if(prSDLScreen != NULL)
{
@ -209,12 +193,14 @@ int check_prefs_changed_gfx (void)
if(currprefs.gfx_size.height != changed_prefs.gfx_size.height ||
currprefs.gfx_size.width != changed_prefs.gfx_size.width ||
currprefs.gfx_size_fs.width != changed_prefs.gfx_size_fs.width)
currprefs.gfx_size_fs.width != changed_prefs.gfx_size_fs.width ||
currprefs.gfx_resolution != changed_prefs.gfx_resolution)
{
cfgfile_configuration_change(1);
currprefs.gfx_size.height = changed_prefs.gfx_size.height;
currprefs.gfx_size.width = changed_prefs.gfx_size.width;
currprefs.gfx_size_fs.width = changed_prefs.gfx_size_fs.width;
currprefs.gfx_resolution = changed_prefs.gfx_resolution;
update_display(&currprefs);
changed = 1;
}
@ -268,18 +254,12 @@ void flush_screen ()
unsigned long start = read_processor_time();
if(start < next_synctime && next_synctime - start > time_per_frame - 1000)
usleep((next_synctime - start) - 750);
if(screen_is_picasso)
{
WaitForVSync();
last_synctime = read_processor_time();
SDL_Flip(prSDLScreen);
}
else
{
SDL_Flip(prSDLScreen);
last_synctime = read_processor_time();
SDL_Flip(prSDLScreen);
last_synctime = read_processor_time();
if(!screen_is_picasso)
gfxvidinfo.bufmem = (uae_u8 *)prSDLScreen->pixels;
}
if(last_synctime - next_synctime > time_per_frame - 1000)
adjust_idletime(0);
@ -421,6 +401,20 @@ static int get_display_depth (void)
}
int GetSurfacePixelFormat(void)
{
int depth = get_display_depth();
int unit = (depth + 1) & 0xF8;
return (unit == 8 ? RGBFB_CHUNKY
: depth == 15 && unit == 16 ? RGBFB_R5G5B5
: depth == 16 && unit == 16 ? RGBFB_R5G6B5
: unit == 24 ? RGBFB_B8G8R8
: unit == 32 ? RGBFB_R8G8B8A8
: RGBFB_NONE);
}
int graphics_init (void)
{
int i,j;
@ -553,102 +547,103 @@ static int save_thumb(char *path)
#ifdef PICASSO96
uae_u16 picasso96_pixel_format = RGBFF_CHUNKY;
void DX_Invalidate (int x, int y, int width, int height)
static int resolution_compare (const void *a, const void *b)
{
// We draw everything direct to the frame buffer
struct PicassoResolution *ma = (struct PicassoResolution *)a;
struct PicassoResolution *mb = (struct PicassoResolution *)b;
if (ma->res.width < mb->res.width)
return -1;
if (ma->res.width > mb->res.width)
return 1;
if (ma->res.height < mb->res.height)
return -1;
if (ma->res.height > mb->res.height)
return 1;
return ma->depth - mb->depth;
}
int DX_BitsPerCannon (void)
static void sortmodes (void)
{
return 8;
}
static int palette_update_start = 256;
static int palette_update_end = 0;
void DX_SetPalette (int start, int count)
{
if (! screen_is_picasso || picasso96_state.RGBFormat != RGBFB_CHUNKY)
return;
if (picasso_vidinfo.pixbytes != 1) {
/* This is the case when we're emulating a 256 color display. */
while (count-- > 0) {
int r = picasso96_state.CLUT[start].Red;
int g = picasso96_state.CLUT[start].Green;
int b = picasso96_state.CLUT[start].Blue;
picasso_vidinfo.clut[start++] =
(doMask256 (r, red_bits, red_shift)
| doMask256 (g, green_bits, green_shift)
| doMask256 (b, blue_bits, blue_shift));
int i = 0, idx = -1;
int pw = -1, ph = -1;
while (DisplayModes[i].depth >= 0)
i++;
qsort (DisplayModes, i, sizeof (struct PicassoResolution), resolution_compare);
for (i = 0; DisplayModes[i].depth >= 0; i++) {
if (DisplayModes[i].res.height != ph || DisplayModes[i].res.width != pw) {
ph = DisplayModes[i].res.height;
pw = DisplayModes[i].res.width;
idx++;
}
notice_screen_contents_lost();
DisplayModes[i].residx = idx;
}
}
int DX_Fill (int dstx, int dsty, int width, int height, uae_u32 color, RGBFTYPE rgbtype)
static void modesList (void)
{
int result = 0;
int i, j;
SDL_Rect rect = {dstx, dsty, width, height};
if (SDL_FillRect (prSDLScreen, &rect, color) == 0) {
DX_Invalidate (dstx, dsty, width, height);
result = 1;
i = 0;
while (DisplayModes[i].depth >= 0) {
write_log ("%d: %s (", i, DisplayModes[i].name);
j = 0;
while (DisplayModes[i].refresh[j] > 0) {
if (j > 0)
write_log (",");
write_log ("%d", DisplayModes[i].refresh[j]);
j++;
}
return result;
write_log (")\n");
i++;
}
}
int DX_FillResolutions (uae_u16 *ppixel_format)
void picasso_InitResolutions (void)
{
struct MultiDisplay *md1;
int i, count = 0;
int w = 0;
int h = 0;
int emulate_chunky = 0;
/* In the new scheme of things, this function is called *before* graphics_init.
* Hence, we need to find the display depth ourselves - Rich */
bitdepth = get_display_depth ();
bit_unit = (bitdepth + 1) & 0xF8;
picasso_vidinfo.rgbformat = (bit_unit == 8 ? RGBFB_CHUNKY
: bitdepth == 15 && bit_unit == 16 ? RGBFB_R5G5B5
: bitdepth == 16 && bit_unit == 16 ? RGBFB_R5G6B5
: bit_unit == 24 ? RGBFB_B8G8R8
: bit_unit == 32 ? RGBFB_A8R8G8B8
: RGBFB_NONE);
*ppixel_format = 1 << picasso_vidinfo.rgbformat;
if (bit_unit == 16 || bit_unit == 32) {
*ppixel_format |= RGBFF_CHUNKY;
// emulate_chunky = 1;
}
char tmp[200];
int bitdepth;
Displays[0].primary = 1;
Displays[0].disabled = 0;
Displays[0].rect.left = 0;
Displays[0].rect.top = 0;
Displays[0].rect.right = 800;
Displays[0].rect.bottom = 640;
sprintf (tmp, "%s (%d*%d)", "Display", Displays[0].rect.right, Displays[0].rect.bottom);
Displays[0].name = my_strdup(tmp);
Displays[0].name2 = my_strdup("Display");
md1 = Displays;
DisplayModes = md1->DisplayModes = (struct PicassoResolution*) xmalloc (sizeof (struct PicassoResolution) * MAX_PICASSO_MODES);
for (i = 0; i < MAX_SCREEN_MODES && count < MAX_PICASSO_MODES; i++) {
int j;
if (SDL_VideoModeOK (x_size_table[i], y_size_table[i], bitdepth, SDL_SWSURFACE))
{
for (j = 0; j <= emulate_chunky && count < MAX_PICASSO_MODES; j++) {
if (x_size_table[i] > picasso_maxw)
picasso_maxw = x_size_table[i];
if (y_size_table[i] > picasso_maxh)
picasso_maxh = y_size_table[i];
DisplayModes[count].res.width = x_size_table[i];
DisplayModes[count].res.height = y_size_table[i];
DisplayModes[count].depth = j == 1 ? 1 : bit_unit >> 3;
DisplayModes[count].refresh = 50;
count++;
}
for(bitdepth = 16; bitdepth <= 32; bitdepth += 16) {
int bit_unit = (bitdepth + 1) & 0xF8;
int rgbFormat = (bitdepth == 16 ? RGBFB_R5G6B5 : RGBFB_R8G8B8A8);
int pixelFormat = 1 << rgbFormat;
pixelFormat |= RGBFF_CHUNKY;
if (SDL_VideoModeOK (x_size_table[i], y_size_table[i], bitdepth, SDL_SWSURFACE))
{
DisplayModes[count].res.width = x_size_table[i];
DisplayModes[count].res.height = y_size_table[i];
DisplayModes[count].depth = bit_unit >> 3;
DisplayModes[count].refresh[0] = 50;
DisplayModes[count].refresh[1] = 60;
DisplayModes[count].refresh[2] = 0;
DisplayModes[count].colormodes = pixelFormat;
sprintf(DisplayModes[count].name, "%dx%d, %d-bit",
DisplayModes[count].res.width, DisplayModes[count].res.height, DisplayModes[count].depth * 8);
count++;
}
}
}
DisplayModes[count].depth = -1;
return count;
sortmodes();
modesList();
DisplayModes = Displays[0].DisplayModes;
}
void gfx_set_picasso_modeinfo (uae_u32 w, uae_u32 h, uae_u32 depth, RGBFTYPE rgbfmt)
@ -682,8 +677,6 @@ void gfx_set_picasso_state (int on)
screen_is_picasso = on;
open_screen(&currprefs);
picasso_vidinfo.rowbytes = prSDLScreen->pitch;
if (on)
DX_SetPalette (0, 256);
}
uae_u8 *gfx_lock_picasso (void)

View file

@ -157,11 +157,22 @@ static struct romdata *scan_single_rom_2 (struct zfile *f)
return 0;
zfile_fread (rombuf, 1, size, f);
if (cl > 0) {
if(decode_cloanto_rom_do (rombuf, size, size))
cl = 0;
decode_cloanto_rom_do (rombuf, size, size);
cl = 0;
}
if (!cl)
if (!cl) {
rd = getromdatabydata (rombuf, size);
if (!rd && (size & 65535) == 0) {
/* check byteswap */
int i;
for (i = 0; i < size; i+=2) {
uae_u8 b = rombuf[i];
rombuf[i] = rombuf[i + 1];
rombuf[i + 1] = b;
}
rd = getromdatabydata (rombuf, size);
}
}
free (rombuf);
return rd;
}
@ -1302,6 +1313,10 @@ void gui_handle_events (void)
}
}
void gui_disk_image_change (int unitnum, const char *name)
{
}
void gui_hd_led (int led)
{
static int resetcounter;

File diff suppressed because it is too large Load diff

View file

@ -31,8 +31,8 @@
#include "include/memory.h"
#include "custom.h"
#include "newcpu.h"
#include "comptbl.h"
#include "compemu.h"
#include "jit/comptbl.h"
#include "jit/compemu.h"
#include <asm/sigcontext.h>
#include <signal.h>

View file

@ -31,6 +31,7 @@
/* #define ACTION_REPLAY */ /* Action Replay 1/2/3 support */
#if !defined(RASPBERRY)
#define PICASSO96 /* Picasso96 display card emulation */
#define UAEGFX_INTERNAL /* built-in libs:picasso96/uaegfx.card */
#endif
/* #define BSDSOCKET */ /* bsdsocket.library emulation */
/* #define CAPS */ /* CAPS-image support */

View file

@ -7,6 +7,8 @@
*/
#include "sysconfig.h"
#include "sysdeps.h"
#include "uae.h"
#define WRITE_LOG_BUF_SIZE 4096
FILE *debugfile = NULL;
@ -42,3 +44,19 @@ void write_log (const char *format,...)
#endif
void jit_abort (const char *format,...)
{
static int happened;
int count;
char buffer[WRITE_LOG_BUF_SIZE];
va_list parms;
va_start (parms, format);
count = vsnprintf (buffer, WRITE_LOG_BUF_SIZE - 1, format, parms);
write_log (buffer);
va_end (parms);
if (!happened)
gui_message ("JIT: Serious error:\n%s", buffer);
happened = 1;
uae_reset (1);
}