summaryrefslogtreecommitdiff
blob: 88e356ebe4af6709f6f05c6e4435865312571363 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
diff -ru zsnes-1.35/authors.txt zsnes/authors.txt
--- zsnes-1.35/authors.txt	2002-06-24 07:34:32.000000000 +0200
+++ zsnes/authors.txt	2002-07-07 05:12:02.000000000 +0200
@@ -1,6 +1,30 @@
-ZSNES Open Source Authors:
---------------------------
+--------------
+The ZSNES Team
+--------------
 
 zsKnight <zsknight@zsnes.com>
 _Demo_ <z_demo_z@users.sourceforge.net>
+pagefault
 
+------------------
+Additional Authors
+------------------
+
+stainless
+pharos
+teuf
+relnev
+prometheus
+theoddone33
+EvilTypeGuy
+hpsolo
+aaronl
+Diablo-D3
+
+-------------
+Miscellaneous
+-------------
+
+Wilbern Cobb - initial OpenBSD work
+Thorsten "mirabile" Glaser - more OpenBSD integration
+Mitchell "The Khan Artist" Mebane - manpage
diff -ru zsnes-1.35/src/aclocal.m4 zsnes/src/aclocal.m4
--- zsnes-1.35/src/aclocal.m4	2002-06-24 07:34:43.000000000 +0200
+++ zsnes/src/aclocal.m4	2002-07-08 19:13:13.000000000 +0200
@@ -1,6 +1,6 @@
-dnl aclocal.m4 generated automatically by aclocal 1.4
+dnl aclocal.m4 generated automatically by aclocal 1.4-p5
 
-dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
Only in zsnes-1.35/src: config.cache
diff -ru zsnes-1.35/src/cpu/dma.asm zsnes/src/cpu/dma.asm
--- zsnes-1.35/src/cpu/dma.asm	2002-06-24 07:34:32.000000000 +0200
+++ zsnes/src/cpu/dma.asm	2002-06-28 00:04:57.000000000 +0200
@@ -88,7 +88,7 @@
     and al,00000111b
     cmp al,5
     jne .notmode5dma
-    mov al,1
+    sub al,4
 .notmode5dma
     mov bl,al
     shl bl,3
@@ -475,6 +475,10 @@
     xor ecx,ecx
     mov al,[esi]
     and al,00000111b
+    cmp al,5
+    jb .notmode567dma
+    sub al,4
+.notmode567dma
     mov ah,[.addrnumt+eax]
     mov [edx+16],ah
     mov bl,al
@@ -575,6 +579,10 @@
     xor ecx,ecx
     mov al,[esi]
     and al,00000111b
+    cmp al,5
+    jb .notmode567dma
+    sub al,4
+.notmode567dma
     mov ah,[.addrnumt+eax]
     mov [edx+16],ah
     mov bl,al
@@ -677,6 +685,10 @@
     xor ecx,ecx
     mov al,[esi]
     and al,00000111b
+    cmp al,5
+    jb .notmode567dma
+    sub al,4
+.notmode567dma
     mov ah,[.addrnumt+eax]
     mov [edx+16],ah
     mov bl,al
diff -ru zsnes-1.35/src/cpu/dspproc.asm zsnes/src/cpu/dspproc.asm
--- zsnes-1.35/src/cpu/dspproc.asm	2002-06-24 07:34:32.000000000 +0200
+++ zsnes/src/cpu/dspproc.asm	2002-07-04 05:13:27.000000000 +0200
@@ -1746,22 +1746,33 @@
     sar eax,8
     add edx,eax
 
+    cmp dword [filter0],488
+    jne %%notfilter2
+
+    mov eax,[prev0]
+    movsx eax,ax
+    mov [prev1],eax
+    mov eax,edx
+    and eax,0fffffffch
+    mov [prev0],eax
+
+    jmp %%skipclamp
+%%notfilter2
     mov eax,[prev0]
     mov [prev1],eax
     cmp edx,-32768
     jnl %%notless
