So what kind of stuff do people want to see on the SNES?

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
psycopathicteen
Posts: 2904
Joined: Wed May 19, 2010 6:12 pm

So what kind of stuff do people want to see on the SNES?

Post by psycopathicteen » Sun Aug 27, 2017 2:25 pm

I proposed the idea of making an engine that acts like the SNES has a large CHR-ROM based sprite system in another thread, to make sprite animation easier for other programmers. I didn't know if people just didn't notice it, or weren't interested, or didn't understand what it is.

So I'm going to ask, if people are not interested in this, what types of stuff do people want to see happen next? If we still want to create a generic game engine for beginners, does anybody want to include some built in special effects, such as HDMA line scrolling effects? In the near future I might be able to do almost real-time sprite scaling and rotation on multiple sprites at once, just as long as I have plenty of SRAM to use. It might be a fun little cheat for beginners who might be unimpressed with static sprites.

User avatar
dougeff
Posts: 2617
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: So what kind of stuff do people want to see on the SNES?

Post by dougeff » Sun Aug 27, 2017 6:05 pm

I read most of the code you write, but I don't understand alot of it.

You mentioned "beginners". If you want to help beginners, you need to explain things very very basic. Like...here's a step by step to go from a GIMP image, to create a CHR file. Here's how to load it to VRAM. Here's how to put it on screen. Here's how to animate it. Lots of details.
nesdoug.com -- blog/tutorial on programming for the NES

psycopathicteen
Posts: 2904
Joined: Wed May 19, 2010 6:12 pm

Re: So what kind of stuff do people want to see on the SNES?

Post by psycopathicteen » Sun Aug 27, 2017 7:26 pm

The code I posted this morning I don't think is that bad.

The thing is there's already lots of tutorials on ASM and PPU. A lot of people complain about the lack of example codes. The example codes I post aren't supposed to "teach" ASM, they're just there as a high level abstraction.

Languages like C and C++ use mysterious functions, and nobody cares how those functions work.

User avatar
Drew Sebastino
Formerly Espozo
Posts: 3503
Joined: Mon Sep 15, 2014 4:35 pm
Location: Richmond, Virginia

Re: So what kind of stuff do people want to see on the SNES?

Post by Drew Sebastino » Sun Aug 27, 2017 9:14 pm

That last comment. :lol:

What I would include in a game engine, is an object table (obviously), a system for adding and deleting objects, a system for actually running object code, a system for creating metasprites (with flipping and no size or shape limitations; just add or subtract x/y values) an animation engine, (it offsets a table with the offsets for metasprite data and tile data; can loop or end) and a dynamic VRAM engine (16x16 and 32x32 sized sprites are fitted into sprite VRAM wherever possible, making sure there are no redundant graphics to save space). Palettes for sprites would be fitted into CGRAM dynamically as well. (My system of changing palettes midscreen is probably overkill, and takes Hblank time...) A CGRAM and a VRAM uploader would need to be made. (The VRAM uploader would probably have separate routines for 8x8 tile/tilemap uploads and sprite tile uploads, as the latter can be more hardcoded.)

I don't really have much of an opinion on what should be included for backgrounds, because I feel like it varies too much from game to game to have an all-purpose solution. Some games need to deal with scrolling freely, while others only need to scroll on one axis at a time, and often only in one direction, and still others don't need to scroll at all. Games that can scroll more linearly can have new tiles uploaded as the screen scrolls, whereas I really don't know how you'd do this with scrolling freely. I think a system that decides when objects are spawned or destroyed should also be up to the programmer to make; some games need to process things offscreen while others don't; some games don't even need to keep track of what has been destroyed if they only scroll forward. I thing both sprite collision and background collision can also be done by the programmer. Fighting games, for example, don't need background collision beyond one "if less/greater than".

Basically, anything that actually touches hardware registers needs to be included. Anything that deals with hardware limitations (128 sprites, 16KB sprite VRAM, 8 sprite palettes) should also be included, although a programmer using the engine should obviously still be cognizant of these limitations even if they don't have to worry about them as much. Things that don't deal with video hardware and are thus no different to program for than on any other system (collision detection, physics, object creation/destruction) don't need to be included.

User avatar
Bregalad
Posts: 7768
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Re: So what kind of stuff do people want to see on the SNES?

Post by Bregalad » Sun Aug 27, 2017 11:08 pm

psycopathicteen wrote:I proposed the idea of making an engine that acts like the SNES has a large CHR-ROM based sprite system in another thread, to make sprite animation easier for other programmers. I didn't know if people just didn't notice it, or weren't interested, or didn't understand what it is.
I vote for 3., I don't understand what this is.

calima
Posts: 1021
Joined: Tue Oct 06, 2015 10:16 am

Re: So what kind of stuff do people want to see on the SNES?

Post by calima » Mon Aug 28, 2017 1:40 am

Even in the best case, interest in such a SNES game engine will be low. Look at comparable engines targeting other platforms, they barely have one user each.

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

Re: So what kind of stuff do people want to see on the SNES?

Post by tepples » Mon Aug 28, 2017 5:16 am

To gain interest from modders, your engine will probably need to be as complete as that of Super Mario World, as will its sample block and sprite graphics.

User avatar
HihiDanni
Posts: 186
Joined: Tue Apr 05, 2016 5:25 pm

Re: So what kind of stuff do people want to see on the SNES?

Post by HihiDanni » Mon Aug 28, 2017 5:44 am

My engine already does everything Espozo's first paragraph mentions except for dynamic sprite and CGRAM allocation. I am actually halfway to the former, because I have updated my sprite placement function so that objects can override the tile and attribute bytes of OAM and therefore offset themselves to use the sprite slot they were assigned.

The World system that I'm planning for later will be in an optional module that is invoked by scene specific code so only games that need it will be using it.

Edit: I also don't have metasprite flipping because I'd rather have flipped versions as separate definitions for performance.
SNES NTSC 2/1/3 1CHIP | serial number UN318588627

psycopathicteen
Posts: 2904
Joined: Wed May 19, 2010 6:12 pm

Re: So what kind of stuff do people want to see on the SNES?

Post by psycopathicteen » Mon Aug 28, 2017 2:24 pm

So I'm referring to the code on this page:
viewtopic.php?f=12&t=10957&start=285

I made a diagram to explain what it does.
VRAM system.png

User avatar
Drew Sebastino
Formerly Espozo
Posts: 3503
Joined: Mon Sep 15, 2014 4:35 pm
Location: Richmond, Virginia

Re: So what kind of stuff do people want to see on the SNES?

Post by Drew Sebastino » Mon Aug 28, 2017 5:36 pm

HihiDanni wrote:I also don't have metasprite flipping because I'd rather have flipped versions as separate definitions for performance.
I actually don't either for the same reason. I figured people would be put off by a lack of flipping, but really, if we wanted anyone to adopt a game engine like this, we would have to make a tool for building metasprites anyway, in which case you could implement a feature where a mirrored duplicates can automatically be made. It will take more ROM space, but I and more than likely others could give a shit.

@Psychopathicteen Why would you need SRAM for this? I wonder how much faster this would be than the system I have. (Which still isn't finished...) It doesn't look like it would offer any advantage other than speed, because of how 16x16 and 32x32 sized sprites have to be separated. I guess if there are two different objects with some sprites in common, it would save space over my system that only checks whether an entire object's graphics are in common rather than their individual sprites.

psycopathicteen
Posts: 2904
Joined: Wed May 19, 2010 6:12 pm

Re: So what kind of stuff do people want to see on the SNES?

Post by psycopathicteen » Mon Aug 28, 2017 8:05 pm

Without using an extremely long table, it would have to compare 128 sprites to 32 slots.

psycopathicteen
Posts: 2904
Joined: Wed May 19, 2010 6:12 pm

Re: So what kind of stuff do people want to see on the SNES?

Post by psycopathicteen » Mon Sep 04, 2017 1:54 pm

Didn't somebody post a code for writing every sPPU register in vblank a while? That would also be useful for a generic engine.

Found it
viewtopic.php?f=12&t=14457

psycopathicteen
Posts: 2904
Joined: Wed May 19, 2010 6:12 pm

Re: So what kind of stuff do people want to see on the SNES?

Post by psycopathicteen » Wed Sep 06, 2017 11:45 am

I decided to make my own shadow sPPU update code, for general use. I discovered a new trick with write-twice registers, where you just need to make a 16-bit write to the high bytes of the register, and it would automatically write the low byte of the next register in one go. The might be an even faster way with PEI, but I'm not sure the exact behavior of writing these registers out of order.

Code: Select all

sPPU_register_write:
php
phd
rep #$30
lda #{shadow_sPPU_regs}
tcd

lda {screen_brightness}
sta $2100

sei
tsx
lda #$210c
tas
pei ({BG1&2_char})
pei ({BG3_tilemap})
pei ({BG1_tilemap})
pei ({BG_mode})

lda #$2132
tas
pei ({color_math_enable})
pei ({window_sub_screen})
pei ({sub_screen})
pei ({window_logic_OBJ})
pei ({window_position_3})
pei ({window_position_1})
pei ({window_settings_OBJ})
pei ({window_settings_1&2})

txs
cli
sep #$10

ldx {window_color_green}
stx $2132
lda {window_color_blue}
sta $2132

ldx {BG1Xlo}
stx $210d
lda {BG1Xhi}
sta $210d
lda {BG1Yhi}
sta $210e
lda {BG2Xhi}
sta $210f
lda {BG2Yhi}
sta $2110
lda {BG3Xhi}
sta $2111
lda {BG3Yhi}
sta $2112
lda {BG4Xhi}
sta $2113
ldx {BG4Yhi}
stx $2114

lda {Mode_7_settings}
sta $211a
lda {parameter_A_hi}
sta $211b
lda {parameter_B_hi}
sta $211c
lda {parameter_C_hi}
sta $211d
lda {parameter_D_hi}
sta $211e
lda {parameter_X_hi}
sta $211f
ldx {parameter_Y_hi}
stx $2120
pld
plp
rts

TOUKO
Posts: 288
Joined: Mon Mar 30, 2015 10:14 am

Re: So what kind of stuff do people want to see on the SNES?

Post by TOUKO » Thu Sep 07, 2017 1:17 am

For mode 7 settings for example, why don't use MVN ??

psycopathicteen
Posts: 2904
Joined: Wed May 19, 2010 6:12 pm

Re: So what kind of stuff do people want to see on the SNES?

Post by psycopathicteen » Thu Sep 07, 2017 4:17 pm

They're write twice registers, so I have to do overlapping 16-bit writes.

Post Reply