[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

2017/01/28: An issue regarding the front page of /jp/ has been fixed. Also, thanks to all who contacted us about sponsorship.

/vr/ - Retro Games

View post   

[ Toggle deleted replies ]
File: 14 KB, 601x571, graviton_part2.png [View same] [iqdb] [saucenao] [google] [report]
2581523 No.2581523 [Reply] [Original] [archived.moe]

This thread documents the creation of a small SNES game. Anons are encouraged to contribute in any way they can. Code is updated regularly both the source and a ROM can downloaded at github.com/gewballs/graviton.

Since the first thread died, let's recap what's been going on...

The game being written "Graviton" is a simple one-screen 2d fighter where the players try to push each other into traps to score points. Gravity can invert during game play, influencing both players and objects alike. Players can step on spikes or get crushed by falling crates.

Of course mechanics are subject to change in the name of fun, but I want to get this basic game play implemented before tweaking it. Ideas are welcome, although try to keep them simple.

So far much of the code for engine framework (reset, main loop, pause), utility (nmi, dma, joy, etc), math (rng, etc), graphics (draw sprite, clear oam, etc), player (idle, walk, jump, punch, uppercut, fall, crush, and respawn states), object (crate), particle (gibs), object-object collision, level-object collision, gravity, and animation has been written. This is a learning process for me, so I am going to have to reprogram a few things, but their behavior won't change much. Also some very nice player graphics were supplied by a certain graphicsfag, who did a real good job on vrtan.

The things remaining are to recode object-object collisions to account for pushing/crushing, add hurtboxes when attacking, make a player stun state and throw them a hurtbox intersects their hitbox, and then vectorize the player code to work with 2+ players. Maybe add a title or splash screen too.

I estimated this project would take 2 weeks. It's now been 2 months. Then again this project's scope has grown and I've had a busy summer. My goal is to finish by the end of August.

Sit back and enjoy (or contribute if ya can)!

>> No.2581525


Also big announcement: I am planning to do sound now. I have a 16-bit Pulse Width Modulated (PWM) to SNES Bit Rate Reduced (BRR) audio codec, and am designing a very simple BackGround Music (BGM) and Sound Effect (SFX) driver for the SPC-700 and A-DSP (The thing that makes the beeps and boops). I will release specs when I'm ready. In the mean time if any audiofags want to contribute by arranging some music in a sequencer, I'm sure we can translate it later. Keep PWM sound samples relatively short; memory is limited!!

>> No.2581702

Link to last thread >>2447092

>> No.2581706

Do you mind writing what the abbreviations are?
nmi dma joy for example

>> No.2581709

I dabble a little bit in jingles. I'l see if I can come up with anyting.

>> No.2581714

I always wanted to make a really ambitious SNES style metroidvania with RPG elements and fighting game combos

>> No.2581727

Since there's a fresh thread, I feel like I should point out that since you're doing an arena fighter on a Nintendo platform, you might consider adding more memetastic characters even if they all are functionally identical. Maybe as unlockables.

I do some low-res art and I was looking at the Tre/vr/ sprite sheets I feel like I could do some other characters.

>> No.2581778
File: 43 KB, 489x596, TCC-Tan.jpg [View same] [iqdb] [saucenao] [google] [report]

Maybe the some of the other boards' mascots? TCC-Tan for example?

>> No.2581832

The team who made pier solar is doing that, it's a Roleplaying Beat em Up, although it's only for genesis

>> No.2581835


>> No.2581846
File: 28 KB, 771x786, 6AYwYVkh.png [View same] [iqdb] [saucenao] [google] [report]

Non-Maskable Interrupt. It's an interrupt that the processor can't ignore. On the SNES it is tied to a safe time to update the video registers without glitching: the Vertical Blank (V-Blank) interval.

V-Blank occurs when a CRT's electron gun scans to the bottom of the screen and needs to turn off while it resets back to the top. This takes a relatively long amount of time, and during this time the TV is not drawing anything. Thus the Picture Processing Units (PPUs, read GPU) can be accessed without glitching the screen, and Video RAM (VRAM) can be read and written to by the CPU since the PPUs aren't accessing it to draw.

Direct Memory Access. A fast way to move lots of data using special hardware rather than the CPU.

While a large part of what CPU does is move data, they aren't fast because of instruction fetches and loop overhead. Most computers have special hardware that the CPU can use to move large data blocks fast. Graphics and levels are good targets for DMA, individual variables not so.

Joystick, aka controller.

Random Number Generator. More precisely a Pseudo-RNG (PRNG). A function that generates random numbers.

I coded a 'linear congruential' RNG. You give it a seed, and every time you call the RNG it multiplies the seed by a number and adds another number. I also exchange the top and bottom bytes of a 2-byte word to mix up the lower bits more.

Object Attribute Memory. The special memory region in the SNES that defines how to draw objects, one of two graphics primitives available (the other being backgrounds). OAM is how you tell the SNES to draw all 128 sprites every frame. An OAM entry is defined per bit as:


S=Size (1 bit, small or large)
X=X position (9-bits, 0-511)
Y=Y position (8-bits, 0-255)
N=Name (9-bits, 512 character graphics)
C=Palette (3-bits, 8 palettes)
P=Background priority (2 bits, 4-priorites)
H=Horizontal flip (1 bit)
V=Vertical flip (1 bit)

>> No.2581852

Yeah shit like that. I assume there's not going to be a save game feature so they could be accessible via ridiculous cheat codes like "at the start screen press up up down down left right left right left right left right left right left right left right left right up for /x/-tan

>> No.2581869

>Inb4 SSB Snes featuring: Sexy 4chan Mascots

>> No.2581906

is your GitHub name pronounced, "jewballs"?

>> No.2581924

I want going to actually come right out and say it...

>> No.2581961

if I wasn't so stupid I would love to create a SSB-like game for the SNES that would, instead of fighting, have the board-tans trying to perform sexual attack on each other.

but anyhow...

god damn dude you're so based, but I have one question: where's the ROM located in the source? I cannot find at the link

>> No.2582006

The way OP's game is coming along it almost seems possible.

>> No.2582301
File: 143 KB, 527x818, 1411535629054.png [View same] [iqdb] [saucenao] [google] [report]

dood, lewd.

But for serious, would a smash bros styled game even work on the SNES?

I only know of one other game that's KIND OF similar and it supposedly inspired smash bros and that's the outfoxies.

But I'm not sure if SNES hardware can handle the scaling.

>> No.2582326

It depends on your definition of "smash bros styled" but no, it can't scale like that. I was just talking about a simple alteration to OPs game that would allow players to choose their characters before they push each other around and get turned upside down.

>> No.2582331

Other than a few visual effects why exactly wouldn't it work? Yeah, it obviously wouldn't be 3D, but all SSB is is a fighting game with Nintendo characters.

>> No.2582347
File: 34 KB, 425x349, 1419667529823.jpg [View same] [iqdb] [saucenao] [google] [report]

Oh. I don't think /vr/ tan has too many sprites associated with hi. His sheet is like 128x40. About 4KB.

Biggest SNES game ever was donkey kong country, right? That was like, what, 32 Megs? Wait, how big was street fighter alpha?

Just the grandeur of it all. Smash bros' screen zooms out and stuff. To not have that would be limiting if you really wanna make it like smash bros. or outfoxies. But we could probably work around that.

>> No.2582379

>Zooms out and stuff
Someone in the previous thread mentioned using Mode 7 to acheive a similar effect.

>> No.2582396

Thank you.
>CRT's electron gun
If I read that somewhere else I'd be 100% it was a troll.
Your RNG sounds simple enough, I thought it would use more complex operations, sometimes it's right in front of me and I over complicate it.

>> No.2582442

Would it?

I'm pretty skeptical.

>> No.2582463

I don't think it would be impossible. Super Mario World has zoom effects if I'm not mistaken, and Super Mario RPG has the minecart track that's pretty impressive.

>> No.2582481
File: 473 KB, 800x800, 1438151263482.png [View same] [iqdb] [saucenao] [google] [report]

Oh yeah, the controls:

Player Mode:
A = Not mapped
B = Jump
X = Explode
Y = Punch
Start = Pause
Select = Level Editor Mode (See below)
L= Hit box visualization
R = CPU usage visualization. Darkens screen when done with frame.
Left,Right = Move player left, right. Double tap direction to run.
Up,Down = Tune gravity
L+R+Start+Select= Reset

Editor Mode:
A = Place block
B = Cycle backwards through blocks (512 total, but only a few usable)
X = Cycle flips (4 total; none, Horizontal, Vertical, Horizontal and Vertical)
Y = Cycle forward through blocks (512 total, but only a few usable)
Start = Pause
Select = Player Mode (See above)
L = Cycle priorities (2 total; low and high)
R = Cycle palettes (8 total, though only the default one useful)
D-Pad = Move cursor

Only use blocks 0x20=Stone, 0x21=Spike, 0x22-0x25 Grass, 0x26-0x27 Moss, and 0x28 Air. You can see what block you're on displayed in player 2's score.

Lol, nope, that's how old TVs work.

You COULD make a Smash styled game for SNES. As someone has already pointed out, a zoomable background could be implemented in Mode 7. The trouble comes with scalable sprites. You could implement them in software, but they would have to be kept small (think Star Ocean), or you would have to use a coprocessor like the SuperFX (think Yoshi's Island), or you could use some mip-mapping wizardry to approximate scaling (worst results).

If you guys want to add more characters, just design the sprites and animations. Vrtan's sprite definition in sprite.asm is a few thousand lines long, but it's straight forward. I don't want to go through the busy work of entering in data again until I get the full game running. I can tell you the data and format I need things in to expedite integration.

Use YY-CHR or anything that can save to 4-plane SNES character format (ie. evidently photoshop will).

>> No.2582489
File: 4 KB, 37x67, dude lmao.png [View same] [iqdb] [saucenao] [google] [report]


>> No.2582490

seems legit but I'm not seeing the metroidvania part of it

>> No.2582509

I wanna contribute some so I better look through the previous thread..

>> No.2582608

Awesome level editing.

>> No.2582614
File: 2.36 MB, 758x716, jump_gravity_punch_uppercut_die.webm [View same] [iqdb] [saucenao] [google] [report]

webm of a little gameplay. Was in last thread, but thought some new to thread might like to see.

>> No.2582620

Nintendo basically copied the TMS 9918 design, which had the video RAM on a separate bus. You can only access the video control registers during the vblank and same for the VRAM, which is accessed indirectly through soft switches. There's roughly 80 clock cycles to do this.

>> No.2582630

I'd think the Genesis is a bit easier to work with as the hardware is simpler (due to being older tech than the SNES) and faster CPU.

>> No.2582640

I think on the SNES you can access video registers anytime, just not VRAM. That's essentially how I implemented the CPU usage visualization, by writing to the screen brightness register $2100 INIDISP at the end of the next frame's computation.

Something else that's neat. V-Blank isn't the only safe time update registers and VRAM. There is also the Horizontal Blank (H-Blank) interval every scan line when the electron gun turns off to reset to from one side of the screen to the other. H-Blank isn't nearly as long as V-Blank, but there is still time to access and change a few registers. Special Horizontal DMA (HDMA) hardware manages the timing for such finely timed writes. This is how I implemented the color gradient in the game, and how a whole slew of really clever effects are done (gradients, background squiggles, non-rectangular shaped window effects, pseudo perspective with mode 7, etc.).

Oh yeah, by the way you can uppercut by pressing punch (Y) then jump (A) before the punch animation is over. I'm thinking about implementing a flying kick if the buttons are pressed the other way around.

>> No.2582662

Now the funny thing is that Nintendo in the late 80s had no plans to replace the Famicom anytime soon, as they were selling every one they could make. However, the sudden arrival of the Mega Drive caused them to panic and finally realize that they needed a next generation console.

>> No.2583284

Sounds like it could bear fruit.

>> No.2583290

So is OP actually going to make carts for this game or will it be a download use your own cart thing?

>> No.2583292

He's a dev not a publisher

>> No.2583367


What do YOU think how CRTs get their screens to glow? The layer has get energy from somewhere, it won't glow on its own. This energy comes from very fast electrons. In the back of the tube is the cathode- which is in principle nothing more than a heating cord- that gets a voltage of several 1000 Volts so it starts glowing, this leads to electrons leaving the cathode metal which are then focused and accelerated be magnets and "shot" at the screen, creating a small bright dot where they hit it. The ray from this electron gun now via the magnets is directed in a very fast precise column movement from top to bottom of the screen, fast enough that all the glowing dots create a for us visible picture.
Amazing tech and surprising that it works so well with all those fine movements if you think about it...

>> No.2583370
File: 691 KB, 1500x1403, tmp_8780-index.php-1311946552.png [View same] [iqdb] [saucenao] [google] [report]

/x/-tan is my favorite.
She is one of the oldest and has the most art and personality. Plus tons of lewds which is always a plus. Fuck there is even good cosplay.

>> No.2583393

Thank you but I wasn't doubting OP, I was just saying that if it came from someone else I'd think it was a troll.
"CRT electron gun" sounds like something you'd hear in a TV show.
Thanks for the explanation though, it's pretty cool how it works.
What's that board about? I don't know if it's serious or if it's just people pretending.

>> No.2583439

Nobody knows.

>> No.2583525

It's 1/3 people pretending, 1/3 people being serious, 1/6 people just curious, and 1/6 people samefagging.

>> No.2583538

you from 420 guy?

>> No.2583582

About what?

>> No.2583647

Everything. Tuplas, Skinwalkers, Tarrot readings, ghost stories, whatever. You know there's some pretty intense samefagging going on when there's 16 responses and only 1 poster.

Depends on how you look at it. I found here first, but have been going to 420chan for years.

>> No.2583656

just wondering, i dont like the video games board on there, /vr/ is a snugger fit for me

>> No.2583663

Why would they samefag though?

>> No.2583702

Why does anyone here samefag?

Yeah, I usually stick to /psy/ and /weed/

>> No.2583751

>Why does anyone here samefag?
I don't know, I was asking because I don't visit the board so I have no idea what the reasons for it are there.

>> No.2583782

Oh. They do it for attention. They'll quote their own posts and say negative or positive things to get a response.

For example, someone posts an obviously fake picture then quotes back to themselves 5 times saying things like "10/10 would fuck" and things like that.

>> No.2583789

Wait, weren't you talking about /x/?

>> No.2583792

I was giving a general example, but if you really need to have it specifically worded for /x/, fine

For example, someone posts an obviously fake copypasta about skinwalkers then quotes back to themselves 5 times saying things like "Woah, that's bretty spoopy!" and things like that.

How old are you, by the way? This is all a pretty simple concept.

>> No.2583803

I'm not underage if that's what you're asking.
I know people samefag but I don't visit that board so I'm not sure what it's about and didn't see a reason why people would samefag there.
What is that?

>> No.2583854

Go there and ask them. Like, are you trying to troll me or something by asking all this stuff?

>> No.2583976

What makes you think I was trolling you? I wasn't.

>> No.2584000

He's a paranoid schizophrenic. I know. I've been watching him.

>> No.2584003

You're either trolling or this is your first day on 4chan.

>> No.2584023

Neither, no idea why you think that.

>> No.2584667

Suggesting weapons just for shits and nipples.

1. Sex pistol : Shoots tiny sailormen.

2. Obamanator: either heals you or temp transforms you into
Mitt romney.

3. GMOs: Does nothing, but "IT'S HAPPENING!" will flash across the screen everytime you use it.

4. Suomiswerd: Melee weapons that paralyses and transforms enemies into nokia phones while they're paralysed.

5. Nazi symbol: Temp invincibility,also turns your skin black.

6. Razor blade: Most powerful weapon, more damage than any gun. Because guns don't kill people.

>> No.2585812

Can you explain the GMOs and "it's happening"?

>> No.2585823
File: 59 KB, 320x224, BGP1_0000%255B1%255D.png [View same] [iqdb] [saucenao] [google] [report]

Do you need art? I just thought of something. You could have real life compressed backgrounds like Umihara Kawase.

>> No.2586526

>But for serious, would a smash bros styled game even work on the SNES?

>Just the grandeur of it all. Smash bros' screen zooms out and stuff. To not have that would be limiting if you really wanna make it like smash bros. or outfoxies. But we could probably work around that.

I was thinking more of super smash bross as 4 chars (or less but not 1) with 1 button attack and jump botton, puch them outside of the stage to win.
Nothing more, nothing less

>> No.2586832

you should google the debate on GMOs to find out why the "it's happening" meme applies to it (or maybe not depending on which side you see is the most credible)

I would explain it, but that would be off-topic and possibly start a pissing match

>1 button attack
or, and hear me out on this, make that a sexual attack like a guy pillaging a hole with his stinky twinky and a women either growing her own humongous hoho of her own to violate the orifices or use her tounge to lick her enemies' crevices.

why would the sprites have to be scaled? sorry if that's a retarded question

>> No.2587018

Okay, this whole "let's make a sex game" thing is played out, and how much you're shooting for it is a little creepy.... Dial it back, anon

>> No.2587034

I miss the old thread. Let's get back to talking about graviton.

>> No.2587037

That's exactly what we're talking about, dumb ass. Try to keep up.

>> No.2589006
File: 480 KB, 900x900, 82734023.jpg [View same] [iqdb] [saucenao] [google] [report]

you know who'd be a cool character to add?

>> No.2590749

OP here. I've been on the road again with no internet access, so no updates. However I've been pouring over my APU documentation and am ready to start coding a sound driver. This looks like it will take some effort due to limited tools and unique programming challenges (like quickly syncing two processors with no interrupt line) but should be a fun and interesting experience. I'll be posting updates soon.

Sorry, I don't think digitizing a photograph is impressive. I'd be fine with rotoscoping, but not straight up digital photography.

For you guys throwing around character ideas, if you want to have your idea in the game, all you have to do draw and arrange the sprites. I'll post the format for those interested, but will not do anymore of that work myself.

>> No.2590768

>it is a little creepy
for you but the world needs quality "retro" h-games. but I'll stop so the thread doesn't go more off-topic.

>> No.2590785

If you could just link me to the actual correctly formatted existing sprites for Tre/vr/ I'll just alter them into at least one other -tan. Maybe include other palettes I could use in a format I can load with photoshop?

I'm probably making it harder than it needs to be but I don't have enough time to redo stuff.

>> No.2590790

>le DAE so creepy!? ecks-dee so fannay and randum! lolz!

Just so you know, this isn't your local church's discussion board.

>> No.2590797

He's being a little too vocal an advocate, plus it seems like 4chan has gotten less offensive over the last year but I agree that a fully chan-esque game should have some questionable (but not outright offensive) content. It's a fine line but as a collaborative work I'm sure it will organically take on the perfect flavor in the hands of those who actually produce content.

>> No.2590818

Maybe his objective isn't too make a 4chan game, just a game.
Did you write the engine yourself or does the SNES come with it's own engine?

>> No.2590824

His objective is obviously to collaborate with /vr/ on creating an SNES game

>> No.2590828
File: 54 KB, 170x170, FFVI_Edgar_Roni_Figaro_Menu_iOS.png [View same] [iqdb] [saucenao] [google] [report]

The file you're looking for is "sprite.asm". In it contains definitions for sprites and their animations. If you find sprite data structure, the first byte is the number of objects to draw - 1 (weird, but why would you draw 0 objects?). The following lines define the object per the OAM entry in >>2581846. If you find animation data, the first word is the number of frames, and the following lines have a word that points to a sprite and a word that indicates how many TV frames until the next animation frame.

Sorry to be brief, but 4chan practically gives my phone a seizure, and it's really difficult to reply.

>> No.2590834

If you use clover it's easier, it's a 4chan app.
For iOS you need to jailbreak your phone though.

>> No.2590845

I'll try opening the sprite.asm file when I'm at my photoshop station. I'm sure I'll have more questions but I'll figure out what I can from trial and error.

>> No.2590874

Note that sprite.asm is a text file. The actual character graphics data is in obj.chr

>> No.2590947
File: 4 KB, 128x40, Trevr.png [View same] [iqdb] [saucenao] [google] [report]

Can I just use the same format as this png and avoid the animation coding since that work's done already?

>> No.2590962

More or less. The characters the new sprites refer to will have to still be updated (add a co start offset) but most of the data could remain thr same. Some of vrtan's characters are a little hard to tell what they are when broken down from the full sprite (for instance heads and bodies are easy to pick out, hand parts harder), but if you can figure them out much you can save yourself some work at the cost of flexibility.

>> No.2591000
File: 66 KB, 100x100, trevr animated.gif [View same] [iqdb] [saucenao] [google] [report]

Yeah I'm pretty good at visualizing stuff like that I think I can probably crank out quite a few but I'll just do one to start with. I assume this gif is using the same tiles as are present in the png

>> No.2591123

Lol, I'm all for a sexy game, just wasn't sure if anon was trying to be edgy, or horny or what.

>> No.2591240

Just add a few swastikas if it's meant to be edgy, I think it's stupid though.

>> No.2591652


>> No.2591662

I don't think an H-game would be out of the question but we're rather limited in the erotic art department.

Plus there's not too many notable female board-tans.

First that come to mind are /x/, /c/, /toy/, and /jp/. The rest are forgettable or have at least one penis associated with them.

>> No.2591721

With what you included plus Tcc that's 5 females. There's the queens of /b/ too, at least Crack-chan and Boxxy, so 7.

>> No.2592816

>no commits in almost 3 weeks

Is this project still alive?

>> No.2592826

OP here. Yeah, I've just been on the road and busy looking for a place to live. I finally have some free time to sit down and work on wrapping up this project. I am currently working on a simple BGM and SFX driver. It may take a couple of days to get anything working because I don't have a SPC-700 assembler.

>> No.2593665

Good luck!

>> No.2595374

Bump so it doesn't die.

>> No.2595557

Sage so it does die

>> No.2595737

Fuck you fag. I hope you die.

>> No.2595768

Fuck off, newfag. Sage doesn't even work supposedly.

>> No.2595780
File: 36 KB, 254x192, 1280555462285.jpg [View same] [iqdb] [saucenao] [google] [report]

>Sage doesn't even work supposedly.

It still works. Just put it in the options field instead of the email field.

>> No.2595783

Sage never worked as people used it to bumplimit theeads
. That's why saying sage'd became a bannable offense.

I think on every board it still prevents a post from bumping a thread, polite of you're correcting a post or adding something that's irrelevant

>> No.2595792


So on this board sage might as well do something.

I apologize for wasting 1/500th of the thread by saging I guess

>> No.2598081

OP bumping. Sorry no update yet, but should have BGM working tomorrow.

>> No.2599572

I've been writing a couple of tunes for this in Renoise, mostly sampling a Yamaha TG500 (from around 1993) and a Roland XV-5050 (from around 2003 but it has some retro sounding sounds)


>> No.2599853

I like where you're going with the first one. Second one sounds iffy.

>> No.2600064

Yeah with the second one I started out trying to write something Streets of Ragey and it went all disco

I tried arranging it so it's more of a rock thing now I think it sounds a bit better?


>> No.2600082

Maybe you should use a different instrument other than the one that kicks in at 00:10?

I'm not sure what the snes sound capabilities are but I know they're capable of more than the genesis.

>> No.2600691

Both me and my gf vote for the first one.

>> No.2600694

Just listened to the third one. I change my vote. A little metal retro video game sound. Badass.

>> No.2602353


>> No.2604249


>> No.2606059
File: 68 KB, 601x583, graviton_sound_i_swear.jpg [View same] [iqdb] [saucenao] [google] [report]

>Audio update

OP here. Huge amount of progress made on BGM. Take a look at Reset.Apu() in 'vector.asm' and the audio driver as of now in 'audio.asm'. Shit's assembled by hand, so my sluggish updates should be no surprise.

So the driver just loads up and plays a diddy you may recognize. I have not programed communication between the SNES side and APU side to choose songs, control tempo, etc.

The driver is composed of a small loop that
>1) syncs with the CPU (yet to be implemented)
>2) reads the timers
>3) processes BGM
>4) processes SFX (yet to be implemented)

