Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2018-04-03 01:26:08

PinoBatch
Member
Registered: 2018-03-22
Posts: 31

STN torture test

This ROM was produced during early development of a Game Boy port of Artemio Urbina's 240p Test Suite.  Techniques demonstrated:

* Fading out the IPL logo
* Drawing text in a variable width font (VWF), also called
  proportional font
* Copying tile data to VRAM during horizontal blanking
* Bank switching background tiles at line 72 using a STAT IRQ
* Drawing half of a character as background and the other
  as flipped sprites
* Ease-in, ease-out, and overscroll bounce for window
* Making an excuse to skip leg day
* No exceptions in BGB

The effect looks great on a Super Game Boy, Game Boy Color, or PC based emulator.  On GBC or GBA, press Left+B to hide miscoloration of flipped sprites.  But it's a smearfest on a Game Boy Pocket, with these analog artifacts:

* Vertical smearing proportional to each pixel column's average
  gray level.  This appears to be inherent in passive matrix
  super-twisted nematic (STN) displays.
* Darkening of gray areas when large white area present.  I'm not
  sure whether this is the fault of the Game Boy Pocket, which
  supplies less power than other models, or of the EverDrive GB X5,
  which draws more power than a single-game cart.

https://forums.nesdev.com/download/file.php?id=12313
Ideal video, similar to SGB/GBC output

Download: Smear test executable and source code (31.4 kB)

Offline

 

#2 2018-04-03 18:52:46

AntonioND
Member
Registered: 2014-06-17
Posts: 108
Website

Re: STN torture test

Pretty cool.

Offline

 

#3 2018-04-10 00:22:33

PinoBatch
Member
Registered: 2018-03-22
Posts: 31

Re: STN torture test

If you haven't heard of 240p Test Suite, it's a tool for testing and calibrating monitors and scalers. But not everybody can run 240p Test Suite.

A. Someone owns a Super NES console, Super Game Boy accessory, and EverDrive GB, but no Super EverDrive or SNES PowerPak.
B. Someone owns a Nintendo GameCube console, Game Boy Player accessory, and EverDrive GB, but no GameCube homebrew device.
C. Someone wants to see exactly how much a Game Boy (DMG) or Game Boy Pocket suffers from motion blur and STN smear artifacts, or gloat over the GBC's utter lack thereof.

Hence the 144p Test Suite. It's just a start, but I've already got most of the easy ones (Grid, Linearity, Gray ramp, Solid screen, Sharpness, Grid scroll, Full screen stripes, About, and Credits) going, enough to give a sense of where the project is headed. And I plan to introduce a couple GB-exclusive tests for good measure.

Download: 144p Test Suite 0.01 ROM and source

https://forums.nesdev.com/download/file.php?id=12350
https://forums.nesdev.com/download/file.php?id=12348

Offline

 

#4 2018-04-10 11:23:35

nitro2k01
Administrator
Registered: 2008-02-22
Posts: 181

Re: STN torture test

PinoBatch wrote:

But not everybody can run 240p Test Suite.

A. Someone owns a Super NES console, Super Game Boy accessory, and EverDrive GB, but no Super EverDrive or SNES PowerPak.

This is not strictly true. The SGB contains facilities for downloading code into SNES RAM and running it. This should be enough to run a special version of the suite using only the hardware listed in A.


Blog: Gameboy Genius
"A journey of a thousand miles begins with one small step"
Old Chinese Proverb

Offline

 

#5 2018-04-14 15:42:28

PinoBatch
Member
Registered: 2018-03-22
Posts: 31

Re: STN torture test

I'd be interested to see the "special version of the suite" that you make using the transfer and jump mechanism that Space Invaders uses. In particular, I'd like to see how something like that could be squeezed into 32K to fit on an MBC-less cartridge, or whether it'd need something bigger and MBC-ful like an EverDrive. Until then, I'm focusing on finishing the minimum viable product.