-    mov dx,0
-;    mov edx,-32768
+    mov edx,-32768
     mov byte[filteron],1
 %%notless
     cmp edx,32767
     jng %%notgreater
-    mov dx,0
-;    mov edx,32767
+    mov edx,32767
     mov byte[filteron],1
 %%notgreater
     movsx edx,dx
     mov [prev0],edx
+%%skipclamp
 %endmacro
 
 %macro ProcessDynamicLowPass 0
diff -ru zsnes-1.35/src/cpu/regs.inc zsnes/src/cpu/regs.inc
--- zsnes-1.35/src/cpu/regs.inc	2002-06-24 07:34:33.000000000 +0200
+++ zsnes/src/cpu/regs.inc	2002-06-29 18:01:27.000000000 +0200
@@ -64,7 +64,7 @@
     setreg 2141h*4,reg2141r
     setreg 2142h*4,reg2142r
     setreg 2143h*4,reg2143r
-    setreg 2144h*4,reg2144r
+    setreg 2144h*4,reg2140r
     setreg 2180h*4,reg2180r
 
     setreg 2A00h*4,reg2Axxr
@@ -948,6 +948,8 @@
 
 ; V counter data by external or software latch
 reg213Dr:
+    cmp byte[latchyr],2 ; hack for games that don't read 213F
+    je .noreset
     cmp byte[latchyr],1
     je .highv
     mov al,byte[latchy]
@@ -959,7 +961,11 @@
     or  al,byte[latchy+1]
     mov byte[latchyr],0
     ret
-
+.noreset
+    mov al,byte[latchy]
+    and al,0FEh    
+    or  al,byte[latchy+1]
+    ret
 ; PPU Status Flag & Version number (OBJ over flags)
 reg213Er:
     mov al,01h
@@ -1426,7 +1432,7 @@
     ret
 
 regINVALID:     ; Invalid Register
-    cmp cx,2050h
+    cmp cx,2100h
     jb .cleared
     mov al,ch
     cmp byte[SPC7110Enable],0
diff -ru zsnes-1.35/src/cpu/regsw.inc zsnes/src/cpu/regsw.inc
--- zsnes-1.35/src/cpu/regsw.inc	2002-06-24 07:34:33.000000000 +0200
+++ zsnes/src/cpu/regsw.inc	2002-06-27 20:13:35.000000000 +0200
@@ -109,6 +109,7 @@
     setregw 2141h*4,reg2141w
     setregw 2142h*4,reg2142w
     setregw 2143h*4,reg2143w
+    setregw 2144h*4,reg2140w
     setregw 2180h*4,reg2180w
     setregw 2181h*4,reg2181w
     setregw 2182h*4,reg2182w
diff -ru zsnes-1.35/src/gui/gui.asm zsnes/src/gui/gui.asm
--- zsnes-1.35/src/gui/gui.asm	2002-06-24 07:34:33.000000000 +0200
+++ zsnes/src/gui/gui.asm	2002-06-29 02:54:35.000000000 +0200
@@ -606,6 +606,9 @@
 NEWSYM CombinDataGlob, times 3300 db 0 ; 20-name, 42-combo, 2-key#, 1-P#, 1-ff
 NEWSYM CombinDataLocl, times 3300 db 0
 
+NEWSYM CmdLineNetPlay, db 0
+NEWSYM CmdLineTCPIPAddress, times 29 db 0
+
 GUIwinorder times    18 db 0
 GUIwinpos   times    18 db 0
 GUIwinactiv times    18 db 0
@@ -892,9 +895,6 @@
     or bl,80h
     ret
 
-NEWSYM CmdLineNetPlay, db 0
-NEWSYM CmdLineTCPIPAddress, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-
 NEWSYM GUIRestoreVars
     mov edx,GUIFName
     call Open_File
diff -ru zsnes-1.35/src/init.asm zsnes/src/init.asm
--- zsnes-1.35/src/init.asm	2002-06-24 07:34:32.000000000 +0200
+++ zsnes/src/init.asm	2002-07-04 19:13:59.000000000 +0200
@@ -1451,6 +1451,7 @@
 .mmx2head db 50,58,56,62,50,62,49,95,39,77,95,95,95,95,95,95,95,95,95,95
 
 EXTSYM ewj2hack
+EXTSYM latchyr
 
 NEWSYM headerhack
     mov byte[disablehdma],0
@@ -1465,6 +1466,103 @@
     mov byte[MMXSRAMFix],0
 
     mov esi,[romdata]
+    add esi,0FFC0h
+    cmp dword[esi],'SAMU'
+    jne .notsamuraishodown
+    cmp dword[esi+4],'RAI '
+    jne .notsamuraishodown
+    cmp dword[esi+8],'SHOD'
+    jne .notsamuraishodown
+    cmp dword[esi+12],'OWN '
+    jne .notsamuraishodown
+    mov word [IRQHack],1
+.notsamuraishodown
+
+    mov esi,[romdata]
+    add esi,07FC0h
+    cmp dword[esi],0DFCAB0BDh
+    jne .notfamista1
+    cmp dword[esi+4],0D0A7CCB0h
+    jne .notfamista1
+    cmp dword[esi+8],02020C0BDh
+    jne .notfamista1
+    cmp dword[esi+12],20202020h
+    jne .notfamista1
+    mov esi,[romdata]
+    add esi,2762Fh
+    mov word [esi],0EAEAh ; Skip a check for value FF at 2140 when spc not
+                          ; initialized yet?!?
+.notfamista1
+
+    mov esi,[romdata]
+    add esi,07FC0h
+    cmp dword[esi],0DFCAB0BDh
+    jne .notfamista2
+    cmp dword[esi+4],0D0A7CCB0h
+    jne .notfamista2
+    cmp dword[esi+8],03220C0BDh
+    jne .notfamista2
+    cmp dword[esi+12],20202020h
+    jne .notfamista2
+    mov esi,[romdata]
+    add esi,6CEDh
+    mov word [esi],0EAEAh ; Skip a check for value FF at 2140 when spc not
+                          ; initialized yet?!?
+    mov esi,[romdata]
+    add esi,6CF9h
+    mov word [esi],0EAEAh ; Skip a check for value FF at 2140 when spc not
+                          ; initialized yet?!?
+.notfamista2
+
+    mov esi,[romdata]
+    add esi,07FC0h
+    cmp dword[esi],20434653h
+    jne .notkamenrider
+    cmp dword[esi+4],0D7DDD2B6h
+    jne .notkamenrider
+    cmp dword[esi+8],0B0DEC0B2h
+    jne .notkamenrider
+    cmp dword[esi+12],20202020h
+    jne .notkamenrider
+    mov byte[latchyr],2
+.notkamenrider
+
+    mov esi,[romdata]
+    add esi,07FC0h
+    cmp dword[esi],'EURO'
+    jne .noteuropeanprimegoal
+    cmp dword[esi+4],'PEAN'
+    jne .noteuropeanprimegoal
+    cmp dword[esi+8],' PRI'
+    jne .noteuropeanprimegoal
+    cmp dword[esi+12],'ME G'
+    jne .noteuropeanprimegoal
+    mov al,0h
+    mov edi,spcRam
+    mov ecx,65472
+    rep stosb
+    ret
+.noteuropeanprimegoal
+
+    mov esi,[romdata]
+    add esi,07FC0h
+    cmp dword[esi],'CYBE'
+    jne .notcyberknight2
+    cmp dword[esi+4],'R KN'
+    jne .notcyberknight2
+    cmp dword[esi+8],'IGHT'
+    jne .notcyberknight2
+    cmp dword[esi+12],' 2  '
+    jne .notcyberknight2
+    mov byte[cycpb268],75
+    mov byte[cycpb358],77
+    mov byte[cycpbl2],75
+    mov byte[cycpblt2],75
+    mov byte[cycpbl],75
+    mov byte[cycpblt],75
+.notcyberknight2
+
+    mov esi,[romdata]
     add esi,07FC0h
     cmp dword[esi],0B4B1DEC3h
     jne .notdeasomething
