A downloadable game

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

     "ROM-RUN FOR OKTOGONIA" FOR ZX SPECTRUM 16/48K

   

    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

<http: oktogonia.com=""></http:>

Table of Contents

─────────────────

1. Load instructions

.. 1. DISCLAIMER

.. 2. Loading for ZX Spectrum 16k

.. 3. Loading for ZX Spectrum 48k

.. 4. Controls

2. Code and code explanation

3. License

You can find the fully game manual on the attached PDF document.

Also online at https://www.oktogonia.com/en/-/rrfo<https: www.oktogonia.com="" en="" -="" rrfo=""></https:>


2 Code and code explanation

═══════════════════════════

  ┌────
  │ 0        1         2         3         4         5         6         7         8
  │ 12345678901234567890123456789012345678901234567890123456789012345678901234567890
  │ --------------------------------------------------------------------------------
  │ 1 DATA 1,-21,18,16,"!",2,0.01,"↑",4: LET L=1: LET W=224: DIM H(21): POKE 23562,0
  │ 2 RESTORE : READ I,A,C,P,M$,E,T: PAPER 0: INK L: BORDER 0: CLS : POKE 23692,0
  │ 3 LET C=ABS (C+SGN (PEEK (L*985+A)-92)): LET H(I)=C+3: LET I=1+(I AND I<21)
  │ 4 LET K=ABS (CODE INKEY$-98): IF K<3 THEN LET P=P+K*2-3: POKE 23692,0: OUT 254,0
  │ 5 PRINT AT 21,0;"oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO",AT 20,C;"Oo   ": OUT 254,16
  │ 6 PRINT INK 7;AT 0,P;"V": REM © victor@oktogonia.com (https://www.oktogonia.com)
  │ 7 LET A=A+1: IF A=W THEN LET L=L+1: LET W=128+L*96: READ M$,E: GO TO 9
  │ 8 IF A<0 OR ABS (P-H(I))<=1 THEN GO TO 3: DATA 99,1," ▞▞ SAVED OKTOGONIA ▞▞"
  │ 9 PRINT #1;AT 0,13-L/9;M$;" (";A;")": BORDER E: IF L=5 THEN READ L,T,M$: GO TO 9
  │ 10 FOR N=0 TO (E-3)*E*4 STEP E-3: BEEP T,24+N: BEEP T,30+N: NEXT N: GO TO 2+T*9
  └────

  1. Game Initialization

     ⁃ Variables:

       • L: Current Level

       • W: Level depth (total rows)

       • H: Circular queue to hold hole position for each row

     POKE 23561,0: Makes the keyboard more responsive.

     ┌────

     │ 23561: "REPDEL" System Variable: "Time (in 50ths of a second in

     │ 60ths of a second in N. America) that a key must be held down

     │ before it repeats. This starts off at 35, but you can POKE in

     │ other values"

     └────

  2. Level Initialization

     ⁃ Variables:

       • I: Circular Queue Index

       • A: Current Depth

       • C: Current row hole column

       • P: Player column

       • M$: Current Message

       • E: Current status (2: Fail, 4: Success)

       • T: Time a note must beep

     We set INK to the current level (blue, red, magenta, green)

     POKE 23692,0: Make the scroll non-stop.

     ┌────

     │ 23692: "SCR CT" Counts scrolls System Variable: "it is always 1

     │ more than the number of scrolls that will be done before

     │ stopping with scroll? If you keep poking this with a number

     │ bigger than 1 (say 255), the screen will scroll on and on

     │ without asking you"

     └────

  3. Level row generation and storing

     We calculate the random hole column using the ROM as a

     pseudo-random source and avoid slower math functions to keep

     the mainloop (lines 3-8) running fast.

     We save hole column in our circular queue and advance the

     index.

  4. Keyboard reading, player move + Sound FX

     We read the keyboard and move the player column if 'A' or 'D'

     pressed.

     We keep resetting the scroll count to avoid the scroll to

     stop. We also pull the speaker to make a sound fx while moving.

  5. Level row display + Sound FX

     We print a full ground at last line which makes the full screen

     to scroll up, then print the hole. We also keep the speaker

     pushed here so the pull when moving makes the sound fx.

  6. Player display

     Just prints the player at current position

  7. Row advance and end level check

     We increment current depth (A) then check if we achieved level

     total depth (W) and increase level an recalculate level depth

     if achieved, then set success message and status and go to show

     indicators (line 9).

  8. Collision detection

     We check collision by looking at first row hole position from

     the circular queue. If there is no collision, loop over to

     line 3.

  9. Indicators display + End game check

     Indicators are set to fail on level setup (line 2) so if we

     fall here from previous line because a collision was detected,

     fail message and indicators are displayed.

     If we jumped here from level success (line 7) success message

     and indicators were set so displayed here.

     If we have jumped to level 5 we have succeded level 4 and won

     the game so we setup game end message and "music" (setting beep

     note time larger) and we jump recursive to same line to show

     end game message and indicators. NOTE: we also changed level to

     avoid infinite loop on end game check.

  10. Arpeggio/Music

      ⁃ Does 3 musics:

        • Short down pitch arpeggio to indicate fail

        • Longer up pitch arpeggio to indicate success

        • Melody to indicate end game

      Tricky GO TO: While playing T is 0.01 so the GO TO line evals

      to 2 which starts current level. On end game it evals to 11 so

      the game exits (last line is 10). We can restart the game

      instead of exit if we change the 9 for a -1.

