home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD2.bin / bbs / dev / tbsource.lha / TBSource / SimCC / SCheat13a.S < prev    next >
Text File  |  1993-12-21  |  19KB  |  956 lines

  1. ***********************************************
  2. *                                             *
  3. *              (C)opyright 1991               *
  4. *                                             *
  5. *             by  Tomi Blinnikka              *
  6. *                                             *
  7. *             SimCity 1.1  Cheat              *
  8. *                                             *
  9. * Version 0.00a - 0.99a  18/4/1991            *
  10. *                                             *
  11. * BUGS: Didn't work through DOS               *
  12. *                                             *
  13. * Version 1.00  19/4/1991                     *
  14. *                                             *
  15. * BUGS: No WB Stuff + some font stuff         *
  16. *                                             *
  17. * Version 1.01  26-27/4/1991                  *
  18. *                                             *
  19. * BUGS: No font stuff + WB Stuff didn't work  *
  20. *       from directories                      *
  21. *                                             *
  22. * Version 1.02  27-29/4/1991                  *
  23. *                                             *
  24. * BUGS: Doesn't work with CShell          *
  25. *                                             *
  26. * Version 1.03  29/4/1991                  *
  27. *                                             *
  28. * BUGS: Unknown                      *
  29. *                                             *
  30. ***********************************************
  31.  
  32.     INCLUDE    "JMPLibs.i"
  33.     INCLUDE    "exec/types.i"
  34.     INCLUDE    "libraries/dos.i"
  35.     INCLUDE    "libraries/reqbase.i"
  36.     INCLUDE "workbench/startup.i"
  37.     INCLUDE    "intuition.i"
  38.  
  39.     INCLUDE    "dos.xref"
  40.     INCLUDE    "intuition.xref"
  41.     INCLUDE    "exec.xref"
  42.  
  43.     INCLUDE    "FH1:Language/WF/SimCC/SimCC2.0.i"
  44.  
  45.         section    SimCityCheat,CODE
  46.  
  47. Start:        move.l    a0,SCCAddress        ;Get SimCity filename
  48.         move.l    d0,SCCLength        ;Get length
  49.  
  50.         move.l    #0,a1
  51.         lib    Exec,FindTask
  52.         move.l    d0,SCCTask
  53.         move.l    d0,a4
  54.  
  55.         move.l    pr_CLI(a4),d0
  56.         bne    Start1
  57.         jsr    WBStart
  58.  
  59. Start1:        openlib    Dos,ShutDown
  60.  
  61.         lib    Dos,Output
  62.         move.l    d0,_stdout
  63.  
  64. ;        move.l    SCCTask(pc),a4
  65.         move.l    pr_CLI(a4),d0
  66.         beq    WBInput
  67.  
  68. ;CLI Inputs
  69.  
  70.         move.l    SCCAddress,a0
  71.         move.l    SCCLength,d0
  72.         clr.b    -1(a0,d0.l)        ;add null to end of filename
  73.  
  74.         move.l    SCCAddress(pc),a0
  75.         tst.b    (a0)
  76.         bne    GotFileName
  77.         jmp    StartMain
  78.  
  79. WBStart:    lea.l    pr_MsgPort(a4),a0
  80.         lib    Exec,WaitPort
  81.         lea.l    pr_MsgPort(a4),a0
  82.         lib    Exec,GetMsg
  83.         move.l    d0,WBMsg
  84. WBStart1:    rts
  85.  
  86. GotFileName:
  87.         move.w    #1,Mode
  88.         move.l    SCCAddress(pc),a0
  89.         lea.l    FRPathName(pc),a1
  90.         cmp.b    #"?",(a0)
  91.         beq    CommandLineHelp
  92. CopyFName:    move.b    (a0)+,(a1)+
  93.         cmp.b    #$00,(a0)
  94.         bne    CopyFName
  95.         clr.b    (a1)
  96.  
  97.         move.l    SCCAddress(pc),a0
  98.         lea.l    FRFile(pc),a1
  99. CopyFName1:    move.b    (a0)+,(a1)+
  100.         cmp.b    #$20,(a0)
  101.         beq    CopyFName2
  102.         cmp.b    #160,(a0)
  103.         beq    CopyFName2
  104.         cmp.b    #$00,(a0)
  105.         bne    CopyFName1
  106. CopyFName2:    clr.b    (a1)
  107.  
  108.         lea.l    FRFile(pc),a0
  109.         move.l    a0,d1
  110.         move.l    #MODE_OLDFILE,d2
  111.         lib    Dos,Open
  112.         move.l    d0,SCCFile
  113.         bne    DOSCheat
  114.         jsr    SCCNotOpen
  115.         jmp    ShutDown
  116. ;WB Inputs
  117.  
  118. WBInput:
  119.  
  120. ;Open NIL:
  121.  
  122.         lea.l    NILName(pc),a0
  123.         move.l    a0,d1
  124.         move.l    #MODE_NEWFILE,d2
  125.         lib    Dos,Open
  126.         move.l    d0,NILFile
  127.         beq    ShutDown
  128.         move.l    NILFile(pc),_stdout
  129.     
  130.         move.l    #$00,d1
  131.         lib    Dos,CurrentDir
  132.         move.l    d0,OldLock
  133.         move.l    WBMsg(pc),a2
  134.         move.l    sm_NumArgs(a2),ArgsLeft
  135.         move.l    sm_ArgList(a2),ArgList
  136.  
  137. WBInputIn:    sub.l    #1,ArgsLeft
  138.         add.l    #8,ArgList
  139.         cmp.l    #$00,ArgsLeft
  140.         beq    WBInputOut
  141.  
  142. WBInput1:    move.l    ArgList(pc),a0
  143.         move.l    wa_Name(a0),d1
  144.         move.l    d1,a1
  145.         tst.b    (a1)
  146.         bne    WBInput2
  147. WBInput1.1:    move.l    ArgList(pc),a0
  148.         move.l    wa_Lock(a0),d1
  149.         beq    WBInputIn
  150.         lib    Dos,CurrentDir
  151.         move.l    #$00,FRDir
  152.         jmp    WBInputIn
  153.  
  154. WBInput2:    move.l    d1,a0
  155.         lea.l    FRFile(pc),a1
  156. WBInput2.1:    move.b    (a0)+,(a1)+
  157.         cmp.b    #$00,(a0)
  158.         bne    WBInput2.1
  159.         clr.b    (a1)
  160.         jmp    WBInput1.1
  161.  
  162. WBInputOut:    move.l    FRDir(pc),a0
  163.         lea.l    FRPathName(pc),a1
  164.         cmp.b    #$00,(a0)
  165.         beq    WBInputOut1.1
  166. WBInputOut1:    move.b    (a0)+,(a1)+
  167.         cmp.b    #$00,(a0)
  168.         bne    WBInputOut1
  169. WBInputOut1.1:    lea.l    FRFile(pc),a0
  170. WBInputOut2:    move.b    (a0)+,(a1)+
  171.         cmp.b    #$00,(a0)
  172.         bne    WBInputOut2
  173.         clr.b    (a1)
  174.  
  175. StartMain:    move.w    #0,Mode
  176.         moveq.l    #2,d0
  177.         openlib    Req,NoReq
  178.         openlib    Intuition,NoInt
  179.         openlib    Gfx,NoGfx
  180.  
  181.         move.l    #$31363737,AmountBuf
  182.         move.l    #$37323135,AmountBuf+4
  183.         move.l    #16777215,AmountInt
  184.  
  185. ;test for 2.0
  186.  
  187.         move.l    _IntuitionBase(pc),a0
  188.         move.w    $14(a0),d0
  189.         cmp.w    #36,d0
  190.         bcs    StartWin1
  191.  
  192. ;under 2.0
  193.         move.l    #$00,a0
  194.         lib    Intuition,LockPubScreen
  195.         move.l    d0,PubScreen
  196.         beq    NoPub
  197.  
  198. ;Get DragBar size
  199.  
  200.         move.w    #40,Win1YSize
  201.         move.l    d0,a0
  202.         move.b    $1e(a0),d0
  203.         move.w    #$00,Win1ZoomY
  204.         move.b    d0,Win1ZoomY+1
  205.         add.b    d0,Gad1YPos+1
  206.  
  207. ;use new OpenWindow (OpenWindowTagList)
  208.  
  209.         lea.l    NewWindow1(pc),a0
  210.         lea.l    Win1TagList(pc),a1
  211.         lib    Intuition,OpenWindowTagList
  212.         move.l    d0,Window1
  213.         beq    NoWin1
  214.         move.l    #$00,a0
  215.         move.l    PubScreen(pc),a1
  216.         lib    Intuition,UnlockPubScreen
  217.         move.l    #$00,PubScreen
  218.         jmp    GetRP1
  219.  
  220. ;under 1.3
  221.  
  222. StartWin1:    add.w    #10,Gad1YPos
  223.         lea.l    NewWindow1(pc),a0
  224.         lib    Intuition,OpenWindow
  225.         move.l    d0,Window1
  226.         beq    NoWin1
  227. GetRP1:        move.l    d0,a0
  228.         move.l    $32(a0),RP1
  229.         move.w    #$01,Gad1On
  230.  
  231. ;Add Menus to Window1
  232.  
  233.         move.l    Window1(pc),a0
  234.         lea.l    Menu1(pc),a1
  235.         lib    Intuition,SetMenuStrip
  236.  
  237. ;Add gadget
  238.  
  239.         lea.l    AmountGad1(pc),a1
  240.         move.l    Window1(pc),a0
  241.         move.l    #$00,d0
  242.         lib    Intuition,AddGadget
  243.  
  244. ;Refresh gad list
  245.  
  246.         lea.l    AmountGad1(pc),a0
  247.         move.l    Window1(pc),a1
  248.         move.l    #$00,a2
  249.         lib    Intuition,RefreshGadgets
  250.  
  251. ;Activate string gad
  252.  
  253.         lea.l    AmountGad1(pc),a0
  254.         move.l    Window1(pc),a1
  255.         move.l    #$00,a2
  256.         lib    Intuition,ActivateGadget
  257.  
  258. Window1IDCMP:    move.l    Window1(pc),a0
  259.         jsr    CheckIDCMP
  260.         cmp.l    #CLOSEWINDOW,d2
  261.         beq    ShutDown
  262.         cmp.l    #VANILLAKEY,d2
  263.         beq    VanillaKeys
  264.         cmp.l    #RAWKEY,d2
  265.         beq    RawKeys
  266.         cmp.l    #MENUPICK,d2
  267.         beq    Win1Menus
  268.         cmp.l    #MOUSEBUTTONS,d2
  269.         beq    ActivateGad1
  270.         jmp    Window1IDCMP
  271.  
  272. VanillaKeys:    cmp.w    #$1b,d3
  273.         beq    ShutDown
  274.         jmp    Window1IDCMP
  275. RawKeys:    cmp.w    #$5f,d3
  276.         beq    Help
  277.         jmp    Window1IDCMP
  278.  
  279. ActivateGad1:    cmp.l    #IECODE_LBUTTON,d3
  280.         bne    ActivateGadOut
  281.         lea.l    AmountGad1(pc),a0
  282.         move.l    Window1(pc),a1
  283.         move.l    #$00,a2
  284.         lib    Intuition,ActivateGadget
  285. ActivateGadOut:    jmp    Window1IDCMP
  286.  
  287. Win1Menus:    jsr    MenuNull
  288.         cmp.l    #$00,d5
  289.         beq    GetN
  290.         cmp.l    #$01,d5
  291.         beq    Help
  292.         cmp.l    #$02,d5
  293.         beq    About
  294.         cmp.l    #$03,d5
  295.         beq    ShutDown
  296.         jmp    Window1IDCMP
  297.  
  298. GetN:
  299.         cmp.l    #16777216,AmountInt
  300.         bcs    GetN0.1
  301.         move.l    Window1(pc),a0
  302.         move.l    $2e(a0),a0
  303.         lib    Intuition,DisplayBeep
  304.         move.l    Window1(pc),a0
  305.         lea.l    AmountGad1(pc),a1
  306.         lib    Intuition,RemoveGadget
  307.         move.l    #$31363737,AmountBuf
  308.         move.l    #$37323135,AmountBuf+4
  309.         move.l    #16777215,AmountInt
  310.         move.l    Window1(pc),a0
  311.         lea.l    AmountGad1(pc),a1
  312.         move.l    #$00,d0
  313.         lib    Intuition,AddGadget
  314.         lea.l    AmountGad1(pc),a0
  315.         move.l    Window1(pc),a1
  316.         move.l    #$00,a2
  317.         lib    Intuition,RefreshGadgets
  318. CheckAmountOut:    jmp    Window1IDCMP
  319.  
  320. GetN0.1:    jsr    MenusOff
  321.         lea.l    GetNName(pc),a5
  322.         move.l    #FRQABSOLUTEXYM+FRQLOADINGM,d5
  323.         jsr    FileRequester
  324.         tst.l    d0
  325.         beq    GetNOut
  326.  
  327.         lea.l    FRPathName(pc),a1
  328.         move.l    a1,d1
  329.         cmp.b    #$00,(a1)
  330.         beq    GetNOut
  331.         move.l    #MODE_OLDFILE,d2
  332.         lib    Dos,Open
  333.         move.l    d0,SCCFile
  334.         bne    GetN1
  335.         jsr    FileError
  336.         jmp    GetNOut
  337.  
  338. GetN1:        jsr    MenusOff
  339.         move.l    Window1(pc),a0
  340.         lea.l    Cheat?Txt(pc),a1
  341.         lea.l    OKTxt(pc),a2
  342.         lea.l    CancelTxt(pc),a3
  343.         move.l    #$00,d0
  344.         move.l    #$00,d1
  345.         move.l    #$100,d2
  346.         move.l    #$40,d3
  347.         lib    Intuition,AutoRequest
  348.         cmp.l    #00,d0
  349.         beq    GetN1.1
  350.         jsr    TestForCity
  351. GetN1.1:    jsr    MenusOn
  352.     
  353. GetN2:        move.l    SCCFile(pc),d1
  354.         lib    Dos,Close
  355.         move.l    #$00,SCCFile
  356.  
  357. GetNOut:    jsr    MenusOn
  358.         jmp    Window1IDCMP
  359.  
  360. FileRequester:    move.l    a5,FRTitle
  361.         move.l    d5,FRFlags
  362.         lea.l    FileRequest1(pc),a0
  363.         lib    Req,FileRequester
  364. FROut:        rts
  365.  
  366. About:        jsr    MenusOff
  367.         move.l    Window1(pc),a0
  368.         lea.l    AboutTxt1(pc),a1
  369.         move.l    #$00,a2        ;positive text
  370.         lea.l    OKTxt(pc),a3    ;a bit the wrong way around but...
  371.         move.l    #$00,d0
  372.         move.l    #$00,d1
  373.         move.l    #$134,d2
  374.         move.l    #$50,d3
  375.         lib    Intuition,AutoRequest
  376.         jsr    MenusOn
  377.         jmp    Window1IDCMP
  378.  
  379. Help:        jsr    MenusOff
  380.         move.l    Window1(pc),a0
  381.         lea.l    HelpTxt1(pc),a1
  382.         move.l    #$00,a2        ;positive text
  383.         lea.l    OKTxt(pc),a3    ;a bit the wrong way around but...
  384.         move.l    #$00,d0
  385.         move.l    #$00,d1
  386.         move.l    #$190,d2
  387.         move.l    #$40,d3
  388.         lib    Intuition,AutoRequest
  389.         jsr    MenusOn
  390.         jmp    Window1IDCMP
  391.  
  392. Finished:    move.l    Window1(pc),a0
  393.         lea.l    FinitoTxt1(pc),a1
  394.         move.l    #$00,a2        ;positive text
  395.         lea.l    OKTxt(pc),a3