Author Topic: Zelda 64(NES Zelda Clone) Demo  (Read 3194 times)

0 Members and 1 Guest are viewing this topic.

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Zelda 64(NES Zelda Clone) Demo
« on: December 19, 2021, 09:41:26 pm »
After taking a peek at Craz1000's Master Sword game (based on the NES game Zelda) reminded me of my Zelda Clone I started in March 2018! So I brought it up, deleted all the code and started from scratch!
And here is my past Weeks worth of work on it!

Temporary controls(Defaults)

Letter controls are UPPER CASE!

A -  Start Button
B -  Select Button (change selection(option) in game selection screen)
Space Bar - Button A (attack)
Enter - Button B(not used yet)
Arrow Keys - Map navigation, letter selection

The Title Scroll works!
The Game Selection menus all work, Pick a game to resume, Register a name, and Elimination Mode.
Once Registering and picking your character you can Explore the map.
At the moment the map is empty, no creatures to combat, No caves or dungeons to enter. You do start with the first sword so blast and slash away!

took me a few hours to get the map traversing done, took 4 DAYS to get the title screen and game selection screens working!

Really putting this up here to see what people think of the Title screen and Selection screens, and to see if anyone can break those parts.

I should warn you it is possible to get stuck, if you change map screens and the next screen bottle necks down you can wind up stuck in rock. There is no way to undo this yet, you have to quit.

As I do not have the OPTIONS screen done yet, there is one option you can manually play with if you like, the Scale option. There are 3 settings; LINE 116:G.Scale_Factor = 1
1- Small(actual game size) 256x224px
2- Normal 512x448px
3- Large 768x672px

at scale 1 a debugging map of the game is displayed at the top of the screen, the yellow square is you.

(developed in 2.0.2, but tested on 1.4,1.5,and 1.6 all work[should work with all versions back to 1.1build82])

