SNES programming Videos

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.
User avatar
Nikku4211
Posts: 569
Joined: Sun Dec 15, 2019 1:28 pm
Location: Florida
Contact:

Re: SNES programming Videos

Post by Nikku4211 »

psycopathicteen wrote: Wed Apr 14, 2021 10:19 am I'm going to do a video response to the video, when my laptop gets repaired. The audio stopped working.
Does your laptop's headphone jack still work?

Does your laptop have a headphone jack?
I have an ASD, so empathy is not natural for me. If I hurt you, I apologise.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: SNES programming Videos

Post by psycopathicteen »

I did a live stream video yesterday but the sound quality was echoing, so I'll just post some stuff I mentioned.

-At one part you accidentally wrote $201a instead of $210a.
-lda #$01, sta $420d before setting up anything else would only work if data bank is $00 and A register is 8-bit at reset, which I don't know is true or not.
-Using 16-bit to load 2 write twice registers twice, I'm not exactly sure if that works on real hardware, the way it's supposed to.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: SNES programming Videos

Post by lidnariq »

psycopathicteen wrote: Sat Apr 24, 2021 3:19 pm if data bank is $00 and A register is 8-bit at reset, which I don't know is true or not.
Yes. 65816 datasheet page 17, section 2.25 Reset.
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: SNES programming Videos

Post by Oziphantom »

From the slide immediately preceding the code in question
regs_end.jpg
Although I do reset the DP in the case of "software reset" and I forgot about it at the start. So in order to safely do a Software reset for the above code you would need to set DBR to 00-3F/80-BF and A to 8 then JMP ($FFFC)
alternatively you could change the code to

Code: Select all

lda #$01
nop
sta $00420d 
This way if its 8bit you load 1 and nop then store. if 16 bits you load $EA01 and then write it, 420e is open bus so no harm.

yeah $201a/b total stuffup :D

Looking at the info about how the HOFS and VOFS registers work. That is bizzare and means my comments about a hidden latch are not true. any 2 writes to the registers will set all 16bits as expected. Basically its a very complicated "shift register".

However if you where in 4K demo conditions and wanted to clear it with the least code, it does mean you could just do

Code: Select all

STZ $210D ; set to 0, and "latch" to 0
STZ $210D ; set upper to 0 with "latch" 0
STZ $210F ; set F and 10 to 0 with "latch" 0
STZ $2111 
STZ $2113
as each write does set all 16bits, and it sets it to what you write in the byte and what is in the latch, since it all zero's the latch remains 0 as you cascade through.
calima
Posts: 1745
Joined: Tue Oct 06, 2015 10:16 am

Re: SNES programming Videos

Post by calima »

psycopathicteen wrote: Sat Apr 24, 2021 3:19 pm I did a live stream video yesterday but the sound quality was echoing, so I'll just post some stuff I mentioned.

-At one part you accidentally wrote $201a instead of $210a.
-lda #$01, sta $420d before setting up anything else would only work if data bank is $00 and A register is 8-bit at reset, which I don't know is true or not.
-Using 16-bit to load 2 write twice registers twice, I'm not exactly sure if that works on real hardware, the way it's supposed to.
I'm flambergasted that you would even consider making a video to report three simple issues. Writing this post probably took you half a minute, but you spent hours-days making that video.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: SNES programming Videos

Post by psycopathicteen »

It only took me an hour to make the video.
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: SNES programming Videos

Post by Oziphantom »

Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: SNES programming Videos

Post by Oziphantom »

Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: SNES programming Videos

Post by Oziphantom »

https://youtu.be/8YowrDT9cB8 Episode 5 - Sprites is ready
Basic introduction on how and why to set them offscreen.
Few coding tips to deal with them
I look at Sprite tile allocation methods
And for the experienced SNES developer explain the Reverse Stack Sprite Allocator - for those whom like to code with SWAG and for Speed.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: SNES programming Videos

Post by psycopathicteen »

I forgot that DMA had a reverse mode.
ccovell
Posts: 1045
Joined: Sun Mar 19, 2006 9:44 pm
Location: Japan
Contact:

Re: SNES programming Videos

Post by ccovell »

Thanks for these videos. They are very clear, methodical, and drop words of wisdom regarding beginners' pitfalls.

Though every time I step up to the SNES to dip my toe into a tiny bit of programming I walk away in fear and befuddlement, these videos are a great resource.
calima
Posts: 1745
Joined: Tue Oct 06, 2015 10:16 am

Re: SNES programming Videos

Post by calima »

SNES game jam starts in 19 days. 150 itch users reporting in currently.
User avatar
Nikku4211
Posts: 569
Joined: Sun Dec 15, 2019 1:28 pm
Location: Florida
Contact:

Re: SNES programming Videos

Post by Nikku4211 »

calima wrote: Sat May 15, 2021 11:59 pm SNES game jam starts in 19 days. 150 itch users reporting in currently.
Nice, now let's hope there'll be quite a bit of actual valid submissions there.

The GBADev game jam next door has been experiencing lots of invalid spam submissions like people submitting ROMs of commercial games, people submitting flash games, or people submitting non-Advance Game Boy ROMs.
I have an ASD, so empathy is not natural for me. If I hurt you, I apologise.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: SNES programming Videos

Post by psycopathicteen »

Oziphantom wrote: Sat May 15, 2021 8:47 am https://youtu.be/8YowrDT9cB8 Episode 5 - Sprites is ready
Basic introduction on how and why to set them offscreen.
Few coding tips to deal with them
I look at Sprite tile allocation methods
And for the experienced SNES developer explain the Reverse Stack Sprite Allocator - for those whom like to code with SWAG and for Speed.
If you include the $2180 ram port, you can make it the 5th address register.

SP for OAM
$2180 for HiOAM
DP for object pointer
X for metasprite information
Y for dynamic sprite CHR allocation tables
calima
Posts: 1745
Joined: Tue Oct 06, 2015 10:16 am

Re: SNES programming Videos

Post by calima »

@Nikku4211
What about you? Spent these months practicing and going to kick ass once it starts?
Post Reply