[Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx:[658] vendor/fuse-emulator/current
Brought to you by:
fredm
From: <fr...@us...> - 2010-12-07 12:35:31
|
Revision: 658 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=658&view=rev Author: fredm Date: 2010-12-07 12:35:24 +0000 (Tue, 07 Dec 2010) Log Message: ----------- Load . into vendor/fuse-emulator/current. Modified Paths: -------------- vendor/fuse-emulator/current/fuse/hacking/ChangeLog vendor/fuse-emulator/current/fuse/man/fuse.1 vendor/fuse-emulator/current/fuse/memory.c vendor/fuse-emulator/current/fuse/ui/fb/fbdisplay.c vendor/fuse-emulator/current/fuse-utils/Makefile.am vendor/fuse-emulator/current/fuse-utils/hacking/ChangeLog vendor/fuse-emulator/current/libspectrum/hacking/ChangeLog vendor/fuse-emulator/current/libspectrum/warajevo_read.c Modified: vendor/fuse-emulator/current/fuse/hacking/ChangeLog =================================================================== --- vendor/fuse-emulator/current/fuse/hacking/ChangeLog 2010-10-19 11:21:18 UTC (rev 657) +++ vendor/fuse-emulator/current/fuse/hacking/ChangeLog 2010-12-07 12:35:24 UTC (rev 658) @@ -3361,3 +3361,12 @@ 20101011 ui/gtk/gtkdisplay.c: resize window when machine selection switches between Timex and non-Timex modes (fixes bug #3084862) (thanks, Phil) (Fred). +20101025 memory.c: writable_roms preference shouldn't affect the 16K machine + "empty" page (thanks, Andrew Owen) (Fred). +20101029 man/fuse.1: some updates to bring things a bit more up to date (Fred). +20101102 man/fuse.1: remove reference to fixed issue in RZX playback command + line ordering (patch #3100707) (Sergio Baldovi). +20101129 ui/fb/fbdisplay.c: only call fbdisplay_end() when display is + initialised (fixes bug #3119382) (rkd77). +20101203 ui/fb/fbdisplay.c: improve fb colour handling and initialise scaler + system (fixes bugs #3124787 and #3124788) (rkd77). Modified: vendor/fuse-emulator/current/fuse/man/fuse.1 =================================================================== --- vendor/fuse-emulator/current/fuse/man/fuse.1 2010-10-19 11:21:18 UTC (rev 657) +++ vendor/fuse-emulator/current/fuse/man/fuse.1 2010-12-07 12:35:24 UTC (rev 658) @@ -54,10 +54,12 @@ virtual-tape files. Saving to SZX, Z80 and SNA snapshots and TZX and TAP tape files is supported. The SLT extension to the Z80 format is partly supported (enough for multi-load games); however, loading of -the old DAT-file variant is not. DSK disk images are supported when -emulating a +3, TRD and SCL disk images are supported when emulating -a Pentagon or Scorpion and DCK cartridge images are supported when -emulating a Timex 2068 variant. Interface II ROM cartridges are also +the old DAT-file variant is not. DSK, UDI, FDI, TR0, SDF, MGT, IMG, +SAD, TRD, SCL and OPD disk images are supported when a disk interface +is being emulated, including the integrated disk drives on +3, +Pentagon or Scorpion machines as well as the +D, Opus Discovery and +Beta 128 interfaces. DCK cartridge images are supported when +emulating a Timex 2068 variant. Interface II ROM cartridges are also supported. .PP Finally, there is also support for reading and writing the RZX input recording @@ -435,6 +437,7 @@ a 48K Spectrum. The available options are .IR 16 , .IR 48 , +.IR 48_ntsc, .IR 128 , .IR plus2 , .IR plus2a , @@ -445,8 +448,9 @@ .IR pentagon , .IR pentagon512 , .IR pentagon1024 , +.IR scorpion and -.IR scorpion . +.IR se . .RE .PP .I "\-\-melodik" @@ -1669,9 +1673,9 @@ .RE .PP .I "AY volume" +.RS +Sets the relative volume of the AY-3-8912 chip from a range of 0-100%. .RE -Sets the relative volume of the AY-3-8912 chip from a range of 0-100%. -.RS .PP .I "Beeper volume" .RS @@ -2104,6 +2108,12 @@ of RAM respectively. .RE .PP +.I "Spectrum 48K (NTSC)" +.RS +The NTSC 48K machine released in limited numbers in parts of South +America. +.RE +.PP .I "Spectrum 128K" .RS The 128K machine as released by Sinclair in 1985 (Spain) or 1986 (UK). @@ -3494,13 +3504,16 @@ .\" .SH BETA 128 EMULATION .PP -Fuse supports .SCL and .TRD images in its Pentagon and Scorpion +Fuse supports Betadisk emulation in its Pentagon and Scorpion emulation, and also under 48K, TC2048, 128K and +2 (but not +2A) emulation if the .I Beta 128 interface option from the .I "Options, Peripherals..." dialog is enabled. +See the +.B "DISK FILE FORMATS" +section for mode details on supported disk file formats. .\" .\"------------------------------------------------------------------ .\" @@ -3508,7 +3521,9 @@ .PP By default, Fuse emulates the Opus Discovery interface with the optional 2k RAM expansion and a second 40 track single sided disk drive. -Fuse supports .OPD and .OPU images in its Opus Discovery emulation. The Opus +See the +.B "DISK FILE FORMATS" +section for mode details on supported disk file formats. The Opus Discovery's printer port is also emulated for output only. (See the .B "PRINTER EMULATION" section for more details.) The Opus Discovery may only be @@ -3519,7 +3534,9 @@ .\" .SH +D EMULATION .PP -Fuse supports .MGT and .IMG images in its +D emulation. The +D's +Fuse supports emulating the +D disk and printer interface. See the +.B "DISK FILE FORMATS" +section for mode details on supported disk file formats. The +D's printer port is emulated. (See the .B "PRINTER EMULATION" section for more details.) The +D may only be @@ -3674,13 +3691,6 @@ Selecting a startup filter doesn't work properly with user interfaces other than SDL and GTK+. .PP -Attempting to replay an RZX file without an embedded snapshot from the -command-line doesn't work if you do `./fuse -.IR "rzxfile snapshot" '. -`./fuse -.IR "snapshot rzxfile" ' -does work though, so use that instead. -.PP Changing virtual consoles when using SVGAlib for joystick support causes Fuse to exit. If this is a problem, compile Fuse with the .RI ` \-\-disable\-ui\-joystick ' Modified: vendor/fuse-emulator/current/fuse/memory.c =================================================================== --- vendor/fuse-emulator/current/fuse/memory.c 2010-10-19 11:21:18 UTC (rev 657) +++ vendor/fuse-emulator/current/fuse/memory.c 2010-12-07 12:35:24 UTC (rev 658) @@ -1,7 +1,7 @@ /* memory.c: Routines for accessing memory Copyright (c) 1999-2004 Philip Kendall - $Id: memory.c 4099 2009-10-22 10:59:02Z fredm $ + $Id: memory.c 4186 2010-10-25 10:29:45Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -276,7 +276,9 @@ if( opus_active && address >= 0x2800 && address < 0x3800 ) { opus_write( address, b ); - } else if( mapping->writable || settings_current.writable_roms ) { + } else if( mapping->writable || + (mapping->bank != MEMORY_BANK_NONE && + settings_current.writable_roms) ) { libspectrum_word offset = address & 0x1fff; libspectrum_byte *memory = mapping->page; Modified: vendor/fuse-emulator/current/fuse/ui/fb/fbdisplay.c =================================================================== --- vendor/fuse-emulator/current/fuse/ui/fb/fbdisplay.c 2010-10-19 11:21:18 UTC (rev 657) +++ vendor/fuse-emulator/current/fuse/ui/fb/fbdisplay.c 2010-12-07 12:35:24 UTC (rev 658) @@ -2,7 +2,7 @@ Copyright (c) 2000-2003 Philip Kendall, Matan Ziv-Av, Darren Salt, Witold Filipczyk - $Id: fbdisplay.c 3992 2009-03-29 11:28:17Z fredm $ + $Id: fbdisplay.c 4205 2010-12-03 10:39:39Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,6 +27,7 @@ #include <config.h> #include <errno.h> +#include <math.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> @@ -66,7 +67,7 @@ /* Are we in a Timex display mode? */ static int hires; -static int register_scalers( void ); +static void register_scalers( void ); /* probably 0rrrrrgggggbbbbb */ static short rgbs[16], greys[16]; @@ -77,6 +78,7 @@ static struct fb_fix_screeninfo fixed; static struct fb_var_screeninfo orig_display, display; static int got_orig_display = 0; +static int changed_palette = 0; unsigned long fb_resolution; /* == xres << 16 | yres */ #define FB_RES(X,Y) ((X) << 16 | (Y)) @@ -127,20 +129,20 @@ { 320, 240, 80000, 40, 28, 9, 2, 20, 3, 0, 1 }, ** 320x240-60 60.310 M tall { 320, 240, 55555, 52, 16, 12, 0, 28, 2, 0, 1 }, ** 320x240-85 85.177 M */ + +static unsigned short red16[256], green16[256], blue16[256], transp16[256]; +static struct fb_cmap orig_cmap = {0, 256, red16, green16, blue16, transp16}; + static int fb_set_mode( void ); int uidisplay_init( int width, int height ) { - int error; - hires = ( width == 640 ? 1 : 0 ); - scaler_register_clear(); - image_width = width; image_height = height; image_scale = width / DISPLAY_ASPECT_WIDTH; - error = register_scalers(); if( error ) return error; + register_scalers(); display_ui_initialised = 1; @@ -149,20 +151,40 @@ return 0; } -static int +static void register_scalers( void ) { - return 0; + scaler_register_clear(); + scaler_select_bitformat( 565 ); /* 16bit always */ + scaler_register( SCALER_NORMAL ); } +static void +linear_palette(struct fb_cmap *p_cmap) +{ + int i; + int rcols = 1 << display.red.length; + int gcols = 1 << display.green.length; + int bcols = 1 << display.blue.length; + + for (i = 0; i < rcols; i++) + p_cmap->red[i] = (65535 / (rcols - 1)) * i; + + for (i = 0; i < gcols; i++) + p_cmap->green[i] = (65535 / (gcols - 1)) * i; + + for (i = 0; i < bcols; i++) + p_cmap->blue[i] = (65535 / (bcols - 1)) * i; +} + int fbdisplay_init(void) { int i; const char *dev; - static libspectrum_word paldata[20] = { 0, 0xbbbb, 0xffff }; - static const struct fb_cmap fb_cmap = { - 0, 20, paldata, paldata, paldata, NULL + static libspectrum_word r16[256], g16[256], b16[256]; + static struct fb_cmap fb_cmap = { + 0, 256, r16, g16, b16, NULL }; dev = getenv( DEVICE_VARIABLE ); @@ -187,32 +209,41 @@ fputs( "\x1B[H\x1B[J", stdout ); /* clear tty */ memset( gm, 0, display.xres_virtual * display.yres_virtual * 2 ); - for( i = 0; i < 16; i++ ) { - int v = ( i & 8 ) ? 2 : 1; - rgbs[i] = ( ( i & 1 ) ? v << display.blue.offset : 0 ) - | ( ( i & 2 ) ? v << display.red.offset : 0 ) - | ( ( i & 4 ) ? v << display.green.offset : 0 ); - v = ( i & 8 ) ? 15 : 11; - paldata[i+4] = ( ( (i & 1) ? v * 7471 : 0) /* 0.114 */ - + ( (i & 2) ? v * 19595 : 0) /* 0.299 */ - + ( (i & 4) ? v * 38469 : 0) /* 0.587 */ - ) / 15; - greys[i] = (i + 4) << display.blue.offset - | (i + 4) << display.red.offset - | (i + 4) << display.green.offset; - } - display.activate = FB_ACTIVATE_NOW; - if( ioctl( fb_fd, FBIOPUT_VSCREENINFO, &display ) || - ioctl( fb_fd, FBIOPUTCMAP, &fb_cmap ) ) { + if( ioctl( fb_fd, FBIOPUT_VSCREENINFO, &display ) ) { fprintf( stderr, "%s: couldn't set mode for framebuffer device '%s'\n", fuse_progname, dev ); return 1; } - ioctl( fb_fd, FBIOGET_VSCREENINFO, &display ); + ioctl( fb_fd, FBIOGET_VSCREENINFO, &display); + for( i = 0; i < 16; i++ ) { + int v = ( i & 8 ) ? 0xff : 0xbf; + int c; + rgbs[i] = ( ( i & 1 ) ? (v >> (8 - display.blue.length)) << display.blue.offset : 0 ) + | ( ( i & 2 ) ? (v >> (8 - display.red.length)) << display.red.offset : 0 ) + | ( ( i & 4 ) ? (v >> (8 - display.green.length)) << display.green.offset : 0 ); + + c = (( i & 1 ) ? (v * 0.114) : 0.0) + + (( i & 2) ? (v * 0.299) : 0.0) + + (( i & 4) ? (v * 0.587) : 0.0) + 0.5; + greys[i] = (c >> (8 - display.red.length) << display.red.offset) + | (c >> (8 - display.green.length) << display.green.offset) + | (c >> (8 - display.blue.length) << display.blue.offset); + } + linear_palette(&fb_cmap); + + if (orig_display.bits_per_pixel == 8 || fixed.visual == FB_VISUAL_DIRECTCOLOR) { + ioctl( fb_fd, FBIOGETCMAP, &orig_cmap); + changed_palette = 1; + } + ioctl( fb_fd, FBIOGET_FSCREENINFO, &fixed); + if ( fixed.visual == FB_VISUAL_DIRECTCOLOR) { + ioctl( fb_fd, FBIOPUTCMAP, &fb_cmap ); + } sleep( 1 ); /* give the monitor time to sync before we start emulating */ + fputs( "\x1B[?25l", stdout ); /* hide cursor */ fflush( stdout ); @@ -396,8 +427,6 @@ int uidisplay_end( void ) { - fbdisplay_end(); - display_ui_initialised = 0; return 0; } @@ -405,7 +434,13 @@ fbdisplay_end( void ) { if( fb_fd != -1 ) { - if( got_orig_display ) ioctl( fb_fd, FBIOPUT_VSCREENINFO, &orig_display ); + if( got_orig_display ) { + ioctl( fb_fd, FBIOPUT_VSCREENINFO, &orig_display ); + if (changed_palette) { + ioctl( fb_fd, FBIOPUTCMAP, &orig_cmap); + changed_palette = 0; + } + } close( fb_fd ); fb_fd = -1; fputs( "\x1B[H\x1B[J\x1B[?25h", stdout ); /* clear screen, show cursor */ Modified: vendor/fuse-emulator/current/fuse-utils/Makefile.am =================================================================== --- vendor/fuse-emulator/current/fuse-utils/Makefile.am 2010-10-19 11:21:18 UTC (rev 657) +++ vendor/fuse-emulator/current/fuse-utils/Makefile.am 2010-12-07 12:35:24 UTC (rev 658) @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in ## Copyright (c) 1999-2002 Philip Kendall -## $Id: Makefile.am 4144 2010-08-06 13:44:35Z fredm $ +## $Id: Makefile.am 4208 2010-12-06 19:42:44Z pak21 $ ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -27,6 +27,11 @@ hacking \ man +DIST_SUBDIRS = compat/amiga \ + compat/unix \ + hacking \ + man + bin_PROGRAMS = createhdf \ listbasic \ profile2map \ Modified: vendor/fuse-emulator/current/fuse-utils/hacking/ChangeLog =================================================================== --- vendor/fuse-emulator/current/fuse-utils/hacking/ChangeLog 2010-10-19 11:21:18 UTC (rev 657) +++ vendor/fuse-emulator/current/fuse-utils/hacking/ChangeLog 2010-12-07 12:35:24 UTC (rev 658) @@ -312,3 +312,5 @@ A and F being transposed. 20101007 raw2hdf.c: add missing default for version (fixes bug #3082566; thanks, UB880D) (Fred). +20101206 Makefile.am: remember to put all compat directories in the dist tarball + (thanks, kizmiaz). Modified: vendor/fuse-emulator/current/libspectrum/hacking/ChangeLog =================================================================== --- vendor/fuse-emulator/current/libspectrum/hacking/ChangeLog 2010-10-19 11:21:18 UTC (rev 657) +++ vendor/fuse-emulator/current/libspectrum/hacking/ChangeLog 2010-12-07 12:35:24 UTC (rev 658) @@ -787,3 +787,4 @@ 20101003 szx.c,test/{empty.szx,test.c}: we also need to swap A' and F'. 20101010 configure.in: pad version number for Win32 if needed (patch #3084574) (Sergio Baldovi). +20101130 warajevo_read.c: remove potential signedness problem. Modified: vendor/fuse-emulator/current/libspectrum/warajevo_read.c =================================================================== --- vendor/fuse-emulator/current/libspectrum/warajevo_read.c 2010-10-19 11:21:18 UTC (rev 657) +++ vendor/fuse-emulator/current/libspectrum/warajevo_read.c 2010-12-07 12:35:24 UTC (rev 658) @@ -2,7 +2,7 @@ Copyright (c) 2001, 2002 Philip Kendall, Darren Salt Copyright (c) 2003 Fredrick Meunier - $Id: warajevo_read.c 4118 2010-02-21 04:36:17Z fredm $ + $Id: warajevo_read.c 4196 2010-11-30 18:45:18Z pak21 $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -150,17 +150,17 @@ static libspectrum_dword lsb2dword( const libspectrum_byte *mem ) { - return mem[0] + - mem[1] * 0x100 + - mem[2] * 0x10000 + - mem[3] * 0x1000000 ; + return ( mem[0] << 0 ) | + ( mem[1] << 8 ) | + ( mem[2] << 16 ) | + ( mem[3] << 24 ); } static libspectrum_word lsb2word( const libspectrum_byte *mem ) { - return mem[0] + - mem[1] * 0x100 ; + return ( mem[0] << 0 ) | + ( mem[1] << 8 ); } /* The main load function */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |