Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Plugins/Viewers
| | |-+  Rockbox games
« previous next »
  • Print
Pages: 1 [2]

Author Topic: Rockbox games  (Read 18727 times)

Offline cool_walking_

  • Rockbox Expert
  • Member
  • *
  • Posts: 695
Re: Rockbox games
« Reply #15 on: February 28, 2008, 08:53:33 PM »
1) random_int = (rb->rand() % 5) + 1;

5 is the range. 1 is the lowest possible number. % means modulus (remainder of integer division e.g. 15 % 4 = 3). rb->rand() returns a random number from 0 to some defined really big number.

2) There is a "goto" statement, however it's use is mostly frowned upon because it can lead to "spaghetti code".  It's generally better to use functions.

3) Use "return PLUGIN_OK;" in the plugin_start block.
« Last Edit: February 28, 2008, 09:12:38 PM by cool_walking_ »
Logged

Offline Strife89

  • Member
  • *
  • Posts: 354
  • Michael Carr
    • Strife89's blog
Re: Rockbox games
« Reply #16 on: February 28, 2008, 09:28:23 PM »
Quote from: cool_walking_ on February 28, 2008, 08:53:33 PM
2) There is a "goto" statement, however it's use is mostly frowned upon because it can lead to "spaghetti code".  It's generally better to use functions.

Thank you for the reply. :) Little problem with answer #2 - I'm still a complete novice and have no idea how to implement functions yet. I'll try to learn how to use it; but until then, can you give me the exact syntax for the goto command? (I'd mostly like to use it to test functionality when the "first draft" is completed.)
Logged
Rockbox: Sansa Clip Zip, iPod Color, iRiver H320

Android: Moto X4, Galaxy Tab S2 T710

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Rockbox games
« Reply #17 on: February 28, 2008, 09:31:46 PM »
This forum is hardly the place to learn C. Why not find a good online tutorial on C?
Logged

Offline Strife89

  • Member
  • *
  • Posts: 354
  • Michael Carr
    • Strife89's blog
Re: Rockbox games
« Reply #18 on: February 29, 2008, 08:32:29 AM »
I have. And I'm trying to code as I go, but I skimmed through the whole thing and couldn't find the command I want. As mentioned in the linked post, there are oodles of tutorials out there, and it'll simply take WAY too much time to seek out what I need. (I'm a high school senior at the moment, and my main concern right now are the three research projects I have due this month.) I do what I can in my spare time, but it's so limited lately....

Besides, it's not like I'm asking for a lot of help, just a few tips here and there....  :)
Logged
Rockbox: Sansa Clip Zip, iPod Color, iRiver H320

Android: Moto X4, Galaxy Tab S2 T710

Offline cool_walking_

  • Rockbox Expert
  • Member
  • *
  • Posts: 695
Re: Rockbox games
« Reply #19 on: February 29, 2008, 09:04:21 AM »
I didn't mean "there's so many tutorials out there it's hard to wade through the crap ones", more like "there's so much (good) information out there, google will answer any question you could possibly have".

http://en.wikibooks.org/wiki/C_Programming/Control#One_last_thing:_goto

If for whatever reason google doesn't help you, you could join a programming forum.  Although I appreciate it might be hard to tell if something is C related or Rockbox related, so maybe they'll let you ask in the #rockbox or #rockbox-community IRC channels.  If you're extremely desperate you could PM me, though I'm probably the worst "programmer" I've ever seen in my life.
Logged

Offline Strife89

  • Member
  • *
  • Posts: 354
  • Michael Carr
    • Strife89's blog
Re: Rockbox games
« Reply #20 on: February 29, 2008, 09:20:19 AM »
I'll remember that. Thanks for the help! :)
Logged
Rockbox: Sansa Clip Zip, iPod Color, iRiver H320

Android: Moto X4, Galaxy Tab S2 T710

Offline cool_walking_

  • Rockbox Expert
  • Member
  • *
  • Posts: 695
Re: Rockbox games
« Reply #21 on: February 29, 2008, 09:30:27 AM »
Damnit, I was going to edit.  :-\

You might want to read some of the stuff under "Getting Started & Compiling" and "About the Code" linked from here.  You probably won't understand all of it now, but some of it might be helpful.
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Rockbox games
« Reply #22 on: February 29, 2008, 12:08:15 PM »
You have to understand, we want the "search" feature in this forum to bring up relevant results. So if someone searches for something Rockbox-specific, we generally don't want it to turn up standard C help that's available everywhere. As you said, there's a million places on the internet to find information on C. No sense wasting time here when you can get it faster there, and not dilute search results.

We're glad to provide help where applicable, but both the random thing and the goto thing would've honestly taken you less time elsewhere, if you'd just searched a tutorial.
« Last Edit: February 29, 2008, 12:11:54 PM by Llorean »
Logged

Offline tyrone101

  • Member
  • *
  • Posts: 16
Re: Rockbox games
« Reply #23 on: February 29, 2008, 03:10:28 PM »
i accidently removed my bubbles plugin,is there any where i can get it back?
Logged

Offline LambdaCalculus

  • Member
  • *
  • Posts: 2257
  • Dreaming of Turing Machines...
    • The Nostalgia Roadtrip
Re: Rockbox games
« Reply #24 on: February 29, 2008, 03:19:30 PM »
Download Rockbox again and unzip it to the root of your device. You'll get Bubbles back.
Logged
Former Rockbox dev. Rising from the ashes...

Players: iPod Video /w 128GB SSD mod, H320 /w 128GB SSD mod

Offline tyrone101

  • Member
  • *
  • Posts: 16
Re: Rockbox games
« Reply #25 on: February 29, 2008, 03:23:59 PM »
This may be a dumb idea but its just a thought.since i have seen alot of people wanting games but its just to complicated for them to write them there self (including me)why not make a converter that can get flash games (or some other kind of game you can find on the internet) and convert it into the rockbox format.

is this possible? ???
Logged

Offline LambdaCalculus

  • Member
  • *
  • Posts: 2257
  • Dreaming of Turing Machines...
    • The Nostalgia Roadtrip
Re: Rockbox games
« Reply #26 on: February 29, 2008, 03:35:02 PM »
That would still require a rewrite of the game in question. And also, Rockbox is NOT a game-oriented project; it is an audio playback-oriented project.

If you want a game so badly, either learn how to program, or just buy a PSP or Nintendo DS. End of discussion.
Logged
Former Rockbox dev. Rising from the ashes...

Players: iPod Video /w 128GB SSD mod, H320 /w 128GB SSD mod

Offline AlexP

  • Global Moderator
  • Member
  • *
  • Posts: 3688
  • ex-BigBambi
Re: Rockbox games
« Reply #27 on: February 29, 2008, 03:43:04 PM »
You may as well just rewrite the game.  Without even mentioning how to write something to convert flash to C for rockbox, the requirements for a game that runs on a 2 GHZ PC with 2 GB of RAM (I know flash games aren't quite that bad) and a DAP with a ~100 MHz processor and 32 MB of RAM isn't funny (plus the control differences, no malloc etc).
« Last Edit: February 29, 2008, 03:45:45 PM by BigBambi »
Logged
H140, F60, S120, e260, c240, Clip, Fuze v2, Connect, MP170, Meizu M3, Nano 1G, Android

  • Print
Pages: 1 [2]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Plugins/Viewers
| | |-+  Rockbox games
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.104 seconds with 14 queries.