DSiWare Forum

Topic: Petit Computer

Showing 2,421 to 2,440 of 9,437

AuthorMessage
Avatar

Discostew

2,421. Posted:

SwerdMurd wrote:

Discostew wrote:

It was only the noise which I had to deal with, to which I had to make an estimate with the 2nd mode, and simply use the "white noise" that was part of hte audio hardware.

Gooootcha. Haven't used Petit - and haven't written true MML in....man, like 15 years? I used to use it in the QBasic days...

So I take it there's no way to simulate the PCM "drum" channel from NES, or the VR7 expansion famicom stuff? No drums, no love, imo. :)

Pretty much. It's rather limiting unless you're an expert at using such stuff along with ADSR. I know I'm not. I got what I needed, and left the rest alone. Other than the supplied PSGs and noise, you've got the slew of Midi-like instruments at your disposal, which are good, but you're locked into using them.

MM2PTC continues to be developed, and I began testing just how many 8x8 "compressed" graphic cells into a single GRP, and right now with almost the entire sprite collection for the game, I'm at 3152 blocks, taking up just under 40KB, about 10KB under the max size of a GRP (and roughly 31 QR codes). If the graphic cells were decompressed, they'd take up roughly 101KB, so I think I'm doing pretty well so far. Maybe at some point, I'll figure out how to reduce it even further, but for now, it looks like it'll be good enough to store all my data (not code) into the 4 available GRPs.

"What fun is there in making sense?"
Lazer Light Studios - Home of the MM2 PTC project

Pokemon 3DS Friend Safari - Ice - Spheal, Sneasel, Lapras

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

AuthorMessage
Avatar

Sgt_Cola

2,422. Posted:

bluerobin2 wrote:

Petithead wrote:

EDIT: & some more. This would be my reaction If it wouldn't work. http://www.youtube.com/watch?v=oZRKozAzZmY

HAHA Good One!

seriously, did you see how depressed he was? It was FUNNY depression

Sgt_Cola

AuthorMessage
Avatar

Sgt_Cola

2,423. Posted:

Also, does anybody know how to move fonts around? E.G have a face font move around an area. I have heard of the X=1 & Y=2 statements. Variables?

Sgt_Cola

AuthorMessage
Avatar

boot

2,424. Posted:

I made a big radio app out of the three SONGS! the Mario theme zelda theme and poke.on theme plus an extra!how do I post qrs?

Just your average talking boot. The Boot that can program.

AuthorMessage
Avatar

randomous

2,425. Posted:

@Anonymous_Ninja Wow, that song is very hard! Kirby songs are all pretty ridiculous, so I don't know if I'm proficient enough to do that one yet. I'm sorry!

@bluerobin2 I can try to make something. I'm not sure how it will turn out, so I apologize in advance if it's not all that great.

randomous

AuthorMessage
Avatar

randomous

2,426. Posted:

The game is only supposed to be played for 60 seconds, right? I hope that this extremely generic 35 second looping song is fine then:

Untitled

I know it's very repetitive, but I'm no composer; I'm more of a "transferer". I hope it's alright. If you decide to use it, just append it to your code. You'll probably want to remove the "BGMPLAY" line and put it where the song is supposed to play though, and BGMCLEAR/BGMSETD needs to be called just once at the top of the program. The data portion can go at the bottom of the program if you want. I won't be upset if you decide not to use it by the way.

randomous

AuthorMessage
Avatar

ramstrong

2,427. Posted:

randomouscrap98 wrote:

The game is only supposed to be played for 60 seconds, right? I hope that this extremely generic 35 second looping song is fine then:

It's in. The song is fine. I'd prefer generic type for this game, anyway. Thanks randomous! The only problem I have is that the volume is too low. The beeping from movement is much louder than the song. I pumped up the song to 127, but apparently, that's the default level. Any advice?

I'm not interested in putting that C-word in credits. I don't suppose you have a family-friendly name I can put you under, do you?

Edited on by ramstrong

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

AuthorMessage
Avatar

randomous

2,428. Posted:

@Ramstrong Oh, sorry about that! Uhhh... you can use limitlessinfinity, which is my other online name. Otherwise, you can just say CJ.

As for the song's quietness/beep's loudness, that's easily fixed by lowering the volume of the beep instead of raising the volume of the music (which you can also do if you like). For instance, let's say you're using beep 15. The resulting command for half volume is:

BEEP 15, 0, 64

Where 64 is the volume, and 0 is the pitch difference. 0 pitch will just play the beep normally, whereas something like 512 in that slot will raise it a couple of steps. Hope that helps!

randomous

AuthorMessage
Avatar

ramstrong

2,429. Posted:

Done. I'm saving and packaging everything. Will upload shortly. Thanks.

EDIT:
Uploaded. Link in QR thread. Including CORAL.ZIP. Please check it out and let me know if I made any mistake. I was in a rush in getting this done, I may have overlooked something. Hopefully not, but please check. Thanks.

Edited on by ramstrong

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

AuthorMessage
Avatar

randomous

2,430. Posted:

You're welcome! I'm glad you liked it enough to put it in the game!

Edited on by randomous

randomous

AuthorMessage
Avatar

MrSirr

2,431. Posted:

SYNTAX ERROR HELP

http://img585.imageshack.us/img585/6375/qr0.png

where did I go wrong?

MrSirr

AuthorMessage
Avatar

randomous

2,432. Posted:

@MrSirr You've got something like this around line 51:

IF (SOMETHING) THEN IF (SOMETHING2) AND IF (SOMETHING3) AND IF (SOMETHING4) GOTO @SOMEPLACE

The problem is that you don't need the "IF" after "ANDs", so what you really want is:

IF (SOMETHING) THEN IF (SOMETHING2) AND (SOMETHING3) AND (SOMETHING4) GOTO @SOMEPLACE

Plus, if you have an if statement within the THEN of another if statement, you can almost always pull it out and mush the whole thing together using an AND:

IF (SOMETHING) AND (SOMETHING2) AND (SOMETHING3) AND (SOMETHING4) GOTO @SOMEPLACE