I came up with a GB/SNES counterpart to PB8, a CHR data codec used in some of my NES games. (PB8 is LZSS with a fixed distance and length of 1, or equivalently RLE with unary-coded run lengths.) To make RLE effective on Game Boy, TurboGrafx-16, or Super NES, you need to change the fixed distance to 2. I was inspired by the RLE tile codecs used in Master System games, which store the data bitplane-major before compression (like NES tiles) rather than row-major (like Master System and Game Boy tiles) and then reinterleave the data when copying it to VRAM.

I also dug up the text coder that I had for made for another NES project. Byte pair encoding (BPE), also called digram coding or (in the ROM hacking community) dual tile encoding (DTE), is a way of compressing text by mapping otherwise unused high-numbered code units to pairs of characters. For example, code units $20-$87 might be your ASCII code plus a few accented glyphs, and $88-$FF would represent pairs of characters. Recursive BPE, or digram tree encoding (DTE), also allows one or both of the pairs to refer to another (lower-numbered) pair.

0.02 (2018-04-14)
* Solid screen: Mention dead pixel test (requested by calima)
* Compress most tile graphics with PB16, saving about 1.25K
* Compress help text with DTE, saving about 3.5K
* Add tests: Shadow sprite, Hill zone scroll, Vertical scroll, and Stopwatch

Download: 144p Test Suite 0.02 ROM and source
It's only missing six tests.

https://forums.nesdev.com/download/file.php?id=12364
darryl.revok's portrait of Gus, 128 tiles

https://forums.nesdev.com/download/file.php?id=12363
Smaller version of mikejmoffitt's Green Hill Zone-alike, 109 tiles

Offline

 

#6 2018-04-17 00:45:53

PinoBatch
Member
Registered: 2018-03-22
Posts: 31

Re: STN torture test

Stick a fork in it 'cause I think it's done, unless someone wants to contribute a patch for SGB or GBC support. There's about 6K left without having to step up to an MBC.

0.03 (2018-04-17)
* Add Overscan, working around a mono hardware bug with WX=166
* Add Audio sync, Manual lag, Sound test, and Motion blur
* Help: When displaying the same page as last time, don't move the window out and back in

Download 144p Test Suite 0.03 ROM and source

Offline

 

#7 2018-04-29 20:58:27

PinoBatch
Member
Registered: 2018-03-22
Posts: 31

Re: STN torture test

It has come to my attention that someone does want to make a GBC port. To prepare for this, I have made some behind-the-scenes technical changes to 144p Test Suite.

0.04 (2018-04-29)

* No more tarbombing: Create zipfile with all files in an internal folder (requested by calima)
* Skip logo fadeout and SGB detection on Game Boy Color/Advance
* Overscan: Start border thickness at 2 instead of temporary values left in from testing
* Overscan: Draw bottom border with WX instead of LCDC (requested by ISSOtm)
* Stopwatch: Hide face with window instead of LCDC (requested by ISSOtm)
* Hide incomplete first frame with BGP and OBP0 instead of LCDC (requested by ISSOtm)
* Vertical scroll: Fix a buffer overflow causing the test to start paused
* Use de facto standard hardware.inc, with 'r' in front of all port names (requested by ISSOtm)
* Grid test pattern no longer uses Sharpness help screen

Download 144p Test Suite 0.04 ROM and source

Offline

 

#8 2018-05-10 01:52:16

PinoBatch
Member
Registered: 2018-03-22
Posts: 31

Re: STN torture test

Now on GitHub: pinobatch/240p-test-mini

Offline

 

#9 2018-05-21 21:57:16

PinoBatch
Member
Registered: 2018-03-22
Posts: 31

Re: STN torture test

I have begun work on adding Game Boy Color enhancements to the following activities:

* Activities using help engine (menu, About, Credits, Sound test)
* Vertical scroll
* Lame boy demo