@@ -6047,6 +6145,8 @@
     and al,0F0h
     cmp al,10h
     je .yessfx
+    cmp al,20h
+    je .yesobc
     cmp al,30h
     je near .yessa1
     cmp al,40h
@@ -6071,6 +6171,7 @@
     add esi,32704
     cmp dword[esi],'META'
     jne .notsfx
+.yesobc
     mov byte[OBCEnable],1
     jmp .nosfx
 .notsfx
diff -ru zsnes-1.35/src/linux/copyvwin.asm zsnes/src/linux/copyvwin.asm
--- zsnes-1.35/src/linux/copyvwin.asm	2002-06-24 07:34:33.000000000 +0200
+++ zsnes/src/linux/copyvwin.asm	2002-06-28 08:50:20.000000000 +0200
@@ -38,12 +38,11 @@
 SECTION .text
 
 NEWSYM copy640x480x16bwin
-    pushad
     cmp byte[curblank],40h
     jne .startcopy
-    popad
     ret
 .startcopy
+    pushad
     mov esi,[vidbuffer]
     mov edi,[WinVidMemStart]
     add esi,16*2+256*2+32*2
@@ -120,14 +119,13 @@
     inc ebx
     dec dl
     jnz near .loopa
+    popad
     xor byte[res512switch],1
     cmp byte[MMXSupport],1
     je .mmx2
-    popad
     ret
 .mmx2
     emms
-    popad
     ret
 .yeshires
     mov byte[ebx],0
@@ -231,7 +229,7 @@
 .loopab
     mov ecx,256
     cmp byte[ebx],1
-    je .yeshiresb
+    je near .yeshiresb
     cmp byte[ebx],1
     jbe .ignorehrb
     call HighResProc
@@ -261,10 +259,10 @@
     inc ebx
     dec dl
     jnz .loopab
+    popad
     xor byte[res512switch],1
     cmp byte[MMXSupport],1
     je near .mmx2
-    popad
     ret
 .yeshiresb
     mov byte[ebx],0
@@ -348,9 +346,9 @@
     inc ebx
     dec dl
     jnz near .loopabh
+    popad
     cmp byte[MMXSupport],1
     je near .mmx2
-    popad
     ret
 .mmxslh
     mov eax,[spritetablea]
@@ -448,9 +446,9 @@
     inc ebx
     dec byte[lineleft]
     jnz near .loopabh2
+    popad
     cmp byte[MMXSupport],1
     je near .mmx2
-    popad
     ret
 .mmxslh2
     mov eax,[spritetablea]
@@ -529,7 +527,6 @@
     jnz .nofielde
     add edi,[NumBytesPerLine]
 .nofielde
-    popad
     ret
 .hiresmode7
     cmp byte[MMXSupport],1
@@ -557,7 +554,6 @@
     dec ecx
     jnz .a2b
     sub esi,75036*4
-    popad
     ret
 .yeshiresngmmxmode7
     mov ecx,64
@@ -590,7 +586,6 @@
     dec ecx
     jnz .mmxrb
     sub esi,75036*4
-    popad
     ret
 .hires
     cmp byte[MMXSupport],1
@@ -611,7 +606,6 @@
     jnz .lowerfield
     add edi,[NumBytesPerLine]
 .lowerfield
-    popad
     ret
 .nofieldb
     cmp byte[scanlines],1
