18
17
;along with this program; if not, write to the Free Software
19
18
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
22
%include "macros.mac"
23
24
EXTSYM MessageOn,MsgCount,Msgptr,Voice0Disable,Voice0Status,Voice1Disable
24
25
EXTSYM Voice1Status,Voice2Disable,Voice2Status,Voice3Disable,Voice3Status
25
26
EXTSYM Voice4Disable,Voice4Status,Voice5Disable,Voice5Status,Voice6Disable
26
EXTSYM Voice6Status,Voice7Disable,Voice7Status,bgcmsung,bgmode,cbackofsaddr
27
EXTSYM cbitmode,cgmod,debuggeron,disableeffects,frameskip,frskipper,newgfxerror2
28
EXTSYM maxbr,modeused,mousexloc,mouseyloc,newengen,newgfx16b,newgfxerror
29
EXTSYM nextdrawallng,oamaddr,pal16b,pal16bxcl,pressed,prevbright,prevpal
30
EXTSYM scaddsngb,scaddtngb,scaddtngbx,scfbl,scrndis,snesmouse,sprprdrn
31
EXTSYM t1cc,vidbright,vidbuffer,vidbufferm,vidbufferofsa,vidbufferofsb
32
EXTSYM vidmemch2,statefileloc,fnamest,GUIClick,MousePRClick,ngmsdraw,cvidmode
27
EXTSYM Voice6Status,Voice7Disable,Voice7Status,bgcmsung,bgmode
28
EXTSYM cgmod,disableeffects,frameskip,frskipper,current_zst
29
EXTSYM maxbr,modeused,mousexloc,mouseyloc,newengen,KeyRTRCycle
30
EXTSYM nextdrawallng,pal16b,pal16bxcl,pressed,prevbright,prevpal
31
EXTSYM scaddsngb,scaddtngb,scaddtngbx,scfbl,scrndis,sprprdrn,t1cc
32
EXTSYM vidbright,vidbuffer,vidbufferofsa,vidmemch2,MZTForceRTR
33
EXTSYM GUIRClick,MousePRClick,ngmsdraw,cvidmode,fulladdtab
33
34
EXTSYM KeyDisableSC0,KeyDisableSC1,KeyDisableSC2,KeyDisableSC3,KeyDisableSC4
34
35
EXTSYM KeyDisableSC5,KeyDisableSC6,KeyDisableSC7,KeyFastFrwrd,SRAMSave5Sec
35
36
EXTSYM KeyBGDisble0,KeyBGDisble1,KeyBGDisble2,KeyBGDisble3,KeySprDisble
36
EXTSYM KeyResetAll,KeyExtraEnab,KeyWinDisble,KeyNewGfxSwt,KeyOffsetMSw
37
EXTSYM KeyResetAll,KeyWinDisble,KeyNewGfxSwt,KeyOffsetMSw
37
38
EXTSYM KeyStateSlc0,KeyStateSlc1,KeyStateSlc2,KeyStateSlc3,KeyStateSlc4
38
39
EXTSYM KeyStateSlc5,KeyStateSlc6,KeyStateSlc7,KeyStateSlc8,KeyStateSlc9
39
EXTSYM KeyIncStateSlot,KeyDecStateSlot,KeyUsePlayer1234
40
EXTSYM maxskip,DSPMem,SprValAdd,dsp1ptr,dsp1array,FastFwdToggle,SaveSramData
41
EXTSYM ngextbg,Mode7HiRes,Check60hz,Get_MouseData,Get_MousePositionDisplacement
42
EXTSYM WindowDisables,scanlines,romispal
43
EXTSYM MusicRelVol,MusicVol,WDSPReg0C,WDSPReg1C
44
EXTSYM DSPOp02,Op02AAS,Op02AZS,Op02CX,Op02CY,Op02FX,Op02FY
45
EXTSYM Op02FZ,Op02LES,Op02LFE,Op02VOF,Op02VVA
51
EXTSYM KeyFRateDown,KeyFRateUp,KeyVolUp,KeyVolDown,KeyDisplayFPS,FPSOn,pl12s34
52
EXTSYM bg1ptr,bg2ptr,bg3ptr,bg4ptr,cachebg1,resolutn
53
EXTSYM curypos,oamram,objhipr,objptr,objptrn,objsize1,objsize2
54
EXTSYM spritetablea,sprleftpr,sprlefttot,vcache4b
55
EXTSYM objadds1,objadds2,objmovs1,objmovs2,tltype4b,vidmemch4,vram
56
EXTSYM bgptr,bgptrc,bgptrd,curtileptr,vcache2b
57
EXTSYM vcache8b,vidmemch8
58
EXTSYM offsetmshl,NextLineCache
60
EXTSYM tltype8b,objwlrpos
61
EXTSYM snesinputdefault,cycleinputdevice
40
EXTSYM KeyIncStateSlot,KeyDecStateSlot,KeyUsePlayer1234,maxskip,DSPMem
41
EXTSYM FastFwdToggle,SaveSramData,ngextbg,Mode7HiRes,Check60hz
42
EXTSYM Get_MouseData,Get_MousePositionDisplacement,scanlines
43
EXTSYM romispal,MusicRelVol,MusicVol,WDSPReg0C,WDSPReg1C,KeySlowDown
44
EXTSYM KeyFRateDown,KeyFRateUp,KeyVolUp,KeyVolDown,KeyDisplayFPS
45
EXTSYM FPSOn,pl12s34,bg1ptr,bg2ptr,bg3ptr,bg4ptr,cachebg1,resolutn,curypos
46
EXTSYM oamram,objhipr,objptr,objptrn,objsize1,objsize2,spritetablea,sprleftpr
47
EXTSYM sprlefttot,vcache4b,objadds1,objadds2,objmovs1,objmovs2,tltype4b
48
EXTSYM vidmemch4,vram,bgptr,bgptrc,bgptrd,curtileptr,vcache2b,vcache8b,vidmemch8
49
EXTSYM offsetmshl,NextLineCache,tltype2b,tltype8b,objwlrpos
50
EXTSYM EmuSpeed,SDRatio,FFRatio,DisplayBatteryStatus,lhguimouse,SwapMouseButtons
51
EXTSYM KeyResetSpeed,KeyEmuSpeedUp,KeyEmuSpeedDown,KeyDisplayBatt,EMUPause
52
EXTSYM device1,device2,snesinputdefault1,snesinputdefault2
53
EXTSYM KeyExtraEnab1,KeyExtraEnab2,cycleinputdevice1,cycleinputdevice2,MouseDis
54
EXTSYM KeyIncreaseGamma,KeyDecreaseGamma,gammalevel,gammalevel16b
55
EXTSYM RawDumpInProgress
63
63
; Process stuff & Cache sprites
66
NEWSYM fskipped, resb 1
67
NEWSYM objvramadder, resd 1
68
NEWSYM pobjvram, resw 1
71
69
NEWSYM sprprifix, db 1
74
NEWSYM OMBGTestVal, resd 1
75
NEWSYM ngptrdat2, resd 1
76
NEWSYM ofshvaladd, resd 1
77
NEWSYM ofsmtptrs, resd 1
78
NEWSYM ofsmcptr2, resd 1
79
NEWSYM sramb4save, resd 1
82
NEWSYM mode7hiresen, dd 1
85
NEWSYM hiresstuff, resd 1
86
NEWSYM cmovietimeint, resd 1
87
NEWSYM overalltimer, resd 1
70
NEWSYM OMBGTestVal, dd 0
71
NEWSYM ngptrdat2, dd 0
72
NEWSYM ofshvaladd, dd 0
73
NEWSYM ofsmtptrs, dd 0
74
NEWSYM ofsmcptr2, dd 0
75
NEWSYM sramb4save, dd 0
76
NEWSYM hiresstuff, dd 0
77
NEWSYM overalltimer, dd 0
97
83
test byte[pressed+eax],1
99
85
mov byte[pressed+eax],2
100
mov byte[sselm+11],%2
101
mov eax,[statefileloc]
102
mov byte[fnamest+eax],%3
103
97
mov dword[Msgptr],sselm
104
98
mov eax,[MsgCount]
105
99
mov [MessageOn],eax
508
454
mov eax,[MsgCount]
509
455
mov [MessageOn],eax
457
mov eax,[KeyEmuSpeedDown]
458
test byte[pressed+eax],1
460
mov byte[pressed+eax],2
465
mov eax,[KeyEmuSpeedUp]
466
test byte[pressed+eax],1
468
mov byte[pressed+eax],2
469
cmp byte[EmuSpeed],58
473
mov eax,[KeyResetSpeed]
474
test byte[pressed+eax],1
476
mov byte[pressed+eax],2
477
mov byte[EmuSpeed],29
511
479
mov eax,[KeyResetAll]
512
480
test byte[pressed+eax],1
514
482
mov byte[pressed+eax],2
515
mov byte[Voice0Disable],01h
516
mov byte[Voice1Disable],01h
517
mov byte[Voice2Disable],01h
518
mov byte[Voice3Disable],01h
519
mov byte[Voice4Disable],01h
520
mov byte[Voice5Disable],01h
521
mov byte[Voice6Disable],01h
522
mov byte[Voice7Disable],01h
523
mov byte[scrndis],00h
525
mov al,byte[snesinputdefault]
526
mov byte[snesmouse],al
483
mov byte[Voice0Disable],1
484
mov byte[Voice1Disable],1
485
mov byte[Voice2Disable],1
486
mov byte[Voice3Disable],1
487
mov byte[Voice4Disable],1
488
mov byte[Voice5Disable],1
489
mov byte[Voice6Disable],1
490
mov byte[Voice7Disable],1
492
mov byte[disableeffects],0
494
mov byte[EmuSpeed],29
495
mov al,[snesinputdefault1]
497
mov al,[snesinputdefault2]
528
499
mov dword[Msgptr],panickeyp
529
500
mov eax,[MsgCount]
530
501
mov [MessageOn],eax
532
mov eax,[KeyExtraEnab]
533
test byte[pressed+eax],1
503
mov eax,[KeyRTRCycle]
504
test byte[pressed+eax],1
506
mov byte[pressed+eax],2
507
inc byte[MZTForceRTR]
508
cmp byte[MZTForceRTR],3
510
mov byte[MZTForceRTR],0
511
mov dword[Msgptr],mztrtr0
514
cmp byte[MZTForceRTR],1
516
mov dword[Msgptr],mztrtr1
519
mov dword[Msgptr],mztrtr2
524
mov eax,[KeyExtraEnab1]
525
test byte[pressed+eax],1
535
527
mov byte[pressed+eax],2
537
call cycleinputdevice
529
call cycleinputdevice1
539
mov dword[Msgptr],snesle
540
cmp byte[snesmouse],0
542
531
mov dword[Msgptr],snesmousep0
544
cmp byte[snesmouse],1
546
534
mov dword[Msgptr],snesmousep1
548
cmp byte[snesmouse],2
538
call Get_MousePositionDisplacement
540
mov eax,[KeyExtraEnab2]
541
test byte[pressed+eax],1
543
mov byte[pressed+eax],2
545
call cycleinputdevice2
547
mov dword[Msgptr],snesmousep0
550
550
mov dword[Msgptr],snesmousep2
552
cmp byte[snesmouse],3
554
554
mov dword[Msgptr],snesss
555
555
mov word[mousexloc],128
556
556
mov word[mouseyloc],112
560
mov dword[Msgptr],snesle1
564
mov dword[Msgptr],snesle2
558
566
mov eax,[MsgCount]
559
567
mov [MessageOn],eax
560
568
call Get_MousePositionDisplacement
562
cmp byte[CNetType],20
564
cmp byte[snesmouse],0
566
mov byte[snesmouse],0
567
mov dword[MessageOn],0
569
570
mov eax,[KeyNewGfxSwt]
570
571
test byte[pressed+eax],1
572
573
mov byte[pressed+eax],2
575
cmp byte[newgfx16b],1
578
mov dword[Msgptr],newgfxerror
587
mov dword[Msgptr],newgfxerror2
590
574
mov byte[prevbright],16
591
575
xor byte[newengen],1
592
576
mov dword[Msgptr],ngena
920
NEWSYM ClearBGFPUCopy
952
913
NEWSYM osm2dis, db 0
953
NEWSYM cachedmode, db 0
954
NEWSYM tempfname, db 'vram.bin',0
955
NEWSYM scrnsizebyte, dw 1024,2048,2048,4096
956
914
NEWSYM colormodedef, db 1,1,1,1, 2,2,1,0, 2,2,0,0, 3,2,0,0,
957
915
db 3,1,0,0, 2,1,0,0, 2,0,0,0, 0,0,0,0
958
NEWSYM colormoded2, db 4,4,4,4, 5,5,4,0, 5,5,0,0, 6,5,0,0,
959
db 6,4,0,0, 5,4,0,0, 5,0,0,0, 0,0,0,0
960
916
NEWSYM colormodeofs, dd 0
961
917
NEWSYM curblank, db 80h ; current blank state (40h = skip fill)
962
918
NEWSYM addr2add, dd 0
979
935
NEWSYM curcolbg3, db 0
980
936
NEWSYM curcolbg4, db 0
981
937
NEWSYM panickeyp, db 'ALL SWITCHES NORMAL',0
982
NEWSYM snesmousep0, db 'MOUSE/SUPER SCOPE DISABLED',0
938
NEWSYM mztrtr0, db 'LOAD MZT MODE - OFF',0
939
NEWSYM mztrtr1, db 'LOAD MZT MODE - RECORD',0
940
NEWSYM mztrtr2, db 'LOAD MZT MODE - REPLAY',0
941
NEWSYM snesmousep0, db 'EXTRA DEVICES DISABLED',0
983
942
NEWSYM snesmousep1, db 'MOUSE ENABLED IN PORT 1',0
984
943
NEWSYM snesmousep2, db 'MOUSE ENABLED IN PORT 2',0
985
944
NEWSYM snesss, db 'SUPER SCOPE ENABLED',0
986
NEWSYM snesle, db 'LETHAL ENFORCER GUN ENABLED',0
945
NEWSYM snesle1, db '1 JUSTIFIER ENABLED',0
946
NEWSYM snesle2, db '2 JUSTIFIERS ENABLED',0
987
947
NEWSYM windissw, db 'WINDOWING DISABLED',0
988
948
NEWSYM winenasw, db 'WINDOWING ENABLED',0
989
949
NEWSYM ofsdissw, db 'OFFSET MODE DISABLED',0
990
950
NEWSYM ofsenasw, db 'OFFSET MODE ENABLED',0
991
951
NEWSYM ngena, db 'NEW GFX ENGINE ENABLED',0
992
952
NEWSYM ngdis, db 'NEW GFX ENGINE DISABLED',0
993
NEWSYM sselm, db 'STATE SLOT 0 SELECTED',0
953
NEWSYM sselm, db 'STATE SLOT 0 SELECTED',0
994
954
NEWSYM vollv, db 'VOLUME LEVEL : ',0
995
955
NEWSYM frlev, db 'FRAME SKIP SET TO ',0
996
956
NEWSYM frlv0, db 'AUTO FRAMERATE ENABLED',0
3882
NEWSYM dcolortab, resd 256
3885
NEWSYM ExitFromGUI, db 0
3886
NEWSYM videotroub, dd 0
3887
NEWSYM TripBufAvail, db 0
3888
NEWSYM vesa2_clbit, dd 0 ; clear all bit 0's if AND is used
3889
NEWSYM vesa2_rpos, dd 0 ; Red bit position
3890
NEWSYM vesa2_gpos, dd 0 ; Green bit position
3891
NEWSYM vesa2_bpos, dd 0 ; Blue bit position
3892
NEWSYM vesa2_clbitng, dd 0 ; clear all bit 0's if AND is used
3893
NEWSYM vesa2_clbitng2, dd 0,0 ; clear all bit 0's if AND is used
3894
NEWSYM vesa2_clbitng3, dd 0 ; clear all bit 0's if AND is used
3895
NEWSYM vesa2red10, dd 0 ; red position at bit 10
3896
NEWSYM vesa2_rtrcl, dd 0 ; red transparency clear (bit+4)
3897
NEWSYM vesa2_rtrcla, dd 0 ; red transparency (AND) clear (not(bit+4))
3898
NEWSYM vesa2_rfull, dd 0 ; red max (or bit*1Fh)
3899
NEWSYM vesa2_gtrcl, dd 0 ; red transparency clear (bit+4)
3900
NEWSYM vesa2_gtrcla, dd 0 ; red transparency (AND) clear (not(bit+4))
3901
NEWSYM vesa2_gfull, dd 0 ; red max (or bit*1Fh)
3902
NEWSYM vesa2_btrcl, dd 0 ; red transparency clear (bit+4)
3903
NEWSYM vesa2_btrcla, dd 0 ; red transparency (AND) clear (not(bit+4))
3904
NEWSYM vesa2_bfull, dd 0 ; red max (or bit*1Fh)
3905
NEWSYM vesa2_x, dd 320 ; Desired screen width
3906
NEWSYM vesa2_y, dd 240 ; Height
3907
NEWSYM vesa2_bits, dd 8 ; Bits per pixel
3908
NEWSYM vesa2_rposng, dd 0 ; Red bit position
3909
NEWSYM vesa2_gposng, dd 0 ; Green bit position
3910
NEWSYM vesa2_bposng, dd 0 ; Blue bit position
3911
NEWSYM vesa2_usbit, dd 0 ; Unused bit in proper bit location
3912
NEWSYM ErrorPointer, dd 0
3915
NEWSYM genfulladdtab
3917
cmp byte[newengen],1
3919
cmp byte[vesa2red10],0
3920
jne near genfulladdtabred
3925
test [vesa2_rtrcl],cx
3927
and ax,[vesa2_rtrcla]
3930
test [vesa2_gtrcl],cx
3932
and ax,[vesa2_gtrcla]
3935
test [vesa2_btrcl],cx
3937
and ax,[vesa2_btrcla]
3941
mov [fulladdtab+ecx*2],ax
3946
NEWSYM genfulladdtabred
3947
NEWSYM genfulladdtabng
3952
test cx,0100000000000000b
3954
and ax,1011111111111111b
3955
or ax, 0011110000000000b
3957
test cx,0000001000000000b
3959
and ax,1111110111111111b
3960
or ax, 0000000111100000b
3962
test cx,0000000000010000b
3964
and ax,1111111111101111b
3965
or ax, 0000000000001111b
3968
mov [fulladdtab+ecx*2],ax