The BGM program plays 8 'tracks'. Each track has a timer, and when the timer is greater or equal to a target, the timer is reset and a script is advanced. Scripts are composed of 8 (low level) commands currently:

>Pass 00 : End script execution and start to wait.
>Wait 01 ww : Set the amount of time 'ww' to wait, end script execution, and start to wait.
>Time 02 nn tt : Set timer 'nn' to count up to time 'tt'.
>Data 03 bb dd : Set A-DSP data.
>Jump 04 aaaa : Set next script address to 'aaaa'
>Loop 05 ll aaaa : Compare 'll' against loop counter, if less than loop to 'aaaa', otherwise not.
>Code 06 aaaa : Call script address to 'aaaa'.
>Back 07 : Return from call.

Holy shit this is sex to my ears. I want to get this in the game. I need from you mainly note values, pitches, and volumes. Also I need 16-bit PWM samples of the instruments you use. Keep in mind all sound data (program, music, sound effects, variables) have to fit in 64kBytes, so keep samples small. We have envelope features to take advantage of to give simple sounds more shape. The limit is you only have 8 voices to work with at any time.

I can help translate your music. Just post the score and samples for the love of god man.

>> No.2606072

I liked the original second more, it felt more desperate and synthy, good for a first real wallbump/casual filter stage, the rock one can just be a late remix for when things get rough but you're also ready to kick ass (this assuming the game features a 1P mode). As for your first song, it's so Crash Bandicoot it hurts (in a good way).