@@ -631,10 +625,8 @@
     add edi,4
     dec ecx
     jnz .bngb
-    popad
     ret
 .scanlines
-    popad
     ret
 .yeshiresngmmx
     mov eax,[spritetablea]
@@ -663,7 +655,6 @@
     jnz .lowerfieldb
     add edi,[NumBytesPerLine]
 .lowerfieldb
-    popad
     ret
 .nofieldc
     cmp byte[scanlines],1
@@ -696,7 +687,6 @@
     add edi,32
     dec ecx
     jnz .mmxr2
-    popad
     ret
 .antialias
     add edi,[AddEndBytes]
@@ -730,7 +720,6 @@
     add esi,8
     dec ecx
     jnz .mmxr2aa
-    popad
     ret
 .halfscanlines
     add edi,[AddEndBytes]
@@ -747,7 +736,6 @@
     add edi,4
     dec ecx
     jnz .abhs
-    popad
     ret
 .quartscanlines
     add edi,[AddEndBytes]
@@ -767,7 +755,6 @@
     add edi,4
     dec ecx
     jnz .abhs2
-    popad
     ret
 .halfscanlinesmmx
     mov eax,[spritetablea]
@@ -796,7 +783,6 @@
     add edi,32
     dec ecx
     jnz .mmxr2h
-    popad
     ret
 .quartscanlinesmmx
     mov eax,[spritetablea]
@@ -1383,7 +1369,7 @@
     jmp .returninterps
 .ignorehrs
     cmp byte[ebx],1
-    je .yeshiresb
+    je near .yeshiresb
 .ignorehrb
     push ebx
 .ab
diff -ru zsnes-1.35/src/linux/sdlintrf.asm zsnes/src/linux/sdlintrf.asm
--- zsnes-1.35/src/linux/sdlintrf.asm	2002-06-24 07:34:33.000000000 +0200
+++ zsnes/src/linux/sdlintrf.asm	2002-06-29 01:46:14.000000000 +0200
@@ -170,6 +170,10 @@
     mov byte[esi+11+256],'t'
     mov byte[esi+12+256],0
 
+    mov byte[spcon],1
+    mov byte[soundon],1
+    mov byte[cfgsoundon],1
+
     ; Get and set the initial directory
 %ifdef __LINUX__
     call obtaindir
diff -ru zsnes-1.35/src/linux/sdllink.c zsnes/src/linux/sdllink.c
--- zsnes-1.35/src/linux/sdllink.c	2002-06-24 07:34:33.000000000 +0200
+++ zsnes/src/linux/sdllink.c	2002-07-07 05:45:40.000000000 +0200
@@ -580,6 +580,22 @@
 	return TRUE;
 }
 
