Skip to content

Commit 94384e7

Browse files
committed
Runs
1 parent 3579c80 commit 94384e7

File tree

8 files changed

+395
-632
lines changed

8 files changed

+395
-632
lines changed

src/draw_tile_ammx.c

Lines changed: 203 additions & 265 deletions
Large diffs are not rendered by default.

src/draw_tile_m68k.c

Lines changed: 174 additions & 215 deletions
Large diffs are not rendered by default.

src/emu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ void main_loop(void) {
315315

316316
for(i=0; i<nb_interlace; i++) {
317317
cpu_z80_run(cpu_z80_timeslice_scanline);
318-
handle_event();
318+
// handle_event();
319319
timer_run();
320320
}
321321
if(arg[OPTION_BENCH]) {

src/messages.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void render_message(double fps) {
6868
char buffer[32];
6969

7070
if (arg[OPTION_SHOWFPS]) {
71-
fps /= 120.0;
71+
//fps /= 120.0;
7272
dtostr(buffer, 2, fps);
7373
len = sprintf(display_buffer, "%s fps %s", buffer, message);
7474
} else {

src/screen.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,10 @@ static void video_do_fps(void) {
192192
double this_fps = 1.0 / time_d;
193193
fps_avg = fps_avg * 0.9 + this_fps * 0.1;
194194
}
195-
196-
render_message(fps_avg);
195+
if(arg[OPTION_FRAMESKIP])
196+
render_message(2.0 * fps_avg);
197+
else
198+
render_message(fps_avg);
197199
}
198200
last_time = time;
199201
}

src/timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static struct timeval now;
4747

4848
double timer_get_time(void) {
4949
GetSysTime(&now);
50-
return (double)now.tv_secs + (double)now.tv_micro / 1000000.0;
50+
return (double)now.tv_secs + (double)now.tv_micro * 0.000001;
5151
}
5252

5353
void timer_set_time(timer_struct *timer, double duration) {

src/video.c

Lines changed: 9 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -21,187 +21,51 @@
2121
#include <config.h>
2222
#include <string.h>
2323
#include <stdlib.h>
24-
//#include <zlib.h>
2524
#include "video.h"
2625
#include "memory.h"
2726
#include "emu.h"
2827
#include "messages.h"
2928
#include "conf.h"
3029
#include "screen.h"
31-
// #include "frame_skip.h"
32-
// #include "transpack.h"
33-
//#include <cybergraphx/cybergraphics.h>
34-
//#include <proto/cybergraphics.h>
35-
extern int neogeo_fix_bank_type;
36-
37-
38-
// #ifdef PROCESSOR_ARM
39-
// /* global declaration for video_arm.S */
40-
// uint8_t *mem_gfx = NULL; /*=memory.rom.tiles.p;*/
41-
// uint8_t *mem_video = NULL; //memory.vid.ram;
42-
// //#define TOTAL_GFX_BANK 4096
43-
// uint32_t *mem_bank_usage;
44-
//
45-
// //GFX_CACHE gcache;
46-
//
47-
// void draw_one_char_arm(int byte1, int byte2, uint16_t *br);
48-
// int draw_tile_arm_norm(uint32_t tileno, int color, uint8_t *bmp, int zy);
49-
// #endif
50-
51-
// #ifdef I386_ASM
52-
// /* global declaration for video_i386.asm */
53-
// uint8_t **mem_gfx; //=&memory.rom.tiles.p;
54-
// uint8_t *mem_video; //=memory.vid.ram;
55-
//
56-
// /* prototype */
57-
// void draw_tile_i386_norm(uint32_t tileno, int sx, int sy, int zx, int zy,
58-
// int color, int xflip, int yflip, uint8_t *bmp);
59-
// void draw_tile_i386_50(uint32_t tileno, int sx, int sy, int zx, int zy,
60-
// int color, int xflip, int yflip, uint8_t *bmp);
61-
// void draw_one_char_i386(int byte1, int byte2, uint16_t *br);
62-
//
63-
// void draw_scanline_tile_i386_norm(uint32_t tileno, int yoffs, int sx, int line, int zx,
64-
// int color, int xflip, uint8_t *bmp);
65-
//
66-
// void draw_scanline_tile_i386_50(uint32_t tileno, int yoffs, int sx, int line, int zx,
67-
// int color, int xflip, uint8_t *bmp);
68-
// #endif
6930

70-
//uint8_t strip_usage[0x300];
7131
#define PEN_USAGE(tileno) ((((uint32_t*) memory.rom.spr_usage.p)[tileno>>4]>>((tileno&0xF)*2))&0x3)
7232

73-
74-
static uint8_t dr, dg, db, sr, sg, sb;
75-
// static __inline__ uint16_t alpha_blend(uint16_t dest, uint16_t src, uint8_t a) {
76-
//
77-
//
78-
// dr = ((dest & 0xF800) >> 11) << 3;
79-
// dg = ((dest & 0x7E0) >> 5) << 2;
80-
// db = ((dest & 0x1F)) << 3;
81-
//
82-
// sr = ((src & 0xF800) >> 11) << 3;
83-
// sg = ((src & 0x7E0) >> 5) << 2;
84-
// sb = ((src & 0x1F)) << 3;
85-
//
86-
// dr = (((sr - dr)*(a)) >> 8) + dr;
87-
// dg = (((sg - dg)*(a)) >> 8) + dg;
88-
// db = (((sb - db)*(a)) >> 8) + db;
89-
//
90-
// return ((dr >> 3) << 11) | ((dg >> 2) << 5) | (db >> 3);
91-
// }
92-
// #define BLEND16_50(a,b) ((((a)&0xf7de)>>1)+(((b)&0xf7de)>>1))
93-
// #define BLEND16_25(a,b) alpha_blend(a,b,63)
94-
95-
96-
char dda_y_skip[17];
97-
uint32_t dda_y_skip_i;
98-
uint32_t full_y_skip_i = 0xFFFE;
99-
char full_y_skip[16] = {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
100-
uint32_t neogeo_frame_counter_speed = 8;
101-
102-
// static uint16_t fix_addr[40][32];
103-
// static uint8_t fix_shift[40];
104-
105-
static uint16_t dda_x_skip_i;
33+
extern int neogeo_fix_bank_type;
10634
const uint16_t ddaxskip_i[17] = {
10735
0x0000, 0x0080, 0x0880, 0x0888, 0x2888, 0x288a, 0x2a8a, 0x2aaa, 0xaaaa,
10836
0xaaea, 0xbaea, 0xbaeb, 0xbbeb, 0xbbef, 0xfbef, 0xfbff, 0xffff
10937
};
110-
#define dda_x_skip(N) (dda_x_skip_i & (1 << N))
111-
static void fix_value_init(void) {
112-
// int x, y;
113-
// for (x = 0; x < 40; x++) {
114-
// for (y = 0; y < 32; y++) {
115-
// fix_addr[x][y] = 0xea00 + (y << 1) + 64 * (x / 6);
116-
// }
117-
// fix_shift[x] = (5 - (x % 6));
118-
// }
119-
}
120-
121-
122-
/* Drawing function generation */
123-
// #define RENAME(name) name##_tile
124-
// #define PUTPIXEL(dst,src) dst=src
125-
// #include "video_template.h"
126-
127-
// #define RENAME(name) name##_tile_50
128-
// #define PUTPIXEL(dst,src) dst=BLEND16_50(src,dst)
129-
// #include "video_template.h"
130-
//
131-
// #define RENAME(name) name##_tile_25
132-
// #define PUTPIXEL(dst,src) dst=BLEND16_25(src,dst)
133-
// #include "video_template.h"
134-
//
135-
// #ifdef PROCESSOR_ARM
136-
//
137-
//
138-
// #endif
13938
const int overscan = 1;
14039

141-
14240
extern struct RastPort *theRastPort;
14341

14442
uint8_t line_limit[256] = {0xFF}, *limit;
43+
uint32_t neogeo_frame_counter_speed = 8;
14544
uint32_t even_odd = 0;
14645

147-
//(palbase, tilepos, gfxdata, rzx, yskip)
148-
149-
//OPTION_INTERLEAVED
46+
static uint8_t dr, dg, db, sr, sg, sb;
15047

15148
void draw_screen(void) {
15249
if(screen_prerender()) {
153-
if(arg[OPTION_INTERLEAVED]) {
154-
uint8_t c = even_odd - 1;
155-
uint32_t i, x;
156-
uint16_t *clear = (uint16_t*)bufferpixels;
157-
158-
for(i=0;i<224;i++) {
159-
line_limit[i] = c;
160-
if(!c) {
161-
uint16_t pixel = current_pc_pal[4095];
162-
for(x=0;x<320;x++) clear[x] = pixel;
163-
c = 255;
164-
} else {
165-
c = 0;
166-
}
167-
clear += 384;
168-
}
169-
even_odd = !even_odd;
170-
171-
} else {
172-
bzero( line_limit, 224 );
173-
clr_screen_m68k(bufferpixels, current_pc_pal[4095] );
174-
}
50+
clr_screen_m68k(bufferpixels, current_pc_pal[4095] );
17551

17652
/* Draw sprites */
177-
if(AC68080) draw_tiles_ammx();
178-
else draw_tiles_m68k();
53+
if(AC68080)
54+
draw_tiles_ammx();
55+
else
56+
draw_tiles_m68k();
17957

18058
/* Draw fix layer */
18159
draw_fix_char(bufferpixels, 0, 0);
18260

18361
clr_border_m68k(bufferpixels, 0 );
184-
screen_update();
185-
62+
screen_update();
18663
} else {
18764
debug("Unable to lock screen (%p)\n", bufferpixels);
18865
exit(-1);
18966
}
19067
}
19168

192-
19369
void init_video(void) {
194-
#ifdef PROCESSOR_ARM
195-
if (!mem_gfx) {
196-
mem_gfx = memory.rom.tiles.p;
197-
}
198-
if (!mem_video) {
199-
mem_video = memory.vid.ram;
200-
}
201-
#elif I386_ASM
202-
mem_gfx = &memory.rom.tiles.p;
203-
mem_video = memory.vid.ram;
204-
#endif
205-
fix_value_init();
20670
memory.vid.modulo = 1;
20771
}

src/ym2610.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,10 +1325,10 @@ static void init_timetables(const u8 *dttable) {
13251325
int i, d;
13261326
double rate;
13271327

1328-
//#if 0
1328+
#if 0
13291329
printf("FM.C: samplerate=%8i chip clock=%8i freqbase=%f \n",
13301330
YM2610.OPN.ST.rate, YM2610.OPN.ST.clock, YM2610.OPN.ST.freqbase );
1331-
//#endif
1331+
#endif
13321332

13331333
/* DeTune table */
13341334
for (d = 0; d <= 3; d++) {

0 commit comments

Comments
 (0)