@boot Are those my songs? I'm glad you're using them! If you already have the qr code as a picture, you can post images using any image hosting service. My personal favorite is Dropbox (http://db.tt/RomXvvo), since you can store any type of file on there and then link to it (for instance, zip files or whatnot). If you choose to go with Dropbox, go to the website and go to the "Public" folder, make a new folder in there for you QR codes if you don't want to have to rename them all the time, and then drag and drop the file into the webpage. Once it appears, you select the file, go to the top and click "Copy Public Link". It'll give you this big long address, just put that within [img] tags and you're all set!
Other people use imgur (I've never used it so I can't help you there), and there are plenty of other options available. For instance, another free image hosting service is provided by Google called Picasa Web Albums, which is here: https://picasaweb.google.com/home. The neat thing about Picasa is that you can use your existing Google account (such as gmail/youtube/whatever) and you don't have to do anything extra.

Edited on by randomous

randomous

AuthorMessage
Avatar

Discostew

2,433. Posted:

@randomouscrap98

An interesting thing I encountered with those IFs and ANDs. Take these two lines....

IF (SOMETHING1) AND (SOMETHING2) THEN
IF (SOMETHING1) THEN IF (SOMETHING2) THEN

The only time where the first line is faster than the second line is if both SOMETHING1 and SOMETHING2 are true. In all other cases, the second line, while equivalent to the first outside of using ELSE, is usually faster. This is because in the first line, even if SOMETHING1 is false, SOMETHING2 is still parsed and examined, whereas in the second line, if SOMETHING1 is false, then it stops and moves on. Even if SOMETHING1 is true in the second line, it doesn't have to compare that condition with SOMETHING2. Though, I find it odd that if SOMETHING1 is true and SOMETHING2 is false in line 2, it is faster than line 1, yet when SOMETHING2 is true in line 2, it is slower than the first line.

"What fun is there in making sense?"
Lazer Light Studios - Home of the MM2 PTC project

Pokemon 3DS Friend Safari - Ice - Spheal, Sneasel, Lapras

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

AuthorMessage
Avatar

randomous

2,434. Posted:

@Discostew Ahhh, I was under the impression that Petit Computer did short-circuit evaluation (that's what that phenomenon you described is called, but you probably already knew that). It says in the manual that the operators are more like C operators than BASIC, so I assumed that it included the evaluation methods of C operators as well. I guess they retained the old ways for AND and OR. That's good to know, thanks! How did you figure this out? Did you have a really tight loop that executed a bazillion times?

randomous

AuthorMessage
Avatar

Discostew

2,435. Posted:

@randomouscrap98 - Petit Computer (or BASIC in general) running code under interpretation is unable to make such short-circuit evaluations because it has no idea if latter evaluations would affect it. Languages that compile code to machine code examine these scenarios, and rearrange the logic so that it'll take the evaluations that would render the entire condition false first, at least I think that's how they do it. It was about a week ago when I stumbled across it. I wasn't even looking for it, but found it nonetheless, so then I did FOR/NEXT loops utilizing the frame counter (MAINCNTL), and started with 40k iterations to see how many frames it took to process one and then the other, and that's how I got the conclusion of what was faster.

So, with that, if you have an IF statement that strings a bunch of AND comparisons and you consider one of them to be false more often than true, you could test that one by itself and then follow the rest with their own IF statement.

"What fun is there in making sense?"
Lazer Light Studios - Home of the MM2 PTC project

Pokemon 3DS Friend Safari - Ice - Spheal, Sneasel, Lapras

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

AuthorMessage
Avatar

Hairmanban19

2,436. Posted:

randomouscrap98 wrote:

Alright, I need to study for my finals instead of making these haha. But it's so much fun! Here's the original Legend of Zelda Overworld song (the one everybody knows):

Untitled

This one, although a more simple song than the Super Mario Bros 2 theme, was trickier than the rest because it seems like all the sheet music was made for a more grandiose version. Either it was someone's interpretation of the song or things were added/changed to sound more like a certain game. Oh well, in the end, I used this mostly: http://www.youtube.com/watch?v=lpEzYEoV9qY

Original song composed by Koji Kondo.

You did an awesome job on this! It sounds exactly the same as the original overworld music!

...

3DS Friend Code: 3136-7615-5907

AuthorMessage
Avatar

Sgt_Cola

2,437. Posted:

randomouscrap98 wrote:

Alright, I need to study for my finals instead of making these haha. But it's so much fun! Here's the original Legend of Zelda Overworld song (the one everybody knows):

Untitled

This one, although a more simple song than the Super Mario Bros 2 theme, was trickier than the rest because it seems like all the sheet music was made for a more grandiose version. Either it was someone's interpretation of the song or things were added/changed to sound more like a certain game. Oh well, in the end, I used this mostly: http://www.youtube.com/watch?v=lpEzYEoV9qY

Original song composed by Koji Kondo.

Random mouse, Do you think you can make the king DeDeDe theme? It would be great if you could... Or at least anybody who is good with MML & can translate sheet music... :)

Sgt_Cola

AuthorMessage
Avatar

Sgt_Cola

2,438. Posted:

actually, I won't join the contest. I'm not so good with BASIC. I need to practice...

Sgt_Cola

AuthorMessage
Avatar

Sgt_Cola

2,439. Posted:

Anonymous_Ninja wrote:

hey randomnouscrap if i can make a request, could you make the wispy woods battle music from the original kirby? my game is almost done and that is the last major thing i need. if not ill try, but mml is the only command that confuses me to no end. if i took the time i could learn it but im too lazy to do that anytime soon.

Why not king DeDeDe's theme? that was awesome! (expecially the masked DeDeDe one... :)

Edited on by Sgt_Cola

Sgt_Cola

AuthorMessage
Avatar

randomous

2,440. Posted:

@hairmanban19 Thanks again! No love for the Pokemon Bike theme? Nah, I'm just kidding.

@Petithead Kirby songs are really hard, so I don't know if I can make those yet.

@Discostew I think that in terms of Petit Computer, the reason they did not include this optimization was to keep the basic execution closer to the original language specification. Notice that BASIC is one of the few popular languages missing from this list, but other interpreted languages such as Perl include this feature: http://en.wikipedia.org/wiki/Short-circuit_evaluation . Most modern programming languages include this feature, and if it is a part of the language, it is always evaluated as such.

Either way, it's still great that you discovered this interesting exclusion. Now I can start using the faster method!

Edited on by randomous

randomous