Common pitfalls: Difference between revisions

From NeoGeo Development Wiki
Jump to navigation Jump to search
(Created page with "Check your hardware before checking your code... =Unwanted resets= * Watchdog not written to fast enough * Misaligned word or longword read/write * RTS with wrong return address…")
 
mNo edit summary
Line 2: Line 2:


=Unwanted resets=
=Unwanted resets=
* Watchdog not written to fast enough
* Watchdog not written to often enough
* Misaligned word or longword read/write
* Misaligned word or longword read/write
* RTS with wrong return address in stack (or bad SP ?)
* RTS with wrong return address in stack (or bad SP ?)
* JSR to BIOSF_BOOTSCR ($C00438) instead of JMP


=Invisible sprites=
=Invisible sprites=
* Sprites are disabled (NeoGeo CD only ? Register ?)
* Sprites are disabled (NeoGeo CD only)
* The [[fix layer]] is filled with non-transparent tiles and hides everything underneath.
* The [[fix layer]] is filled with non-transparent tiles and hides everything.
* Bad X or Y position (Sprite is out of the 320x224 visible area).
* Sprite position is out of the 320x224 visible area.
* Size is 0 ([[Sprites|SCB3]]).
* Sprite size is 0 ([[Sprites|SCB3]]).
* Sprite tiles are all transparent (bad tile numbers ?).
* Sprite tiles are all transparent (bad tile numbers ?).
* Shrinking values too low (should still be visible)
* Shrinking values too low (few pixels 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.


=Invisible fix layer=
=Invisible fix layer=
* Fix is disabled (NeoGeo CD only ? Register ?)
* Fix is disabled (NeoGeo CD only)
* No non-transparent tiles mapped (bad [[S ROM]] ?)
* No non-transparent tiles mapped (bad [[S ROM]] ?)
* Tiles are on the invisible borders.
* Tiles are on the invisible borders.
Line 24: Line 25:
=Wrong colors=
=Wrong colors=
* Reference color (0) is not black. Set $400000 to #$8000.
* Reference color (0) is not black. Set $400000 to #$8000.
* Palettes were loaded in bytes instead of words.
* Palettes loading routine is broken.
* Tiles are assigned to an uninitialized palette.
* Tiles are assigned to an uninitialized palette.


Line 32: Line 33:
=Erratic sprite movement=
=Erratic sprite movement=
* Sprite is driven by the previous one.
* Sprite is driven by the previous one.
* VRAM writes done at the bad moment.
* VRAM writes too fast.


=Interrupts don't work=
=Interrupts don't work=

Revision as of 02:08, 6 May 2011

Check your hardware before checking your code...

Unwanted resets

  • Watchdog not written to often enough
  • Misaligned word or longword read/write
  • 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 size is 0 (SCB3).
  • Sprite tiles are all transparent (bad tile numbers ?).
  • Shrinking values too low (few pixels 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 (0) is not black.

Wrong colors

  • Reference color (0) is not black. Set $400000 to #$8000.
  • Palettes loading routine is broken.
  • Tiles are assigned to an uninitialized palette.

Shrinked sprites show garbage below them

  • The unused part of the sprite maps isn't cleared with a transparent tile (hardware glitch ?).

Erratic sprite movement

  • Sprite is driven by the previous one.
  • VRAM writes too fast.

Interrupts don't work

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