Code: QB64: [Select]
  1. 'Zelda Clone take 2
  2.  
  3. TYPE ControllerKeys
  4.  KBCon_Up AS LONG
  5.  KBCon_Down AS LONG
  6.  KBCon_Left AS LONG
  7.  KBCon_Right AS LONG
  8.  KBCon_Select AS LONG
  9.  KBCon_Start AS LONG
  10.  KBCon_A_Button AS LONG
  11.  KBCon_B_Button AS LONG
  12.  
  13. TYPE Game_Data
  14.  Impactflag AS _BYTE
  15.  Scale_Factor AS _BYTE
  16.  Scale_X AS _BYTE
  17.  Scale_Y AS _BYTE
  18.  NextScreen AS _BYTE
  19.  Wtime AS _BYTE
  20.  Atime AS _BYTE
  21.  Wframe AS _BYTE
  22.  Aframe AS _BYTE
  23.  Projectile_Count AS _BYTE
  24.  LoadedGame AS _BYTE 'which game is loaded?(1-3)
  25.  
  26. TYPE Projectile_Data
  27.  Id AS _BYTE '       Kind of projectile; Sword\Arrow\Rock\Ball
  28.  Xloc AS INTEGER '   Projectile location
  29.  Yloc AS INTEGER '
  30.  Direction AS _BYTE 'Direction Projectile is traveling
  31.  Hits AS _BYTE '     Hits per projectile\(AKA:damage) in half heart increments
  32.  Owner AS _BYTE '    Who shot the projectile
  33.  
  34. TYPE Links_Data
  35.  '-----Position data-----
  36.  World AS _BYTE '           Player in Overworld or Underworld
  37.  World_X AS _BYTE '         Overworld X position
  38.  World_Y AS _BYTE '         Overworld Y position
  39.  Tile_X AS _UNSIGNED _BYTE 'Array X location:for Collision\entrances
  40.  Tile_Y AS _BYTE '          Array Y location:for Collision\entrances
  41.  Screen_X AS INTEGER '      X Position on screen
  42.  Screen_Y AS INTEGER '      Y Position on screen
  43.  Direction AS _BYTE '       Direction player is moving\facing
  44.  '-----------------------
  45.  '------Status Data------
  46.  Hearts AS _BYTE '    Units of health: 2 units(halves) per heart
  47.  Containers AS _BYTE 'Max number of health: total full hearts
  48.  Hits AS _BYTE '      Used when Link has defence rings;Blue = 2 hits per 1\2 heart, Red = 4 hits per 1\2 heart
  49.  '-----------------------
  50.  '------Items Data-------
  51.  Sword AS _BYTE ' which Sword does player have? Wooden-1,Silver-2,Magical-3
  52.  Weapon AS _BYTE 'Which Weapon is in hand A? Wooden-1,Silver-2,Magical-3,Wand-4
  53.  Ring AS _BYTE 'which does player have? 0-none, 1-blue,2-red
  54.  '-----------------------
  55.  '------Extra Data-------
  56.  Action AS _BYTE '          is player; using an item, Aquiring an item\sword, or aquiring a piece of the triforce?
  57.  Shot AS _BYTE '            player has shot sword
  58.  Projectile_id AS _BYTE '
  59.  Played AS _UNSIGNED _BYTE 'how many times has player played?
  60.  Beaten AS _BYTE '          Has player beaten Game 1? Game 2?
  61.  '-----------------------
  62.  
  63. TYPE Map_Data
  64.  Id AS _UNSIGNED _BYTE 'Tile id
  65.  Hidden AS _BYTE '      is there something under the tile?
  66.  Burnable AS _BYTE '    can the tile be burnt with candle?
  67.  Pushable AS _BYTE '    can the tile be moved by pushing?
  68.  PushableXtra AS _BYTE 'can the tile be moved by pushing with braclet?
  69.  Is_Shop AS _BYTE '     is there a shop here?(shop\gift\gamble)
  70.  Walkable AS _BYTE '    can the tile be walk upon?
  71.  
  72.  
  73. CONST TRUE = -1, FALSE = NOT TRUE, None = 0
  74. CONST Up = 3, Right = 2, Left = 1, Down = 0, SELECT_BUTTON = 4, START_BUTTON = 5, BUTTON_B = 6, BUTTON_A = 7
  75. CONST OverWorld = 0, UnderWorld = 1
  76. CONST Walking = 1, Useing = 2, GetItem = 3, GetTriforce = 4, Attack = 5
  77. CONST Key_Right = 19712, Key_Left = 19200, Key_Up = 18432, Key_Down = 20480
  78. CONST Key_Space = 32, Key_Enter = 13
  79. CONST Default_Key_Right = 19712, Default_Key_Left = 19200, Default_Key_Up = 18432, Default_Key_Down = 20480
  80. CONST Default_A_Button = 32, Default_B_Button = 13, Default_Start_Button = 65, Default_Select_Button = 66
  81. CONST Sword = 1, Arrow = 2, Rock = 3, Ball = 4, Boomerang = 5
  82. CONST Player = 1, Monster = 2
  83. CONST Item = 0, Slash = 1, Stairs = 2, SwordShot = 3
  84.  
  85. DIM SHARED Layer(16) AS LONG, Hyrule(255, 87) AS Map_Data, Link AS Links_Data, Reset_Link AS Links_Data
  86. DIM SHARED C AS ControllerKeys, G AS Game_Data, P(16) AS Projectile_Data, Letter(44) AS STRING * 1
  87. DIM SHARED Offset_X(3) AS INTEGER, Offset_Y(3) AS INTEGER, Cave(15, 10) AS Map_Data
  88. DIM SHARED BGM(8) AS LONG, SFX(10) AS LONG, FFX(1) AS LONG
  89. DIM SHARED Records(3) AS Links_Data, Nick(3) AS STRING * 8 'loading\registering\elimination
  90.  
  91. SCREEN _NEWIMAGE(800, 600, 32)
  92.  
  93. Layer(0) = _DISPLAY
  94. Layer(1) = _NEWIMAGE(800, 600, 32) 'temp layer
  95. Layer(2) = _NEWIMAGE(640, 480, 256) 'palettized sprite sheet for color shifting
  96. Layer(3) = _NEWIMAGE(800, 600, 32) 'Map background prebuild layer
  97. Layer(4) = _NEWIMAGE(800, 600, 32) 'Mob layer
  98. Layer(5) = _NEWIMAGE(800, 600, 32) 'Sprite layer, moveable\burnable items + bomb holes + pickups
  99. Layer(6) = _NEWIMAGE(12288, 4224, 32) 'PreBuilt Map, upto 300%, for easier map scrolling.
  100. Layer(8) = _NEWIMAGE(800, 600, 32) 'debug map display
  101. Layer(16) = _NEWIMAGE(800, 600, 32) 'temp
  102.  
  103. MFI_Loader "Zelda.MFI"
  104.  
  105. _CLEARCOLOR _RGB32(31), Layer(7)
  106. _CLEARCOLOR _RGB32(116), Layer(12)
  107.  
  108.  
  109. '==================================
  110. G.Scale_Factor = 1
  111. G.Scale_X = 16 * G.Scale_Factor - 1
  112. G.Scale_Y = 16 * G.Scale_Factor - 1
  113. Link.Screen_X = Offset_X(G.Scale_Factor) + (16 * G.Scale_Factor * 7) + 8 * G.Scale_Factor '392
  114. Link.Screen_Y = Offset_Y(G.Scale_Factor) + (16 * G.Scale_Factor * 5) '292
  115. Nick(0) = "": Nick(1) = "": Nick(2) = "": Nick(3) = ""
  116. '==================================
  117.  
  118. 'OPEN "debug.txt" FOR OUTPUT AS #6
  119. Build_Map_Screen 16 * Link.World_X, 11 * Link.World_Y
  120. ClearLayer Layer(6)
  121. Build_Map_in_Totallity 'prebuild the entire map at the current scale factor
  122. ClearLayer Layer(1)
  123. _FONT FFX(0), Layer(1)
  124. _FONT FFX(0), Layer(16)
  125. Title_Screen
  126. Select_Screen
  127.  
  128.  SELECT CASE Get_Input
  129.   CASE BUTTON_A
  130.    IF G.Aframe = 0 AND G.Atime = 0 THEN _SNDPLAY SFX(Slash): Link.Action = Attack: Press = Press + 1
  131.    Check_Link_Sword_Shot
  132.   CASE Up
  133.    IF Link.Action <> Attack THEN Link.Direction = Up: Link.Action = Walking
  134.   CASE Down
  135.    IF Link.Action <> Attack THEN Link.Direction = Down: Link.Action = Walking
  136.   CASE Right
  137.    IF Link.Action <> Attack THEN Link.Direction = Right: Link.Action = Walking
  138.   CASE Left
  139.    IF Link.Action <> Attack THEN Link.Direction = Left: Link.Action = Walking
  140.    IF Link.Action = Walking THEN Link.Action = None
  141.  
  142.  IF Link.Action = GetItem OR Link.Action = GetTriforce THEN
  143.   IF NOT _SNDPLAYING(Temp&) THEN Link.Action = None
  144.  '------Graphx build------
  145.  _PUTIMAGE , Layer(3), Layer(1)
  146.  IF Link.Action = Walking THEN Move_Link
  147.  IF Link.Shot THEN Move_Sword_Shot
  148.  IF G.Impactflag THEN Impact 0, 0
  149.  Place_Link
  150.  ' _PRINTSTRING (0, 0), STR$(Link.Tile_X) + STR$(Link.Tile_Y) + STR$(G.Projectile_Count), Layer(1)
  151.  IF G.Scale_Factor = 1 THEN _PUTIMAGE , Layer(8), Layer(1)
  152.  _DEST Layer(1)
  153.  LINE (100 + 2 * Link.Tile_X, 0 + 2 * Link.Tile_Y)-STEP(1, 1), _RGB32(255, 255, 0), BF
  154.  _PUTIMAGE , Layer(1), Layer(0)
  155.  ClearLayer Layer(1)
  156.  '------------------------
  157.  IF INKEY$ = CHR$(27) THEN ExitFlag%% = TRUE
  158.  _LIMIT 60
  159. LOOP UNTIL ExitFlag%%
  160.  
  161.  
  162. SUB Add_Projectile (What%%, Who%%)
  163.  SELECT CASE What%%
  164.   CASE Sword
  165.    P(G.Projectile_Count).Owner = Who%%
  166.    P(G.Projectile_Count).Id = Sword
  167.    P(G.Projectile_Count).Direction = Link.Direction
  168.    IF Who%% = Player THEN
  169.     P(G.Projectile_Count).Xloc = Link.Screen_X
  170.     P(G.Projectile_Count).Yloc = Link.Screen_Y
  171.    ELSE
  172.    END IF
  173.    G.Projectile_Count = G.Projectile_Count + 1
  174.  
  175. SUB Remove_Projectile (What%%, Who%%)
  176.  SELECT CASE What%%
  177.   CASE Sword
  178.    IF Who%% = Player THEN
  179.     G.Projectile_Count = G.Projectile_Count - 1
  180.    END IF
  181.  
  182. SUB Build_Cave_Screen
  183.  FOR Y%% = 0 TO 10
  184.   FOR X%% = 0 TO 15
  185.    Place_Tile_On_Screen (16 * G.Scale_Factor) * X%%, (16 * G.Scale_Factor) * Y%%, Cave(X%%, Y%%).Id, Layer(3)
  186.   NEXT
  187.  
  188. SUB Build_Map_Screen (Map_X~%%, Map_Y%%)
  189.  _DEST Layer(8)
  190.  FOR Y%% = 0 TO 10
  191.   FOR X%% = 0 TO 15
  192.    Place_Tile_On_Screen (16 * G.Scale_Factor) * X%%, (16 * G.Scale_Factor) * Y%%, Hyrule(Map_X~%% + X%%, Map_Y%% + Y%%).Id, Layer(3)
  193.   NEXT
  194.  FOR Y%% = 0 TO 87
  195.   FOR x~%% = 0 TO 255
  196.    IF Hyrule(x~%%, Y%%).Walkable = FALSE THEN LINE (100 + 2 * x~%%, 0 + 2 * Y%%)-STEP(1, 1), _RGB32(255), BF
  197.   NEXT
  198.  _DEST Layer(0)
  199.  
  200. SUB Build_Map_in_Totallity
  201.  FOR Y%% = 0 TO 87
  202.   FOR X~%% = 0 TO 255
  203.    tile~%% = Hyrule(X~%%, Y%%).Id
  204.    Gy% = 17 * (tile~%% \ 20) 'get which row it comes from
  205.    Gx% = 17 * (tile~%% MOD 20) 'which column position
  206.    _PUTIMAGE ((16 * G.Scale_Factor) * X~%%, (16 * G.Scale_Factor) * Y%%)-STEP(G.Scale_X, G.Scale_Y), Layer(7), Layer(6), (1 + Gx%, 1 + Gy%)-STEP(15, 15)
  207.   NEXT
  208.  
  209. SUB Check_Link_Location
  210.  Ax% = Link.World_X * 16 * (16 * G.Scale_Factor) 'gets the Left most pixel point for the current map screen
  211.  Ay% = Link.World_Y * 11 * (16 * G.Scale_Factor) 'gets the Top most pixel point for the current map screen
  212.  Tx~%% = (Ax% + Link.Screen_X - Offset_X(G.Scale_Factor) + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent x-offset+50% sprite size
  213.  Ty%% = (Ay% + Link.Screen_Y - Offset_Y(G.Scale_Factor) - 2 + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent y-offset+50% sprite size
  214.  IF Hyrule(Tx~%%, Ty%%).Is_Shop THEN Enter_Shop Hyrule(Tx~%%, Ty%%).Is_Shop
  215.  
  216.  
  217. SUB Enter_Shop (Which%%)
  218.  
  219. SUB Check_Link_Sword_Shot 'Can Link shoot his sword?
  220.  IF Link.Hearts = Link.Containers * 2 THEN 'Link has full hearts and can shoot
  221.   IF NOT _SNDPLAYING(SFX(SwordShot)) THEN 'Link did not just shoot
  222.    IF NOT G.Impactflag THEN 'Link's last shot has finished
  223.     IF NOT Link.Shot THEN
  224.      _SNDPLAY SFX(SwordShot)
  225.      Link.Shot = TRUE
  226.      Add_Projectile Sword, Player
  227.     END IF
  228.    END IF
  229.   END IF
  230.  
  231. SUB ClearLayer (L&)
  232.  _DEST L&
  233.  CLS
  234.  
  235. SUB ClearLayerTrans (L&)
  236.  _DEST L&
  237.  CLS , 0
  238.  
  239. SUB DarkenImage (Image AS LONG, Value_From_0_To_1 AS SINGLE)
  240.  IF Value_From_0_To_1 <= 0 OR Value_From_0_To_1 >= 1 OR _PIXELSIZE(Image) <> 4 THEN EXIT SUB
  241.  DIM Buffer AS _MEM: Buffer = _MEMIMAGE(Image) 'Get a memory reference to our image
  242.  DIM Frac_Value AS LONG: Frac_Value = Value_From_0_To_1 * 65536 'Used to avoid slow floating point calculations
  243.  DIM O AS _OFFSET, O_Last AS _OFFSET
  244.  O = Buffer.OFFSET 'We start at this offset
  245.  O_Last = Buffer.OFFSET + _WIDTH(Image) * _HEIGHT(Image) * 4 'We stop when we get to this offset
  246.  'use on error free code ONLY!
  247.  DO
  248.   _MEMPUT Buffer, O, _MEMGET(Buffer, O, _UNSIGNED _BYTE) * Frac_Value \ 65536 AS _UNSIGNED _BYTE
  249.   _MEMPUT Buffer, O + 1, _MEMGET(Buffer, O + 1, _UNSIGNED _BYTE) * Frac_Value \ 65536 AS _UNSIGNED _BYTE
  250.   _MEMPUT Buffer, O + 2, _MEMGET(Buffer, O + 2, _UNSIGNED _BYTE) * Frac_Value \ 65536 AS _UNSIGNED _BYTE
  251.   O = O + 4
  252.  LOOP UNTIL O = O_Last
  253.  'turn checking back on when done!
  254.  _MEMFREE Buffer
  255.  
  256. SUB Fade_Out (L&)
  257.  FOR n! = 1 TO 0.5 STEP -0.05
  258.   i2& = _COPYIMAGE(L&)
  259.   DarkenImage i2&, n!
  260.   _PUTIMAGE (0, 0), i2&, Layer(0)
  261.   _FREEIMAGE i2&
  262.   _DELAY .03
  263.  
  264. SUB Fade_In (L&)
  265.  FOR n! = 0.01 TO 1 STEP 0.05
  266.   i2& = _COPYIMAGE(L&)
  267.   DarkenImage i2&, n!
  268.   _PUTIMAGE (0, 0), i2&, Layer(0)
  269.   _FREEIMAGE i2&
  270.   _DELAY .03
  271.  
  272. FUNCTION Find_First_Available%% (Which%%, Start%%)
  273.  Selection%% = Start%% 'always start at the first saved game slot then check
  274.  DO 'lets find the first available selection (if there are any saved games)
  275.   IF Selection%% < 4 THEN
  276.    IF Which%% = 0 THEN IF RTRIM$(Nick(Selection%%)) = "" THEN Selection%% = Selection%% + 1 ELSE Good_Selection%% = TRUE
  277.    IF Which%% = 1 THEN IF RTRIM$(Nick(Selection%%)) = "" THEN Good_Selection%% = TRUE ELSE Selection%% = Selection%% + 1
  278.   ELSE '4 and 5 are always good selections
  279.    Good_Selection%% = TRUE
  280.   END IF
  281.  LOOP UNTIL Good_Selection%%
  282.  Find_First_Available = Selection%%
  283.  
  284. FUNCTION Get_Input%% ()
  285.  Result%% = TRUE '-1 for no input
  286.  ' SELECT CASE G.ControlType
  287.  '  CASE TRUE 'Keyboard input
  288.  IF _KEYDOWN(C.KBCon_Up) THEN Result%% = Up
  289.  IF _KEYDOWN(C.KBCon_Down) THEN Result%% = Down
  290.  IF _KEYDOWN(C.KBCon_Left) THEN Result%% = Left
  291.  IF _KEYDOWN(C.KBCon_Right) THEN Result%% = Right
  292.  IF _KEYDOWN(C.KBCon_Select) THEN Result%% = SELECT_BUTTON: ' DO: LOOP WHILE _KEYDOWN(C.KBCon_Select)
  293.  IF _KEYDOWN(C.KBCon_Start) THEN Result%% = START_BUTTON: ' DO: LOOP WHILE _KEYDOWN(C.KBCon_Start)
  294.  IF _KEYDOWN(C.KBCon_A_Button) THEN Result%% = BUTTON_A: ' DO: LOOP WHILE _KEYDOWN(C.KBCon_A_Button)
  295.  IF _KEYDOWN(C.KBCon_B_Button) THEN Result%% = BUTTON_B: ' DO: LOOP WHILE _KEYDOWN(C.KBCon_B_Button)
  296.  '  CASE FALSE 'joystick input
  297.  'IF C.Control_Pad THEN
  298.  'IF NOT G.Flag THEN DO: LOOP WHILE _DEVICEINPUT(C.Control_Pad)
  299.  'IF NOT C.BAD_Pad THEN
  300.  ' nul%% = AxisPower(CJR%%, CJL%%, CJU%%, CJD%%) 'read directional axis values
  301.  ' IF CJU%% THEN Result%% = Up
  302.  ' IF CJD%% THEN Result%% = Down
  303.  ' IF CJL%% THEN Result%% = Left
  304.  ' IF CJR%% THEN Result%% = Right
  305.  'ELSE
  306.  '   IF _BUTTON(C.Joy_Button_Up) THEN Result%% = Up ': Joy_Lock_Button (C.Joy_Button_Up)
  307.  '   IF _BUTTON(C.Joy_Button_Down) THEN Result%% = Down ': Joy_Lock_Button (C.Joy_Button_Down)
  308.  '   IF _BUTTON(C.Joy_Button_Left) THEN Result%% = Left ': Joy_Lock_Button (C.Joy_Button_Left)
  309.  '   IF _BUTTON(C.Joy_Button_Right) THEN Result%% = Right ': Joy_Lock_Button (C.Joy_Button_Right)
  310.  ' END IF
  311.  '  IF _BUTTON(C.Joy_Select) THEN Result%% = SELECT_BUTTON: Joy_Lock_Button (C.Joy_Select)
  312.  '  IF _BUTTON(C.Joy_Start) THEN Result%% = START_BUTTON: Joy_Lock_Button (C.Joy_Start)
  313.  '  IF _BUTTON(C.Joy_A_Button) THEN Result%% = BUTTON_A: Joy_Lock_Button (C.Joy_A_Button)
  314.  '  IF _BUTTON(C.Joy_B_Button) THEN Result%% = BUTTON_B: Joy_Lock_Button (C.Joy_B_Button)
  315.  ' END IF
  316.  ' END SELECT
  317.  Get_Input = Result%%
  318.  
  319. SUB Link_Attack
  320.  SELECT CASE Link.Direction
  321.   CASE Up
  322.    Ox%% = 0: Oy%% = -14 * G.Scale_Factor
  323.   CASE Down
  324.    Ox%% = 0: Oy%% = 14 * G.Scale_Factor
  325.   CASE Left
  326.    Ox%% = -14 * G.Scale_Factor + G.Aframe * (4 * G.Scale_Factor): Oy%% = 0
  327.   CASE Right
  328.    Ox%% = 14 * G.Scale_Factor - G.Aframe * (4 * G.Scale_Factor): Oy%% = 0
  329.  SELECT CASE G.Aframe
  330.   CASE 0
  331.    _PUTIMAGE (Link.Screen_X, Link.Screen_Y)-STEP(G.Scale_X, G.Scale_Y), Layer(7), Layer(1), (1 + 17 * (Link.Direction + 8), 137)-STEP(15, 15)
  332.   CASE 1
  333.    _PUTIMAGE (Link.Screen_X, Link.Screen_Y)-STEP(G.Scale_X, G.Scale_Y), Layer(7), Layer(1), (1 + 17 * (Link.Direction + 8), 137)-STEP(15, 15)
  334.    _PUTIMAGE (Link.Screen_X + Ox%%, Link.Screen_Y + Oy%%)-STEP(G.Scale_X, G.Scale_Y), Layer(7), Layer(1), (1 + 51 * Link.Weapon, 171 + 17 * Link.Direction)-STEP(15, 15)
  335.   CASE 2
  336.    _PUTIMAGE (Link.Screen_X, Link.Screen_Y)-STEP(G.Scale_X, G.Scale_Y), Layer(7), Layer(1), (1 + 34 * Link.Direction + 17, 137)-STEP(15, 15)
  337.    _PUTIMAGE (Link.Screen_X + Ox%%, Link.Screen_Y + Oy%%)-STEP(G.Scale_X, G.Scale_Y), Layer(7), Layer(1), (1 + 51 * Link.Weapon + 17, 171 + 17 * Link.Direction)-STEP(15, 15)
  338.   CASE 3
  339.    _PUTIMAGE (Link.Screen_X, Link.Screen_Y)-STEP(G.Scale_X, G.Scale_Y), Layer(7), Layer(1), (1 + 34 * Link.Direction + 0, 137)-STEP(15, 15)
  340.    _PUTIMAGE (Link.Screen_X + Ox%%, Link.Screen_Y + Oy%%)-STEP(G.Scale_X, G.Scale_Y), Layer(7), Layer(1), (1 + 51 * Link.Weapon + 34, 171 + 17 * Link.Direction)-STEP(15, 15)
  341.   CASE ELSE 'attack animation finished
  342.    G.Atime = 0: G.Aframe = 0: Link.Action = None
  343.    _PUTIMAGE (Link.Screen_X, Link.Screen_Y)-STEP(G.Scale_X, G.Scale_Y), Layer(7), Layer(1), (1 + 34 * Link.Direction + 17 * Frame%%, 137)-STEP(15, 15)
  344.  
  345. FUNCTION Link_Collision%% (Dir%%)
  346.  Result%% = FALSE 'start at no collision
  347.  'get links center point x\y tile position to check for collision
  348.  Ax% = Link.World_X * 16 * (16 * G.Scale_Factor) 'gets the Left most pixel point for the current map screen
  349.  Ay% = Link.World_Y * 11 * (16 * G.Scale_Factor) 'gets the Top most pixel point for the current map screen
  350.  'we now have the tile that Links center pixel is in!
  351.  SELECT CASE Dir%%
  352.   CASE Up
  353.    Tx~%% = (Ax% + Link.Screen_X - Offset_X(G.Scale_Factor) + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent x-offset+50% sprite size
  354.    Ty%% = (Ay% + Link.Screen_Y - Offset_Y(G.Scale_Factor) - 2 + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent y-offset+50% sprite size
  355.    IF NOT Hyrule(Tx~%%, Ty%%).Walkable THEN Result%% = TRUE
  356.   CASE Down
  357.    Tx~%% = (Ax% + Link.Screen_X - Offset_X(G.Scale_Factor) + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent x-offset+50% sprite size
  358.    Ty%% = (2 + Ay% + Link.Screen_Y - Offset_Y(G.Scale_Factor) + 2 + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent y-offset+50% sprite size
  359.    IF NOT Hyrule(Tx~%%, Ty%%).Walkable THEN Result%% = TRUE
  360.   CASE Left
  361.    Tx~%% = (Ax% + Link.Screen_X - Offset_X(G.Scale_Factor) - 2 + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent x-offset+50% sprite size
  362.    Ty%% = (Ay% + Link.Screen_Y - Offset_Y(G.Scale_Factor) + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent y-offset+50% sprite size
  363.    IF NOT Hyrule(Tx~%%, Ty%%).Walkable THEN Result%% = TRUE
  364.   CASE Right
  365.    Tx~%% = (2 + Ax% + Link.Screen_X - Offset_X(G.Scale_Factor) + 2 + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent x-offset+50% sprite size
  366.    Ty%% = (Ay% + Link.Screen_Y - Offset_Y(G.Scale_Factor) + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent y-offset+50% sprite size
  367.    IF NOT Hyrule(Tx~%%, Ty%%).Walkable THEN Result%% = TRUE
  368.  Link.Tile_X = Tx~%%
  369.  Link.Tile_Y = Ty%%
  370.  Link_Collision = Result%%
  371.  
  372. SUB Move_Link
  373.  SELECT CASE Link.Direction
  374.   CASE Up
  375.    IF NOT Link_Collision(Up) THEN 'nothing blocking Link
  376.     IF Link.Screen_Y > Offset_Y(G.Scale_Factor) THEN 'Link is not at the edge of the screen
  377.      Link.Screen_Y = Link.Screen_Y - 2 * G.Scale_Factor
  378.     ELSE 'player is at edge of screen to shift to next one.
  379.      G.NextScreen = Up
  380.      Shift_New_Map_Screen
  381.     END IF
  382.    END IF
  383.   CASE Down
  384.    IF NOT Link_Collision(Down) THEN 'nothing blocking Link
  385.     IF Link.Screen_Y < (Offset_Y(G.Scale_Factor) + (16 * G.Scale_Factor * 10)) THEN 'Link is not at the edge of the screen
  386.      Link.Screen_Y = Link.Screen_Y + 2 * G.Scale_Factor
  387.     ELSE 'player is at edge of screen to shift to next one.
  388.      G.NextScreen = Down
  389.      Shift_New_Map_Screen
  390.     END IF
  391.    END IF
  392.   CASE Left
  393.    IF NOT Link_Collision(Left) THEN 'nothing blocking Link
  394.     IF Link.Screen_X > Offset_X(G.Scale_Factor) THEN 'Link is not at the edge of the screen
  395.      Link.Screen_X = Link.Screen_X - 2 * G.Scale_Factor
  396.     ELSE 'player is at edge of screen to shift to next one.
  397.      G.NextScreen = Left
  398.      Shift_New_Map_Screen
  399.     END IF
  400.    END IF
  401.   CASE Right
  402.    IF NOT Link_Collision(Right) THEN 'nothing blocking Link
  403.     IF Link.Screen_X < (Offset_X(G.Scale_Factor) + (16 * G.Scale_Factor * 15)) THEN 'Link is not at the edge of the screen
  404.      Link.Screen_X = Link.Screen_X + 2 * G.Scale_Factor
  405.     ELSE 'player is at edge of screen to shift to next one.
  406.      G.NextScreen = Right
  407.      Shift_New_Map_Screen
  408.     END IF
  409.    END IF
  410.  
  411. SUB Move_Sword_Shot
  412.  STATIC Xloc AS INTEGER, Yloc AS INTEGER, Direction AS _BYTE, Fstp AS _BYTE, Frame AS _BYTE
  413.  IF Direction = -1 OR Xloc = 0 THEN 'if no direction assigned then assign one
  414.   Direction = Link.Direction
  415.   Xloc = Link.Screen_X
  416.   Yloc = Link.Screen_Y
  417.  SELECT CASE Direction
  418.   CASE Up
  419.    Yloc = Yloc - 4 * G.Scale_Factor
  420.   CASE Down
  421.    Yloc = Yloc + 4 * G.Scale_Factor
  422.   CASE Left
  423.    Xloc = Xloc - 4 * G.Scale_Factor
  424.   CASE Right
  425.    Xloc = Xloc + 4 * G.Scale_Factor
  426.  _PUTIMAGE (Xloc, Yloc)-STEP(G.Scale_X, G.Scale_Y), Layer(7), Layer(1), (1 + 17 * Frame + 68 * Direction, 239)-STEP(15, 15)
  427.  SELECT CASE G.Scale_Factor
  428.   CASE 1
  429.    IF Xloc <= 272 OR Xloc >= 514 OR Yloc <= 212 OR Yloc >= 372 THEN Done%% = TRUE
  430.   CASE 2
  431.    IF Xloc <= 140 OR Xloc >= 630 OR Yloc <= 100 OR Yloc >= 430 THEN Done%% = TRUE
  432.   CASE 3
  433.    IF Xloc <= 16 OR Xloc >= 744 OR Yloc <= 96 OR Yloc >= 559 THEN Done%% = TRUE
  434.  IF Done%% THEN Link.Shot = FALSE: G.Impactflag = TRUE: Impact Xloc, Yloc: Direction = -1: Remove_Projectile Sword, Player
  435.  Fstp = Fstp + 1
  436.  IF Fstp = 2 THEN Fstp = 0: Frame = Frame + 1
  437.  IF Frame = 4 THEN Frame = 0
  438.  
  439. SUB Impact (X%, Y%)
  440.  STATIC Frame AS _BYTE, Fstp AS _BYTE, Xloc(3) AS INTEGER, Yloc(3) AS INTEGER
  441.  IF Frame = -1 OR Xloc(2) = 0 THEN
  442.   Fstp = 0
  443.   FOR i%% = 0 TO 3: Xloc(i%%) = X% + 8 * G.Scale_Factor: Yloc(i%%) = Y% + 8 * G.Scale_Factor: NEXT i%%
  444.  Xloc(0) = Xloc(0) - G.Scale_Factor: Yloc(0) = Yloc(0) - G.Scale_Factor
  445.  Xloc(1) = Xloc(1) + G.Scale_Factor: Yloc(1) = Yloc(1) - G.Scale_Factor
  446.  Xloc(2) = Xloc(2) + G.Scale_Factor: Yloc(2) = Yloc(2) + G.Scale_Factor
  447.  Xloc(3) = Xloc(3) - G.Scale_Factor: Yloc(3) = Yloc(3) + G.Scale_Factor
  448.  FOR i%% = 0 TO 3
  449.   SELECT CASE i%%
  450.    CASE 0
  451.     _PUTIMAGE (Xloc(i%%) - 16, Yloc(i%%) - 16)-STEP(G.Scale_X, G.Scale_Y), Layer(7), Layer(1), (205 + 17 * Frame, 205)-STEP(15, 15)
  452.    CASE 1
  453.     _PUTIMAGE (Xloc(i%%) + 16, Yloc(i%%) - 16)-STEP(-G.Scale_X, G.Scale_Y), Layer(7), Layer(1), (205 + 17 * Frame, 205)-STEP(15, 15)
  454.    CASE 2
  455.     _PUTIMAGE (Xloc(i%%) + 16, Yloc(i%%) + 16)-STEP(-G.Scale_X, -G.Scale_Y), Layer(7), Layer(1), (205 + 17 * Frame, 205)-STEP(15, 15)
  456.    CASE 3
  457.     _PUTIMAGE (Xloc(i%%) - 16, Yloc(i%%) + 16)-STEP(G.Scale_X, -G.Scale_Y), Layer(7), Layer(1), (205 + 17 * Frame, 205)-STEP(15, 15)
  458.  NEXT i%%
  459.  Fstp = Fstp + 1
  460.  Frame = Frame + 1
  461.  IF Frame = 4 THEN Frame = 0
  462.  IF Fstp = 16 THEN Frame = -1: G.Impactflag = FALSE
  463.  
  464. SUB Place_Link
  465.  STATIC Ftime AS _BYTE, Frame AS _BYTE
  466.  IF Link.Action = Walking THEN 'while Link is moving
  467.   G.Wtime = G.Wtime + 1 'Increment frame time
  468.   IF G.Wtime = 8 THEN
  469.    IF G.Wframe THEN G.Wframe = 0 ELSE G.Wframe = 1 'change frame
  470.    G.Wtime = 0 'reset frame time
  471.   END IF
  472.   _PUTIMAGE (Link.Screen_X, Link.Screen_Y)-STEP(G.Scale_X, G.Scale_Y), Layer(7), Layer(1), (1 + 34 * Link.Direction + 17 * G.Wframe, 137)-STEP(15, 15)
  473.  ELSEIF Link.Action = Useing THEN 'when Link uses an item
  474.   Ftime = Ftime + 1 'Increment frame time
  475.   IF Ftime = 32 THEN Link.Action = None: Ftime = 0 'action is done
  476.   _PUTIMAGE (Link.Screen_X, Link.Screen_Y)-STEP(G.Scale_X, G.Scale_Y), Layer(7), Layer(1), (1 + 17 * (Link.Direction + 8), 137)-STEP(15, 15)
  477.  ELSEIF Link.Action = GetItem THEN 'When Link gets a sword\item or buys something
  478.   'Held while music plays
  479.   _PUTIMAGE (Link.Screen_X, Link.Screen_Y)-STEP(G.Scale_X, G.Scale_Y), Layer(7), Layer(1), (1 + 17 * 12, 137)-STEP(15, 15)
  480.  ELSEIF Link.Action = GetTriforce THEN 'When Link recovers a Triforce piece
  481.   'Held while music plays
  482.   _PUTIMAGE (Link.Screen_X, Link.Screen_Y)-STEP(G.Scale_X, G.Scale_Y), Layer(7), Layer(1), (1 + 17 * 13, 137)-STEP(15, 15)
  483.  ELSEIF Link.Action = Attack THEN
  484.   G.Atime = G.Atime + 1 'Increment frame time
  485.   IF G.Atime = 4 THEN G.Aframe = G.Aframe + 1: G.Atime = 0 'change frame:reset frame time
  486.   Link_Attack
  487.  ELSE 'Link is standing Still(Action=None)
  488.   G.Atime = 0: G.Aframe = 0
  489.   G.Wtime = 0: G.Wframe = 0
  490.   _PUTIMAGE (Link.Screen_X, Link.Screen_Y)-STEP(G.Scale_X, G.Scale_Y), Layer(7), Layer(1), (1 + 34 * Link.Direction + 17 * Frame%%, 137)-STEP(15, 15)
  491.  
  492. SUB Place_Player_Record (I%%, Where%)
  493.  SELECT CASE Where%
  494.   CASE 0
  495.    IF Records(I%% + 1).Beaten THEN _PUTIMAGE (260, 228 + 48 * I%%)-STEP(15, 31), Layer(12), Layer(16), (64, 247)-STEP(7, 15) 'Player 1 Sword
  496.    _PUTIMAGE (236, 234 + 48 * I%%)-STEP(31, 31), Layer(12), Layer(16), (1 + 17 * Records(I%% + 1).Ring, 230)-STEP(15, 15) 'Player 1 Link (green)
  497.    _PRINTSTRING (284, 232 + 48 * I%%), RTRIM$(Nick(I%% + 1)), Layer(16) 'player 1 name
  498.    _PRINTSTRING (284, 248 + 48 * I%%), LEFT$("   ", 3 - LEN(LTRIM$(RTRIM$(STR$(Records(I%% + 1).Played))))) + LTRIM$(STR$(Records(I%% + 1).Played)), Layer(16) 'player 1 tries
  499.    FOR j%% = 1 TO Records(I%% + 1).Containers
  500.     IF j%% < 4 THEN 'first 3 hearts are red
  501.      _PUTIMAGE (428 + 16 * j%%, 232 + 48 * I%%)-STEP(15, 15), Layer(12), Layer(16), (52, 230)-STEP(7, 7) 'Player 1 hearts red
  502.     ELSE
  503.      IF j%% < 9 THEN
  504.       _PUTIMAGE (428 + 16 * j%%, 232 + 48 * I%%)-STEP(15, 15), Layer(12), Layer(16), (73, 267)-STEP(7, 7) 'Player 1 hearts white
  505.      ELSE
  506.       _PUTIMAGE (428 + 16 * (j%% - 8), 232 + 64 * I%%)-STEP(15, 15), Layer(12), Layer(16), (73, 267)-STEP(7, 7) 'Player 1 hearts white
  507.      END IF
  508.     END IF
  509.    NEXT j%%
  510.   CASE 1
  511.    IF Records(I%% + 1).Beaten THEN _PUTIMAGE (326, 148 + 48 * (I%% - 1))-STEP(15, 31), Layer(12), Layer(16), (64, 247)-STEP(7, 15) 'Player 1 Sword
  512.    _PUTIMAGE (300, 154 + 48 * (I%%))-STEP(31, 31), Layer(12), Layer(16), (1 + 17 * Records(I%% + 1).Ring, 230)-STEP(15, 15) 'Player 1 Link (green)
  513.    _PRINTSTRING (364, 152 + 48 * (I%%)), RTRIM$(Nick(I%% + 1)), Layer(1)
  514.  
  515.  
  516. SUB Place_Tile_On_Screen (X%, Y%, Tile~%%, L&)
  517.  Gy% = 17 * (Tile~%% \ 20) 'get which row it comes from
  518.  Gx% = 17 * (Tile~%% MOD 20) 'which column position
  519.  _PUTIMAGE (Offset_X(G.Scale_Factor) + X%, Offset_Y(G.Scale_Factor) + Y%)-STEP(G.Scale_X, G.Scale_Y), Layer(7), L&, (1 + Gx%, 1 + Gy%)-STEP(15, 15)
  520.  
  521. SUB Scroll_Screen_II (Dir%%)
  522.  Cx% = Offset_X(G.Scale_Factor) 'top left corner location of map displayed
  523.  Cy% = Offset_Y(G.Scale_Factor)
  524.  Sfx% = 16 * 16 * G.Scale_Factor 'size of the map display
  525.  Sfy% = 11 * 16 * G.Scale_Factor
  526.  Lwx% = 16 * 16 * G.Scale_Factor * Link.World_X 'map area link is in
  527.  Lwy% = 11 * 16 * G.Scale_Factor * Link.World_Y
  528.  SELECT CASE Dir%%
  529.   CASE Up
  530.    FOR y% = 0 TO Sfy% STEP 2 * G.Scale_Factor
  531.     _PUTIMAGE (Cx%, Cy%)-STEP(Sfx%, Sfy%), Layer(6), Layer(1), (Lwx%, Lwy% - y%)-STEP(Sfx%, Sfy%)
  532.     IF y% > 16 * G.Scale_Factor THEN Link.Screen_Y = Link.Screen_Y + 2 * G.Scale_Factor
  533.     Place_Link
  534.     _LIMIT 60
  535.     _PUTIMAGE , Layer(1), Layer(0)
  536.    NEXT
  537.    Link.World_Y = Link.World_Y - 1
  538.   CASE Down
  539.    FOR y% = 0 TO Sfy% STEP 2 * G.Scale_Factor
  540.     _PUTIMAGE (Cx%, Cy%)-STEP(Sfx%, Sfy%), Layer(6), Layer(1), (Lwx%, Lwy% + y%)-STEP(Sfx%, Sfy%)
  541.     IF y% > 16 * G.Scale_Factor THEN Link.Screen_Y = Link.Screen_Y - 2 * G.Scale_Factor
  542.     Place_Link
  543.     _LIMIT 60
  544.     _PUTIMAGE , Layer(1), Layer(0)
  545.    NEXT
  546.    Link.World_Y = Link.World_Y + 1
  547.   CASE Left
  548.    FOR x% = 0 TO Sfx% STEP 2 * G.Scale_Factor
  549.     _PUTIMAGE (Cx%, Cy%)-STEP(Sfx%, Sfy%), Layer(6), Layer(1), (Lwx% - x%, Lwy%)-STEP(Sfx%, Sfy%)
  550.     IF x% > 16 * G.Scale_Factor THEN Link.Screen_X = Link.Screen_X + 2 * G.Scale_Factor
  551.     Place_Link
  552.     _LIMIT 60
  553.     _PUTIMAGE , Layer(1), Layer(0)
  554.    NEXT
  555.    Link.World_X = Link.World_X - 1
  556.   CASE Right
  557.    FOR x% = 0 TO Sfx% STEP 2 * G.Scale_Factor
  558.     _PUTIMAGE (Cx%, Cy%)-STEP(Sfx%, Sfy%), Layer(6), Layer(1), (Lwx% + x%, Lwy%)-STEP(Sfx%, Sfy%)
  559.     IF x% > 16 * G.Scale_Factor THEN Link.Screen_X = Link.Screen_X - 2 * G.Scale_Factor
  560.     Place_Link
  561.     _LIMIT 60
  562.     _PUTIMAGE , Layer(1), Layer(0)
  563.    NEXT
  564.    Link.World_X = Link.World_X + 1
  565.  Place_Link
  566.  Lwx% = 16 * 16 * G.Scale_Factor * Link.World_X
  567.  Lwy% = 11 * 16 * G.Scale_Factor * Link.World_Y
  568.  _PUTIMAGE (Cx%, Cy%)-STEP(Sfx%, Sfy%), Layer(6), Layer(3), (Lwx%, Lwy%)-STEP(Sfx%, Sfy%) 'move new screen to layer(3)
  569.  
  570. SUB Shift_New_Map_Screen
  571.  SELECT CASE G.NextScreen
  572.   CASE Up
  573.    Scroll_Screen_II Up
  574.   CASE Down
  575.    Scroll_Screen_II Down
  576.   CASE Left
  577.    Scroll_Screen_II Left
  578.   CASE Right
  579.    Scroll_Screen_II Right
  580.  G.NextScreen = -1
  581.  
  582. SUB Title_Screen
  583.  _CLEARCOLOR _RGB32(21), Layer(9)
  584.  _CLEARCOLOR _RGB32(21), Layer(10)
  585.  _SNDVOL BGM(0), .33
  586.  _SNDLOOP BGM(0)
  587.  DO
  588.   F%% = 0: F% = 0: ExitFlag%% = FALSE
  589.   DO: _LIMIT 60: LOOP WHILE _SNDGETPOS(BGM(0)) > 10
  590.   DO
  591.    _PUTIMAGE ((800 - 512) \ 2, (600 - 448) \ 2)-STEP(511, 447), Layer(9), Layer(1), (0, 0)-STEP(255, 223)
  592.    SELECT CASE F%%
  593.     CASE 12 TO 18
  594.      _PUTIMAGE (400 - 74, 300 - 128)-STEP(143, 143), Layer(9), Layer(1), (289, 0)-STEP(71, 71)
  595.     CASE 19 TO 24
  596.      _PUTIMAGE (400 - 74, 300 - 128)-STEP(143, 143), Layer(9), Layer(1), (289, 0 + 72)-STEP(71, 71)
  597.     CASE 25 TO 36
  598.      _PUTIMAGE (400 - 74, 300 - 128)-STEP(143, 143), Layer(9), Layer(1), (289, 0 + 144)-STEP(71, 71)
  599.     CASE 37 TO 52
  600.      _PUTIMAGE (400 - 74, 300 - 128)-STEP(143, 143), Layer(9), Layer(1), (289, 0 + 72)-STEP(71, 71)
  601.     CASE 53 TO 59
  602.      _PUTIMAGE (400 - 74, 300 - 128)-STEP(143, 143), Layer(9), Layer(1), (289, 0 + 0)-STEP(71, 71)
  603.    END SELECT
  604.    _PUTIMAGE (304, 523 - 112), Layer(10), Layer(1), (0 + 64 * wave%%, 0)-STEP(63, 111)
  605.    _PUTIMAGE , Layer(1), Layer(0)
  606.    _LIMIT 90
  607.    F%% = F%% + 1
  608.    IF F%% = 60 THEN F%% = 0
  609.    IF F%% MOD 2 = 0 THEN wave%% = wave%% + 1
  610.    IF wave%% = 16 THEN wave%% = 0
  611.    IF Get_Input = START_BUTTON THEN ExitFlag%% = TRUE
  612.   LOOP UNTIL _SNDGETPOS(BGM(0)) > 8.4 OR ExitFlag%%
  613.  
  614.   IF NOT ExitFlag%% THEN
  615.    'start the title fade
  616.    _DEST Layer(1)
  617.    F%% = 0
  618.    DO
  619.     SELECT CASE F%
  620.      CASE 0 TO 13
  621.       LINE (144, 76)-STEP(511, 447), _RGB32(202, 241, 159), BF
  622.       _PUTIMAGE ((800 - 512) \ 2, (600 - 448) \ 2)-STEP(511, 447), Layer(9), Layer(1), (361, 0)-STEP(255, 223)
  623.      CASE 13 TO 24
  624.       LINE (144, 76)-STEP(511, 447), _RGB32(182, 216, 255), BF
  625.       _PUTIMAGE ((800 - 512) \ 2, (600 - 448) \ 2)-STEP(511, 447), Layer(9), Layer(1), (361, 0)-STEP(255, 223)
  626.      CASE 25 TO 34
  627.       LINE (144, 76)-STEP(511, 447), _RGB32(166, 229, 255), BF
  628.       _PUTIMAGE ((800 - 512) \ 2, (600 - 448) \ 2)-STEP(511, 447), Layer(9), Layer(1), (361, 0)-STEP(255, 223)
  629.      CASE 35 TO 42
  630.       LINE (144, 76)-STEP(511, 447), _RGB32(165, 238, 223), BF
  631.       _PUTIMAGE ((800 - 512) \ 2, (600 - 448) \ 2)-STEP(511, 447), Layer(9), Layer(1), (617, 0)-STEP(255, 223)
  632.      CASE 43 TO 48
  633.       LINE (144, 76)-STEP(511, 447), _RGB32(37, 190, 255), BF
  634.       _PUTIMAGE ((800 - 512) \ 2, (600 - 448) \ 2)-STEP(511, 447), Layer(9), Layer(1), (617, 0)-STEP(255, 223)
  635.      CASE 49 TO 52
  636.       LINE (144, 76)-STEP(511, 447), _RGB32(0, 109, 181), BF
  637.       _PUTIMAGE ((800 - 512) \ 2, (600 - 448) \ 2)-STEP(511, 447), Layer(9), Layer(1), (617, 0)-STEP(255, 223)
  638.      CASE 53 TO 57
  639.       _PUTIMAGE ((800 - 512) \ 2, (600 - 448) \ 2)-STEP(511, 447), Layer(9), Layer(1), (873, 0)-STEP(255, 223)
  640.       Wf% = 112
  641.      CASE 58 TO 61
  642.       _PUTIMAGE ((800 - 512) \ 2, (600 - 448) \ 2)-STEP(511, 447), Layer(9), Layer(1), (1129, 0)-STEP(255, 223)
  643.       Wf% = 224
  644.      CASE 62 TO 363
  645.       _PUTIMAGE ((800 - 512) \ 2, (600 - 448) \ 2)-STEP(511, 447), Layer(9), Layer(1), (1385, 0)-STEP(255, 223)
  646.       Wf% = 336
  647.      CASE 364 TO 385
  648.       _PUTIMAGE ((800 - 512) \ 2, (600 - 448) \ 2)-STEP(511, 447), Layer(9), Layer(1), (1641, 0)-STEP(255, 223)
  649.       Wf% = 448
  650.      CASE 386 TO 393
  651.       _PUTIMAGE ((800 - 512) \ 2, (600 - 448) \ 2)-STEP(511, 447), Layer(9), Layer(1), (1897, 0)-STEP(255, 223)
  652.       Wf% = 560
  653.     END SELECT
  654.     _PUTIMAGE (304, 523 - 112), Layer(10), Layer(1), (0 + 64 * wave%%, 0 + Wf%)-STEP(63, 111)
  655.     _PUTIMAGE , Layer(1), Layer(0)
  656.     _LIMIT 90
  657.     F% = F% + 1
  658.     IF F% = 394 THEN ExitFlag%% = TRUE
  659.     IF F% MOD 2 = 0 THEN wave%% = wave%% + 1
  660.     IF wave%% = 16 THEN wave%% = 0
  661.     IF Get_Input = START_BUTTON THEN ExitFlag%% = TRUE
  662.    LOOP UNTIL ExitFlag%%
  663.    ExitFlag%% = FALSE
  664.   END IF
  665.   ClearLayer Layer(0)
  666.   ClearLayer Layer(1)
  667.   IF NOT ExitFlag%% THEN
  668.    'Title scroll
  669.    DO: _LIMIT 60: IF Get_Input = START_BUTTON THEN ExitFlag%% = TRUE
  670.    LOOP UNTIL _SNDGETPOS(BGM(0)) > 16 OR ExitFlag%%
  671.    F% = 0
  672.    IF NOT ExitFlag%% THEN
  673.     DO
  674.      SELECT CASE F%
  675.       CASE 0 TO 223
  676.        _PUTIMAGE (144, 76)-STEP(511, 447), Layer(11), Layer(1), (0, -223 + F%)-STEP(255, 223)
  677.       CASE IS >= 354
  678.        IF blink% THEN
  679.         _PUTIMAGE (72, 332)-STEP(7, 15), Layer(7), Layer(11), (247, 154)-STEP(7, 15) 'heart
  680.         _PUTIMAGE (72, 464)-STEP(7, 15), Layer(7), Layer(11), (213, 171)-STEP(7, 15) 'Ruby
  681.         _PUTIMAGE (120, 1432)-STEP(15, 15), Layer(7), Layer(11), (239, 188)-STEP(15, 15) 'Triforce
  682.        ELSE
  683.         _PUTIMAGE (72, 332)-STEP(7, 15), Layer(7), Layer(11), (239, 154)-STEP(7, 15) 'heart
  684.         _PUTIMAGE (72, 464)-STEP(7, 15), Layer(7), Layer(11), (205, 171)-STEP(7, 15) 'Ruby
  685.         _PUTIMAGE (120, 1432)-STEP(15, 15), Layer(7), Layer(11), (222, 188)-STEP(15, 15) 'Triforce
  686.        END IF
  687.        IF Fblink% THEN
  688.         _PUTIMAGE (72, 400)-STEP(7, 15), Layer(7), Layer(11), (256, 188)-STEP(7, 15) 'fairy blank
  689.         _PUTIMAGE (72, 400)-STEP(7, 15), Layer(7), Layer(11), (281, 154)-STEP(7, 15) 'fairy
  690.        ELSE
  691.         _PUTIMAGE (72, 400)-STEP(7, 15), Layer(7), Layer(11), (256, 188)-STEP(7, 15) 'fairy blank
  692.         _PUTIMAGE (72, 400)-STEP(7, 15), Layer(7), Layer(11), (273, 154)-STEP(7, 15) 'fairy
  693.        END IF
  694.        _PUTIMAGE (144, 76)-STEP(511, 447), Layer(11), Layer(1), (0, F% - 354)-STEP(255, 223)
  695.      END SELECT
  696.      _PUTIMAGE , Layer(1), Layer(0)
  697.      _LIMIT 30
  698.      F% = F% + 1
  699.      IF F% = 1762 THEN F% = F% - 1 'ExitFlag%% = TRUE
  700.      B% = B% + 1
  701.      IF B% = 4 THEN blink% = NOT blink%: B% = 0
  702.      IF B% MOD 2 = 0 THEN Fblink% = NOT Fblink%
  703.      IF Get_Input = START_BUTTON THEN ExitFlag%% = TRUE
  704.     LOOP UNTIL _SNDGETPOS(BGM(0)) >= 79.75 OR ExitFlag%%
  705.     ExitFlag%% = FALSE
  706.    END IF
  707.   END IF
  708.  
  709.  LOOP UNTIL ExitFlag%%
  710.  _DEST Layer(0)
  711.  _SNDSTOP BGM(0)
  712.  DO: LOOP UNTIL Get_Input%% = -1
  713.  
  714.  
  715. FUNCTION Projectile_Collision%%
  716.  Result%% = FALSE
  717.  FOR i%% = 0 TO G.Projectile_Count
  718.  Projectile_Collision = Result%%
  719.  
  720. SUB Select_Screen
  721.  ClearLayer Layer(16)
  722.  IF _FILEEXISTS("Zelda.MSF") THEN 'load saved data
  723.   OPEN "Zelda.MSF" FOR BINARY AS #1
  724.   FOR I%% = 1 TO 3 'load all 3 records
  725.    GET #1, , Nick(I%%)
  726.    GET #1, , Records(I%%)
  727.    IF Selection%% = 0 THEN IF RTRIM$(Nick(I%%)) <> "" THEN Selection%% = I%%
  728.   NEXT I%%
  729.   CLOSE #1
  730.  ELSE 'file doesn't exist so make it.
  731.   Reset_Record 1
  732.   Reset_Record 2
  733.   Reset_Record 3
  734.   Save_Records
  735.  _PUTIMAGE (140, 72)-STEP(511, 447), Layer(12), Layer(16), (1, 1)-STEP(255, 223) 'background
  736.  FOR I%% = 1 TO 3
  737.   IF RTRIM$(Nick(I%%)) <> "" THEN Place_Player_Record I%% - 1, 0
  738.  NEXT I%%
  739.  IF Record_Count%% = 0 THEN Selection%% = 4 ELSE Selection%% = 1
  740.  Selection%% = Find_First_Available(0, 1)
  741.  DO
  742.   _PUTIMAGE , Layer(16), Layer(1)
  743.   SELECT CASE Get_Input%%
  744.    CASE START_BUTTON
  745.     SELECT CASE Selection%%
  746.      CASE 1 TO 3
  747.       Link = Records(Selection%%)
  748.       Exitflag%% = TRUE
  749.      CASE 4
  750.       DO: LOOP UNTIL Get_Input%% = -1
  751.       nul%% = Register(nul%%)
  752.       OPEN "Zelda.MSF" FOR BINARY AS #1 'update records
  753.       FOR I%% = 1 TO 3
  754.        PUT #1, , Nick(I%%)
  755.        PUT #1, , Link
  756.        IF RTRIM$(Nick(I%%)) <> "" THEN Place_Player_Record I%% - 1, 0
  757.       NEXT I%%
  758.       CLOSE #1
  759.      CASE 5
  760.       DO: LOOP UNTIL Get_Input%% = -1
  761.       Elimination_Mode
  762.       nul%% = Register(nul%%) 'go straight to register mode after elimination
  763.     END SELECT
  764.    CASE SELECT_BUTTON
  765.     Selection%% = Selection%% + 1
  766.     IF Selection%% = 6 THEN Selection%% = 1
  767.     Selection%% = Find_First_Available(0, Selection%%)
  768.     DO: LOOP UNTIL Get_Input%% = -1
  769.    CASE ELSE
  770.     _PRINTSTRING (0, 20), STR$(SELECT_BUTTON), Layer(1)
  771.  
  772.   SELECT CASE Selection%%
  773.    CASE 1
  774.     _PUTIMAGE (220, 242)-STEP(15, 15), Layer(12), Layer(1), (73, 247)-STEP(7, 7) 'Player 1
  775.    CASE 2
  776.     _PUTIMAGE (220, 290)-STEP(15, 15), Layer(12), Layer(1), (73, 247)-STEP(7, 7) 'Player 2
  777.    CASE 3
  778.     _PUTIMAGE (220, 338)-STEP(15, 15), Layer(12), Layer(1), (73, 247)-STEP(7, 7) 'Player 3
  779.    CASE 4
  780.     _PUTIMAGE (220, 394)-STEP(15, 15), Layer(12), Layer(1), (73, 247)-STEP(7, 7) 'register
  781.    CASE 5
  782.     _PUTIMAGE (220, 426)-STEP(15, 15), Layer(12), Layer(1), (73, 247)-STEP(7, 7) 'Elimination
  783.   _PRINTSTRING (0, 0), STR$(Selection%%), Layer(1)
  784.   _PUTIMAGE , Layer(1), Layer(0)
  785.   _LIMIT 60
  786.   IF INKEY$ = CHR$(27) THEN Exitflag%% = TRUE
  787.  LOOP UNTIL Exitflag%%
  788.  
  789. FUNCTION Register%% (Records%%)
  790.  DIM Names(2, 8) AS STRING * 1
  791.  Result%% = Records%%
  792.  Tmp& = _COPYIMAGE(Layer(16))
  793.  ClearLayer Layer(16)
  794.  ClearLayer Layer(1)
  795.  _PUTIMAGE (140, 72)-STEP(511, 447), Layer(12), Layer(16), (258, 1)-STEP(255, 223) 'background
  796.  FOR i%% = 1 TO 3
  797.   IF RTRIM$(Nick(i%%)) <> "" THEN Place_Player_Record i%% - 1, 1
  798.  NEXT i%%
  799.  IF i%% > 0 THEN Selection%% = i%% ELSE Selection%% = 1
  800.  FOR i%% = 1 TO 3
  801.   IF RTRIM$(Nick(i%%)) = "" THEN _PUTIMAGE (300, 154 + 48 * (i%% - 1))-STEP(31, 31), Layer(12), Layer(16), (1, 230)-STEP(15, 15) 'Player 1 Link (green)
  802.  NEXT i%%
  803.  _CLEARCOLOR _RGB32(0), Layer(16)
  804.  _PUTIMAGE , Layer(16), Layer(1)
  805.  _DEST Layer(1)
  806.  Current_Letter%% = 1
  807.  Selection%% = Find_First_Available(1, 1)
  808.  DO
  809.  
  810.   SELECT CASE Get_Input%%
  811.    CASE Up
  812.     _PUTIMAGE (236 + 32 * Lx%, 328 + 32 * Ly%)-STEP(15, 15), Layer(12), Layer(1), (86, 240)-STEP(7, 7) 'Current selected Letter
  813.     Ly% = Ly% - 1
  814.     IF Ly% = -1 THEN Ly% = 3
  815.     Current_Letter%% = Current_Letter%% - 11
  816.     IF Current_Letter%% < 0 THEN Current_Letter%% = 44 - ABS(Current_Letter%%)
  817.    CASE Down
  818.     _PUTIMAGE (236 + 32 * Lx%, 328 + 32 * Ly%)-STEP(15, 15), Layer(12), Layer(1), (86, 240)-STEP(7, 7) 'Current selected Letter
  819.     Ly% = Ly% + 1
  820.     IF Ly% = 4 THEN Ly% = 0
  821.     Current_Letter%% = Current_Letter%% + 11
  822.     IF Current_Letter%% > 44 THEN Current_Letter%% = Current_Letter%% - 44
  823.    CASE Left
  824.     _PUTIMAGE (236 + 32 * Lx%, 328 + 32 * Ly%)-STEP(15, 15), Layer(12), Layer(1), (86, 240)-STEP(7, 7) 'Current selected Letter
  825.     Lx% = Lx% - 1
  826.     IF Lx% = -1 THEN Lx% = 10: Ly% = Ly% - 1: IF Ly% = -1 THEN Ly% = 3
  827.     Current_Letter%% = Current_Letter%% - 1
  828.     IF Current_Letter%% = 0 THEN Current_Letter%% = 44
  829.    CASE Right
  830.     _PUTIMAGE (236 + 32 * Lx%, 328 + 32 * Ly%)-STEP(15, 15), Layer(12), Layer(1), (86, 240)-STEP(7, 7) 'Current selected Letter
  831.     Lx% = Lx% + 1
  832.     IF Lx% = 11 THEN Lx% = 0: Ly% = Ly% + 1: IF Ly% = 4 THEN Ly% = 0
  833.     Current_Letter%% = Current_Letter%% + 1
  834.     IF Current_Letter%% = 45 THEN Current_Letter%% = 1
  835.    CASE BUTTON_A OR BUTTON_B
  836.     IF Selection%% <> 4 THEN 'only allow buttons if valid name entry selection
  837.      _PUTIMAGE (364 + 16 * Length%%, 152 + 48 * (Selection%% - 1))-STEP(15, 15), Layer(12), Layer(1), (86, 240)-STEP(7, 7) 'Current Nick Letter
  838.      Names(Selection%% - 1, Length%%) = Letter(Current_Letter%%)
  839.      Length%% = Length%% + 1
  840.      IF Length%% = 8 THEN Length%% = 0
  841.     END IF
  842.    CASE START_BUTTON
  843.     SELECT CASE Selection%%
  844.      CASE 4 'end
  845.       FOR j%% = 0 TO 2
  846.        a$ = ""
  847.        IF RTRIM$(Nick(j%% + 1)) = "" THEN
  848.         FOR i%% = 0 TO 7
  849.          IF ASC(Names(j%%, i%%)) > 31 THEN a$ = a$ + Names(j%%, i%%)
  850.         NEXT
  851.         Nick(j%% + 1) = a$
  852.        END IF
  853.       NEXT
  854.       ExitFlag%% = TRUE
  855.     END SELECT
  856.    CASE SELECT_BUTTON 'Change to different name or end registration
  857.     _PUTIMAGE (364 + 16 * Length%%, 152 + 48 * (Selection%% - 1))-STEP(15, 15), Layer(12), Layer(1), (86, 240)-STEP(7, 7) 'Current Nick Letter
  858.     _PUTIMAGE (274, 152 + 48 * (Selection%% - 1))-STEP(15, 15), Layer(12), Layer(1), (86, 240)-STEP(7, 7) 'heart selection
  859.     Selection%% = Selection%% + 1: Length%% = 0 'reset the name position when changing.
  860.     IF Selection%% = 5 THEN Selection%% = 1
  861.     _PRINTSTRING (0, 0), STR$(Selection%%), Layer(1)
  862.     Selection%% = Find_First_Available(1, Selection%%)
  863.    CASE ELSE
  864.     LINE (0, 0)-STEP(160, 40), _RGB32(0), BF
  865.     _PRINTSTRING (0, 20), STR$(Selection%%), Layer(1)
  866.   DO: LOOP UNTIL Get_Input%% = -1
  867.  
  868.   _PUTIMAGE (274, 152 + 48 * (Selection%% - 1))-STEP(15, 15), Layer(12), Layer(1), (73, 247)-STEP(7, 7) 'heart selection
  869.   IF Selection%% <> 4 THEN
  870.    FOR j%% = 0 TO 8
  871.     IF Names(Selection%% - 1, j%%) > CHR$(31) THEN _PRINTSTRING (364 + 16 * j%%, 152 + 48 * (Selection%% - 1)), Names(Selection%% - 1, j%%), Layer(1)
  872.    NEXT j%%
  873.   END IF
  874.   _PUTIMAGE , Layer(1), Layer(0)
  875.   IF blink%% AND Selection%% <> 4 THEN
  876.    _PUTIMAGE (364 + 16 * Length%%, 152 + 48 * (Selection%% - 1))-STEP(15, 15), Layer(12), Layer(1), (61, 230)-STEP(7, 7) 'Current Nick Letter
  877.    _PUTIMAGE (236 + 32 * Lx%, 328 + 32 * Ly%)-STEP(15, 15), Layer(12), Layer(1), (61, 230)-STEP(7, 7) 'Current selected Letter
  878.   ELSE
  879.    _PUTIMAGE (364 + 16 * Length%%, 152 + 48 * (Selection%% - 1))-STEP(15, 15), Layer(12), Layer(1), (86, 240)-STEP(7, 7) 'Current Nick Letter
  880.    _PUTIMAGE (236 + 32 * Lx%, 328 + 32 * Ly%)-STEP(15, 15), Layer(12), Layer(1), (86, 240)-STEP(7, 7) 'Current selected Letter
  881.   END IF
  882.   _PUTIMAGE , Layer(16), Layer(1)
  883.   b%% = b%% + 1
  884.   IF b%% = 8 THEN blink%% = NOT blink%%: b%% = 0
  885.   _LIMIT 60
  886.   IF INKEY$ = CHR$(27) THEN ExitFlag%% = TRUE
  887.  LOOP UNTIL ExitFlag%%
  888.  ClearLayer Layer(16)
  889.  _PUTIMAGE , Tmp&, Layer(16)
  890.  _FREEIMAGE Tmp&
  891.  Save_Records
  892.  FOR i%% = 1 TO 3
  893.   IF RTRIM$(Nick(i%%)) <> "" THEN Place_Player_Record i%% - 1, 0
  894.  NEXT i%%
  895.  Register = Result%%
  896.  
  897. SUB Elimination_Mode
  898.  Tmp& = _COPYIMAGE(Layer(16))
  899.  ClearLayer Layer(16)
  900.  ClearLayer Layer(1)
  901.  _PUTIMAGE (140, 72)-STEP(511, 447), Layer(12), Layer(16), (515, 1)-STEP(255, 223) 'background
  902.  FOR i%% = 1 TO 3
  903.   IF RTRIM$(Nick(i%%)) <> "" THEN Place_Player_Record i%% - 1, 1
  904.  NEXT i%%
  905.  _PUTIMAGE , Layer(16), Layer(0)
  906.  IF i%% > 0 THEN Selection%% = i%% ELSE Selection%% = 1
  907.  FOR i%% = 1 TO 3 'remove the erased game from the background screens
  908.   IF RTRIM$(Nick(i%%)) = "" THEN _PUTIMAGE (300, 154 + 48 * (i%% - 1))-STEP(31, 31), Layer(12), Layer(16), (1, 230)-STEP(15, 15) 'Player 1 Link (green)
  909.  NEXT i%%
  910.  _CLEARCOLOR _RGB32(0), Layer(16)
  911.  _PUTIMAGE , Layer(16), Layer(1)
  912.  _DEST Layer(1)
  913.  Current_Letter%% = 1
  914.  Selection%% = 1
  915.  DO
  916.   _PUTIMAGE , Layer(16), Layer(1)
  917.   SELECT CASE Get_Input%%
  918.    CASE START_BUTTON
  919.     SELECT CASE Selection%%
  920.      CASE 1 TO 3
  921.       Nick(Selection%%) = ""
  922.       Reset_Record Selection%%
  923.       _PUTIMAGE (364, 152 + 48 * (Selection%% - 1))-STEP(159, 31), Layer(12), Layer(16), (86, 240)-STEP(7, 7) 'black out
  924.       _PUTIMAGE (236, 232 + 48 * (Selection%% - 1))-STEP(159, 33), Layer(12), Tmp&, (86, 240)-STEP(7, 7) 'black out name
  925.       _PUTIMAGE (428, 232 + 48 * (Selection%% - 1))-STEP(127, 31), Layer(12), Tmp&, (86, 240)-STEP(7, 7) 'black out hearts
  926.      CASE 4
  927.       ExitFlag%% = TRUE
  928.     END SELECT
  929.    CASE SELECT_BUTTON
  930.     _PUTIMAGE (274, 152 + 48 * (Selection%% - 1))-STEP(15, 15), Layer(12), Layer(1), (86, 240)-STEP(7, 7) 'heart selection black out
  931.     Selection%% = Selection%% + 1
  932.     IF Selection%% = 5 THEN Selection%% = 1
  933.    CASE ELSE
  934.     _PRINTSTRING (0, 20), STR$(SELECT_BUTTON), Layer(1)
  935.   DO: LOOP UNTIL Get_Input%% = -1
  936.   _PUTIMAGE (274, 152 + 48 * (Selection%% - 1))-STEP(15, 15), Layer(12), Layer(1), (73, 267)-STEP(7, 7) 'heart selection
  937.   _PUTIMAGE , Layer(1), Layer(0)
  938.   _LIMIT 60
  939.   IF INKEY$ = CHR$(27) THEN ExitFlag%% = TRUE
  940.  LOOP UNTIL ExitFlag%%
  941.  ClearLayer Layer(16)
  942.  _PUTIMAGE , Tmp&, Layer(16)
  943.  _FREEIMAGE Tmp&
  944.  
  945. SUB Reset_Record (Which%%)
  946.  Records(Which%%) = Reset_Link
  947.  
  948. SUB Save_Records
  949.  OPEN "Zelda.MSF" FOR BINARY AS #1
  950.  FOR I%% = 1 TO 3
  951.   PUT #1, , Nick(I%%)
  952.   PUT #1, , Records(I%%)
  953.  NEXT I%%
  954.  CLOSE #1
  955.  
  956. SUB MFI_Loader (FN$)
  957.  DIM Size(128) AS LONG, FOffset(128) AS LONG
  958.  GET #1, , c~%% 'retrieve number of files
  959.  FOR I~%% = 1 TO c~%%
  960.   GET #1, , FOffset(I~%%)
  961.   GET #1, , Size(I~%%)
  962.   FOffset&(I~%%) = FOffset&(I~%%) + 1
  963.  NEXT I~%%
  964.  Layer(7) = LoadGFX(FOffset(1), Size(1)) '_LOADIMAGE("overworldtiles.bmp", 32)
  965.  Layer(9) = LoadGFX(FOffset(2), Size(2)) '_LOADIMAGE("TitleScreen.bmp", 32)
  966.  Layer(10) = LoadGFX(FOffset(3), Size(3)) '_LOADIMAGE("Titlefalls.bmp", 32)
  967.  Layer(11) = LoadGFX(FOffset(4), Size(4)) '_LOADIMAGE("Titlescroll.bmp", 32)
  968.  Layer(12) = LoadGFX(FOffset(5), Size(5)) '_LOADIMAGE("selectionscreen.bmp", 32)
  969.  
  970.  SFX(0) = LoadSFX(FOffset(6), Size(6))
  971.  SFX(1) = LoadSFX(FOffset(7), Size(7))
  972.  SFX(2) = LoadSFX(FOffset(8), Size(8))
  973.  SFX(3) = LoadSFX(FOffset(9), Size(9))
  974.  BGM(0) = LoadSFX(FOffset(10), Size(10))
  975.  FFX(0) = LoadFFX(FOffset(11), Size(11), 16)
  976.  LoadData FOffset(12), Size(12)
  977.  
  978.  CLOSE #1
  979.  IF _FILEEXISTS("temp.dat") THEN KILL "temp.dat"
  980.  
  981. FUNCTION LoadGFX& (Foff&, Size&)
  982.  IF _FILEEXISTS("temp.dat") THEN KILL "temp.dat"
  983.  OPEN "temp.dat" FOR BINARY AS #3
  984.  dat$ = SPACE$(Size&)
  985.  GET #1, Foff&, dat$
  986.  PUT #3, , dat$
  987.  CLOSE #3
  988.  LoadGFX& = _LOADIMAGE("temp.dat", 32)
  989.  
  990. FUNCTION LoadFFX& (Foff&, Size&, Fize%%)
  991.  IF _FILEEXISTS("temp.dat") THEN KILL "temp.dat"
  992.  OPEN "temp.dat" FOR BINARY AS #3
  993.  dat$ = SPACE$(Size&)
  994.  GET #1, Foff&, dat$
  995.  PUT #3, , dat$
  996.  CLOSE #3
  997.  LoadFFX& = _LOADFONT("temp.dat", Fize%%, "monospace")
  998.  
  999. FUNCTION LoadSFX& (Foff&, Size&)
  1000.  IF _FILEEXISTS("temp.dat") THEN KILL "temp.dat"
  1001.  OPEN "temp.dat" FOR BINARY AS #3
  1002.  dat$ = SPACE$(Size&)
  1003.  GET #1, Foff&, dat$
  1004.  PUT #3, , dat$
  1005.  CLOSE #3
  1006.  LoadSFX& = _SNDOPEN("temp.dat")
  1007.  
  1008. SUB LoadData (Foff&, Size&)
  1009.  IF _FILEEXISTS("temp.dat") THEN KILL "temp.dat"
  1010.  OPEN "temp.dat" FOR BINARY AS #3
  1011.  dat$ = SPACE$(Size&)
  1012.  GET #1, Foff&, dat$
  1013.  PUT #3, , dat$
  1014.  CLOSE #3
  1015.  
  1016.  F1 = FREEFILE
  1017.  OPEN "temp.dat" FOR BINARY AS #F1
  1018.  GET #F1, , Hyrule()
  1019.  GET #F1, , Link
  1020.  GET #F1, , C
  1021.  GET #F1, , G
  1022.  GET #F1, , Offset_X()
  1023.  GET #F1, , Offset_Y()
  1024.  FOR I%% = 1 TO 44
  1025.   GET #F1, , Letter(I%%)
  1026.  NEXT I%%
  1027.  CLOSE #F1
  1028.  
  1029.  
* Zelda.MFI (Filesize: 1.74 MB, Downloads: 187)
Granted after becoming radioactive I only have a half-life!