>> No.2606098
File: 81 KB, 300x363, Sailor_Moon_(1st_uniform).png [View same] [iqdb] [saucenao] [google] [report]

OP again. I like both, they kind of remind me of Fever and Chill from Dr. Mario. The first one just works. The second one I was meh at first, but have listened to it a few times now and it's grown on me. I think it's because it reminds me of something like cheesy Sailor Moon battle music (I have never once watched Sailor Moon, it's just what I imagine).

Anyway I think what I've programmed can implement either one. It may not look like much of a music player, but it allows you to poke at audio hardware at set intervals, at hey, what more do you need?

Oh yeah, when I say 8 voices at once, I mean at literally one time. A song may be composed of more than 8 instruments.

>> No.2606201

Can you give me a rundown of the sprite limitations you're working with: size, colors, tiling, what have you?

I make pixel art and code on-and-off, so I'm curious.

>> No.2606407

Honestly, the first one starts off as kind of a clusterfuck, but mellows out into it's own groove around :38 or so (though the random dog barks at the end feel out of place).

I totally get the Streets of Rage vibe from the second, though I'm about as much of a fan of Koshiro's works as one can be. If you really want to channel that, the top instrument (that comes in at :12) could stand to be changed. It's just way too pop-y and lighthearted for what you're trying to achieve.

>> No.2606715


This zip is the samples in pcm wav format and tracker file in .XM format for the first track (which you can open in OpenMPT or a similar)


Looking at Renoise, there's Lua scripting so you can make your own plugins - if you can annotate/dissect the stuff in audio.asm a bit to show what bit is doing what I think I could script something that would output the song data from Renoise straight into your format

>> No.2607278

I like /x/ for interesting spooky stuff like creepy areas exploration threads and surveilance camera threads(some cameras can be accessed by pasting an ip into your browser), I even once saw a man dying in some hospital camera. If you get past the shit you can find some cool stuff on that board, but its mostly shit

>> No.2608186

awesome. should have it transcribed in a day

>> No.2609654

You guys are badass

>> No.2609691
File: 41 KB, 625x472, even-now-there-is-hope-for-man.jpg [View same] [iqdb] [saucenao] [google] [report]


Somebody make it happen.

>> No.2612227
File: 1.55 MB, 300x306, 1438937169258.gif [View same] [iqdb] [saucenao] [google] [report]


>> No.2612282
File: 92 KB, 576x508, drum-kit-setupBETTER.jpg [View same] [iqdb] [saucenao] [google] [report]

It's taking longer than I thought to transcribe the music. I have a lot of it done, but am carefully going through it to make sure nothing is fucked up. I haven't encoded the sounds yet, but am working on it. I've implemented the drum tracks using stand in instruments of some sine and square waves for the time being. Pushed to the repo. Have a listen if you want to. Will post the full song soon.

>> No.2614695
File: 37 KB, 802x598, tracker.png [View same] [iqdb] [saucenao] [google] [report]

>BGM Update

I finished sequencing the BGM. Damn that was a chore. If there is one thing that I have begun to appreciate it's that most of the work in game design is in content creation, and you need tools to do that effectively.

Anyway, you can find the 'music' in the repo under bgm.asm. I still need to encode the samples, so the in game music uses stand in instruments for the time being. The result is recognizable as audiofag's great >>2599572 vocaroo demos, but sounds a little like carney music without the more realistic samples. Still very cool stuff!

I can add a few sound effects most likely, but nothing extreme. I'm wanting to get back to the main game program and wrap it up soonish.


>> No.2614706
File: 23 KB, 494x482, 1439673416778.jpg [View same] [iqdb] [saucenao] [google] [report]

btw guys, do you hear any pops or clicks in the audio? I don't know if my code needs some tweaks or my emulator sucks.

It wouldn't surprise me if I was causing popping by not keying off voices, causing discontinuities in the sound data when keying on a new instrument. Feedback would be appreciated (actually working on sound it wouldn't!).

>> No.2617330


>> No.2618097

I hear a little distortion on snes9x. Nothing big though and it's pretty awesome you decided to throw sound in there. Wish I knew more and was able to contribute but this has been the coolest thing on /vr/ for the past couple months.

>> No.2619337

I believe in you, OP.

>> No.2620596


SNES style aside, Gaucamelee might fit your bill.

>> No.2620629

>Sugui Hebereke on the SFC
>Four-player 2D fighting game; similar in nature to the Super Smash Bros. series and Sonic Battle

>> No.2623035


>> No.2624635
File: 294 KB, 1090x757, 1357804589518.png [View same] [iqdb] [saucenao] [google] [report]

OP here. Been extremely busy preparing for a new semester. I've yet to encode the samples and insert them, but will try to get that done tonight.

I've played on a few different emulators now and I'm definitely causing some popping when keying on certain notes. I think it's because the sound envelope experiences a discontinuity going from the previous sample to the next. I'll have to key off a few notes before keying on that channel again if the note doesn't have time for the envelope to naturally decay to a level that won't cause popping.

This is a game format that I've been serious interested in developing for a long time. I've been toying with the idea of this for a while. I want to make a game one day where you can disarm or use defeated enemy weapons for attacking and puzzle solving (think throwing a sword into a tall wall so you can use it as a step to get over it), or maybe grab enemies and use them to block or throw at other enemies. Thinking along these lines, I heard Mischief Makers was very difficult to fine tune the grabbing mechanics, but it would just be so damn cool to have a fast action Metroidvania where you used enemies and terrain to your advantage.

Never heard of it, I'll have to check it out.

>> No.2625289

So why SNES and not Genesis?

>> No.2625348

That's a really dumb question, especially at this point.

>> No.2625383

i haven't been on /vr/ in months,
what's so hard about answering a simple question anyway?

>> No.2625415
File: 57 KB, 600x1136, 1416852156229.gif [View same] [iqdb] [saucenao] [google] [report]

Do you have to deal with a real-mode segmented model on the SNES?

I've read some more modern books on Assembly and it seems like systems from around the SNES's time would have to deal with limitations like that.

Also, why did you make your assembly lines start with a semicolon. They look like comments.

Great job on this though, I really want to lean 6502 and make a 2600 game sometime.

>> No.2625421

Where did you learn to write an SNES game?

Is there an old book on the subject floating around somewhere?

>> No.2625449
File: 994 KB, 500x286, tumblr_mhi87i0tnS1rg0lgoo5_500.gif [View same] [iqdb] [saucenao] [google] [report]

Because that's what they decided on.

>> No.2625458

coding for the genesis can be an extremely risky endeavor for the amateur as blast processors are highly unstable and liable to go into meltdown

>> No.2625468

OP learned welding in the SNES, so he has to stick with that otherwise the bomb I planted in his brain will explode.

>> No.2628015
File: 153 KB, 900x749, sm_art_devmap.jpg [View same] [iqdb] [saucenao] [google] [report]

I think the SNES is technically a more interesting machine. The graphics are without question better, and while I've come to respect the Genesis's YM2612 as an iconic instrument that's bad ass in the right hands, I prefer the SNES's S-DSP ability to mimic a wider range of sounds, even if interpolation can make samples muddy. Also I am much more familiar with the SNES library and enjoy on hacking some of my favorite video games of yesteryear. Don't get me wrong though, I love the Genesis. I'm just not interested in developing for it.

There is no real mode like in the x86 in the 65816 architecture. However there is a concept called banks which has some similarities.

The 24-bit address space 65816 is fully backwards compatible with the 16-bit address space 6502. To reconcile the two designs, a bank strategy had to be employed to divide the address space up into 256 16-bit banks. The primary limitation of banks is that the Program Counter (PC, the register that keeps track of where in the program you are) wraps in a bank when executing code, thus limiting the maximum size of a program to 65536 bytes without using jumps or subroutine instructions that alter the top 8 bits of the PC. If a particular section of code exceeds this limit, you need to somewhere split up your code into two banks, and use 24-bit addressing modes to jump between the two where necessary.

This bank strategy isn't as limiting as you would think, as it's pretty easy to split programs up, and a single function will never be a full bank long if you code in any sane manner. Furthermore indexing addressing modes _aren't_ affected by bank wrapping effects. In C notation, $00FFFF[1] would access $010000, not wrap to $00FFFF. Of course your index registers are only 16-bits, so a single array can't be larger without splitting it up.


>> No.2628056
File: 93 KB, 1200x816, WDSI7.jpg [View same] [iqdb] [saucenao] [google] [report]

... (had to bank my comment between posts, kek)