3 License

═════════

  "ROM-Run for OKTOGONIA" game code © victor@oktogonia.com. Released

  under CC BY-NC-ND 4.0.

  ([Creative Commons — Attribution-NonCommercial-NoDerivatives 4.0

  International — CC BY-NC-ND 4.0])

  oktogonia.com web and OKTOGONIA games assets are ©

  victor@oktogonia.com. All rights reserved.

[Creative Commons — Attribution-NonCommercial-NoDerivatives 4.0

International — CC BY-NC-ND 4.0]

<https: creativecommons.org="" licenses="" by-nc-nd="" 4.0="" legalcode=""></https:>

Download

Download
rrfo.tap 926 bytes
Download
rrfo.txt 7 kB
Download
rrfo.pdf 465 kB

Install instructions

1 Load instructions

═══════════════════

1.1 DISCLAIMER

──────────────

  This game has to be run on an original Sinclair 48k BASIC ROM (MD5

  4c42a2f075212361c3117015b107ff68).  This is due to the fact we RUN

  over the ROM (hence the name) as a source for deterministic "fake"

  pseudo-random sequence used to generate the game levels (been the

  starting address the "seed"). This technique, the functions

  selected to generate the level, the System Variables setting, the

  screen limits detection omission and even the DATA list order are

  carefully tweaked to keep the game responsive and the full-screen

  scroll running fast (as per interpreted BASIC standards) in order

  to give an Arcade-like experience. On the other hand, we change

  the ship color and feature ship movement sound FX because the

  benefits outperform the slight penalty in those cases.

1.2 Loading for ZX Spectrum 16k

───────────────────────────────

  To run the rrfo TAP file with "[Fuse - the Free Unix Spectrum

  Emulator]":

  ┌────

  │ fuse --machine 16 --auto-load rrfo.tap

  └────

  (tested with Fuse version 1.5.7)

[Fuse - the Free Unix Spectrum Emulator]

1.3 Loading for ZX Spectrum 48k

───────────────────────────────

  To run the rrfo TAP file with "[Fuse - the Free Unix Spectrum

  Emulator]":

  ┌────

  │ fuse --machine 48 --auto-load rrfo.tap

  └────

  (tested with Fuse version 1.5.7)

[Fuse - the Free Unix Spectrum Emulator]

1.4 Controls

────────────

  ‣ 'A': Left

  ‣ 'D': Right

Leave a comment

Log in with itch.io to leave a comment.