Difference between revisions of "Common pitfalls"

From NeoGeo Development Wiki
Jump to: navigation, search
m (5 revisions: Import from wikkii)
m
Line 11: Line 11:
 
* The [[fix layer]] is filled with non-transparent tiles and hides everything.
 
* The [[fix layer]] is filled with non-transparent tiles and hides everything.
 
* Sprite position is out of the 320x224 visible area.
 
* Sprite position is out of the 320x224 visible area.
* Sprite size is 0 ([[Sprites|SCB3]]).
+
* Sprite height is set to 0 ([[Sprites|SCB3]]).
 
* Sprite tiles are all transparent (bad tile numbers ?).
 
* Sprite tiles are all transparent (bad tile numbers ?).
* Shrinking values too low (few pixels should still be visible).
+
* Shrinking values too low (at least one pixel should still be visible).
 
* Bad [[C ROM]], it happens...
 
* Bad [[C ROM]], it happens...
 
* [[Palettes|Reference color]] (0) is not black.
 
* [[Palettes|Reference color]] (0) is not black.
Line 24: Line 24:
  
 
=Wrong colors=
 
=Wrong colors=
 +
* The wrong palette bank is selected.
 
* Reference color is not black.
 
* Reference color is not black.
* Palettes loading routine is broken.
+
* Palettes loading routine is broken (byte load instead of word, bad offset...).
 
* Tiles are assigned to an uninitialized palette.
 
* Tiles are assigned to an uninitialized palette.
  
=Shrinked sprites show garbage below them=
+
=Erratic sprite movement or display=
* The unused part of the sprite maps isn't cleared with a transparent tile (hardware glitch ?).
 
* Bad sprite size (too tall).
 
 
 
=Erratic sprite movement=
 
 
* Sprite is driven by the previous one.
 
* Sprite is driven by the previous one.
 
* VRAM writes too fast.
 
* VRAM writes too fast.
 +
* '''Never''' use CLR instructions on [[Memory mapped registers|LSPC registers]].
  
 
=Interrupts don't work=
 
=Interrupts don't work=
* Some emulators ignore the [[68k interrupts|raster line interrupt]], it may work on the real hardware.
+
* Some emulators ignore the [[68k interrupts|timer interrupt]], it may work on the real hardware.
 
* The interrupt mask causes them to be ignored by the 68k. Check the SR register.
 
* The interrupt mask causes them to be ignored by the 68k. Check the SR register.
* Wrong configuration of the raster line interrupt, see [[Memory mapped registers|'''REG_HBLANKCNT''' ($3C0006)]].
+
* Wrong configuration of the timer interrupt, see [[Memory mapped registers|'''REG_HBLANKCNT''' ($3C0006)]].
 
* The interrupt vector points to an RTE or RTS. Beware of the different levels between cart and CD systems.
 
* The interrupt vector points to an RTE or RTS. Beware of the different levels between cart and CD systems.
  

Revision as of 19:44, 6 July 2011

Check your hardware before checking your code...

Unwanted resets

  • Watchdog not written to often enough
  • Misaligned word or longword read/write (generates an Address error)
  • RTS with wrong return address in stack (or bad SP ?)
  • JSR to BIOSF_BOOTSCR ($C00438) instead of JMP

Invisible sprites

  • Sprites are disabled (NeoGeo CD only)
  • The fix layer is filled with non-transparent tiles and hides everything.
  • Sprite position is out of the 320x224 visible area.
  • Sprite height is set to 0 (SCB3).
  • Sprite tiles are all transparent (bad tile numbers ?).
  • Shrinking values too low (at least one pixel should still be visible).
  • Bad C ROM, it happens...
  • Reference color (0) is not black.

Invisible fix layer

  • Fix is disabled (NeoGeo CD only)
  • No non-transparent tiles mapped (bad S ROM ?)
  • Tiles are on the invisible borders.
  • Reference color is not black.

Wrong colors

  • The wrong palette bank is selected.
  • Reference color is not black.
  • Palettes loading routine is broken (byte load instead of word, bad offset...).
  • Tiles are assigned to an uninitialized palette.

Erratic sprite movement or display

  • Sprite is driven by the previous one.
  • VRAM writes too fast.
  • Never use CLR instructions on LSPC registers.

Interrupts don't work

  • Some emulators ignore the timer interrupt, it may work on the real hardware.
  • The interrupt mask causes them to be ignored by the 68k. Check the SR register.
  • Wrong configuration of the timer interrupt, see REG_HBLANKCNT ($3C0006).
  • The interrupt vector points to an RTE or RTS. Beware of the different levels between cart and CD systems.

Game don't boot (goes directly to the crosshatch)

  • Check the "NEO-GEO" string at 0x100
  • Check the security code at (0x182).l