Commit add1223e authored by GnoStiC's avatar GnoStiC

puae 2.3.1

parent a2e4c835
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
# this is the main script to build (and test) PUAE # this is the main script to build (and test) PUAE
# #
base=" --with-sdl --with-sdl-gl --with-sdl-gfx --with-sdl-sound --enable-drvsnd " base=" --with-sdl --with-sdl-gl --with-sdl-gfx --with-sdl-sound --enable-drvsnd "
wiqt=" "
cd32=" --enable-cd32 " cd32=" --enable-cd32 "
a600=" --enable-gayle " a600=" --enable-gayle "
scsi=" --enable-scsi-device --enable-ncr --enable-a2091 " scsi=" --enable-scsi-device --enable-ncr --enable-a2091 "
......
...@@ -1163,10 +1163,10 @@ static void akiko_internal (void) ...@@ -1163,10 +1163,10 @@ static void akiko_internal (void)
void AKIKO_hsync_handler (void) void AKIKO_hsync_handler (void)
{ {
unsigned int i;
if (!currprefs.cs_cd32cd || !akiko_inited) if (!currprefs.cs_cd32cd || !akiko_inited)
return; return;
unsigned int i;
static float framecounter; static float framecounter;
framecounter--; framecounter--;
if (framecounter <= 0) { if (framecounter <= 0) {
......
...@@ -109,7 +109,8 @@ struct audio_channel_data { ...@@ -109,7 +109,8 @@ struct audio_channel_data {
static int samplecnt; static int samplecnt;
#if SOUNDSTUFF > 0 #if SOUNDSTUFF > 0
int extrasamples, outputsample, doublesample; static int extrasamples;
int outputsample, doublesample;
#endif #endif
int sampleripper_enabled; int sampleripper_enabled;
...@@ -292,7 +293,8 @@ int sound_available = 0; ...@@ -292,7 +293,8 @@ int sound_available = 0;
void (*sample_handler) (void); void (*sample_handler) (void);
static void (*sample_prehandler) (unsigned long best_evtime); static void (*sample_prehandler) (unsigned long best_evtime);
float sample_evtime, scaled_sample_evtime; static float sample_evtime;
float scaled_sample_evtime;
static unsigned long last_cycles; static unsigned long last_cycles;
static float next_sample_evtime; static float next_sample_evtime;
...@@ -1840,7 +1842,7 @@ void AUDxDAT (int nr, uae_u16 v, uaecptr addr) ...@@ -1840,7 +1842,7 @@ void AUDxDAT (int nr, uae_u16 v, uaecptr addr)
do_samplerip (cdp); do_samplerip (cdp);
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
if (debugchannel (nr)) if (debugchannel (nr))
write_log ("AUD%d looped, IRQ=%d, LC=%08X LEN=%d\n", nr, isirq (nr), cdp->pt, cdp->wlen); write_log ("AUD%d looped, IRQ=%d, LC=%08X LEN=%d\n", nr, isirq (nr) ? 1 : 0, cdp->pt, cdp->wlen);
#endif #endif
} else { } else {
cdp->wlen = (cdp->wlen - 1) & 0xffff; cdp->wlen = (cdp->wlen - 1) & 0xffff;
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include "bsdsocket.h" #include "bsdsocket.h"
#include "native2amiga.h" #include "native2amiga.h"
#define TRUE 1
#define FALSE 0
#ifdef BSDSOCKET #ifdef BSDSOCKET
#ifdef WIN32 #ifdef WIN32
...@@ -154,17 +156,17 @@ BOOL checksd(SB, int sd) ...@@ -154,17 +156,17 @@ BOOL checksd(SB, int sd)
if (iCounter != sd) { if (iCounter != sd) {
if (getsock(sb,iCounter) == s) { if (getsock(sb,iCounter) == s) {
releasesock(sb,sd); releasesock(sb,sd);
return 1; return TRUE;
} }
} }
} }
for (iCounter = 0; iCounter < SOCKPOOLSIZE; iCounter++) { for (iCounter = 0; iCounter < SOCKPOOLSIZE; iCounter++) {
if (s == sockdata->sockpoolsocks[iCounter]) if (s == sockdata->sockpoolsocks[iCounter])
return 1; return TRUE;
} }
} }
BSDTRACE(("checksd FALSE s 0x%x sd %d\n",s,sd)); BSDTRACE(("checksd FALSE s 0x%x sd %d\n",s,sd));
return 0; return FALSE;
} }
void setsd(SB, int sd, SOCKET_TYPE s) void setsd(SB, int sd, SOCKET_TYPE s)
......
...@@ -315,10 +315,8 @@ void catweasel_do_bput (uaecptr addr, uae_u32 b) ...@@ -315,10 +315,8 @@ void catweasel_do_bput (uaecptr addr, uae_u32 b)
} else { } else {
#endif #endif
ioport_write (cwc.iobase + addr, b); ioport_write (cwc.iobase + addr, b);
#if 0
} }
//write_log ("P %02X %02X %d\n", (uae_u8)addr, (uae_u8)b, did_read); //write_log ("P %02X %02X %d\n", (uae_u8)addr, (uae_u8)b, did_read);
#endif
} }
#include "core.cw4.cpp" #include "core.cw4.cpp"
......
...@@ -303,7 +303,7 @@ static void REGPARAM2 fmv_lput (uaecptr addr, uae_u32 w) ...@@ -303,7 +303,7 @@ static void REGPARAM2 fmv_lput (uaecptr addr, uae_u32 w)
fmv_wput (addr + 2, w >> 0); fmv_wput (addr + 2, w >> 0);
} }
extern addrbank fmv_bank; //extern addrbank fmv_bank;
static void REGPARAM2 fmv_bput (uaecptr addr, uae_u32 w) static void REGPARAM2 fmv_bput (uaecptr addr, uae_u32 w)
{ {
...@@ -370,7 +370,7 @@ static uae_u8 *REGPARAM2 fmv_xlate (uaecptr addr) ...@@ -370,7 +370,7 @@ static uae_u8 *REGPARAM2 fmv_xlate (uaecptr addr)
return rom + addr; return rom + addr;
} }
addrbank fmv_bank = { static addrbank fmv_bank = {
fmv_lget, fmv_wget, fmv_bget, fmv_lget, fmv_wget, fmv_bget,
fmv_lput, fmv_wput, fmv_bput, fmv_lput, fmv_wput, fmv_bput,
fmv_xlate, fmv_check, NULL, "CD32 FMV module", fmv_xlate, fmv_check, NULL, "CD32 FMV module",
......
...@@ -765,8 +765,6 @@ static void init_play (int start, int end) ...@@ -765,8 +765,6 @@ static void init_play (int start, int end)
bool cdtv_front_panel (int button) bool cdtv_front_panel (int button)
{ {
unsigned int j;
if (!frontpanel || configured <= 0) if (!frontpanel || configured <= 0)
return false; return false;
if (button < 0) if (button < 0)
...@@ -792,6 +790,7 @@ bool cdtv_front_panel (int button) ...@@ -792,6 +790,7 @@ bool cdtv_front_panel (int button)
uae_u8 *sq = cdrom_qcode + 4; uae_u8 *sq = cdrom_qcode + 4;
int track = frombcd (sq[1]); int track = frombcd (sq[1]);
int pos = 0; int pos = 0;
unsigned int j;
for (j = 0; j < toc.points; j++) { for (j = 0; j < toc.points; j++) {
int t = toc.toc[j].track; int t = toc.toc[j].track;
pos = toc.toc[j].paddress; pos = toc.toc[j].paddress;
...@@ -1861,7 +1860,6 @@ uae_u8 *save_cdtv (int *len, uae_u8 *dstptr) ...@@ -1861,7 +1860,6 @@ uae_u8 *save_cdtv (int *len, uae_u8 *dstptr)
uae_u8 *restore_cdtv (uae_u8 *src) uae_u8 *restore_cdtv (uae_u8 *src)
{ {
unsigned int i; unsigned int i;
cdtv_free (); cdtv_free ();
if (!currprefs.cs_cdtvcd) { if (!currprefs.cs_cdtvcd) {
changed_prefs.cs_cdtvcd = changed_prefs.cs_cdtvram = true; changed_prefs.cs_cdtvcd = changed_prefs.cs_cdtvram = true;
......
...@@ -97,24 +97,6 @@ static void uae_abort (const TCHAR *format,...) ...@@ -97,24 +97,6 @@ static void uae_abort (const TCHAR *format,...)
nomore = 1; nomore = 1;
} }
#if 0
void customhack_put (struct customhack *ch, uae_u16 v, int hpos)
{
ch->v = v;
ch->vpos = vpos;
ch->hpos = hpos;
}
uae_u16 customhack_get (struct customhack *ch, int hpos)
{
if (ch->vpos == vpos && ch->hpos == hpos) {
ch->vpos = -1;
return 0xffff;
}
return ch->v;
}
#endif
uae_u16 last_custom_value1; uae_u16 last_custom_value1;
static unsigned int n_consecutive_skipped = 0; static unsigned int n_consecutive_skipped = 0;
...@@ -233,7 +215,7 @@ static uae_u16 sprdata[MAX_SPRITES][1], sprdatb[MAX_SPRITES][1]; ...@@ -233,7 +215,7 @@ static uae_u16 sprdata[MAX_SPRITES][1], sprdatb[MAX_SPRITES][1];
#endif #endif
static int sprite_last_drawn_at[MAX_SPRITES]; static int sprite_last_drawn_at[MAX_SPRITES];
static int last_sprite_point, nr_armed; static int last_sprite_point, nr_armed;
int sprite_width, sprres; static int sprite_width, sprres;
int sprite_buffer_res; int sprite_buffer_res;
#ifdef CPUEMU_12 #ifdef CPUEMU_12
...@@ -264,16 +246,16 @@ enum diw_states ...@@ -264,16 +246,16 @@ enum diw_states
DIW_waiting_start, DIW_waiting_stop DIW_waiting_start, DIW_waiting_stop
}; };
int plffirstline, plflastline; static int plffirstline, plflastline;
int plffirstline_total, plflastline_total; int plffirstline_total, plflastline_total;
static int autoscale_bordercolors; static int autoscale_bordercolors;
int plfstrt_start, plfstrt, plfstop; static int plfstrt_start, plfstrt, plfstop;
static int sprite_minx, sprite_maxx; static int sprite_minx, sprite_maxx;
static int first_bpl_vpos; static int first_bpl_vpos;
static int last_ddf_pix_hpos; static int last_ddf_pix_hpos;
static int last_decide_line_hpos; static int last_decide_line_hpos;
static int last_fetch_hpos, last_sprite_hpos; static int last_fetch_hpos, last_sprite_hpos;
int diwfirstword, diwlastword; static int diwfirstword, diwlastword;
static int plfleft_real; static int plfleft_real;
static int last_hdiw; static int last_hdiw;
static enum diw_states diwstate, hdiwstate, ddfstate; static enum diw_states diwstate, hdiwstate, ddfstate;
...@@ -334,15 +316,15 @@ int bogusframe; ...@@ -334,15 +316,15 @@ int bogusframe;
/* Recording of custom chip register changes. */ /* Recording of custom chip register changes. */
static int current_change_set; static int current_change_set;
struct sprite_entry sprite_entries[2][MAX_SPR_PIXELS / 16]; static struct sprite_entry sprite_entries[2][MAX_SPR_PIXELS / 16];
struct color_change color_changes[2][MAX_REG_CHANGE]; static struct color_change color_changes[2][MAX_REG_CHANGE];
struct decision line_decisions[2 * (MAXVPOS + 2) + 1]; struct decision line_decisions[2 * (MAXVPOS + 2) + 1];
struct draw_info line_drawinfo[2][2 * (MAXVPOS + 2) + 1]; static struct draw_info line_drawinfo[2][2 * (MAXVPOS + 2) + 1];
#define COLOR_TABLE_SIZE (MAXVPOS + 2) * 2 #define COLOR_TABLE_SIZE (MAXVPOS + 2) * 2
struct color_entry color_tables[2][COLOR_TABLE_SIZE]; static struct color_entry color_tables[2][COLOR_TABLE_SIZE];
int next_sprite_entry = 0; static int next_sprite_entry = 0;
static int prev_next_sprite_entry; static int prev_next_sprite_entry;
static int next_sprite_forced = 1; static int next_sprite_forced = 1;
...@@ -5221,7 +5203,7 @@ STATIC_INLINE int trigger_frh (int v) ...@@ -5221,7 +5203,7 @@ STATIC_INLINE int trigger_frh (int v)
return (v & (N_LINES - 1)) == 0; return (v & (N_LINES - 1)) == 0;
} }
long int diff32 (frame_time_t x, frame_time_t y) static long int diff32 (frame_time_t x, frame_time_t y)
{ {
return (long int)(x - y); return (long int)(x - y);
} }
......
...@@ -25,11 +25,25 @@ AR_FLAGS = $(LIBS) ...@@ -25,11 +25,25 @@ AR_FLAGS = $(LIBS)
noinst_LIBRARIES = libguidep.a noinst_LIBRARIES = libguidep.a
libguidep_a_SOURCES = puae_mainwindow.cpp moc_puae_mainwindow.cpp puae_bridge.cpp moc_puae_bridge.cpp puae_misc.cpp moc_puae_misc.cpp libguidep_a_SOURCES = \
puae_mainwindow.cpp moc_puae_mainwindow.cpp \
noinst_HEADERS = puae_mainwindow.h ui_puae_mainwindow.h puae_bridge.h puae_misc.h puae_bridge.cpp moc_puae_bridge.cpp \
puae_misc.cpp moc_puae_misc.cpp \
BUILT_SOURCES = moc_puae_mainwindow.cpp moc_puae_bridge.cpp moc_puae_misc.cpp ui_puae_mainwindow.h puae_registry.cpp moc_puae_registry.cpp
noinst_HEADERS = \
ui_puae_mainwindow.h \
puae_mainwindow.h \
puae_bridge.h \
puae_misc.h \
puae_registry.h
BUILT_SOURCES = \
moc_puae_mainwindow.cpp \
moc_puae_bridge.cpp \
moc_puae_misc.cpp \
moc_puae_registry.cpp \
ui_puae_mainwindow.h
CLEANFILES = *.o qrc*.* ui*.* moc*.* CLEANFILES = *.o qrc*.* ui*.* moc*.*
......
...@@ -8,6 +8,20 @@ ...@@ -8,6 +8,20 @@
* *
*/ */
// REMOVEME>tmp stuff from *.h
#define CSMASK_ECS_AGNUS 1
#define CSMASK_ECS_DENISE 2
#define CSMASK_AGA 4
#define CSMASK_MASK (CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE | CSMASK_AGA)
#define VRES_NONDOUBLE 0
#define VRES_DOUBLE 1
#define VRES_MAX 1
#define DEFAULT_SOUND_MAXB 16384
// REMOVEME>tmp stuff from *.h
#include "puae_registry.h"
#include "puae_mainwindow.h" #include "puae_mainwindow.h"
#include "ui_puae_mainwindow.h" #include "ui_puae_mainwindow.h"
...@@ -20,24 +34,21 @@ ...@@ -20,24 +34,21 @@
#define hDlg 0 #define hDlg 0
extern "C" { extern "C" {
#include "include/rommgr.h"
#include "include/options.h" #include "include/options.h"
extern int candirect; extern int candirect;
extern bool canbang; extern bool canbang;
struct uae_prefs workprefs; struct uae_prefs workprefs;
}
// defs from *.h
#define CSMASK_ECS_AGNUS 1
#define CSMASK_ECS_DENISE 2
#define CSMASK_AGA 4
#define CSMASK_MASK (CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE | CSMASK_AGA)
#define VRES_NONDOUBLE 0
#define VRES_DOUBLE 1
#define VRES_MAX 1
#define DEFAULT_SOUND_MAXB 16384 // REMOVEME>tmp
extern const char *uae_archive_extensions[];
#ifdef ARCADIA
extern struct romdata *scan_arcadia_rom (char*, int);
#endif
// REMOVEME>tmp
}
//
int full_property_sheet = 1; int full_property_sheet = 1;
// Paths Tab // Paths Tab
...@@ -745,6 +756,95 @@ void puae_MainWindow::on_IDC_FLOPPYSPD_valueChanged(int value) ...@@ -745,6 +756,95 @@ void puae_MainWindow::on_IDC_FLOPPYSPD_valueChanged(int value)
out_floppyspeed(); out_floppyspeed();
} }
//
// Santa's Little Helpers
//
int puae_MainWindow::isromext (const char *path, bool deepscan)
{
const TCHAR *ext;
int i;
if (!path)
return 0;
ext = strrchr (path, '.');
if (!ext)
return 0;
ext++;
if (!strcasecmp (ext, "rom") || !strcasecmp (ext, "adf") || !strcasecmp (ext, "key")
|| !strcasecmp (ext, "a500") || !strcasecmp (ext, "a1200") || !strcasecmp (ext, "a4000") || !strcasecmp (ext, "cd32"))
return 1;
if (strlen (ext) >= 2 && toupper(ext[0]) == 'U' && isdigit (ext[1]))
return 1;
if (!deepscan)
return 0;
for (i = 0; uae_archive_extensions[i]; i++) {
if (!strcasecmp (ext, uae_archive_extensions[i]))
return 1;
}
return 0;
}
bool puae_MainWindow::scan_rom_hook (const char *name, int line)
{
/* MSG msg;
if (!infoboxhwnd)
return true;
if (name != NULL) {
const char *s = NULL;
if (line == 2) {
s = strrchr (name, '/');
if (!s)
s = strrchr (name, '\\');
if (s)
s++;
}
SetWindowText (GetDlgItem (infoboxhwnd, line == 1 ? IDC_INFOBOX_TEXT1 : (line == 2 ? IDC_INFOBOX_TEXT2 : IDC_INFOBOX_TEXT3)), s ? s : name);
}
while (PeekMessage (&msg, infoboxhwnd, 0, 0, PM_REMOVE)) {
if (!IsDialogMessage (infoboxhwnd, &msg)) {
TranslateMessage (&msg);
DispatchMessage (&msg);
}
}
return infoboxdialogstate;*/
return false;
}
int puae_MainWindow::addrom (struct romdata *rd, const char *name)
{
char tmp1[MAX_DPATH], tmp2[MAX_DPATH];
printf (tmp1, "ROM_%03d", rd->id);
}
int puae_MainWindow::scan_rom (const char *path, bool deepscan)
{
struct romdata *rd;
int cnt = 0;
if (!isromext (path, deepscan)) {
return 0;
}
scan_rom_hook (path, 2);
#ifdef ARCADIA
for (;;) {
char tmp[MAX_DPATH];
strcpy (tmp, path);
rd = scan_arcadia_rom (tmp, cnt++);
if (rd) {
if (!addrom (rd, tmp))
return 1;
continue;
}
break;
}
#endif
return 0;
}
void puae_MainWindow::display_fromselect (int val, int *fs, int *vsync, int p96) void puae_MainWindow::display_fromselect (int val, int *fs, int *vsync, int p96)
{ {
int ofs = *fs; int ofs = *fs;
...@@ -794,9 +894,6 @@ void puae_MainWindow::display_fromselect (int val, int *fs, int *vsync, int p96) ...@@ -794,9 +894,6 @@ void puae_MainWindow::display_fromselect (int val, int *fs, int *vsync, int p96)
} }
} }
//
// Santa's Little Helpers
//
int puae_MainWindow::getcpufreq (int m) int puae_MainWindow::getcpufreq (int m)
{ {
int f; int f;
......
...@@ -119,6 +119,10 @@ private slots: ...@@ -119,6 +119,10 @@ private slots:
void updatez3 (unsigned int *size1p, unsigned int *size2p); void updatez3 (unsigned int *size1p, unsigned int *size2p);
int getcpufreq (int); int getcpufreq (int);
void display_fromselect (int val, int *fs, int *vsync, int p96); void display_fromselect (int val, int *fs, int *vsync, int p96);
int isromext (const char *path, bool deepscan);
int scan_rom (const char *path, bool deepscan);
bool scan_rom_hook (const char *name, int line);
int addrom (struct romdata *rd, const char *name);
// //
void enable_for_memorydlg (); void enable_for_memorydlg ();
void values_to_memorydlg (); void values_to_memorydlg ();
......
...@@ -139,7 +139,6 @@ extern frame_time_t syncbase; ...@@ -139,7 +139,6 @@ extern frame_time_t syncbase;
#define CYCLE_CPUNASTY 0x80 #define CYCLE_CPUNASTY 0x80
extern unsigned long frametime, timeframes; extern unsigned long frametime, timeframes;
extern int plfstrt, plfstop, plffirstline, plflastline;
extern uae_u16 htotal, vtotal, beamcon0; extern uae_u16 htotal, vtotal, beamcon0;
/* 100 words give you 1600 horizontal pixels. Should be more than enough for /* 100 words give you 1600 horizontal pixels. Should be more than enough for
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#define max_diwlastword (PIXEL_XPOS(0x1d4 >> 1)) #define max_diwlastword (PIXEL_XPOS(0x1d4 >> 1))
extern int lores_factor, lores_shift, sprite_width, interlace_seen; extern int lores_factor, lores_shift, interlace_seen;
extern bool aga_mode, direct_rgb; extern bool aga_mode, direct_rgb;
STATIC_INLINE int coord_hw_to_window_x (int x) STATIC_INLINE int coord_hw_to_window_x (int x)
...@@ -200,13 +200,6 @@ extern uae_u16 spixels[MAX_SPR_PIXELS * 2]; ...@@ -200,13 +200,6 @@ extern uae_u16 spixels[MAX_SPR_PIXELS * 2];
/* Way too much... */ /* Way too much... */
#define MAX_REG_CHANGE ((MAXVPOS + 1) * 2 * MAXHPOS) #define MAX_REG_CHANGE ((MAXVPOS + 1) * 2 * MAXHPOS)
#ifdef OS_WITHOUT_MEMORY_MANAGEMENT
extern struct color_change *color_changes[2];
#else
extern struct color_change color_changes[2][MAX_REG_CHANGE];
#endif
extern struct color_entry color_tables[2][(MAXVPOS + 2) * 2];
extern struct color_entry *curr_color_tables, *prev_color_tables; extern struct color_entry *curr_color_tables, *prev_color_tables;
extern struct sprite_entry *curr_sprite_entries, *prev_sprite_entries; extern struct sprite_entry *curr_sprite_entries, *prev_sprite_entries;
...@@ -241,8 +234,6 @@ struct draw_info { ...@@ -241,8 +234,6 @@ struct draw_info {
int nr_color_changes, nr_sprites; int nr_color_changes, nr_sprites;
}; };
extern int next_sprite_entry;
extern struct decision line_decisions[2 * (MAXVPOS + 2) + 1]; extern struct decision line_decisions[2 * (MAXVPOS + 2) + 1];
extern uae_u8 line_data[(MAXVPOS + 2) * 2][MAX_PLANES * MAX_WORDS_PER_LINE * 2]; extern uae_u8 line_data[(MAXVPOS + 2) * 2][MAX_PLANES * MAX_WORDS_PER_LINE * 2];
...@@ -283,7 +274,6 @@ extern void putpixel (uae_u8 *buf, int bpp, int x, xcolnr c8, int opaq); ...@@ -283,7 +274,6 @@ extern void putpixel (uae_u8 *buf, int bpp, int x, xcolnr c8, int opaq);
/* Finally, stuff that shouldn't really be shared. */ /* Finally, stuff that shouldn't really be shared. */
extern int thisframe_first_drawn_line, thisframe_last_drawn_line; extern int thisframe_first_drawn_line, thisframe_last_drawn_line;
extern int diwfirstword, diwlastword;
#define IHF_SCROLLLOCK 0 #define IHF_SCROLLLOCK 0
#define IHF_QUIT_PROGRAM 1 #define IHF_QUIT_PROGRAM 1
......
/* Let's see whether hiding this away somewhere where the compiler can't /* Let's see whether hiding this away somewhere where the compiler can't
see it will cure it of its silly urge to mis-optimize the comparison */ see it will cure it of its silly urge to mis-optimize the comparison */
extern long int diff32(frame_time_t x, frame_time_t y); //extern long int diff32(frame_time_t x, frame_time_t y);
extern int pissoff_value; extern int pissoff_value;
STATIC_INLINE void events_schedule (void) STATIC_INLINE void events_schedule (void)
......
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