home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD2.bin / bbs / dev / tbsource.lha / TBSource / SimCC / SimCCheat.bak < prev    next >
Text File  |  1993-12-21  |  26KB  |  1,279 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  30/4/1991              *
  27. *                                             *
  28. * BUGS: Still little problems with CShell     *
  29. *                                             *
  30. * Version 1.04  01/5/1991              *
  31. *                                             *
  32. * BUGS: Unknown                      *
  33. *                                             *
  34. * Version 1.05  02/5/1991              *
  35. *                                             *
  36. * BUGS: Unknown                      *
  37. *                                             *
  38. * Version 1.06  18/5/1991              *
  39. *                                             *
  40. * BUGS: No PoC DOS support              *
  41. *       No PoC 2,3,4 player support           *
  42. *                                             *
  43. * Version 1.07  27/5/1991              *
  44. *                                             *
  45. * BUGS: No PoC/OilImp/Oil Imperium DOS sup-   *
  46. *    port                      *
  47. *       No PoC 2, 3, 4 player support         *
  48. *                                             *
  49. ***********************************************
  50.  
  51.     INCLUDE    "JMPLibs.i"
  52.     INCLUDE    "exec/types.i"
  53.     INCLUDE    "libraries/dos.i"
  54.     INCLUDE    "libraries/reqbase.i"
  55.     INCLUDE "workbench/startup.i"
  56.     INCLUDE    "intuition.i"
  57.  
  58.     INCLUDE    "dos.xref"
  59.     INCLUDE    "intuition.xref"
  60.     INCLUDE    "exec.xref"
  61.     INCLUDE    "gfx.xref"
  62.  
  63.     INCLUDE    "FH1:Language/WF/SimCC/SimCC2.0.i"
  64.  
  65.     XREF    Help
  66.     XREF    HWin1
  67.  
  68.     XDEF    _IntuitionBase
  69.     XDEF    _GfxBase
  70.     XDEF    MenusOff
  71.     XDEF    MenusOn
  72.     XDEF    Kick
  73.     XDEF    YOffset
  74.     XDEF    Topaz
  75.     XDEF    NoWin
  76.     XDEF    CheckIDCMP
  77.     XDEF    ClearMSGs
  78.     XDEF    Window1IDCMP
  79.     XDEF    wd_RPort
  80.  
  81.         section    SimCityCheat,CODE
  82.  
  83. Start:        move.l    a0,SCCAddress        ;Get SimCity filename
  84.         move.l    d0,SCCLength        ;Get length
  85.  
  86.         move.l    #0,a1
  87.         lib    Exec,FindTask
  88.         move.l    d0,SCCTask
  89.         move.l    d0,a4
  90.  
  91.         move.l    pr_CLI(a4),d0
  92.         bne    Start1
  93.         jsr    WBStart
  94.  
  95. Start1:        openlib    Dos,ShutDown
  96.  
  97.         lib    Dos,Output
  98.         move.l    d0,_stdout
  99.  
  100.         move.l    pr_CLI(a4),d0
  101.         beq    WBInput
  102.  
  103. ;CLI Inputs
  104.  
  105.         move.l    SCCAddress(pc),a0
  106.         move.l    SCCLength(pc),d0
  107.         clr.b    -1(a0,d0.l)        ;add null to end of filename
  108.  
  109.         cmp.b    #160,(a0)
  110.         beq    StartMain
  111.         cmp.b    #$0a,(a0)
  112.         beq    StartMain
  113.         cmp.b    #$0d,(a0)
  114.         beq    StartMain
  115.         tst.b    (a0)
  116.         bne    GotFileName
  117.         jmp    StartMain
  118.  
  119. WBStart:    lea.l    pr_MsgPort(a4),a0
  120.         lib    Exec,WaitPort
  121.         lea.l    pr_MsgPort(a4),a0
  122.         flib    Exec,GetMsg
  123.         move.l    d0,WBMsg
  124. WBStart1:    rts
  125.  
  126. GotFileName:    move.w    #1,Mode
  127.         cmp.b    #"?",(a0)
  128.         beq    CommandLineHelp
  129.         lea.l    FRFile(pc),a1
  130.         jsr    CopyText
  131.         tst.l    d0
  132.         bne    ShutDown
  133.         lea.l    FRFile(pc),a0
  134.         move.l    a0,d1
  135.         move.l    #MODE_OLDFILE,d2
  136.         lib    Dos,Open
  137.         move.l    d0,SCCFile
  138.         bne    DOSCheat
  139.         jsr    SCCNotOpen
  140.         jmp    ShutDown
  141.  
  142. ;Copies filename from one place to another
  143. ;Handles CShell and quotes
  144. ;
  145. ;INPUTS
  146. ;------
  147. ;a0 = Source
  148. ;a1 = Destination
  149. ;
  150. ;RETURNS
  151. ;-------
  152. ;d0 = #$00 if everything OK
  153. ;d0 = #$ff if need to goto ShutDown
  154. ;
  155. ;DEFAULTS
  156. ;--------
  157. ;a0 = SCCAddress from DOS
  158. ;a1 = FRFile     from DOS
  159. ;
  160.  
  161. CopyText:    cmp.b    #'"',(a0)
  162.         beq    Quotes
  163. CopyTText:    move.b    (a0)+,(a1)+
  164.         cmp.b    #'"',(a0)
  165.         beq    Quotes
  166.         cmp.b    #$20,(a0)
  167.         beq    CopyTText1
  168.         cmp.b    #160,(a0)
  169.         beq    CopyTText1
  170.         cmp.b    #$0a,(a0)
  171.         beq    CopyTText1
  172.         cmp.b    #$0d,(a0)
  173.         beq    CopyTText1
  174.         cmp.b    #$00,(a0)
  175.         bne    CopyTText
  176. CopyTText1:    clr.b    (a1)
  177.         clr.l    d0
  178.         rts
  179. Quotes:        add.l    #1,a0
  180. Quotes1:    move.b    (a0)+,(a1)+
  181.         cmp.b    #$00,(a0)
  182.         beq    MismatchQuotes
  183.         cmp.b    #160,(a0)
  184.         beq    MismatchQuotes
  185.         cmp.b    #$0a,(a0)
  186.         beq    MismatchQuotes
  187.         cmp.b    #$0d,(a0)
  188.         beq    MismatchQuotes
  189.         cmp.b    #'"',(a0)
  190.         bne    Quotes1
  191. Quotes2:    clr.b    (a1)
  192.         clr.l    d0
  193.         rts
  194. MismatchQuotes:    print    <"***Break",13,10,"Mismatched quotes",13,10>
  195.         move.l    #$ff,d0
  196.         rts
  197.  
  198. ;WB Inputs, start with opening NIL:
  199.  
  200. WBInput:    lea.l    NILName(pc),a0
  201.         move.l    a0,d1
  202.         move.l    #MODE_NEWFILE,d2
  203.         lib    Dos,Open
  204.         move.l    d0,NILFile
  205.         beq    ShutDown
  206.         move.l    NILFile(pc),_stdout
  207.  
  208.         move.l    #$00,d1
  209.         flib    Dos,CurrentDir
  210.         move.l    d0,OldLock
  211.         move.l    WBMsg(pc),a2
  212.         move.l    sm_NumArgs(a2),ArgsLeft
  213.         move.l    sm_ArgList(a2),ArgList
  214.  
  215. WBInputIn:    sub.l    #1,ArgsLeft
  216.         add.l    #8,ArgList
  217.         cmp.l    #$00,ArgsLeft
  218.         beq    WBInputOut
  219.  
  220. WBInput1:    move.l    ArgList(pc),a0
  221.         move.l    wa_Name(a0),d1
  222.         move.l    d1,a1
  223.         tst.b    (a1)
  224.         bne    WBInput2
  225. WBInput1.1:    move.l    ArgList(pc),a0
  226.         move.l    wa_Lock(a0),d1
  227.         beq    WBInputIn
  228.         lib    Dos,CurrentDir
  229.         move.l    #$00,FRDir
  230.         jmp    WBInputIn
  231.  
  232. WBInput2:    move.l    d1,a0
  233.         lea.l    FRFile(pc),a1
  234. WBInput2.1:    move.b    (a0)+,(a1)+
  235.         cmp.b    #$00,(a0)
  236.         bne    WBInput2.1
  237.         clr.b    (a1)
  238.         jmp    WBInput1.1
  239.  
  240. WBInputOut:    move.l    FRDir(pc),a0
  241.         lea.l    FRPathName(pc),a1
  242.         cmp.b    #$00,(a0)
  243.         beq    WBInputOut1.1
  244. WBInputOut1:    move.b    (a0)+,(a1)+
  245.         cmp.b    #$00,(a0)
  246.         bne    WBInputOut1
  247. WBInputOut1.1:    lea.l    FRFile(pc),a0
  248. WBInputOut2:    move.b    (a0)+,(a1)+
  249.         cmp.b    #$00,(a0)
  250.         bne    WBInputOut2
  251.         clr.b    (a1)
  252.  
  253. StartMain:    move.w    #0,Mode
  254.         moveq.l    #2,d0
  255.         openlib    Req,NoReq
  256.         openlib    Intuition,NoInt
  257.         openlib    Gfx,NoGfx
  258.  
  259. ;test for 2.0
  260.  
  261.         move.l    _IntuitionBase(pc),a6
  262.         move.w    $14(a6),d0
  263.         cmp.w    #36,d0
  264.         bcs    StartWin1
  265.  
  266. ;under 2.0
  267.         move.w    #$01,Kick
  268.         move.l    #$00,a0
  269.         flib    Intuition,LockPubScreen
  270.         move.l    d0,PubScreen
  271.         beq    NoPub
  272.  
  273. ;Get DragBar size
  274.  
  275.         move.w    #40,Win1YSize
  276.         move.l    d0,a0
  277.         move.b    $1e(a0),d0
  278.         move.w    #$00,Win1ZoomY
  279.         move.b    d0,Win1ZoomY+1
  280.         add.b    d0,Gad1YPos+1
  281.         move.b    d0,YOffset
  282.  
  283. ;use new OpenWindow (OpenWindowTagList)
  284.  
  285.         lea.l    NewWindow1(pc),a0
  286.         lea.l    Win1TagList(pc),a1
  287.         flib    Intuition,OpenWindowTagList
  288.         move.l    d0,Window1
  289.         beq    NoWin
  290.         move.l    #$00,a0
  291.         move.l    PubScreen(pc),a1
  292.         flib    Intuition,UnlockPubScreen
  293.         move.l    #$00,PubScreen
  294.         jmp    AddMenu1
  295.  
  296. ;under 1.3
  297.  
  298. StartWin1:    move.w    #$00,Kick
  299.         add.w    #10,Gad1YPos
  300.         lea.l    NewWindow1(pc),a0
  301.         lib    Intuition,OpenWindow
  302.         move.l    d0,Window1
  303.         beq    NoWin
  304.  
  305. ;Add Menus to Window1
  306.  
  307. AddMenu1:    move.l    Window1(pc),a0
  308.         move.l    wd_RPort(a0),Win1RP
  309.         lea.l    Menu1(pc),a1
  310.         flib    Intuition,SetMenuStrip
  311.  
  312. ;Add gadget
  313.  
  314.         lea.l    AmountGad1(pc),a1
  315.         move.l    Window1(pc),a0
  316.         move.l    #$00,d0
  317.         flib    Intuition,AddGadget
  318.  
  319. ;Refresh gad list
  320.  
  321.         lea.l    AmountGad1(pc),a0
  322.         move.l    Window1(pc),a1
  323.         move.l    #$00,a2
  324.         flib    Intuition,RefreshGadgets
  325.  
  326. ;Activate string gad
  327.  
  328.         lea.l    AmountGad1(pc),a0
  329.         move.l    Window1(pc),a1
  330.         move.l    #$00,a2
  331.         flib    Intuition,ActivateGadget
  332.  
  333. Window1IDCMP:    move.l    Window1(pc),a0
  334.         jsr    CheckIDCMP
  335.         cmp.l    #CLOSEWINDOW,d2
  336.         beq    ShutDown
  337.         cmp.l    #VANILLAKEY,d2
  338.         beq    VanillaKeys
  339.         cmp.l    #RAWKEY,d2
  340.         beq    RawKeys
  341.         cmp.l    #MENUPICK,d2
  342.         beq    Win1Menus
  343.         cmp.l    #MOUSEBUTTONS,d2
  344.         beq    ActivateGad
  345.         jmp    Window1IDCMP
  346.  
  347. VanillaKeys:    cmp.w    #$1b,d3
  348.         beq    ShutDown
  349.         cmp.w    #"q",d3
  350.         beq    ShutDown
  351.         cmp.w    #"Q",d3
  352.         beq    ShutDown
  353.         jmp    Window1IDCMP
  354. RawKeys:    cmp.w    #$5f,d3
  355.         beq    Help
  356.         jmp    Window1IDCMP
  357.  
  358. ActivateGad:    cmp.l    #IECODE_LBUTTON,d3
  359.         bne    ActivateGadOut
  360. ActivateGad1:    lea.l    AmountGad1(pc),a0
  361.         move.l    Window1(pc),a1
  362.         move.l    #$00,a2
  363.         lib    Intuition,ActivateGadget
  364. ActivateGadOut:    jmp    Window1IDCMP
  365.  
  366. Win1Menus:    jsr    MenuNull
  367.         cmp.l    #$00,d6
  368.         beq    DoMenu1
  369.         cmp.l    #$01,d6
  370.         beq    DoMenu2
  371.         jmp    Window1IDCMP
  372. DoMenu1:    cmp.l    #$00,d5
  373.         beq    GetN
  374.         cmp.l    #$01,d5
  375.         beq    Help
  376.         cmp.l    #$02,d5
  377.         beq    About
  378.         cmp.l    #$03,d5
  379.         beq    ShutDown
  380.         jmp    Window1IDCMP
  381. DoMenu2:    cmp.l    #$00,d5
  382.         beq    DM2.1
  383.         jmp    Window1IDCMP
  384. DM2.1:        cmp.l    #$00,d4
  385.         beq    DM2.1.1
  386.         cmp.l    #$01,d4
  387.         beq    DM2.1.2
  388.         cmp.l    #$02,d4
  389.         beq    DM2.1.3
  390.         cmp.l    #