home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD2.bin
/
bbs
/
dev
/
tbsource.lha
/
TBSource
/
SimCC
/
SCheat13a.S
< prev
next >
Wrap
Text File
|
1993-12-21
|
19KB
|
956 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 29/4/1991 *
* *
* BUGS: Unknown *
* *
***********************************************
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 "FH1:Language/WF/SimCC/SimCC2.0.i"
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 SCCTask(pc),a4
move.l pr_CLI(a4),d0
beq WBInput
;CLI Inputs
move.l SCCAddress,a0
move.l SCCLength,d0
clr.b -1(a0,d0.l) ;add null to end of filename
move.l SCCAddress(pc),a0
tst.b (a0)
bne GotFileName
jmp StartMain
WBStart: lea.l pr_MsgPort(a4),a0
lib Exec,WaitPort
lea.l pr_MsgPort(a4),a0
lib Exec,GetMsg
move.l d0,WBMsg
WBStart1: rts
GotFileName:
move.w #1,Mode
move.l SCCAddress(pc),a0
lea.l FRPathName(pc),a1
cmp.b #"?",(a0)
beq CommandLineHelp
CopyFName: move.b (a0)+,(a1)+
cmp.b #$00,(a0)
bne CopyFName
clr.b (a1)
move.l SCCAddress(pc),a0
lea.l FRFile(pc),a1
CopyFName1: move.b (a0)+,(a1)+
cmp.b #$20,(a0)
beq CopyFName2
cmp.b #160,(a0)
beq CopyFName2
cmp.b #$00,(a0)
bne CopyFName1
CopyFName2: clr.b (a1)
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
;WB Inputs
WBInput:
;Open NIL:
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
lib 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
move.l #$31363737,AmountBuf
move.l #$37323135,AmountBuf+4
move.l #16777215,AmountInt
;test for 2.0
move.l _IntuitionBase(pc),a0
move.w $14(a0),d0
cmp.w #36,d0
bcs StartWin1
;under 2.0
move.l #$00,a0
lib 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
;use new OpenWindow (OpenWindowTagList)
lea.l NewWindow1(pc),a0
lea.l Win1TagList(pc),a1
lib Intuition,OpenWindowTagList
move.l d0,Window1
beq NoWin1
move.l #$00,a0
move.l PubScreen(pc),a1
lib Intuition,UnlockPubScreen
move.l #$00,PubScreen
jmp GetRP1
;under 1.3
StartWin1: add.w #10,Gad1YPos
lea.l NewWindow1(pc),a0
lib Intuition,OpenWindow
move.l d0,Window1
beq NoWin1
GetRP1: move.l d0,a0
move.l $32(a0),RP1
move.w #$01,Gad1On
;Add Menus to Window1
move.l Window1(pc),a0
lea.l Menu1(pc),a1
lib Intuition,SetMenuStrip
;Add gadget
lea.l AmountGad1(pc),a1
move.l Window1(pc),a0
move.l #$00,d0
lib Intuition,AddGadget
;Refresh gad list
lea.l AmountGad1(pc),a0
move.l Window1(pc),a1
move.l #$00,a2
lib Intuition,RefreshGadgets
;Activate string gad
lea.l AmountGad1(pc),a0
move.l Window1(pc),a1
move.l #$00,a2
lib 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 ActivateGad1
jmp Window1IDCMP
VanillaKeys: cmp.w #$1b,d3
beq ShutDown
jmp Window1IDCMP
RawKeys: cmp.w #$5f,d3
beq Help
jmp Window1IDCMP
ActivateGad1: cmp.l #IECODE_LBUTTON,d3
bne ActivateGadOut
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,d5
beq GetN
cmp.l #$01,d5
beq Help
cmp.l #$02,d5
beq About
cmp.l #$03,d5
beq ShutDown
jmp Window1IDCMP
GetN:
cmp.l #16777216,AmountInt
bcs GetN0.1
move.l Window1(pc),a0
move.l $2e(a0),a0
lib Intuition,DisplayBeep
move.l Window1(pc),a0
lea.l AmountGad1(pc),a1
lib Intuition,RemoveGadget
move.l #$31363737,AmountBuf
move.l #$37323135,AmountBuf+4
move.l #16777215,AmountInt
move.l Window1(pc),a0
lea.l AmountGad1(pc),a1
move.l #$00,d0
lib Intuition,AddGadget
lea.l AmountGad1(pc),a0
move.l Window1(pc),a1
move.l #$00,a2
lib Intuition,RefreshGadgets
CheckAmountOut: jmp Window1IDCMP
GetN0.1: jsr MenusOff
lea.l GetNName(pc),a5
move.l #FRQABSOLUTEXYM+FRQLOADINGM,d5
jsr FileRequester
tst.l d0
beq GetNOut
lea.l FRPathName(pc),a1
move.l a1,d1
cmp.b #$00,(a1)
beq GetNOut
move.l #MODE_OLDFILE,d2
lib Dos,Open
move.l d0,SCCFile
bne GetN1
jsr FileError
jmp GetNOut
GetN1: jsr MenusOff
move.l Window1(pc),a0
lea.l Cheat?Txt(pc),a1
lea.l OKTxt(pc),a2
lea.l CancelTxt(pc),a3
move.l #$00,d0
move.l #$00,d1
move.l #$100,d2
move.l #$40,d3
lib Intuition,AutoRequest
cmp.l #00,d0
beq GetN1.1
jsr TestForCity
GetN1.1: jsr MenusOn
GetN2: move.l SCCFile(pc),d1
lib Dos,Close
move.l #$00,SCCFile
GetNOut: jsr MenusOn
jmp Window1IDCMP
FileRequester: move.l a5,FRTitle
move.l d5,FRFlags
lea.l FileRequest1(pc),a0
lib Req,FileRequester
FROut: rts
About: jsr MenusOff
move.l Window1(pc),a0
lea.l AboutTxt1(pc),a1
move.l #$00,a2 ;positive text
lea.l OKTxt(pc),a3 ;a bit the wrong way around but...
move.l #$00,d0
move.l #$00,d1
move.l #$134,d2
move.l #$50,d3
lib Intuition,AutoRequest
jsr MenusOn
jmp Window1IDCMP
Help: jsr MenusOff
move.l Window1(pc),a0
lea.l HelpTxt1(pc),a1
move.l #$00,a2 ;positive text
lea.l OKTxt(pc),a3 ;a bit the wrong way around but...
move.l #$00,d0
move.l #$00,d1
move.l #$190,d2
move.l #$40,d3
lib Intuition,AutoRequest
jsr MenusOn
jmp Window1IDCMP
Finished: move.l Window1(pc),a0
lea.l FinitoTxt1(pc),a1
move.l #$00,a2 ;positive text
lea.l OKTxt(pc),a3