[Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx:[660] trunk
Brought to you by:
fredm
From: <fr...@us...> - 2010-12-08 11:29:53
|
Revision: 660 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=660&view=rev Author: fredm Date: 2010-12-08 11:29:46 +0000 (Wed, 08 Dec 2010) Log Message: ----------- Merge up to vendor revision 4209. Revision Links: -------------- http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=4209&view=rev Modified Paths: -------------- trunk/fuse/fusepb/resources/Fuse Help/html/about.html trunk/fuse/fusepb/resources/Fuse Help/html/changelog.html trunk/fuse/fusepb/resources/Fuse Help/html/machine.html trunk/fuse/fusepb/resources/Fuse Help/html/opus.html trunk/fuse/fusepb/resources/Fuse Help/html/plusd.html trunk/fuse/fusepb/resources/Fuse Help/html/trdos.html trunk/fuse/hacking/ChangeLog trunk/fuse/man/fuse.1 trunk/fuse/memory.c trunk/fuse/ui/fb/fbdisplay.c trunk/libspectrum/libspectrum/hacking/ChangeLog trunk/libspectrum/libspectrum/warajevo_read.c Property Changed: ---------------- trunk/fuse/ trunk/fuse/fusepb/libspectrum.h trunk/libspectrum/libspectrum/ Property changes on: trunk/fuse ___________________________________________________________________ Modified: svn:mergeinfo - /vendor/fuse-emulator/0.10.0/fuse:556-557 /vendor/fuse-emulator/0.10.0-pre1/fuse:545-546 /vendor/fuse-emulator/current/fuse:530-655 + /vendor/fuse-emulator/0.10.0/fuse:556-557 /vendor/fuse-emulator/0.10.0-pre1/fuse:545-546 /vendor/fuse-emulator/current/fuse:530-659 Property changes on: trunk/fuse/fusepb/libspectrum.h ___________________________________________________________________ Modified: svn:mergeinfo - /vendor/fuse-emulator/current/fuse/fusepb/libspectrum.h:638-655 /vendor/fuse-emulator/current/libspectrum/libspectrum.h.in:538-600 + /vendor/fuse-emulator/current/fuse/fusepb/libspectrum.h:638-659 /vendor/fuse-emulator/current/libspectrum/libspectrum.h.in:538-600 Modified: trunk/fuse/fusepb/resources/Fuse Help/html/about.html =================================================================== --- trunk/fuse/fusepb/resources/Fuse Help/html/about.html 2010-12-07 12:36:15 UTC (rev 659) +++ trunk/fuse/fusepb/resources/Fuse Help/html/about.html 2010-12-08 11:29:46 UTC (rev 660) @@ -1,7 +1,11 @@ -<!-- AppleSegStart="About Fuse" --> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> <head> + +<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><!-- AppleSegStart="About Fuse" --> <title>About Fuse</title> </head> +<body> <div class="refentry" xml:lang="en" lang="en"> <font face="Lucida Grande,Helvetica,Arial"><a name="About Fuse"></a><!-- AppleSegDescription="This section describes the Fuse emulator." --></font> <div class="refsect1" xml:lang="en" lang="en"> @@ -18,17 +22,18 @@ 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 ZS 256 and MGT and IMG disk images are -supported when emulating the +D interface. DCK cartridge images are -supported when emulating a Timex TC2068 or TS2068. Interface II ROM -cartriges are also -supported.</font></p> +partly supported (enough for multi-load games); however, loading of 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.</font></p> <p><font face="Lucida Grande,Helvetica,Arial">Finally, there is also support for reading and writing the RZX input recording format.</font></p> </div> <!-- AppleSegEnd --> +</body> +</html> Modified: trunk/fuse/fusepb/resources/Fuse Help/html/changelog.html =================================================================== --- trunk/fuse/fusepb/resources/Fuse Help/html/changelog.html 2010-12-07 12:36:15 UTC (rev 659) +++ trunk/fuse/fusepb/resources/Fuse Help/html/changelog.html 2010-12-08 11:29:46 UTC (rev 660) @@ -14,7 +14,7 @@ name="What's New In Fuse?" id="What's New In Fuse?"></a><!-- AppleSegDescription="This section describes the changes for version 0.10.0 of the Fuse emulator." --></font><br> <div class="refsect1" xml:lang="en" lang="en"> <h2><font face="Lucida Grande,Helvetica,Arial">What's new in Fuse -For Mac OS X Beta 201010??</font></h2> +For Mac OS X Beta 201012??</font></h2> <ul> <li><font face="Lucida Grande,Helvetica,Arial">Changes since last beta:</font></li> @@ -45,12 +45,18 @@ <li><font face="Lucida Grande,Helvetica,Arial">Add support for NTSC ZX Spectrum 48K (Philip Kendall).</font></li> <li><font face="Lucida Grande,Helvetica,Arial">Fix autoload -snapshots (thanks, Gergely Szasz) (Fred).</font></li> +snapshots (thanks, Gergely Szasz) (</font><font + face="Lucida Grande,Helvetica,Arial">Fredrick +Meunier</font><font face="Lucida Grande,Helvetica,Arial">).</font></li> <li><font face="Lucida Grande,Helvetica,Arial">Query for an initial snapshot when opening a RZX file which doesn't have one as is common in competition mode RZX files (Sergio Baldovi).</font></li> <li><font face="Lucida Grande,Helvetica,Arial">Don't close a disk -or mdr if a write fails (thanks, Crisis) (Gergely Szasz).<br> +or mdr if a write fails (thanks, Crisis) (Gergely Szasz).</font></li> + <li><font face="Lucida Grande,Helvetica,Arial">The Allow Writes to +ROM preference shouldn't affect the 16K machine "empty" page (thanks, +Andrew Owen) (</font><font face="Lucida Grande,Helvetica,Arial">Fredrick +Meunier</font><font face="Lucida Grande,Helvetica,Arial">).<br> </font></li> </ul> </ul> Modified: trunk/fuse/fusepb/resources/Fuse Help/html/machine.html =================================================================== --- trunk/fuse/fusepb/resources/Fuse Help/html/machine.html 2010-12-07 12:36:15 UTC (rev 659) +++ trunk/fuse/fusepb/resources/Fuse Help/html/machine.html 2010-12-08 11:29:46 UTC (rev 660) @@ -19,7 +19,10 @@ more technical information -can be found at +can +be +found +at <a href="http://www.worldofspectrum.org/faq/reference/reference.htm">http://www.worldofspectrum.org/faq/reference/reference.htm</a>.</font></p> <p style="margin-left: 40px;"> <span class="emphasis"><font face="Lucida Grande,Helvetica,Arial"><em>Spectrum @@ -30,7 +33,15 @@ released by Sinclair in 1982 with 16 or 48K of RAM respectively.</font></p> <p style="margin-left: 40px;"> -<span class="emphasis"><font face="Lucida Grande,Helvetica,Arial"><em>Spectrum +<span class="emphasis"><font face="Lucida Grande,Helvetica,Arial"><font + face="Lucida Grande,Helvetica,Arial"><em>Spectrum 48K (NTSC)</em></font></font></span> +<font face="Lucida Grande,Helvetica,Arial"><font + face="Lucida Grande,Helvetica,Arial">The NTSC 48K machine released in +limited numbers in +parts of South America.</font></font> +</p> +<p style="margin-left: 40px;"><span class="emphasis"><font + face="Lucida Grande,Helvetica,Arial"><em>Spectrum 128K</em></font></span> <font face="Lucida Grande,Helvetica,Arial">The 128K machine as released by Sinclair in 1985 (Spain) or 1986 (UK).</font></p> @@ -91,7 +102,10 @@ of the Pentagon -Russian Spectrum clones which incorporate more +Russian +Spectrum +clones +which incorporate more memory and the "Mr Gluk Reset Service" ROM offering a more powerful firmware.</font></p> <p style="margin-left: 40px;"><span class="emphasis"><font @@ -102,13 +116,19 @@ of the Spectrum. -Some details can be found at +Some +details +can +be found at <a href="http://www.worldofspectrum.org/rusfaq/index.html">http://www.worldofspectrum.org/rusfaq/index.html</a>, like all the Russian -clones they have built in 3.5" disk drives, +clones +they +have +built in 3.5" disk drives, accessed via the Betadisk interface and TR-DOS (the Technology Research Disk Operating System). The most important distinction from the Pentagon Modified: trunk/fuse/fusepb/resources/Fuse Help/html/opus.html =================================================================== --- trunk/fuse/fusepb/resources/Fuse Help/html/opus.html 2010-12-07 12:36:15 UTC (rev 659) +++ trunk/fuse/fusepb/resources/Fuse Help/html/opus.html 2010-12-08 11:29:46 UTC (rev 660) @@ -1,6 +1,8 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> + +<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <!-- AppleSegStart="Opus Discovery Emulation" --> <title>Opus Discovery Emulation</title> </head> @@ -14,9 +16,11 @@ the Opus Discovery interface with the optional 2k RAM expansion and a second 40 track single sided disk drive.<br> </font></p> -<p><font face="Lucida Grande,Helvetica,Arial">Fuse supports .OPD and -.OPU -images in its Opus Discovery emulation. The Opus Discoveries' printer +<p><font face="Lucida Grande,Helvetica,Arial">See the <font + face="Lucida Grande,Helvetica,Arial"><span class="emphasis"><em>DISK +FILE FORMATS</em></span></font> +section for more details on supported disk file formats.</font><font + face="Lucida Grande,Helvetica,Arial"> The Opus Discoveries' printer port is also emulated for output only. (See the </font><font face="Lucida Grande,Helvetica,Arial"><span class="emphasis"><em>PRINTER EMULATION</em></span></font><font face="Lucida Grande,Helvetica,Arial"> Modified: trunk/fuse/fusepb/resources/Fuse Help/html/plusd.html =================================================================== --- trunk/fuse/fusepb/resources/Fuse Help/html/plusd.html 2010-12-07 12:36:15 UTC (rev 659) +++ trunk/fuse/fusepb/resources/Fuse Help/html/plusd.html 2010-12-08 11:29:46 UTC (rev 660) @@ -1,14 +1,23 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> <head> -<!-- AppleSegStart="+D Emulation" --> + +<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><!-- AppleSegStart="+D Emulation" --> <title>+D Emulation</title> </head> +<body> <font face="Lucida Grande,Helvetica,Arial"><a name="+D EMULATION"></a><!-- AppleSegDescription="This section describes the +D interface emulation in Fuse." --></font> <div class="refsect1" xml:lang="en" lang="en"> <h2><font face="Lucida Grande,Helvetica,Arial">+D Emulation</font></h2> </div> <p> -<font face="Lucida Grande,Helvetica,Arial">Fuse supports .MGT and .IMG -images in its +D emulation. The +D's printer port is emulated. (See the +<font face="Lucida Grande,Helvetica,Arial">Fuse supports emulating the ++D disk and printer interface. See the <font + face="Lucida Grande,Helvetica,Arial"><span class="emphasis"><em>DISK +FILE FORMATS</em></span></font> +section for more details on supported disk file formats.</font><font + face="Lucida Grande,Helvetica,Arial"> The +D's printer port is +emulated. (See the </font><font face="Lucida Grande,Helvetica,Arial"><span class="emphasis"><em>PRINTER EMULATION</em></span></font><font face="Lucida Grande,Helvetica,Arial"> section for more details.) The +D may only be used with 48K, 128K and @@ -30,3 +39,5 @@ screenshots to be printed (in monochrome) if printer emulation is enabled.</font></p> <!-- AppleSegEnd --> +</body> +</html> Modified: trunk/fuse/fusepb/resources/Fuse Help/html/trdos.html =================================================================== --- trunk/fuse/fusepb/resources/Fuse Help/html/trdos.html 2010-12-07 12:36:15 UTC (rev 659) +++ trunk/fuse/fusepb/resources/Fuse Help/html/trdos.html 2010-12-08 11:29:46 UTC (rev 660) @@ -1,6 +1,8 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> + <meta http-equiv="content-type" + content="text/html; charset=ISO-8859-1"> <!-- AppleSegStart="Beta 128 Emulation" --> <title>Beta 128 Emulation</title> </head> @@ -10,15 +12,22 @@ <h2><font face="Lucida Grande,Helvetica,Arial">Beta 128 Emulation</font></h2> </div> <p> -<font face="Lucida Grande,Helvetica,Arial">Fuse supports .SCL and .TRD -images in its Pentagon and Scorpion emulation, and also under 128K and +<font face="Lucida Grande,Helvetica,Arial">Fuse supports Betadisk +emulation in its Pentagon and Scorpion emulation, and also under 128K +and +2 (but not +2A) emulation if the </font><font face="Lucida Grande,Helvetica,Arial"><span class="emphasis"><em>Beta 128 interface option</em></span></font><font face="Lucida Grande,Helvetica,Arial"> from the </font><font face="Lucida Grande,Helvetica,Arial"><span class="emphasis"><em>Preferences, Peripherals...</em></span></font><font - face="Lucida Grande,Helvetica,Arial"> dialog is enabled.</font></p> + face="Lucida Grande,Helvetica,Arial"> dialog is enabled.<br> +</font></p> +<p><font face="Lucida Grande,Helvetica,Arial">See the <font + face="Lucida Grande,Helvetica,Arial"><span class="emphasis"><em>DISK +FILE FORMATS</em></span></font> +section for more details on supported disk file formats.<br> +</font></p> <!-- AppleSegEnd --> </body> </html> Modified: trunk/fuse/hacking/ChangeLog =================================================================== --- trunk/fuse/hacking/ChangeLog 2010-12-07 12:36:15 UTC (rev 659) +++ trunk/fuse/hacking/ChangeLog 2010-12-08 11:29:46 UTC (rev 660) @@ -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: trunk/fuse/man/fuse.1 =================================================================== --- trunk/fuse/man/fuse.1 2010-12-07 12:36:15 UTC (rev 659) +++ trunk/fuse/man/fuse.1 2010-12-08 11:29:46 UTC (rev 660) @@ -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: trunk/fuse/memory.c =================================================================== --- trunk/fuse/memory.c 2010-12-07 12:36:15 UTC (rev 659) +++ trunk/fuse/memory.c 2010-12-08 11:29:46 UTC (rev 660) @@ -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: trunk/fuse/ui/fb/fbdisplay.c =================================================================== --- trunk/fuse/ui/fb/fbdisplay.c 2010-12-07 12:36:15 UTC (rev 659) +++ trunk/fuse/ui/fb/fbdisplay.c 2010-12-08 11:29:46 UTC (rev 660) @@ -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 */ Property changes on: trunk/libspectrum/libspectrum ___________________________________________________________________ Modified: svn:mergeinfo - /vendor/fuse-emulator/0.10.0/libspectrum:556-557 /vendor/fuse-emulator/0.10.0-pre1/libspectrum:545-546 /vendor/fuse-emulator/current/libspectrum:530-655 + /vendor/fuse-emulator/0.10.0/libspectrum:556-557 /vendor/fuse-emulator/0.10.0-pre1/libspectrum:545-546 /vendor/fuse-emulator/current/libspectrum:530-659 Modified: trunk/libspectrum/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/libspectrum/hacking/ChangeLog 2010-12-07 12:36:15 UTC (rev 659) +++ trunk/libspectrum/libspectrum/hacking/ChangeLog 2010-12-08 11:29:46 UTC (rev 660) @@ -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: trunk/libspectrum/libspectrum/warajevo_read.c =================================================================== --- trunk/libspectrum/libspectrum/warajevo_read.c 2010-12-07 12:36:15 UTC (rev 659) +++ trunk/libspectrum/libspectrum/warajevo_read.c 2010-12-08 11:29:46 UTC (rev 660) @@ -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. |