Author Topic: Some Phantasy Star Progess, Opening Sequence.  (Read 3387 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
Some Phantasy Star Progess, Opening Sequence.
« on: May 22, 2021, 06:51:18 pm »
⚠️ Here is some work that I have been doing toward my Phantasy Star I clone. ⚠️

⚠️⚠️A little Caution though, some the audio is quite loud at times.⚠️⚠️

Only option that really does anything is Start, Though some of Continue does exist(you can delete the dummy save slots) it doesn't make a difference anywhere.

Controls:
Up and Down arrows
Enter key.

⚠️⚠️⚠️⚠️Don't forget to download the MFI file!⚠️⚠️⚠️⚠️

Code: QB64: [Select]
  1. TYPE ControllerKeys
  2.  KBCon_Up AS LONG
  3.  KBCon_Down AS LONG
  4.  KBCon_Left AS LONG
  5.  KBCon_Right AS LONG
  6.  KBCon_Select AS LONG
  7.  KBCon_Start AS LONG
  8.  KBCon_A_Button AS LONG
  9.  KBCon_B_Button AS LONG
  10.  
  11.  Control_Pad AS _BYTE 'which Gamepad\Joystick Device Is player Using?
  12.  BAD_Pad AS _BYTE 'option for Buttons As Directions
  13.  Joy_Up AS _BYTE 'axis for up
  14.  Joy_Up_Val AS _BYTE 'axis value for up
  15.  Joy_Down AS _BYTE 'axis for down
  16.  Joy_Down_Val AS _BYTE 'axis value for down
  17.  Joy_Left AS _BYTE 'axis for left
  18.  Joy_Left_Val AS _BYTE 'axis value for left
  19.  Joy_Right AS _BYTE 'axis for right
  20.  Joy_Right_Val AS _BYTE 'axis value for right
  21.  Joy_Select AS _BYTE
  22.  Joy_Start AS _BYTE
  23.  Joy_A_Button AS _BYTE
  24.  Joy_B_Button AS _BYTE
  25.  Joy_Button_Up AS _BYTE 'for people whos controllers give BUTTON states for direction keys
  26.  Joy_Button_Down AS _BYTE 'or just want to use buttons for the direction keys.
  27.  Joy_Button_Left AS _BYTE '""""
  28.  Joy_Button_Right AS _BYTE 'however this fails to work so may not be implemented.
  29. TYPE Game_Data
  30.  SavedGames AS _BYTE
  31.  
  32. CONST Default_Key_Right = 19712, Default_Key_Left = 19200, Default_Key_Up = 18432, Default_Key_Down = 20480
  33. CONST Default_A_Button = 13, Default_B_Button = 32, Default_Start_Button = 65, Default_Select_Button = 66
  34. CONST ESC_Key = 27, ESC = 99
  35. CONST TRUE = -1, FALSE = NOT TRUE
  36. CONST New_Game = 101, Loaded_Game = 102
  37. CONST DOWN = 0, LEFT = 1, UP = 2, RIGHT = 3, SELECT_BUTTON = 4, START_BUTTON = 5, BUTTON_B = 6, BUTTON_A = 7
  38.  
  39. DIM SHARED Line$(1200), Temp&
  40. DIM SHARED G AS Game_Data, SavedNames(5) AS STRING * 5, C AS ControllerKeys
  41. DIM SHARED Layer(64) AS LONG, SFX(64) AS LONG
  42. '------dummy data-------
  43. C.KBCon_Up = Default_Key_Up
  44. C.KBCon_Down = Default_Key_Down
  45. C.KBCon_Left = Default_Key_Left
  46. C.KBCon_Right = Default_Key_Right
  47. C.KBCon_Select = Default_Select_Button
  48. C.KBCon_Start = Default_Start_Button
  49. C.KBCon_A_Button = Default_A_Button
  50. C.KBCon_B_Button = Default_B_Button
  51. SavedNames(1) = "ALIS"
  52. SavedNames(2) = "FELLI"
  53. SavedNames(3) = "STEVE"
  54. SavedNames(4) = "BPLUS"
  55. SavedNames(5) = "DAVID"
  56. G.SavedGames = 5
  57. '-----------------------
  58. MFI_Loader "PS_Opening_Demo.MFI"
  59. 'Layer(33) = _LOADIMAGE("GFX\SMS_Console_SM.bmp", 32)
  60. 'Layer(34) = _LOADIMAGE("GFX\SMS_Console_Overlay.bmp", 32)
  61. 'Layer(35) = _LOADIMAGE("GFX\SMS_Console_Overlay2.bmp", 32)
  62. 'Layer(36) = _LOADIMAGE("GFX\CartridgeInserted.bmp", 32)
  63. 'Layer(37) = _LOADIMAGE("GFX\Controller_Plug.bmp", 32)
  64. 'Layer(38) = _LOADIMAGE("GFX\Controller.bmp", 32)
  65. 'Layer(39) = _LOADIMAGE("GFX\PowerButton_ON.bmp", 32)
  66. 'Layer(40) = _LOADIMAGE("GFX\PowerLED_ON.bmp", 32)
  67. 'Layer(41) = _LOADIMAGE("GFX\FingerPressPower.bmp", 32)
  68. 'Layer(42) = _LOADIMAGE("GFX\SMS_BIOS_UP.bmp", 32)
  69. 'Layer(43) = _LOADIMAGE("GFX\MainMenuScreen.bmp", 32)
  70. 'Layer(44) = _LOADIMAGE("GFX\BackGroundsMaster.bmp", 32)
  71. 'Layer(45) = _LOADIMAGE("GFX\CutScenes_NPC_Sprites.bmp", 32)
  72. 'Layer(46) = _LOADIMAGE("GFX\StarSkyLoop.bmp", 32)
  73. 'Layer(47) = _LOADIMAGE("GFX\FontMasterLinear.bmp", 32)
  74. 'SFX(0) = _SNDOPEN("Audio\MasterSystem_StartUp.ogg")
  75. 'SFX(1) = _SNDOPEN("Audio\InsertCart_SLOW.ogg")
  76. 'SFX(2) = _SNDOPEN("Audio\Power_Button.ogg")
  77. 'SFX(3) = _SNDOPEN("Audio\MainMenuLoop.ogg")
  78. 'SFX(4) = _SNDOPEN("Audio\IntroLoop.ogg")
  79. '
  80. 'OPEN "dialog_dump.txt" FOR BINARY AS #1
  81. 'DO
  82. ' LINE INPUT #1, Line$(i%)
  83. ' Line$(i%) = RTRIM$(LTRIM$(Line$(i%)))
  84. ' i% = i% + 1
  85. 'LOOP UNTIL EOF(1)
  86. 'CLOSE #1
  87.  
  88. Temp& = _NEWIMAGE(640, 480, 32)
  89. Layer(32) = _NEWIMAGE(640, 480, 32)
  90. _CLEARCOLOR _RGB32(0), Layer(37)
  91. _CLEARCOLOR _RGB32(0), Layer(36)
  92. _CLEARCOLOR _RGB32(0), Layer(41)
  93. _CLEARCOLOR _RGB32(0), Layer(34)
  94. _CLEARCOLOR _RGB32(0), Layer(35)
  95. _CLEARCOLOR _RGB32(0), Layer(38)
  96.  
  97. Elaborate_Loading
  98. Startup_Menu
  99. New_Game_Sequence
  100.  
  101.  
  102. SUB TimedPrint (X%, Y%, Txt$, LPS%)
  103.  Speed! = (100 / LPS%) / 100
  104.  FOR i%% = 1 TO LEN(Txt$)
  105.   IF MID$(Txt$, i%%, 1) = CHR$(34) THEN By%% = 8 ELSE By%% = 0
  106.   _PUTIMAGE (X% + i%% * 16, Y% - By%%)-STEP(15, 15), Layer(47), _DISPLAY, (1 + (10 * (ASC(MID$(Txt$, i%%, 1)) - 32)), 1)-STEP(7, 7)
  107.   _DELAY Speed!
  108.  NEXT i%%
  109.  
  110. SUB KeyPressWait
  111.  DO: LOOP UNTIL INKEY$ <> ""
  112.  
  113. SUB ClearTextRegion
  114.  LINE (144, 320)-(464, 464), _RGB32(0), BF
  115.  
  116. SUB PS_Print (X%, Y%, TxT$)
  117.  L% = LEN(TxT$)
  118.  FOR i%% = 1 TO L%
  119.   _PUTIMAGE (X% + i%% * 16, Y%)-STEP(15, 15), Layer(47), _DISPLAY, (1 + (10 * (ASC(MID$(TxT$, i%%, 1)) - 32)), 1)-STEP(7, 7)
  120.  
  121. SUB Create_Dialog_Box (X%, Y%, H%, W%)
  122.  Top$ = "a"
  123.  Bot$ = "g"
  124.  FOR i%% = 1 TO W%
  125.   Top$ = Top$ + "b"
  126.   Bot$ = Bot$ + "h"
  127.  NEXT i%%
  128.  Top$ = Top$ + "c"
  129.  Bot$ = Bot$ + "i"
  130.  sid$ = "d" + SPACE$(W%) + "f"
  131.  ' PS_Print 144, 336, "abbbbbbbbbbbbbbbbbbc"
  132.  ' PS_Print 144, 352, "d                  f"
  133.  ' PS_Print 144, 368, "d                  f"
  134.  ' PS_Print 144, 384, "d                  f"
  135.  ' PS_Print 144, 400, "d                  f"
  136.  ' PS_Print 144, 416, "ghhhhhhhhhhhhhhhhhhi"
  137.  PS_Print X% * 16, Y% * 16, Top$
  138.  FOR i%% = 1 TO H%
  139.   PS_Print X% * 16, (Y% + i%%) * 16, sid$
  140.  NEXT i%%
  141.  PS_Print X% * 16, (Y% + i%%) * 16, Bot$
  142.  
  143. SUB StarScroll
  144.  DO
  145.   _PUTIMAGE (64, 48)-STEP(511, 383), Layer(46), _DISPLAY, (0, gx%)-STEP(255, 191)
  146.   _LIMIT 60
  147.   gx% = gx% + 1
  148.  LOOP UNTIL gx% = 256
  149.  
  150. SUB Fade_Out (L&)
  151.  FOR n! = 1 TO 0.00 STEP -0.05
  152.   i2& = _COPYIMAGE(L&)
  153.   DarkenImage i2&, n!
  154.   _PUTIMAGE (0, 0), i2&
  155.   _FREEIMAGE i2&
  156.   _DELAY .03
  157.  
  158. SUB Fade_In (L&)
  159.  FOR n! = 0.01 TO 1 STEP 0.05
  160.   i2& = _COPYIMAGE(L&)
  161.   DarkenImage i2&, n!
  162.   _PUTIMAGE (0, 0), i2&
  163.   _FREEIMAGE i2&
  164.   _DELAY .03
  165.  
  166. SUB DarkenImage (Image AS LONG, Value_From_0_To_1 AS SINGLE)
  167.  IF Value_From_0_To_1 <= 0 OR Value_From_0_To_1 >= 1 OR _PIXELSIZE(Image) <> 4 THEN EXIT SUB
  168.  DIM Buffer AS _MEM: Buffer = _MEMIMAGE(Image) 'Get a memory reference to our image
  169.  DIM Frac_Value AS LONG: Frac_Value = Value_From_0_To_1 * 65536 'Used to avoid slow floating point calculations
  170.  DIM O AS _OFFSET, O_Last AS _OFFSET
  171.  O = Buffer.OFFSET 'We start at this offset
  172.  O_Last = Buffer.OFFSET + _WIDTH(Image) * _HEIGHT(Image) * 4 'We stop when we get to this offset
  173.  'use on error free code ONLY!
  174.  DO
  175.   _MEMPUT Buffer, O, _MEMGET(Buffer, O, _UNSIGNED _BYTE) * Frac_Value \ 65536 AS _UNSIGNED _BYTE
  176.   _MEMPUT Buffer, O + 1, _MEMGET(Buffer, O + 1, _UNSIGNED _BYTE) * Frac_Value \ 65536 AS _UNSIGNED _BYTE
  177.   _MEMPUT Buffer, O + 2, _MEMGET(Buffer, O + 2, _UNSIGNED _BYTE) * Frac_Value \ 65536 AS _UNSIGNED _BYTE
  178.   O = O + 4
  179.  LOOP UNTIL O = O_Last
  180.  'turn checking back on when done!
  181.  _MEMFREE Buffer
  182.  
  183. SUB ClearLayer (L&)
  184.  old& = _DEST
  185.  _DEST L&
  186.  CLS
  187.  _DEST old&
  188.  
  189. SUB Startup_Menu
  190.  _SNDLOOP SFX(3)
  191.  _PUTIMAGE (64, 48)-STEP(512, 383), Layer(43), Temp& 'place start menu into temp to fade in
  192.  Fade_In Temp&
  193.  _PUTIMAGE (64, 48)-STEP(512, 383), Layer(43), _DISPLAY
  194.  DO
  195.   Inputs%% = Get_Input
  196.   SELECT CASE Inputs%%
  197.    CASE UP
  198.     TimedPrint 192, 304 + (32 * Opt%%), " ", 100
  199.     Opt%% = Opt%% - 1
  200.     IF Opt%% = -1 THEN Opt%% = 0
  201.     DO: Inputs%% = Get_Input: LOOP UNTIL Inputs%% = TRUE
  202.    CASE DOWN
  203.     TimedPrint 192, 304 + (32 * Opt%%), " ", 100
  204.     Opt%% = Opt%% + 1
  205.     IF Opt%% = 3 THEN Opt%% = 2
  206.     DO: Inputs%% = Get_Input: LOOP UNTIL Inputs%% = TRUE
  207.    CASE BUTTON_A
  208.     SELECT CASE Opt%%
  209.      CASE 0
  210.       ExitFlag%% = TRUE
  211.       Result%% = New_Game
  212.      CASE 1
  213.       IF G.SavedGames THEN Result%% = Continue ELSE ExitFlag%% = TRUE: Result%% = New_Game
  214.       IF Result%% = TRUE THEN
  215.        ExitFlag%% = TRUE: Result%% = Loaded_Game
  216.       ELSE
  217.        _PUTIMAGE (64, 48)-STEP(512, 383), Layer(43), Temp& 'place start menu into temp to fade in
  218.        Fade_In Temp&
  219.        _PUTIMAGE (64, 48)-STEP(512, 383), Layer(43), _DISPLAY
  220.       END IF
  221.      CASE 2
  222.       Run_Options
  223.     END SELECT
  224.    CASE ESC
  225.     END
  226.   IF blinkon%% THEN TimedPrint 192, 304 + (32 * Opt%%), "j", 100 ELSE TimedPrint 192, 304 + (32 * Opt%%), " ", 100
  227.   blink%% = blink%% + 1
  228.   IF blink%% = 8 AND blinkon%% = 0 THEN blinkon%% = -1: blink%% = 0
  229.   IF blink%% = 8 AND blinkon%% = -1 THEN blinkon%% = 0: blink%% = 0
  230.   _LIMIT 60
  231.  LOOP UNTIL ExitFlag%%
  232.  
  233. FUNCTION Continue%%
  234.  Fade_Out _DISPLAY
  235.  Create_Dialog_Box 9, 21, 4, 18
  236.  TimedPrint 16 * 10, 16 * 23, "CONTINUE GAME- YES", 100
  237.  TimedPrint 16 * 10, 16 * 25, "DELETE   GAME- NO ", 100
  238.  Result%% = Yes_No_Box(24, 16)
  239.  SELECT CASE Result%%
  240.   CASE 0
  241.    Load_Game
  242.    Result%% = TRUE
  243.   CASE 1
  244.    Delete_Game
  245.    Result%% = FALSE
  246.  Continue%% = Result%%
  247.  
  248. SUB Run_Options
  249.  
  250. FUNCTION Yes_No_Box%% (X%, Y%)
  251.  Result%% = TRUE
  252.  Create_Dialog_Box X%, Y%, 3, 3
  253.  TimedPrint 16 * (X% + 1), 16 * (Y% + 1), "YES", 100
  254.  TimedPrint 16 * (X% + 1), 16 * (Y% + 3), "NO", 100
  255.  DO
  256.   IF _KEYDOWN(Default_Key_Down) OR _KEYDOWN(Default_Key_Up) THEN
  257.    IF NOT KeyStop%% THEN
  258.     IF Opt%% THEN Opt%% = 0 ELSE Opt%% = 1
  259.     KeyStop%% = TRUE
  260.    END IF
  261.   ELSE
  262.    KeyStop%% = FALSE
  263.   END IF
  264.   SELECT CASE Opt%%
  265.    CASE 0
  266.     IF Blinkon%% THEN PS_Print 16 * (X%), 16 * (Y% + 1), "k" ELSE PS_Print 16 * (X%), 16 * (Y% + 1), "d"
  267.     PS_Print 16 * X%, 16 * (Y% + 3), "d"
  268.    CASE 1
  269.     PS_Print 16 * X%, 16 * (Y% + 1), "d"
  270.     IF Blinkon%% THEN PS_Print 16 * X%, 16 * (Y% + 3), "k" ELSE PS_Print 16 * X%, 16 * (Y% + 3), "d"
  271.   _LIMIT 60
  272.   blink%% = blink%% + 1
  273.   IF blink%% = 10 THEN Blinkon%% = NOT Blinkon%%: blink%% = 0
  274.   LOCATE 1, 1: PRINT Opt%%
  275.   IF _KEYDOWN(Default_A_Button) THEN Result%% = Opt%%: ExitFlag%% = TRUE
  276.  LOOP UNTIL ExitFlag%%
  277.  Yes_No_Box = Result%%
  278.  
  279. SUB Load_Game
  280.  CLS
  281.  Create_Dialog_Box 9, 21, 4, 18
  282.  TimedPrint 16 * 10, 16 * 23, "CONTINUE A GAME.", 100
  283.  TimedPrint 16 * 10, 16 * 25, "SELECT A NUMBER. ", 100
  284.  Result%% = Select_Game
  285.  
  286. SUB Delete_Game
  287.  Create_Dialog_Box 9, 21, 4, 18
  288.  TimedPrint 16 * 10, 16 * 23, "WILL DELETE A", 100
  289.  TimedPrint 16 * 10, 16 * 25, "SAVED GAME O.K.? ", 100
  290.  Result%% = Yes_No_Box(24, 16)
  291.  SELECT CASE Result%%
  292.   CASE 0
  293.    CLS
  294.    Create_Dialog_Box 9, 21, 4, 18
  295.    TimedPrint 16 * 10, 16 * 23, "DELETE A GAME", 100
  296.    TimedPrint 16 * 10, 16 * 25, "SELECT A NUMBER. ", 100
  297.    Result%% = Select_Game
  298.  
  299. FUNCTION Select_Game
  300.  Create_Dialog_Box 26, 1, 10, 7
  301.  TimedPrint 16 * 27, 16 * 3, "1", 100
  302.  TimedPrint 16 * 27, 16 * 5, "2 ", 100
  303.  TimedPrint 16 * 27, 16 * 7, "3", 100
  304.  TimedPrint 16 * 27, 16 * 9, "4 ", 100
  305.  TimedPrint 16 * 27, 16 * 11, "5", 100
  306.  FOR i%% = 1 TO 5
  307.   TimedPrint 16 * 29, 16 * (1 + i%% * 2), SavedNames(i%%), 100
  308.  NEXT i%%
  309.  Opt%% = 1
  310.  DO
  311.   Inputs%% = Get_Input
  312.   SELECT CASE Inputs%%
  313.    CASE UP
  314.     Opt%% = Opt%% - 1
  315.     IF Opt%% = 0 THEN Opt%% = 1
  316.     DO: Inputs%% = Get_Input: LOOP UNTIL Inputs%% = TRUE
  317.    CASE DOWN
  318.     Opt%% = Opt%% + 1
  319.     IF Opt%% = 6 THEN Opt%% = 5
  320.     DO: Inputs%% = Get_Input: LOOP UNTIL Inputs%% = TRUE
  321.    CASE BUTTON_A
  322.     IF LTRIM$(SavedNames(Opt%%)) <> "" THEN
  323.      SavedNames(Opt%%) = ""
  324.      G.SavedGames = G.SavedGames - 1
  325.      ExitFlag%% = TRUE
  326.     ELSE
  327.      Opt%% = 1
  328.     END IF
  329.   _PUTIMAGE , Tmp&, _DISPLAY
  330.   IF Blinkon%% THEN PS_Print 16 * (26), 16 * (1 + Opt%% * 2), "k"
  331.   _PRINTSTRING (0, 0), STR$(Opt%%)
  332.   _LIMIT 60
  333.   blink%% = blink%% + 1
  334.   IF blink%% = 10 THEN Blinkon%% = NOT Blinkon%%: blink%% = 0
  335.  LOOP UNTIL ExitFlag%%
  336.  _FREEIMAGE Tmp&
  337.  
  338.  
  339. FUNCTION Get_Input%% ()
  340.  Result%% = TRUE '-1 for no input
  341.  ' SELECT CASE G.ControlType
  342.  '  CASE TRUE 'Keyboard input
  343.  IF _KEYDOWN(ESC_Key) THEN Result%% = ESC
  344.  IF _KEYDOWN(C.KBCon_Up) THEN Result%% = UP
  345.  IF _KEYDOWN(C.KBCon_Down) THEN Result%% = DOWN
  346.  IF _KEYDOWN(C.KBCon_Left) THEN Result%% = LEFT
  347.  IF _KEYDOWN(C.KBCon_Right) THEN Result%% = RIGHT
  348.  IF _KEYDOWN(C.KBCon_Select) THEN Result%% = SELECT_BUTTON: DO: LOOP WHILE _KEYDOWN(C.KBCon_Select)
  349.  IF _KEYDOWN(C.KBCon_Start) THEN Result%% = START_BUTTON: DO: LOOP WHILE _KEYDOWN(C.KBCon_Start)
  350.  IF _KEYDOWN(C.KBCon_A_Button) THEN Result%% = BUTTON_A: DO: LOOP WHILE _KEYDOWN(C.KBCon_A_Button)
  351.  IF _KEYDOWN(C.KBCon_B_Button) THEN Result%% = BUTTON_B: DO: LOOP WHILE _KEYDOWN(C.KBCon_B_Button)
  352.  
  353.  '  CASE FALSE 'joystick input
  354.  ' IF C.Control_Pad THEN
  355.  '  IF NOT G.Flag THEN DO: LOOP WHILE _DEVICEINPUT(C.Control_Pad)
  356.  '  IF NOT C.BAD_Pad THEN
  357.  '   nul%% = AxisPower(CJR%%, CJL%%, CJU%%, CJD%%) 'read directional axis values
  358.  ' IF CJU%% THEN Result%% = UP
  359.  ' IF CJD%% THEN Result%% = DOWN
  360.  ' IF CJL%% THEN Result%% = LEFT
  361.  ' IF CJR%% THEN Result%% = RIGHT
  362.  '  ELSE
  363.  '   IF _BUTTON(C.Joy_Button_Up) THEN Result%% = UP ': Joy_Lock_Button (C.Joy_Button_Up)
  364.  '   IF _BUTTON(C.Joy_Button_Down) THEN Result%% = DOWN ': Joy_Lock_Button (C.Joy_Button_Down)
  365.  ' IF _BUTTON(C.Joy_Button_Left) THEN Result%% = LEFT ': Joy_Lock_Button (C.Joy_Button_Left)
  366.  ' IF _BUTTON(C.Joy_Button_Right) THEN Result%% = RIGHT ': Joy_Lock_Button (C.Joy_Button_Right)
  367.  '  END IF
  368.  '  IF _BUTTON(C.Joy_Select) THEN Result%% = SELECT_BUTTON: Joy_Lock_Button (C.Joy_Select)
  369.  '  IF _BUTTON(C.Joy_Start) THEN Result%% = START_BUTTON: Joy_Lock_Button (C.Joy_Start)
  370.  '  IF _BUTTON(C.Joy_A_Button) THEN Result%% = BUTTON_A: Joy_Lock_Button (C.Joy_A_Button)
  371.  '  IF _BUTTON(C.Joy_B_Button) THEN Result%% = BUTTON_B: Joy_Lock_Button (C.Joy_B_Button)
  372.  ' END IF
  373.  ' END SELECT
  374.  Get_Input = Result%%
  375.  
  376. SUB New_Game_Sequence
  377.  Fade_Out _DISPLAY
  378.  Fade_SFX_Out SFX(3)
  379.  ClearLayer Temp&
  380.  _PUTIMAGE (64, 48)-STEP(511, 383), Layer(46), Temp&, (0, 0)-STEP(255, 191)
  381.  Fade_In Temp&
  382.  _SNDLOOP SFX(4)
  383.  StarScroll
  384.  _DELAY 1
  385.  Fade_Out _DISPLAY
  386.  ClearLayer Temp&
  387.  _PUTIMAGE (64, 48)-STEP(511, 383), Layer(44), Temp&, (0, 0)-STEP(255, 191)
  388.  Fade_In Temp&
  389.  _PUTIMAGE (64, 48)-STEP(511, 383), Layer(44), _DISPLAY, (0, 0)-STEP(255, 191)
  390.  Create_Dialog_Box 6, 5, 3, 18
  391.  TimedPrint 16 * 7, 16 * 6, "SPACE CENTURY 324,", 20
  392.  TimedPrint 16 * 7, 16 * 8, "CAMINEET ON PALMA", 20
  393.  _DELAY 1.5
  394.  ClearLayer Temp&
  395.  _PUTIMAGE (64, 48)-STEP(511, 319), Layer(45), Temp&, (0, 0)-STEP(255, 159)
  396.  _PUTIMAGE (160, 96)-STEP(319, 191), Layer(45), Temp&, (0, 160)-STEP(159, 95)
  397.  Fade_In Temp&
  398.  FOR i%% = 0 TO 3
  399.   TimedPrint 144, 320 + 30 * i%%, Line$(1083 + i%%), 24
  400.  NEXT i%%
  401.  KeyPressWait
  402.  Fade_Out _DISPLAY
  403.  _PUTIMAGE (160, 96)-STEP(319, 191), Layer(45), Temp&, (161, 257)-STEP(159, 95)
  404.  Fade_In Temp&
  405.  FOR i%% = 0 TO 1
  406.   TimedPrint 144, 320 + 30 * i%%, Line$(1087 + i%%), 24
  407.  NEXT i%%
  408.  KeyPressWait
  409.  Fade_Out _DISPLAY
  410.  _PUTIMAGE (160, 96)-STEP(319, 191), Layer(45), Temp&, (0, 257)-STEP(159, 95)
  411.  Fade_In Temp&
  412.  FOR i%% = 0 TO 3
  413.   TimedPrint 144, 320 + 30 * i%%, Line$(1089 + i%%), 24
  414.  NEXT i%%
  415.  KeyPressWait
  416.  ClearTextRegion
  417.  FOR i%% = 0 TO 3
  418.   TimedPrint 144, 320 + 30 * i%%, Line$(1093 + i%%), 24
  419.  NEXT i%%
  420.  KeyPressWait
  421.  ClearTextRegion
  422.  FOR i%% = 0 TO 3
  423.   TimedPrint 144, 320 + 30 * i%%, Line$(1097 + i%%), 24
  424.  NEXT i%%
  425.  KeyPressWait
  426.  ClearTextRegion
  427.  FOR i%% = 0 TO 3
  428.   TimedPrint 144, 320 + 30 * i%%, Line$(1101 + i%%), 24
  429.  NEXT i%%
  430.  KeyPressWait
  431.  Fade_Out _DISPLAY
  432.  _PUTIMAGE (160, 96)-STEP(319, 191), Layer(45), Temp&, (161, 160)-STEP(159, 95)
  433.  Fade_In Temp&
  434.  FOR i%% = 0 TO 3
  435.   TimedPrint 144, 320 + 30 * i%%, Line$(1105 + i%%), 24
  436.  NEXT i%%
  437.  KeyPressWait
  438.  ClearTextRegion
  439.  TimedPrint 144, 320, Line$(1105 + i%%), 24
  440.  KeyPressWait
  441.  Fade_Out _DISPLAY
  442.  Fade_SFX_Out SFX(4)
  443.  
  444. SUB Elaborate_Loading
  445.  _PUTIMAGE (0, 0), Layer(33), Layer(32)
  446.  _PUTIMAGE (80, 300), Layer(38), Layer(32)
  447.  Fade_In Layer(32)
  448.  'insert Cart
  449.  FOR i% = 256 TO 0 STEP -1
  450.   _PUTIMAGE (0, 0), Layer(32), Temp&
  451.   _PUTIMAGE (356, 16 - i%), Layer(36), Temp&
  452.   _PUTIMAGE (318, 68), Layer(34), Temp&
  453.   _PUTIMAGE , Temp&, _DISPLAY
  454.   IF i% = 50 THEN _SNDPLAY SFX(1)
  455.   _LIMIT 120
  456.  NEXT i%
  457.  _PUTIMAGE , _DISPLAY, Layer(32)
  458.  'insert Controller
  459.  FOR i% = 256 TO 0 STEP -1
  460.   _PUTIMAGE (0, 0), Layer(32), Temp&
  461.   _PUTIMAGE (0 - i%, 194 + i%), Layer(37), Temp&
  462.   _PUTIMAGE (215, 189), Layer(35), Temp&
  463.   _PUTIMAGE , Temp&, _DISPLAY
  464.   _LIMIT 90
  465.  NEXT i%
  466.  _PUTIMAGE , _DISPLAY, Layer(32)
  467.  'Press Power Button
  468.  FOR i% = 128 TO 0 STEP -1
  469.   _PUTIMAGE (0, 0), Layer(32), Temp&
  470.   _PUTIMAGE (-184 - i%, 160 + i%), Layer(41), Temp&
  471.  
  472.   IF i% = 15 THEN _SNDPLAY SFX(2)
  473.   _PUTIMAGE , Temp&, _DISPLAY
  474.   _DELAY .008
  475.  NEXT i%
  476.  'Depress button
  477.  _PUTIMAGE (31, 139), Layer(39), Layer(32)
  478.  _PUTIMAGE (356, 139), Layer(40), Layer(32)
  479.  
  480.  FOR i% = 0 TO 128
  481.   _PUTIMAGE (0, 0), Layer(32), Temp&
  482.   _PUTIMAGE (-184 - i%, 160 + i%), Layer(41), Temp&
  483.   _PUTIMAGE , Temp&, _DISPLAY
  484.   _DELAY .008
  485.  NEXT i%
  486.  _DELAY .5
  487.  Fade_Out _DISPLAY
  488.  _SNDPLAY SFX(0)
  489.  _PUTIMAGE , Layer(42), Temp&
  490.  Fade_In Temp&
  491.  Fade_Out _DISPLAY
  492.  
  493. SUB Fade_SFX_Out (Snd&)
  494.  FOR i%% = 100 TO 0 STEP -1
  495.   _SNDVOL Snd&, (i%% / 100)
  496.   _LIMIT 100
  497.  NEXT i%%
  498.  _SNDSTOP Snd&
  499.  
  500. SUB MFI_Loader (FN$)
  501.  DIM Size(128) AS LONG, FOffset(128) AS LONG
  502.  GET #1, , c~%% 'retrieve number of files
  503.  FOR I~%% = 1 TO c~%%
  504.   GET #1, , FOffset(I~%%)
  505.   GET #1, , Size(I~%%)
  506.   FOffset&(I~%%) = FOffset&(I~%%) + 1
  507.  NEXT I~%%
  508.  FOR i%% = 1 TO 15
  509.   Layer(32 + i%%) = LoadGFX(FOffset(i%%), Size(i%%))
  510.  NEXT i%%
  511.  FOR i%% = 0 TO 4
  512.   SFX(i%%) = LoadSFX(FOffset(16 + i%%), Size(16 + i%%))
  513.  NEXT i%%
  514.  LoadData FOffset(21), Size(21)
  515.  F1 = FREEFILE
  516.  OPEN "temp.dat" FOR BINARY AS #F1
  517.  DO
  518.   LINE INPUT #F1, Line$(i%)
  519.   i% = i% + 1
  520.  LOOP UNTIL EOF(F1)
  521.  CLOSE #F1
  522.  
  523.  CLOSE #1
  524.  IF _FILEEXISTS("temp.dat") THEN KILL "temp.dat"
  525.  
  526. SUB LoadData (Foff&, Size&)
  527.  IF _FILEEXISTS("temp.dat") THEN KILL "temp.dat"
  528.  OPEN "temp.dat" FOR BINARY AS #3
  529.  dat$ = SPACE$(Size&)
  530.  GET #1, Foff&, dat$
  531.  PUT #3, , dat$
  532.  CLOSE #3
  533.  
  534. REM '$include:'MFI_Loader2.bi'
  535.  
  536. FUNCTION LoadGFX& (Foff&, Size&)
  537.  IF _FILEEXISTS("temp.dat") THEN KILL "temp.dat"
  538.  OPEN "temp.dat" FOR BINARY AS #3
  539.  dat$ = SPACE$(Size&)
  540.  GET #1, Foff&, dat$
  541.  PUT #3, , dat$
  542.  CLOSE #3
  543.  LoadGFX& = _LOADIMAGE("temp.dat", 32)
  544.  
  545. FUNCTION LoadFFX& (Foff&, Size&, Fize%%)
  546.  IF _FILEEXISTS("temp.dat") THEN KILL "temp.dat"
  547.  OPEN "temp.dat" FOR BINARY AS #3
  548.  dat$ = SPACE$(Size&)
  549.  GET #1, Foff&, dat$
  550.  PUT #3, , dat$
  551.  CLOSE #3
  552.  LoadFFX& = _LOADFONT("temp.dat", Fize%%, "monospace")
  553.  
  554. FUNCTION LoadSFX& (Foff&, Size&)
  555.  IF _FILEEXISTS("temp.dat") THEN KILL "temp.dat"
  556.  OPEN "temp.dat" FOR BINARY AS #3
  557.  dat$ = SPACE$(Size&)
  558.  GET #1, Foff&, dat$
  559.  PUT #3, , dat$
  560.  CLOSE #3
  561.  LoadSFX& = _SNDOPEN("temp.dat")
  562.  
* PS_Opening_Demo.MFI (Filesize: 2.01 MB, Downloads: 217)
Granted after becoming radioactive I only have a half-life!

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Some Phantasy Star Progess, Opening Sequence.
« Reply #1 on: May 24, 2021, 05:18:36 pm »
I am not a fan of this type of game nor have I played this game before.... But this is very well made. I do not know how it compares with the original, but what you have done so far, is quite impressive... Well done!
Logic is the beginning of wisdom.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Some Phantasy Star Progess, Opening Sequence.
« Reply #2 on: May 24, 2021, 05:28:05 pm »
Might want to drop a limit in the keypress wait routine to keep cpu usage low:


SUB KeyPressWait
 _KEYCLEAR
 DO
    _LIMIT 30
 LOOP UNTIL INKEY$ <> ""
END SUB
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

FellippeHeitor

  • Guest
Re: Some Phantasy Star Progess, Opening Sequence.
« Reply #3 on: May 28, 2021, 04:43:38 pm »
Finally got around to running this, @Cobalt. Great job recreating the intro!

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: Some Phantasy Star Progess, Opening Sequence.
« Reply #4 on: May 29, 2021, 08:01:45 am »
Its amazing... The first animation looks like 3D.. I like it.. Its look very professional
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials