Why no SNES homebrew scene?

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Why no SNES homebrew scene?

Post by tepples »

byuu wrote:For what it's worth, I am open to changing my SPC700-6502 syntax if anyone wants to discuss it.
I'll start a new topic about it.
65816 already uses , for + for some mindfucked reason
Probably because + is already taken by expressions: lda label+5,x
and some interesting problems like "ora" not really applying to the non-A or modes
Which is why ARM went to orr.
User avatar
blargg
Posts: 3715
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Re: Why no SNES homebrew scene?

Post by blargg »

tepples wrote:
byuu wrote:65816 already uses , for + for some mindfucked reason
Probably because + is already taken by expressions: lda label+5,x
Accepting + leads to the the odd restriction that you can only add the index register as the last item in an expression. Comma is the standard argument separator for assembly, and indexed modes have a separate argument: what register to index via.
byuu wrote:and some interesting problems like "ora" not really applying to the non-A or modes
I read that companies sued others or some legal bullshit over mnemonics back then, so everyone tried to make their own. That's what I've always explained to myself as to why they didn't just use or. That and their appreciated goal of making all mnemonics three characters.
Last edited by blargg on Wed Feb 05, 2014 10:32 pm, edited 1 time in total.
Near
Founder of higan project
Posts: 1553
Joined: Mon Mar 27, 2006 5:23 pm

Re: Why no SNES homebrew scene?

Post by Near »

> Which is why ARM went to orr.

That's what I ended up using for the non-A based ones. I left ora for consistency with 65816's ora.

> Probably because + is already taken by expressions: lda label+5,x

lda label+5+x would have been fine. You could also technically allow lda label+x+5 if you wanted to write a more complex parser. Both would require reserving a/x/y/s, and not allowing their use in user-made labels.

At any rate, even if we accept the justification, what do we do about opcodes that legitimately need commas for operand separators on the SPC700? And technically, MVN/MVP on the 65816.

My idea was to use =. Maybe a good one, maybe not.

bbs dp:bit=target
bne dp,x=target
orr dp=#imm

Added benefit of making the "dest,src or src,dest" ordering more clear.

> I read that companies sued others or some legal bullshit over mnemonics back then, so everyone tried to make their own. That's what I've always explained to myself as to why they didn't just use or. That and their appreciated goal of making all mnemonics three characters.

I figured they went with ora because or would have been the only mnemonic that wasn't exactly three letters.

Say what you will on mnemonics, but I've always really appreciated the visual operand alignment without needing to pad opcode names with spaces or tabs. When you get into Intel-era 20-letter-long AVX instructions, it's downright infuriating.

But yeah exactly. This is why the SPC700 has that half-assed, hideous mnemonic set. They knew they'd be sued for ripping off the 6502.

If I were designing it, I would have used ior (inclusive or.)
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Why no SNES homebrew scene?

Post by tepples »

byuu wrote:At any rate, even if we accept the justification, what do we do about opcodes that legitimately need commas for operand separators on the SPC700? And technically, MVN/MVP on the 65816.
Do these opcodes also happen to use indexed addressing?
If I were designing it, I would have used ior (inclusive or.)
That looks like "immediate or" to me ever since I saw MIPS in college.
User avatar
blargg
Posts: 3715
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Re: Why no SNES homebrew scene?

Post by blargg »

byuu wrote:I figured they went with ora because or would have been the only mnemonic that wasn't exactly three letters.
IOR = inclusive or
EOR/XOR = exclusive or
Say what you will on mnemonics, but I've always really appreciated the visual operand alignment without needing to pad opcode names with spaces or tabs. When you get into Intel-era 20-letter-long AVX instructions, it's downright infuriating.
No disagreement there. Coding on variable-length mnemonic assemblies is never pleasant, unless you want to depend on your editor to have custom tab widths or custom tab stops and tab between the mnemonic and operands.
If I were designing it, I would have used ior (inclusive or.)
Haha.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Why no SNES homebrew scene?

Post by psycopathicteen »

It shouldn't be that difficult to develop an SNES game that looks like an NES game. You can use 128 8x8 sprites without the need of dealing with the extra 32 bytes, and you don't need to use 16-bit mode or use more than a single bank.

Also, is HLL a standard language that Nintendo uses, or does it refer to any high level language in general assuming that is what HLL stands for.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Why no SNES homebrew scene?

Post by tepples »

I think "HLL" refers to any high-level language. And as I understand how nocash's worldview connects to the ARM-powered platforms supported by his emulators, "HLL" in this post probably means C or the less RAM-heavy parts of C++.
slobu
Posts: 276
Joined: Tue Jul 12, 2011 10:58 am

Re: Why no SNES homebrew scene?

Post by slobu »

The state of development tools coupled with the expertise needed to create games for the SNES pretty much guarantees it's a niche within a niche for homebrew development.

We need both assembly gurus and amateur 3rd generation language capable homeworkers to create a thriving scene.

Sadly, the last effort to lower the bar on SNES game development has been abandoned twice:
http://www.snesgamemaker.comeze.com/

Anyone with knowledge of the 65816 flavor of wla could pick up the pieces and add functionality to it. Rejuvenate the project and grow the homebrew community.
User avatar
mikejmoffitt
Posts: 1353
Joined: Sun May 27, 2012 8:43 pm

Re: Why no SNES homebrew scene?

Post by mikejmoffitt »

tepples wrote:
Bregalad wrote:Or just rip samples out of SNES games :)
And open yourself to a lawsuit just as much as if you had ripped the Mario sprites out of Super Mario World.
This is blown out of proportion. If the use of the dinky samples from Super Mario World are comparable to Mario's direct likeness, then something is wrong here. I've come across dozens of POS systems in small stores and gas stations that use the ring, drowning, and goalpost sound effects ripped straight out of Sonic the Hedgehog. Surprise surprise, nobody's upset! Those are actual recognizable sounds. Using an instrument sample from a SNES game will get nobody in trouble, especially since the game likely is not being sold. If someone uses a Mario sprite to teach themselves how to manipulate sprites for a demo, that's absolutely fine. A single sample of an instrument used in a part of one particular game is not going to tangle anyone's undergarments.

If needed, take the sample, mar it up a bit until it's a little different, and use it.

I don't see why the issue of "THERE COULD BE A LAWSUIT" is so often an issue that gets excitedly brought up.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Why no SNES homebrew scene?

Post by psycopathicteen »

I remember trying to explain to the maker of snesgamemaker that in order to display a sprite onscreen, you had to upload a sprite pattern table during initialization, upload the oam during vblank, clear unused oam entries AND calculate hi-oam at the end of active display, as well as having the "display sprite" subroutine, to display sprites. He was seriously confused by all these steps.

EDIT: I have an idea. Why don't we take the famous snes initiation code, and add the addition of a default color palette, default sprite and bg pattern table and default vram memory arrangement settings.

How's this as a default setting:

Code: Select all

sprites: 8x8 and 16x16
bg mode: 1, with high priority bg3

vram layout:
$0000 sprite patterns
$2000 bg1 map (64x64)
$3000 bg2 map (64x64)
$4000 bg1 & bg2 patterns
$6c00 bg3 map (32x32)
$7000 bg3 patterns

tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Why no SNES homebrew scene?

Post by tepples »

No idea why the maps have to be 64x64 instead of 64x32, which is enough for scrolling without artifacts. But if you could port my NES project template to the Super NES, that'd be great.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Why no SNES homebrew scene?

Post by psycopathicteen »

Okay, that's a good point. It lets all 4 BG layers fit from $2000-$3fff.

EDIT:
Okay, here is a modified version of the initialization routine. It also puts it in fast mode, all layers on main screen, and in active display, full brightness.
Attachments
improved snes initiation.txt
(4.57 KiB) Downloaded 264 times
slobu
Posts: 276
Joined: Tue Jul 12, 2011 10:58 am

Re: Why no SNES homebrew scene?

Post by slobu »

I don't know anything about assembly. Is there any way to modify the InitSNES.asm to take advantage of your improved init routine psycopathicteen?

Here is the init used in SNESGameMaker (Located in C:\SNESGameMaker\Temp\Include)
Attachments
InitSNES.asm
(7.25 KiB) Downloaded 261 times
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Why no SNES homebrew scene?

Post by psycopathicteen »

I'll look into the code.

I want to know how you are assembling the code. Is it just a bunch of .asm files being assembled to a ROM individually, or are they using "includes."


Here's a question for others on this website. Is there a "correct" way to use NMI interrupts? In the last couple of projects I've been using an IRQ interrupt in the place of an NMI, because NMI interrupts could trigger late when the CPU is busy, causing a black bar to appear at the top of the screen, instead of the usual slowdown. If you keep the NMI interrupt flag set, it can interrupt the CPU while it's not finished with a frame, causing glitches, unless you reserve a byte of memory to signal if the frame is finished or not.

EDIT: Your code RTL after it clears wram. That would cause crashing, due to the stack being swiped out.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Why no SNES homebrew scene?

Post by psycopathicteen »

Okay, I'm finished with the snes initiation code. I even made text files ready to use as main and nmi code. Graphics should be stored in the $81xxxx and $82xxxx ROM banks, since each ROM bank is 32kB, it takes 2 banks to fill up 64kB of vram. I use xkas, if anyone has issues with wla or another assembler. If anyone finds a mistake, please tell me, and I'll fix it.

EDIT: No wonder nobody responded. I made two mistakes. The first is setting $2100 to $1f instead of $8f, the second is dma-ing both banks to address $0000 in VRAM. I'll post a correct version when I get home.

EDIT 2: Uploaded the corrected version. Hope people find this useful.
Attachments
snes initialization.zip
(2.41 KiB) Downloaded 269 times
Post Reply