Common pitfalls: Difference between revisions

From NeoGeo Development Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 2: Line 2:


=Unwanted resets=
=Unwanted resets=
* Watchdog not written to often enough
* [[Watchdog]] not written to often enough
* Misaligned word or longword read/write
* Misaligned word or longword read/write (generates an [[68k error handling|Address error]])
* 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
* JSR to BIOSF_BOOTSCR ($C00438) instead of JMP
Line 21: Line 21:
* 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.
* Reference color (0) is not black.
* Reference color is not black.


=Wrong colors=
=Wrong colors=
* Reference color (0) is not black. Set $400000 to #$8000.
* Reference color is not black.
* Palettes loading routine is broken.
* Palettes loading routine is broken.
* Tiles are assigned to an uninitialized palette.
* Tiles are assigned to an uninitialized palette.
Line 30: Line 30:
=Shrinked sprites show garbage below them=
=Shrinked sprites show garbage below them=
* The unused part of the sprite maps isn't cleared with a transparent tile (hardware glitch ?).
* The unused part of the sprite maps isn't cleared with a transparent tile (hardware glitch ?).
* Bad sprite size (too tall).


=Erratic sprite movement=
=Erratic sprite movement=
Line 37: Line 38:
=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|raster line interrupt]], it may work on the real hardware.
* Interrupt mask cause 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 raster line 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.
Line 44: Line 45:
* Check the "NEO-GEO" string at 0x100
* Check the "NEO-GEO" string at 0x100
* Check the security code at (0x182).l
* Check the security code at (0x182).l


[[Category:Code]]
[[Category:Code]]

Revision as of 22:28, 25 May 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 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 is not black.

Wrong colors

  • Reference color is not black.
  • 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 ?).
  • Bad sprite size (too tall).

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.
  • The interrupt mask causes 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.

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

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