240p test suite

A place where you can keep others updated about your NES-related projects through screenshots, videos or information in general.

Moderator: Moderators

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

Re: 240p test suite

Post by tepples »

A few days, mikejmoffitt and I were brainstorming alternatives to the Green Hill Zone background for the Scroll Test. This is what I have so far.

It could use better clouds and a mountain backdrop. So far I've only used three of the palettes:
backdrop: 22
grass: 08 1A 29
dirt: 08 18 28
sky: 08 32 20
Attachments
greenhillzone.png
greenhillzone.png (3.73 KiB) Viewed 18113 times
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: 240p test suite

Post by tokumaru »

You can always draw inspiration from the reduced complexity renditions of Green Hill Zone from games like Sonic 1 and 2 (GHZ in this game is pretty different though) on the Master System, or Sonic Pocket Adventure on the Neo Geo Pocket, if you want to stay close to the original theme. If you're going for something more original, I think you're on the right track, although the colors could be a little more vibrant.

If you're gonna include background mountains, be sure to make them look way less saturated than the foreground. Since you don't have parallax scrolling (unless you plan on adding that?), this is kind necessary to properly convey distance.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: 240p test suite

Post by tepples »

tokumaru wrote:Since you don't have parallax scrolling (unless you plan on adding that?), this is kind necessary to properly convey distance.
Yes, I have parallax scrolling. Currently the topmost cloud is still (to act as the sprite 0 trigger), the rest of the clouds are at 1/8 speed, the mountains/water is at 1/4 speed, and the ground is at full speed. It'll be a b#### to get right on PAL though. I haven't made anything PAL-friendly yet.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: 240p test suite

Post by tokumaru »

tepples wrote:Yes, I have parallax scrolling.
Ah, cool.
It'll be a b#### to get right on PAL though.
Really? If you're interested, I have a "WaitScanlines" function that receives a scanline count in X and waits that many scanlines, adjusting itself automatically to PAL or NTSC based on a flag. I planned on using it for raster effects but haven't had the chance yet. Let me know if you want it and I'll post it. It's nothing out of this world, but since it's ready...

BTW, are you using any sprites or can you consider using them for the foreground trees (blowing your sprite budget)?
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: 240p test suite

Post by tepples »

tokumaru wrote:If you're interested, I have a "WaitScanlines" function that receives a scanline count in X and waits that many scanlines, adjusting itself automatically to PAL or NTSC based on a flag.
I'd have to adjust the other parts of the loop as well, such as reading the breakpoint list, dividing the X position by 8, and doing that thing where I combine the current strip's fine scroll with the next strip's coarse scroll to fully avoid glitches. I lack confidence in releasing anything that races the beam that I haven't tested on hardware, and I own no PAL NES.
BTW, are you using any sprites or can you consider using them for the foreground trees (blowing your sprite budget)?
I could put foreground trees in "Scroll test", but they'd blow the sprite budget in "Drop shadow sprite".
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: 240p test suite

Post by tokumaru »

tepples wrote:I'd have to adjust the other parts of the loop as well, such as reading the breakpoint list, dividing the X position by 8, and doing that thing where I combine the current strip's fine scroll with the next strip's coarse scroll to fully avoid glitches.
Assuming all of that takes a constant amount of time, shouldn't it just be a matter of doing all that, compensating for the scanline duration difference the same way it's done in the "WaitScanlines" subroutine, and then waiting n scanlines until the next split?
that thing where I combine the current strip's fine scroll with the next strip's coarse scroll to fully avoid glitches
Not really sure what you mean here.
I lack confidence in releasing anything that races the beam that I haven't tested on hardware, and I own no PAL NES.
You can always take your best shot with emulators, make it clear that PAL support is experimental, and have people with the proper equipment test it for you, no? Otherwise you're never going to support PAL consoles.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: 240p test suite

Post by tepples »

tokumaru wrote:
tepples wrote:I'd have to adjust the other parts of the loop as well, such as reading the breakpoint list, dividing the X position by 8, and doing that thing where I combine the current strip's fine scroll with the next strip's coarse scroll to fully avoid glitches.
Assuming all of that takes a constant amount of time
The table specifies a right shift of 0, 2, or 3 bits. Currently I loop, but making this take constant time is doable if necessary.
that thing where I combine the current strip's fine scroll with the next strip's coarse scroll to fully avoid glitches
Not really sure what you mean here.
Because I'm not changing the vertical scroll, I'm writing only to $2000 and $2005. Changes to the coarse horizontal scroll ($2000 bit 0 and $2005 first write bits 7-3) have to go in before horizontal blanking, but changes to the fine horizontal scroll ($2005 first write bits 2-0) have to go in after horizontal blanking. So on the last line of a strip, the line immediately before the split, I write the current strip's fine scroll with the next strip's coarse scroll, then later (during vblank), I write the next strip's complete scroll.

Code: Select all

;;
; Sets the horizontal scroll position to A:X.
.proc set_xscroll_midscreen
onesplit:
  and #$01
  ora #VBLANK_NMI|BG_0000|OBJ_1000
  sta PPUCTRL
  txa
  and #$F8
  ora lastfinex
  ; Set the current fine scroll with the next coarse scroll, because
  ; fine scroll takes effect immediately whereas coarse scroll waits
  ; for x=256
  sta PPUSCROLL
  sta PPUSCROLL
  ; Now waste a bit of time waiting for hblank
  txa
  and #$07
  sta lastfinex
  jsr waste12
  stx PPUSCROLL  ; Set the fine scroll during hblank
  stx PPUSCROLL
waste12:
  rts
.endproc
You can always take your best shot with emulators, make it clear that PAL support is experimental, and have people with the proper equipment test it for you, no? Otherwise you're never going to support PAL consoles.
I am willing to support this iff there are both A. demand and B. a willing tester who can load builds immediately. But with the reduced prestige of PAL NES, getting it feature complete for NTSC takes priority. After all, it's not called the 288p test suite.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: 240p test suite

Post by tokumaru »

Oh, I get it now. Since you're not using $2006, the coarse scroll doesn't change when you finish the writes, but when the PPU does v:0000010000011111=t:0000010000011111, so you have to do the $2005 write before that, but since the fine X scroll changes immediately, you can't update that part at the same time. Got it.

Anyway, landing a couple of PPU writes on hblank shouldn't be so hard, there's quite a bit of tolerance there.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: 240p test suite

Post by tepples »

Here's what mikejmoffitt did to my pseudo green hill zone.
greenhillzone.png
greenhillzone.png (5.83 KiB) Viewed 18014 times
I have only a few final checks before I release 0.04.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: 240p test suite

Post by tepples »

With new graphics in hand, I announce 240p test suite 0.04

0.04 (2015-11-16)
  • IRE: Added emphasis and $2D/$3D grays
  • Shadow sprite: Added full functionality
  • Added Hill zone scroll test with Green Hill Zone-inspired background by mikejmoffitt
  • Sound test: Added pulse beep (requested by mikejmoffitt)
  • Full README file
We seek experts in the following:
  • Testing on PAL NES
  • Testing on Dendy
  • Testing with high-quality displays and scalers
  • Measuring the actual IRE levels of NES video with an oscilloscope
  • Putting 27C512 onto an UNROM-compatible board
Attachments
240pee-0.04.zip
(129.95 KiB) Downloaded 775 times
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: 240p test suite

Post by lidnariq »

tepples wrote:Measuring the actual IRE levels of NES video with an oscilloscope
Make me a subset/variant that I can flash onto an 8KiB PRG EEPROM on a mapper 218 (CHRless) card and I will do this.
User avatar
thefox
Posts: 3134
Joined: Mon Jan 03, 2005 10:36 am
Location: 🇫🇮
Contact:

Re: 240p test suite

Post by thefox »

tepples wrote:Testing on PAL NES
Was there anything in particular that you wanted to be tested?
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: 240p test suite

Post by tepples »

In the current build, you can try these:
  • Color bleed to see what PAL does with horizontal, vertical, and diagonal lines
  • Linearity to see whether it recognizes PAL's aspect ratio
  • Overscan to confirm that 2 pixels on the left and right are already hidden
  • Shadow sprite: Press A+Up to switch to a striped shadow, then press A to switch among horizontal, vertical, and diagonal stripe patterns and see what they do to the portrait.
Here's a tentative list of changes I'll need to make for PAL support in the next build:
  • Color bleed, Full screen stripes: Wrap frame counter at 50 instead of 60 on PAL NES and Dendy
  • Stopwatch: Wrap frame counter at 50 instead of 60 on PAL NES and Dendy
  • Hill zone scroll test: Reduce all delays by 6.25% on PAL NES only
  • Sound test: Decrease tone period slightly to more closely approximate 1 kHz on PAL NES only
I hope to get to PAL over the next few days.

Here's a 1K IRE-only test, compatible with mapper 7 and (presumably) 218. The copy of FCEUX on my PC doesn't appear to support 218 at all.
Attachments
iretiny-0.01.zip
(14.91 KiB) Downloaded 765 times
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: 240p test suite

Post by lidnariq »

Here's the measurements into the 75.1Ω of my television:

SYNC: 48 mV / -37 IRE
CBL: 148 mV / -23 IRE
0D: 228 mV / -12 IRE
1D: 312 mV / ≡ 0 IRE
CBH: 524 mV / 30 IRE
2D: 552 mV / 34 IRE
00: 616 mV / 43 IRE
10: 840 mV / 74 IRE
3D: 880 mV / 80 IRE
20: 1100 mV / 110 IRE
0Dem: 192 mV / -17 IRE
1Dem: 256 mV / -8 IRE
2Dem: 448 mV / 19 IRE
00em: 500 mV / 26 IRE
10em: 676 mV / 51 IRE
3Dem: 712 mV / 56 IRE
20em: 896 mV / 82 IRE

There was about 10mV of noise (and 4mV of quantization error) that I could never quite fully get rid of, so the numbers here should be taken as having an error of ± 2 IRE.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: 240p test suite

Post by lidnariq »

tepples wrote:Putting 27C512 onto an UNROM-compatible board
I'm curious: why are you specifically calling this out?

This is a very simple thing, so why explicitly mention the 'PROM technology?
Post Reply