+int saybitdepth()
+{
+  int MyBitsPerPixel;
+  const SDL_VideoInfo *info;
+  SDL_Init(SDL_INIT_VIDEO);
+  info = SDL_GetVideoInfo();
+  MyBitsPerPixel = info->vfmt->BitsPerPixel;
+  switch (MyBitsPerPixel)
+    {
+    case 0: printf("Cannot detect bitdepth. On fbcon and svgalib this is normal.\nTrying to force 16 bpp.\n\n"); break;
+    case 16: break;
+    default: printf("You are running in %d bpp, but ZSNES is forcing 16 bpp.\nYou may experience poor performance and/or crashing.\n\n", MyBitsPerPixel); break;
+    }
+  return 0;
+}
+
 int startgame(void)
 {
 	int status;
@@ -598,7 +614,7 @@
 	if (sdl_state == vid_soft) sw_end();
 #ifdef __OPENGL__
 	else if (sdl_state == vid_gl) gl_end();
-
+	saybitdepth();
 	if (UseOpenGL)
 	{
 		status = gl_start(WindowWidth, WindowHeight, BitDepth, FullScreen);
diff -ru zsnes-1.35/src/linux/sw_draw.c zsnes/src/linux/sw_draw.c
--- zsnes-1.35/src/linux/sw_draw.c	2002-06-24 07:34:33.000000000 +0200
+++ zsnes/src/linux/sw_draw.c	2002-07-07 04:51:19.000000000 +0200
@@ -41,9 +41,7 @@
 {
     unsigned int color32, p;
     int i;
-    Uint32 flags = SDL_DOUBLEBUF | SDL_HWSURFACE | SDL_HWPALETTE | SDL_ANYFORMAT
-
-;
+    Uint32 flags = SDL_DOUBLEBUF | SDL_HWSURFACE | SDL_HWPALETTE;
     DWORD GBitMask;
     
     p = BitConv32Ptr;
diff -ru zsnes-1.35/src/ui.asm zsnes/src/ui.asm
--- zsnes-1.35/src/ui.asm	2002-06-24 07:34:32.000000000 +0200
+++ zsnes/src/ui.asm	2002-07-07 05:12:02.000000000 +0200
@@ -21,7 +21,7 @@
 EXTSYM ConvertJoyMap,ConvertJoyMap1,ConvertJoyMap2,printhex,InitSPC
 EXTSYM StartUp,PrintStr,WaitForKey,PrintChar,ZFileSystemInit
 EXTSYM SPCDisable,SystemInit,allocmem
-EXTSYM FPSOn,FPSAtStart,cfgsoundon,FirstTimeData
+EXTSYM FPSOn,FPSAtStart,cfgsoundon
 EXTSYM xa
 EXTSYM SBPort,SBInt,SBIrq,SBDMA,SBDMAPage,SBHDMAPage,getenv,vibracard
 EXTSYM ram7fa,wramdataa
@@ -69,14 +69,6 @@
 
 	cld                     ;clear direction flag
 
-%ifndef __MSDOS__
-        cmp byte[FirstTimeData],1
-        je .nofirsttime
-	mov byte[soundon],1
-	mov byte[cfgsoundon],1
-.nofirsttime
-%endif
-
 	call setnoise
 	call InitSPC
 	call allocmem           ;allocate memory
@@ -151,8 +143,7 @@
                  db 'ZSNES v',ZVERSION,' (c) 1997-2002, ZSNES Team (zsKnight & _Demo_)',13,10,13,10
                  db 'Be sure to check http://www.zsnes.com/ for the latest version.',13,10
                  db 'Please report crashes to zsnes-devel@lists.sourceforge.net.',13,10,13,10
-                 db '  Main Coders      : zsKnight, _Demo_, and pagefault',13,10
-                 db '  Assistant Coders : Pharos, teuf, theoddone33, and stainless',13,10,13,10
+                 db 'ZSNES is written by the ZSNES Team (See AUTHORS.TXT)',13,10
                  db 'ZSNES comes with ABSOLUTELY NO WARRANTY.  This is free software,',10,13
                  db 'and you are welcome to redistribute it under certain conditions;',10,13
 %ifdef __LINUX__
diff -ru zsnes-1.35/src/video/newgfx16.mac zsnes/src/video/newgfx16.mac
--- zsnes-1.35/src/video/newgfx16.mac	2002-06-24 07:34:34.000000000 +0200
+++ zsnes/src/video/newgfx16.mac	2002-06-29 20:07:04.000000000 +0200
@@ -2832,12 +2832,15 @@
     je near .offsetm
     cmp byte[t16x161+ebx+%1*256],1
     je near .tiles16x16
-    cmp byte[BGMA+ebx],4
-    je near .offsetm
 .nooffsetm
     mov eax,[BGPT1+ebx*2+%1*512]
     test ecx,100h
     jz .noyinc
+    cmp byte[osm2dis],1
+    je .nooffsetm4
+    cmp byte[BGMA+ebx],4
+    je near .offsetm
+.nooffsetm4
     add eax,[BGPT1Y+ebx*2+%1*512]
 .noyinc
     lea ecx,[ecx*8]
@@ -3131,10 +3134,7 @@
     shl edx,6
     xor eax,eax
     mov ax,[BGPT3+ebx*2]
-    cmp dx,0
-    jl .isneg1
     add ax,dx
-.isneg1
     xor edx,edx
     mov dx,[BG3SXl+ebx*2]
     and dx,0F8h
@@ -3303,10 +3303,7 @@
     shl edx,6
     xor eax,eax
     mov ax,[BGPT3+ebx*2]
-    cmp dx,0
-    jl .isneg2
     add ax,dx
-.isneg2
     xor edx,edx
     mov dx,[BG3SXl+ebx*2]
     and dx,0F8h
@@ -3709,10 +3706,7 @@
     shl edx,6
     xor eax,eax
     mov ax,[BGPT3+ebx*2]
-    cmp dx,0
-    jl .isneg3
     add ax,dx
-.isneg3
     xor edx,edx
     mov dx,[BG3SXl+ebx*2]
     and dx,0F8h
diff -ru zsnes-1.35/src/video/newgfx.mac zsnes/src/video/newgfx.mac
--- zsnes-1.35/src/video/newgfx.mac	2002-06-24 07:34:34.000000000 +0200
+++ zsnes/src/video/newgfx.mac	2002-06-29 20:25:36.000000000 +0200
@@ -2611,20 +2611,24 @@
     add ecx,ebx
     jmp %%yesmosaic
 %%nomosaic
-
     cmp byte[BGMA+ebx],5
     jae near .tiles16x8
 %%yesmosaic
-
     cmp byte[t16x161+ebx+%1*256],1
     je near .tiles16x16
+    cmp byte[osm2dis],1
+    je .nooffsetm
     cmp byte[BGMA+ebx],2
     je near .offsetm
-    cmp byte[BGMA+ebx],4
-    je near .offsetm
+.nooffsetm
     mov eax,[BGPT1+ebx*2+%1*512]
     test ecx,100h
     jz .noyinc
+    cmp byte[osm2dis],1
+    je .nooffsetm4
+    cmp byte[BGMA+ebx],4
+    je near .offsetm
+.nooffsetm4
     add eax,[BGPT1Y+ebx*2+%1*512]
 .noyinc
     lea ecx,[ecx*8]
@@ -2888,10 +2892,7 @@
     shl edx,6
     xor eax,eax
     mov ax,[BGPT3+ebx*2]
-    cmp dx,0
-    jl .isneg
     add ax,dx
-.isneg
     xor edx,edx
     mov dx,[BG3SXl+ebx*2]
     and dx,0F8h
@@ -2955,6 +2956,21 @@
     add eax,ecx
     add [ofsmtptr],ecx
     mov [ofsmmptr],eax
+
+    mov word[bgtxadd2],0
+    cmp word[BGPT3X+ebx*2],0
+    je .yesoverfl
+    mov cx,word[BG3SXl+ebx*2]
+    add cx,16
+    test cx,100h
+    jz .notoverfl
+    add dword[ofsmcptr],800h
+    sub word[bgtxadd2],800h
+    jmp .yesoverfl
+.notoverfl
+    add word[bgtxadd2],800h
+.yesoverfl
+
     mov dword[ofshvaladd],0
     mov ecx,[BGOPT1+ebx*2+%1*512]
     mov edx,[BGMA+ebx]
@@ -3066,10 +3082,13 @@
 %%yesmosaic
     cmp byte[t16x161+ebx+%1*256],1
     je near .tiles16x16
+    cmp byte[osm2dis],1
+    je .nooffsetm
     cmp byte[BGMA+ebx],2
     je near .offsetm
-    cmp byte[BGMA+ebx],4
-    je near .offsetm
+;    cmp byte[BGMA+ebx],4
+;    je near .offsetm
+.nooffsetm
     mov eax,[BG1SYl+ebx*2+%1*512]
     and eax,0FFFFh
     add eax,ebx
@@ -3240,10 +3259,7 @@
     shl edx,6
     xor eax,eax
     mov ax,[BGPT3+ebx*2]
-    cmp dx,0
-    jl .isneg
     add ax,dx
-.isneg
     xor edx,edx
     mov dx,[BG3SXl+ebx*2]
     and dx,0F8h
@@ -3275,6 +3291,21 @@
     mov eax,[BGPT1+ebx*2+%1*512]
     mov [ofsmtptr],eax
     mov [ofsmtptrs],eax
+
+    mov word[bgtxadd2],0
+    cmp word[BGPT3X+ebx*2],0
+    je .yesoverfl
+    mov cx,word[BG3SXl+ebx*2]
+    add cx,16
+    test cx,100h
+    jz .notoverfl
+    add dword[ofsmcptr],800h
+    sub word[bgtxadd2],800h
+    jmp .yesoverfl
+.notoverfl
+    add word[bgtxadd2],800h
+.yesoverfl
+
     mov ecx,[BG1SXl+ebx*2+%1*512]
     mov edx,[BGPT1X+ebx*2+%1*512]
     test ecx,100h
diff -ru zsnes-1.35/src/win/winintrf.asm zsnes/src/win/winintrf.asm
--- zsnes-1.35/src/win/winintrf.asm	2002-06-24 07:34:34.000000000 +0200
+++ zsnes/src/win/winintrf.asm	2002-06-29 01:46:14.000000000 +0200
@@ -189,6 +189,10 @@
     mov byte[esi+11+256],'t'
     mov byte[esi+12+256],0
 
+    mov byte[spcon],1
+    mov byte[soundon],1
+    mov byte[cfgsoundon],1
+
     ; Get and set the initial directory
     mov ebx,InitDir
     mov edx,InitDrive
diff -ru zsnes-1.35/src/win/zloaderw.c zsnes/src/win/zloaderw.c
--- zsnes-1.35/src/win/zloaderw.c	2002-06-24 07:34:34.000000000 +0200
+++ zsnes/src/win/zloaderw.c	2002-06-29 01:39:53.000000000 +0200
@@ -40,7 +40,8 @@
                      romtype, scanlines, showallext, smallscreenon, soundon,
                      spcon, vsyncon, DisplayS, fname, filefound, SnowOn,
                      NetChatFirst,NetServer,NetNewNick,
-                     NetFilename,TCPIPAddress,NetQuitAfter,UDPConfig;
+                     NetFilename,CmdLineTCPIPAddress,NetQuitAfter,UDPConfig,
+                     CmdLineNetPlay;
 
 void ccmdline(void);
 
@@ -178,7 +179,8 @@
          if (strptr<4) {
            NetServer=0;
          } else {
-           strp=&TCPIPAddress;
+           CmdLineNetPlay = 1;
+           strp=&CmdLineTCPIPAddress;
            strncpy(strp,ExtA[3],28);
          }
        }
@@ -670,10 +672,17 @@
     }
     else
     {
-      if(gfnm > 0)
+      if(gfnm > 0) // Quick fix to allow spaces, might produce strange names
+                   // if there are unrecognized options
       {
-        printf("Limit yourself to one filename\n");
-        return 2;
+        char *fvar, *fvar2;
+        fvar=&fname;
+        fvar2=&fname+fvar[0]+1;
+        if(fvar[0]+3>127) return(2);
+        fvar2[0]=' ';
+        strncpy(&fvar2[1],argv[p],127-fvar[0]-1);
+        fvar[0] += strlen(argv[p])+1;
+        gfnm++;
       }
       else
       {
@@ -685,7 +694,7 @@
       }
     }
   }
-  if(gfnm == 1)
+  if(gfnm > 0)
   {
     filefound=0;
     makeextension();