···11+25.09.2006 yet more code cleanup, quick snapshot feature,sound should no longer crash,light optimizations
22+1304.09.2006 code cleanup; now using IRAM correctly (i hope)
243531.08.2006 far better sound, volume option is working now
···11-/*
22- * Copyright (C) 1996-1998 Szeredi Miklos
33- * Email: mszeredi@inf.bme.hu
44- *
55- * This program is free software; you can redistribute it and/or modify
66- * it under the terms of the GNU General Public License as published by
77- * the Free Software Foundation; either version 2 of the License, or
88- * (at your option) any later version. See the file COPYING.
99- *
1010- * This program is distributed in the hope that it will be useful,
1111- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1212- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1313- * GNU General Public License for more details.
1414- *
1515- * You should have received a copy of the GNU General Public License
1616- * along with this program; if not, write to the Free Software
1717- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1818- *
1919- */
2020-2121-#include "config.h"
2222-2323-#define SPECTEMU_VERSION "0.94"
2424-2525-#ifdef Z80C
2626-#define SPECTEMU_TYPE "c"
2727-#else
2828-#define SPECTEMU_TYPE "i"
2929-#endif
···6262static unsigned int gbuf_size = 0;
6363#endif
64646565-long video_frames = 0;
6666-long start_time = 0;
6565+long video_frames IBSS_ATTR = 0 ;
6666+long start_time IBSS_ATTR = 0;
67676868enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
6969{
···7373 rb->pcm_play_stop();
7474#endif
7575 rb->splash(HZ, true, "Welcome to ZXBox");
7676- sp_init();
77767877#ifdef USE_IRAM
7978 /* We need to stop audio playback in order to use IRAM */
···8281 rb->memcpy(iramstart, iramcopy, iramend-iramstart);
8382 rb->memset(iedata, 0, iend - iedata);
8483#endif
8484+8585+ sp_init();
85868687#ifdef USE_GRAY
8788 /* get the remainder of the plugin buffer */
···101102#endif
102103103104 start_time = *rb->current_tick;
105105+106106+#ifdef RB_PROFILE
107107+ rb->profile_thread();
108108+#endif
109109+104110 start_spectemu(parameter);
111111+112112+#ifdef RB_PROFILE
113113+ rb->profstop();
114114+#endif
105115106116#if defined(HAVE_ADJUSTABLE_CPU_FREQ)
107117 rb->cpu_boost(false);
···269279 process_keys();
270280}
271281272272-void spkey_textmode(void)
273273-{
274274-}
275275-276276-void spkey_screenmode(void)
277277-{
278278-}
279279-280280-void spscr_refresh_colors(void)
281281-{
282282-}
283283-284284-void resize_spect_scr(int s)
285285-{
286286- /* just to disable warning */
287287- (void)s;
288288-}
289289-290290-int display_keyboard(void)
291291-{
292292- return 0;
293293-}
+4-14
apps/plugins/zxbox/zxconfig.h
···19192020/* undef not to use grayscale lib */
2121#if !defined HAVE_LCD_COLOR && LCD_PIXELFORMAT != HORIZONTAL_PACKING
2222+/* grayscale is far slower for now at least on ipods :( */
2223#define USE_GRAY
2324#define USE_BUFFERED_GRAY
2425#endif
252626272728#define Z80C
2828-#define MULTIUSER 0
2929-#define DATADIR "."
30293130/* Always define this for the spectrum emulator. */
3231#define SPECT_MEM 1
···4241/* Define this to use an alternative way of passing the z80 processor
4342 data to the z80 instruction emulation functions. May make emulation
4443 faster on some machines, but not on intel, and sparc. */
4545-#undef PROCP /* seems not to have effect on arm targets */
4646-/* #define PROCP */
4747-4848-/* Define to empty if the keyword does not work. */
4949-/* #undef const */
5050-5151-/* Define to `unsigned' if <sys/types.h> doesn't define. */
5252-/* #undef size_t */
4444+/* seems not to have effect on arm targets */
4545+#undef PROCP
4646+/*#define PROCP*/
53475448/* Define if you have the ANSI C header files. */
5549#define STDC_HEADERS 1
5656-5757-/* Define if your processor stores words with the most significant
5858- byte first (like Motorola and SPARC, unlike Intel and VAX). */
5959-/* #undef WORDS_BIGENDIAN */
60506151#endif
+28-3
apps/plugins/zxbox/zxvid_4bpp.c
···11#include "zxvid_com.h"
2233-#if !defined USE_GRAY && LCD_PIXELFORMAT == HORIZONTAL_PACKING && LCD_DEPTH < 4
33+#if !defined USE_GRAY && LCD_DEPTH < 4
44/* screen routines for greyscale targets not using greyscale lib */
55+66+#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
57#define FB_WIDTH ((LCD_WIDTH+3)/4)
68unsigned char pixmask[4] ICONST_ATTR = {
79 0xC0, 0x30, 0x0C, 0x03
810 };
1111+#elif LCD_PIXELFORMAT == VERTICAL_PACKING
1212+unsigned char pixmask[4] ICONST_ATTR = {
1313+ 0x03, 0x0C, 0x30, 0xC0
1414+};
1515+#endif
9161017void init_spect_scr(void)
1118{
···4148void update_screen(void)
4249{
4350 char str[80];
4444-5151+4552 fb_data *frameb;
4653 int y=0;
4754 int x=0;
···4956 int srcx, srcy=0; /* x / y coordinates in source image */
5057 image = sp_image + ( (Y_OFF)*(WIDTH) ) + X_OFF;
5158 unsigned mask;
5252-5959+#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
5360 for(y = 0; y < LCD_HEIGHT; y++)
5461 {
5562 frameb = rb->lcd_framebuffer + (y) * FB_WIDTH;
···6471 image += (srcy>>16)*WIDTH; /* and possibly to the next row. */
6572 srcy &= 0xffff; /* set up the y-coordinate between 0 and 1 */
6673 }
7474+#elif LCD_PIXELFORMAT == VERTICAL_PACKING
7575+ int shift;
7676+ for(y = 0; y < LCD_HEIGHT; y++)
7777+ {
7878+ frameb = rb->lcd_framebuffer + (y/4) * LCD_WIDTH;
7979+ srcx = 0; /* reset our x counter before each row... */
8080+ shift = ((y & 3 ) * 2 );
8181+ mask = pixmask[y & 3];
8282+ for(x = 0; x < LCD_WIDTH; x++)
8383+ {
8484+ frameb[x] = (frameb[x] & ~mask) | ((image[(srcx>>16)]&0x3) << shift );
8585+ srcx += X_STEP; /* move through source image */
8686+ }
8787+ srcy += Y_STEP; /* move through the source image... */
8888+ image += (srcy>>16)*WIDTH; /* and possibly to the next row. */
8989+ srcy &= 0xffff; /* set up the y-coordinate between 0 and 1 */
9090+ }
9191+#endif
67926893 if ( settings.showfps ) {
6994 int percent=0;