It is hard to efficiently automate mapping code to banks however. A good 65816 programmer anticipates usage and utility when deciding whether a program needs to be known by a 24-bit or 16-bit address (which gets concatenated with the current PC's top 8 bits to form the full 24-bit address), as 24-bit and 16-bit program addressing isn't typically compatible with each other for reasons concerning pushing/pulling variable width PC data to/from the stack.

A well designed program takes advantage of the banking strategy to reduce program size and increase performance by carefully choosing between 16-bit and 24-bit addressing.

Hope this makes sense.

Taught myself SNES using the leaked (Engrish-y) dev manual

Also Anomie's docs on romhacking.net are invaluable (and written in proper English).

Taught myself 6502 assembly using an ancient document I found on the Internet. Later I picked up "Programming the 65816" by Eyes. I have a hardcopy, but in the last thread someone made me aware of an online copy, which makes it so much more accessible to everyone:

Also this.


Been trying to encode the samples guys, but still haven't completely figured out how to convert the .wav files to 16-bit PCM, which is required before encoding to BRR using my codec. I have the tools needed to do the conversion, but some parameters are off because the output is static atm.

*Minor technical correction: I've been mistakenly referring to Pulse-Code Modulation (PCM) as Pulse-Width Modulation (PWM).

Btw, are you around audio guy? Do you know at what rate your sound was sampled at? I'm guessing 11025Hz because that's what a few tools have reported, but am not 100% sure.

Updates tomorrow evening.

>> No.2628097
File: 57 KB, 513x533, bizarro_spock.jpg [View same] [iqdb] [saucenao] [google] [report]


Sounds a lot like what a DOS programmer would have had to do. I've only read about it, but they had the same 16-bit segment problem you have and used two registers (I forget exactly which ones) to address an exact location. The only difference was that both the segment number and the address offset were 16 bit.

>> No.2628221


You can interpret the 65816's 24-bit PC as being composed of a 16-bit PC and an 8-bit program bank register K. The documentation actually refers to the both PC and K, but I think the instruction set architecture (ISA) more tightly integrates this segmentation strategy than x86 real mode does, and thus I wouldn't call them equivalent for that and other reasons (like per bank privilege levels in x86. No such concept in 65x)

Also of note is an 8-bit data bank register B that allows you to use 16-bit addressing modes to access the full 24-bit address space. All you have to do is set B appropriately before using them.

>> No.2628386

Audiofag here, i saved them as 11025hz (windows format?) pcm wav files - it might be worth checking the endianness of your converter/the format/what the snes expects? Could also be the header mucking things up?

>> No.2628424

I suspect endianess as well. I am using ffmpeg to convert from the .wav format to a raw PCM. I googled how to do it and used the first result. When I ended up with static, I ran --help, but it spewed more lines than my terminal buffer is long, which is over 1000. I need to dig through the man pages, but didn't have time last night. I'll have plenty of time this evening and weekend to sort things out. Thanks verifying the 11025Hz sample rate.

>> No.2631097

I've converted WAV to PCM and encoded to BRR. Working on integrating and fixing music data.

>> No.2631805


>> No.2633040


>> No.2635368
File: 79 KB, 704x448, Radiant Silvergun1.jpg [View same] [iqdb] [saucenao] [google] [report]

No push yet, but here's a brief update on where I am:

I cleaned up my codec code, and will push it with the next update. To encode a PCM waveform to BRR, the wave is first broken down into blocks of 16 samples. Next the codec encodes the 16-cample block using each of the four available "filters". For each filter the block is encoded using a greedy optimization strategy that searches for a "shift" and encoding that when decoded minimizes the error for the current point being considered, not by minimizing the error for the entire sample at once (still haven't figured out the mathematics behind that one yet). The filter with the lowest decoded error is selected as the encoding for the block. Rinse and repeat until the sound is encoded.

I've perfromed the WAV->PCM->BRR conversion and dropped the sounds into the game. Currently I am tweaking the sounds so they have the proper pitch in game.

The original music scale of pitches I put together assumes that when played at 32kHz (the SNES's audio rate), a sample plays A-4 (A440Hz). Since the samples I was given where encoded at 11025Hz, and furthermore since I don't know what note they play when played at 32kHz, I am in the process of resampling and tuning the sounds. This really comes down to a pitch transposition, and is to minimize distortion when playing samples at very low and high frequencies.

Last but not least I am adding key offs between certain notes to get rid of popping/clicking caused by envelope discontinuities. This can only really be done after nailing down the sample encodings.

Sorry for the glacial updates, but remember that I am literally assembling all of my sound related data by hand. Things will move along again at good clip once I get back to the 65816 side of things.

In the mean time enjoy some kick ass video game music:
https://youtu.be/wmbtRW0noRw?t=3443 (the first level is good too).

>> No.2635439


>> No.2637763


>> No.2640657

Sorry guys, still having trouble nailing down the proper resampling rates and transpositions. Part of the reason is that I was a little afraid to take apart the hand-assembled data. Once I got over my phobia I started making progress, but still not there yet. I would post the off pitch music, but I broke it at this point, so another day without an update.

>> No.2640754

Hey guys, could we have an SNES/NES homebrew general? We could all share our projects.

>> No.2641041
File: 47 KB, 512x448, 110830-bk-2[1].jpg [View same] [iqdb] [saucenao] [google] [report]

I'd be down with that honestly. OP proved it's doable to actually work on a game around here, and I'd be surprised if there's not a few other anons on /vr/ who know their assembly too. Plus, we could always talk about homebrews from other sources too.

>> No.2642232


OP here. Absolutely. Feel free to post in this thread if you want. I think it would make it much more interesting and help people get more involved in the hacking/home brew communities.

>> No.2643845

That'd be rad. Would bump and lurk.

>> No.2644290

Make it happen, /vr/

>> No.2645965

how about a homebrew general?

gotta include the saturn, dreamcast, genesis and so on too.

>> No.2645983

no, no fucking more generals.
enough with the god damn generals

>> No.2648620


I forget, what's the bump limit on /vr/?

>> No.2648763

Not a general in the traditional sense, just other people posting their brews in this thread

>> No.2650964

How's it going OP?

>> No.2652427

Just a quick update, I've gotten the samples encoded and they sound great. I cleaned up my codec and it works wonderfully now. I am adding in a per track mute and pause, and also adding some code to key on/off notes all at once instead of per track (this is a programming caution against a race condition). I'm trying to get this together to push tonight, but it may be tomorrow. No later than then.

>> No.2653124
File: 53 KB, 720x720, 1440140636049.jpg [View same] [iqdb] [saucenao] [google] [report]

So I finished encoding the instrument wav samples to brr. I had to make a minor fix in my encoder to utilize the brr per block filters correctly, but now the encodes kick ass.

I used my guitar tuner to determine that all the 11025Hz wav files were of instruments sounding at C-4. Since the snes can only alter pitch +/-2octs (you can go lower, but risk distortion), I wanted to check the sample's range in the song to pick an appropriate note when playing at the snes's default 32768Hz. To make things easy, I chose to stick with C notes. Surprisingly I only had to go to C-3 on the "bass" instrument.

To make my life easier I used milkytracker to resample and crop the waveforms.

Next I used a hex editor to strip away the wav header, leaving only 16-bit PCM.

Finally I encoded.

Inserting the samples into ROM and writing a small test script, I have verified the quality of the encoding. The samples are nearly indistinguishable between snes9x and milkytracker, which is impressive for the snes's reputation of muffling sound with a gaussian filter.

I also updated the audio driver slightly in function (though it took damn long enough to fix pointers and hand assemble again). Most importantly I made it so that the KON and KOF registers (the things that make sounds start and stop) are written to only once per bgm iteration. I had it originally set up so that tracks could freely write to these registers, but listening to earlier work made me think some notes where being dropped. These registers get read by the DSP only every 64 SPC700 cycles, so one tracks key on could easily overwrite another's. To fix this I just OR the tracks' kons/kofs together and set them at the end of the subroutine.

Also I added a per track pause, but you need a debugger to use it right now. I tried adding mute with variable success.

I added some more track functions and now need to recode the tracks.

I've pushed to github.com/gewballs/graviton. Checkout "audio.asm"

>> No.2653127

Oh yeah, I didn't include the encoder this push. If anyone is interested I'll push it next update.

>> No.2653870

daily bump

>> No.2655484
File: 360 KB, 500x368, 1440723482901.gif [View same] [iqdb] [saucenao] [google] [report]

Tons of shit posting recently on the board...

Anyway, I've scripted the drum kit and it plays nicely now. I copied the volumes from the tracker files, but they may need to be adjusted once the song is fully scored to work on the SNES. We'll see. Superbusy with homework atm, but I'll push when I get more tracks done.

Pushed updates to github.

>thinks to self, "it wouldn't be hard to do better than mario paint..."

>> No.2657641

OP with a lil bump. I'm getting my ass handed to me with some electromagnetics homework, so no progress last night to report :'(

>> No.2657843
File: 2 KB, 96x95, wool.png [View same] [iqdb] [saucenao] [google] [report]

Audiofag here, it's getting there, keep at it!

One thing is, don't know if it's just snes9x, the audio seems to be panned hard left

20/20 hindsight it probably would have saved you a lot of time to write something that outputs something like your script from a tracker file. I guess it's a small project though so making a toolkit like that is potentially overkill.

Interested to know how much memory the samples are taking up after being resampled - I was worried there might not be enough space for sound effects. Am I right in saying the audio in memory is compressed by the BRR and uncompressed only as the SPU plays the samples, so they'll be (for example) 28k raw, 18k compressed in the SPU's memory?

>> No.2657864

Where in fuck is that gif from?

>> No.2657871

contra hard corps

>> No.2658463



It was really a challenge to make the sounds in the samplepack not sound like complete shit, but I tried to pull as much as I could out of them. Its also very tough getting things to sound full with only 7 channels (I assumed you would need a channel free for game sounds).

This is also the first time I've written in XM format, and I didn't use any of the instrument envelopes because I don't know if your tools would support that.

>> No.2658520


also wanted to post this, since there are a couple utils for snes music. One is an xm player, and the other can supposedly do some limited it->spc conversion.

>> No.2658996

Bump for the buys OP. Keep at your homework anon.

>> No.2661274

Damn, worked over 16 hours on the fucker and only got 4 out of 6 problems done. Bump to give me time to work on it tonight.

Yes, the data entry really is better for a script, but at this point I'm almost done, and don't plan to add another track. Once I program a more complete driver for another project, I'll program scripts.

Thanks for the heads up on the panning. I'll check it out.

Altogether the code+music+sounds+ramfits in 0x6000 bytes uncompressed, so maybe like 0x5000+ bytes for the samples? I was worried too, but actually have plenty of room to spare.

I'll have to listen once I get home. You have 8 channels to work with, although you're right in that I need a few for sfx. However in a more sophisticated driver low priority channels (percussion) can be temporarily masked by sfx. Mine's not so fancy although that was my intention. I can do limited envelope stuff through hardware and software, although an abundance of grace notes would be murder to score by hand.

>> No.2662808

daily bump

>> No.2663676


>> No.2665027

Been working on the bass track some. You can listen to the track so far, but I warn you, it turns to screeching gibberish 30 or 40 seconds in because the track is not complete. For the time being the drums are disables too, so it's a little bit of a regression. The other notable things are that I re-encoded the bass sample to reduce a very faint buzzing issue, and that I have inserted key-offs to reduce popping noises and act as mutes that I glossed over the first time around.

This is a small update. I will continue to write the tracks. Understand that it is very boring and tedious, but I will be done soon.

>> No.2665925


>> No.2668121

good job

>> No.2669405
File: 142 KB, 200x150, 1440472773971.gif [View same] [iqdb] [saucenao] [google] [report]

OP here. Bass track complete. Sounds real nice. Only two more tracks to go, and they are slightly shorter than the bass track. I'll try to knock one out tomorrow (tonight at this point), probably the pluck track.

Some feedback on whether the track 'pops' would be helpful. I seem to hear a few stray pops here and there on my emulator. If you guys hear any popping between notes too, let me know and I'll try to address it. For the most part it's suppressed now though because I am developing a better understanding of how to rock the S-DSP.

Also audiofag, what do you think of the bass dynamics on part 4? I roughly emulated the volume levels you specified in the track, but I can't decide if it sounds a little weird in game. I rounded volume to the nearest the nearest 25%, but maybe that was too course...

Doing this by hand sucks, but I'm gaining a lot of insight in how to go about designing a better sequencer next time I'm doing this.

Update pushed to github.com/gewballs/graviton as customary.

>> No.2671997

Op is still working on the pluck track. Busy busy.

>> No.2673527

nice job

Name (leave empty)
Comment (leave empty)
Password [?]Password used for file deletion.