I have determined that the following could benefit from enhancement (issue #2):

* Gray ramp
* Motion blur
* Solid screen
* Shadow sprite
* Hill zone scroll

I have further determined that the following tests, which were left out due to lack of color, should be included for feature parity with ports on other consoles (issue 1):

* PLUGE
* Gradient color bars
* SMPTE color bars
* Color bars on gray
* Color bleed

But I doubt that I will be able to fit everything in 32K. I started with 26K used and 6K free. After adding the GBC enhancements that I have added so far, I am up to 27.4K used and 4.6K free. Some of this is because some parts need GBC-specific graphics to distinguish, for example, white-as-backdrop from white-as-skin-color from white-as-shirt when two of them occur in the same tile. Once I near the 32K limit of easily obtained flash carts that are less expensive than SD adapters, could anyone here assist in code review to find things I could pack smaller?

Offline

 

#10 2018-05-30 20:19:08

PinoBatch
Member
Registered: 2018-03-22
Posts: 31

Re: STN torture test

0.05 (2018-05-30)

* Fix Linearity corruption after closing help (0.04 regression)
* Add GBC enhancement for menu/help, Grid, Gray ramp, Solid screen, Motion blur, Shadow sprite, Scroll test, Vertical scroll test, and Lame boy demo (requested by calima)

Download 144p Test Suite 0.05 (ROM and source)

I now have 1726 bytes left to make PLUGE, Gradient color bars, SMPTE color bars, Color bars on gray, Color bleed, and their respective help pages. I might not be able to fit everything unless someone can help me find where I'm wasting space.

Offline

 

#11 2018-06-03 17:35:28

PinoBatch
Member
Registered: 2018-03-22
Posts: 31

Re: STN torture test

It took heroic compression, but I was able to add the color balance tests with 127 bytes to spare.

0.06 (2018-06-03)

* Add GBC-exclusive tests (PLUGE, Gradient color bars, SMPTE bars, Color bars on gray, Color bleed)
* LR35902 assembly source files use .z80 extension for more convenient syntax highlighting
* Backlight zone background is black, not green
* Motion blur, Overscan, and Lame boy demo share 0-9 tiles
* Better compression for tile maps using many tiles only once
* Lame boy demo no longer shows RNG test
* Eliminate some unnecessary ROM byte alignment

Download 144p Test Suite 0.06 (ROM and source)

Offline

 

#12 2018-06-06 22:37:21

PinoBatch
Member
Registered: 2018-03-22
Posts: 31

Re: STN torture test

Great Hierophant discovered a bug in Manual lag test. If you press A the tenth time for a result of 0, the palette will be all black, making average time unreadable. This will be corrected in the next release.

Offline

 

#13 2018-06-30 17:34:45

PinoBatch
Member
Registered: 2018-03-22
Posts: 31

Re: STN torture test

240p Test Suite (NES, GB, GBA) v0.17

A minor update, largely to track updates to the Genesis version. Also includes continued size optimizations in the Game Boy version.

Highlights:

* Sharpness: A to show brick wall pattern (Genesis 1.16 parity)
* Stopwatch: Add third ruler setting to show in even frames (Genesis 1.16 parity)
* Audio sync: Move ceiling up (Genesis 1.16 parity)
* Begin to unify help conversion tooling
* Unify version numbers
* Help (GB): Compress document titles with DTE
* Gray ramp (GB): Use Color tests map loader for GBC version
* Solid screen (GB, GBA): Explain what a bad high voltage regulator does to SGB and GB Player border (requested by ISSOtm)
* Stopwatch (GB, GBA): Draw even frame numbers in blue and odd in red (Genesis 1.16 parity)
* Manual lag (GB): Fix all-black result screen if final press was 0 lag (reported by Great Hierophant, echoing Quietust's NES report)
* GB: ISSOtm golfed SGB detection by 3 bytes; numerous other size optimizations and tile sheet unifications

Download: GitHub release | ROM and source (zip)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson