home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD2.bin
/
bbs
/
dev
/
tbsource.lha
/
TBSource
/
SimCC
/
SimCCheat.bak
< prev
next >
Wrap
Text File
|
1993-12-21
|
26KB
|
1,279 lines
***********************************************
* *
* (C)opyright 1991 *
* *
* by Tomi Blinnikka *
* *
* SimCity 1.1 Cheat *
* *
* Version 0.00a - 0.99a 18/4/1991 *
* *
* BUGS: Didn't work through DOS *
* *
* Version 1.00 19/4/1991 *
* *
* BUGS: No WB Stuff + some font stuff *
* *
* Version 1.01 26-27/4/1991 *
* *
* BUGS: No font stuff + WB Stuff didn't work *
* from directories *
* *
* Version 1.02 27-29/4/1991 *
* *
* BUGS: Doesn't work with CShell *
* *
* Version 1.03 30/4/1991 *
* *
* BUGS: Still little problems with CShell *
* *
* Version 1.04 01/5/1991 *
* *
* BUGS: Unknown *
* *
* Version 1.05 02/5/1991 *
* *
* BUGS: Unknown *
* *
* Version 1.06 18/5/1991 *
* *
* BUGS: No PoC DOS support *
* No PoC 2,3,4 player support *
* *
* Version 1.07 27/5/1991 *
* *
* BUGS: No PoC/OilImp/Oil Imperium DOS sup- *
* port *
* No PoC 2, 3, 4 player support *
* *
***********************************************
INCLUDE "JMPLibs.i"
INCLUDE "exec/types.i"
INCLUDE "libraries/dos.i"
INCLUDE "libraries/reqbase.i"
INCLUDE "workbench/startup.i"
INCLUDE "intuition.i"
INCLUDE "dos.xref"
INCLUDE "intuition.xref"
INCLUDE "exec.xref"
INCLUDE "gfx.xref"
INCLUDE "FH1:Language/WF/SimCC/SimCC2.0.i"
XREF Help
XREF HWin1
XDEF _IntuitionBase
XDEF _GfxBase
XDEF MenusOff
XDEF MenusOn
XDEF Kick
XDEF YOffset
XDEF Topaz
XDEF NoWin
XDEF CheckIDCMP
XDEF ClearMSGs
XDEF Window1IDCMP
XDEF wd_RPort
section SimCityCheat,CODE
Start: move.l a0,SCCAddress ;Get SimCity filename
move.l d0,SCCLength ;Get length
move.l #0,a1
lib Exec,FindTask
move.l d0,SCCTask
move.l d0,a4
move.l pr_CLI(a4),d0
bne Start1
jsr WBStart
Start1: openlib Dos,ShutDown
lib Dos,Output
move.l d0,_stdout
move.l pr_CLI(a4),d0
beq WBInput
;CLI Inputs
move.l SCCAddress(pc),a0
move.l SCCLength(pc),d0
clr.b -1(a0,d0.l) ;add null to end of filename
cmp.b #160,(a0)
beq StartMain
cmp.b #$0a,(a0)
beq StartMain
cmp.b #$0d,(a0)
beq StartMain
tst.b (a0)
bne GotFileName
jmp StartMain
WBStart: lea.l pr_MsgPort(a4),a0
lib Exec,WaitPort
lea.l pr_MsgPort(a4),a0
flib Exec,GetMsg
move.l d0,WBMsg
WBStart1: rts
GotFileName: move.w #1,Mode
cmp.b #"?",(a0)
beq CommandLineHelp
lea.l FRFile(pc),a1
jsr CopyText
tst.l d0
bne ShutDown
lea.l FRFile(pc),a0
move.l a0,d1
move.l #MODE_OLDFILE,d2
lib Dos,Open
move.l d0,SCCFile
bne DOSCheat
jsr SCCNotOpen
jmp ShutDown
;Copies filename from one place to another
;Handles CShell and quotes
;
;INPUTS
;------
;a0 = Source
;a1 = Destination
;
;RETURNS
;-------
;d0 = #$00 if everything OK
;d0 = #$ff if need to goto ShutDown
;
;DEFAULTS
;--------
;a0 = SCCAddress from DOS
;a1 = FRFile from DOS
;
CopyText: cmp.b #'"',(a0)
beq Quotes
CopyTText: move.b (a0)+,(a1)+
cmp.b #'"',(a0)
beq Quotes
cmp.b #$20,(a0)
beq CopyTText1
cmp.b #160,(a0)
beq CopyTText1
cmp.b #$0a,(a0)
beq CopyTText1
cmp.b #$0d,(a0)
beq CopyTText1
cmp.b #$00,(a0)
bne CopyTText
CopyTText1: clr.b (a1)
clr.l d0
rts
Quotes: add.l #1,a0
Quotes1: move.b (a0)+,(a1)+
cmp.b #$00,(a0)
beq MismatchQuotes
cmp.b #160,(a0)
beq MismatchQuotes
cmp.b #$0a,(a0)
beq MismatchQuotes
cmp.b #$0d,(a0)
beq MismatchQuotes
cmp.b #'"',(a0)
bne Quotes1
Quotes2: clr.b (a1)
clr.l d0
rts
MismatchQuotes: print <"***Break",13,10,"Mismatched quotes",13,10>
move.l #$ff,d0
rts
;WB Inputs, start with opening NIL:
WBInput: lea.l NILName(pc),a0
move.l a0,d1
move.l #MODE_NEWFILE,d2
lib Dos,Open
move.l d0,NILFile
beq ShutDown
move.l NILFile(pc),_stdout
move.l #$00,d1
flib Dos,CurrentDir
move.l d0,OldLock
move.l WBMsg(pc),a2
move.l sm_NumArgs(a2),ArgsLeft
move.l sm_ArgList(a2),ArgList
WBInputIn: sub.l #1,ArgsLeft
add.l #8,ArgList
cmp.l #$00,ArgsLeft
beq WBInputOut
WBInput1: move.l ArgList(pc),a0
move.l wa_Name(a0),d1
move.l d1,a1
tst.b (a1)
bne WBInput2
WBInput1.1: move.l ArgList(pc),a0
move.l wa_Lock(a0),d1
beq WBInputIn
lib Dos,CurrentDir
move.l #$00,FRDir
jmp WBInputIn
WBInput2: move.l d1,a0
lea.l FRFile(pc),a1
WBInput2.1: move.b (a0)+,(a1)+
cmp.b #$00,(a0)
bne WBInput2.1
clr.b (a1)
jmp WBInput1.1
WBInputOut: move.l FRDir(pc),a0
lea.l FRPathName(pc),a1
cmp.b #$00,(a0)
beq WBInputOut1.1
WBInputOut1: move.b (a0)+,(a1)+
cmp.b #$00,(a0)
bne WBInputOut1
WBInputOut1.1: lea.l FRFile(pc),a0
WBInputOut2: move.b (a0)+,(a1)+
cmp.b #$00,(a0)
bne WBInputOut2
clr.b (a1)
StartMain: move.w #0,Mode
moveq.l #2,d0
openlib Req,NoReq
openlib Intuition,NoInt
openlib Gfx,NoGfx
;test for 2.0
move.l _IntuitionBase(pc),a6
move.w $14(a6),d0
cmp.w #36,d0
bcs StartWin1
;under 2.0
move.w #$01,Kick
move.l #$00,a0
flib Intuition,LockPubScreen
move.l d0,PubScreen
beq NoPub
;Get DragBar size
move.w #40,Win1YSize
move.l d0,a0
move.b $1e(a0),d0
move.w #$00,Win1ZoomY
move.b d0,Win1ZoomY+1
add.b d0,Gad1YPos+1
move.b d0,YOffset
;use new OpenWindow (OpenWindowTagList)
lea.l NewWindow1(pc),a0
lea.l Win1TagList(pc),a1
flib Intuition,OpenWindowTagList
move.l d0,Window1
beq NoWin
move.l #$00,a0
move.l PubScreen(pc),a1
flib Intuition,UnlockPubScreen
move.l #$00,PubScreen
jmp AddMenu1
;under 1.3
StartWin1: move.w #$00,Kick
add.w #10,Gad1YPos
lea.l NewWindow1(pc),a0
lib Intuition,OpenWindow
move.l d0,Window1
beq NoWin
;Add Menus to Window1
AddMenu1: move.l Window1(pc),a0
move.l wd_RPort(a0),Win1RP
lea.l Menu1(pc),a1
flib Intuition,SetMenuStrip
;Add gadget
lea.l AmountGad1(pc),a1
move.l Window1(pc),a0
move.l #$00,d0
flib Intuition,AddGadget
;Refresh gad list
lea.l AmountGad1(pc),a0
move.l Window1(pc),a1
move.l #$00,a2
flib Intuition,RefreshGadgets
;Activate string gad
lea.l AmountGad1(pc),a0
move.l Window1(pc),a1
move.l #$00,a2
flib Intuition,ActivateGadget
Window1IDCMP: move.l Window1(pc),a0
jsr CheckIDCMP
cmp.l #CLOSEWINDOW,d2
beq ShutDown
cmp.l #VANILLAKEY,d2
beq VanillaKeys
cmp.l #RAWKEY,d2
beq RawKeys
cmp.l #MENUPICK,d2
beq Win1Menus
cmp.l #MOUSEBUTTONS,d2
beq ActivateGad
jmp Window1IDCMP
VanillaKeys: cmp.w #$1b,d3
beq ShutDown
cmp.w #"q",d3
beq ShutDown
cmp.w #"Q",d3
beq ShutDown
jmp Window1IDCMP
RawKeys: cmp.w #$5f,d3
beq Help
jmp Window1IDCMP
ActivateGad: cmp.l #IECODE_LBUTTON,d3
bne ActivateGadOut
ActivateGad1: lea.l AmountGad1(pc),a0
move.l Window1(pc),a1
move.l #$00,a2
lib Intuition,ActivateGadget
ActivateGadOut: jmp Window1IDCMP
Win1Menus: jsr MenuNull
cmp.l #$00,d6
beq DoMenu1
cmp.l #$01,d6
beq DoMenu2
jmp Window1IDCMP
DoMenu1: cmp.l #$00,d5
beq GetN
cmp.l #$01,d5
beq Help
cmp.l #$02,d5
beq About
cmp.l #$03,d5
beq ShutDown
jmp Window1IDCMP
DoMenu2: cmp.l #$00,d5
beq DM2.1
jmp Window1IDCMP
DM2.1: cmp.l #$00,d4
beq DM2.1.1
cmp.l #$01,d4
beq DM2.1.2
cmp.l #$02,d4
beq DM2.1.3
cmp.l #