
                                  NeoPop
                          by neopop_uk@yahoo.co.uk
                         http://neopop.emuxhaven.net


---------------------------------------------------------------------------
About
---------------------------------------------------------------------------

NeoPop is a free NeoGeo Pocket Color emulator for Windows.

DirectX 8.1 or better is required.


---------------------------------------------------------------------------
Disclaimer
---------------------------------------------------------------------------

- The author takes no responsibility for the program, what you do with it,
    or for any problems that it causes you. Use at your own risk.

- You will not distribute modified versions of the archive, the program or
    accompanying files.

- You will not distribute this program with rom images.


---------------------------------------------------------------------------
What's New
---------------------------------------------------------------------------

v0.38
	- Added support for save states. Use the games menu options
	to save and load. The save state directory is stored
	independantly of the rom path.

	- Added a 'Step / Disassemble Both' button to the debugger,
	This steps and disassembles both CPUs.

	- Fixed a problem that the default value of the stack pointer. 
	It was incorrect and causing some many roms to overwrite critical
	system data when they pushed too much.
		- Fixes "Crush Roller"
		- Fixes "Delta Warp"
		- Fixes "Densha de GO!"
		- Fixes "Evolution"
		- Improves "Faselei!" (still black screen)
		- Improves "NeoGeo Cup '98 Plus Color" (more stable)
		- Fixes "Ni-ge-ron-pa (J) [!]"
		- Fixes "Pocket Love If"
		...and no doubt several more

	- Added instructions "RL #4,r", "RL A,r", "RL (mem)"
		- Fixes "BioMotor Unitron" (intro text scroller)

	- Added instructions "RR #4,r", "RR A,r", "RR (mem)"
		- Fixes "Spacies (PD)"
		- Fixes "Asteroids (PD)"
		- Improves "Soreike! Hanafuda Doujyou"

	- Only 12 instructions remain, and they are very rarely used.
	For those of you interested they are: ANDCF, ORCF, XORCF, TSET,
	LINK, UNLK, BS1F, BS1B, MIRR, MULA, RLD and RRD.


v0.37
	- Fixed a huge bug in the release build (present since v0.34)
	that was causing several of the instructions to fail after an
	unhandled memory exeception was generated.
		Fixes "Metal Slug 1", "Cool Cool Jam" and many more.
		Compatibility should be at least as good as v0.33 now.

	- Changed the sound debug output to dump raw data to
	the message window as the current decoding is wrong.

	- Fixed the Real Time Clock so that it doesn't accidentally
	corrupt memory.
		- Fixes "Blocks (homebrew)"
		- Improves "Bust-a-Move"

	- Added support for off-screen edge sprites.
		Fixes glitches in "Metal Slug" and "Fatal Fury"
		and some homebrew roms (thanks for the help Fuz)

	- Optimisations made to the release version.


v0.36
	- Redesigned and re-coded the Z80 register viewer,
		- Fields are disabled when the Z80 is inactive.
		- Added Apply and Refresh buttons
		- Added status flag toggles
		- Added toggle switch to enable / disable the Z80

	- Fixed generic ADD, ADC, SUB and SBC in word and long modes
		- Improves "Blocks" (homebrew)
		- Improves "Bust-A-Move" survival mode (still unplayable)
		- Improves "NeoGeo Cup 98"
		- Improves "Dark Arms" logo is now displayed.
		- Improves "Gals Fighters" - disables secret characters.
		- Improves "Last Blade" - Gets to title screen!
		- Improves "Samurai Shodown" - SNK logo, unstable, glitches
		- Improves "SNK vs. Capcom" 
			- Big character graphics show correctly, still unplayable
		- Improves "Soreike! Hanafuda Doujyou (J)"
			- Shows title screen and menus properly now
		- Improves "Fatal Fury" - Explosions, etc. work in the fight.

	- Added 'save' button which saves the contents of the main
	debugger window to a file called 'neopop_debug_log.txt' in
	the root directory of drive C.


v0.35
	- Re-ordered the debugger dialog.
		- Unified the flag and instruction message filters.
		- Removed the EEPROM command filter, it is unnecessary.

	- Changed 'STEP Z80' so that it only emulates Z80 instructions,
	suspending the TLCS-900h CPU. Hope this helps Ivan!

	- Fixed a bug in the code viewer that was causing the code
	history to be cleared unnecessarily.

	- Moved the z80 registers into a new dialog. 
		- Fixed the flags register.
		- Added SP, AF', BC' DE' and HL' registers.

	- Added independent z80 breakpoint


v0.34
	- Switched Z80 emulators from Raze to Marat Fayzullin's one. This has
	the triple benefit of increased stability, being portable and most of
	all allowing optimisiations to make NeoPop faster!

	- Added instructions MINC/MDEC. Used by a few roms, but there has been
	no improvement in compatibility.

	- Fixed the DIV/DIVS instructions (hopefully). 
	Improves some homebrew roms, but not any commercial ones.

	- Major clean up of the code internally, abstracting all of the
	Windows specific code so that it is more portable and easier to
	understand.

	- Added z80 disassembly using Marat's z80 emulator. I hope this
	is useful to the homebrew developers out there. Use the 'step z80'
	button to step both CPUs, but disassemble z80 code instead of TLCS900h.

	- Added radio buttons to the code viewer to switch between the
	auto-disassembly of the two CPUs. This does not affect the history
	window as it would be too much work. It's already getting a bit hacked
	together.

	- Added z80 register display to the register viewer - it doesn't
	show values when the z80 is inactive. Let me know if I've missed out
	any useful registers - I don't know much about z80 coding!

	- Fixed pause logic, and removed the option the debug build.

	- Converted to zLIB 1.1.4 for increased security.

	- Stopped the debugger from being closed in the debug build.
	Removed the 'debugger' menu option.

	- Improved games:

	Card Fighters Clash (Doesn't crash, so it's now possible to play)
	Dynamite Slugger (Doesn't crash, shows garbage though)
	Card Fighters Clash 2 (Gone a bit strange)


v0.33
	- Fixed Timer 3 so that it generates a Z80 interrups even if the
	main cpu is set to ignore them. Removes the need for any hacks to
	get "KOF-R2", "Cotton", etc to work. Unfortunately one game has broken:
	"Densha de GO! 2", now shows a black screen. I hope to fix this soon!

	- Fixed many problems with the graphics code:
		- Sprites now showing in fighting games and various PD roms.
		- Background colour now shows in most commercial games.
		- Added depth buffer to allow correct sprite priority and ordering.

	- Several instructions fixed:
		- SBC in word and long mode now uses the C flag!
		- EXTS fixed properly (Fixes a lot of roms, silly me!)
		- RETD was getting the D value after the PC had changed,
			causing mad values to be used. Fixes "Dive Alert" intro.
		- H flag on AND (mem),R - insignificant? probably!
		- DAA was giving an incorrect warning in the debugger.

	- Implemented ANDCF, ORCF and XORCF (immediate mode only)
		Improves "Card Fighters 2" a bit, giving some error in Japanese?
		Does anyone know what it says? please mail me!

	- Fixed some memory modes: 
		- "+r8/+r16" in the interpreter.
		- "R32' + d16" now disassembled correctly using a signed value.
			- Makes survival mode show a bit in "Bust-A-Move"
		
	- Made the apply button in the debugger update all the displays
	so that changes to the PC are reflected in the code viewer, etc.

	- Better faking of EEPROM routines allows you to leave the
	"Fatal Fury" options menu. Probably stops some other problems too.
	EEPROM support will be implemented soon because it is the current
	reason why "Last Blade" doesn't work.

	- Improved games:

	Fatal Fury (Shows all sprites, even character select cursor)
	Cool-Cool JAM (Shows intro / title screen - then freezes)
	Neo Turf Masters (Can play a bit - not tested much) 
	Pac-Man (Fixes missing top-left of sprites)
	Cotton (Removed glitches in top left of screen)
	Cool Boarders (Title and Menus look correct now)
	Dive Alert (Shows Title, unplayable, unstable, may crash emu!)
	Card Fighters Clash 2 (Shows title screen, then message)
	Sonic (Shows title screen and main menu)
	SNK Vs Capcom (Unstable, shows intro/menus, unplayable)
	... definitely more


v0.32
	- Finally added the 'apply' button to the debugger register viewer
	so values can be changed. Also added a 'restore' button to restore any
	changes back to the current value of the register / $PC.

	- Rewritten the add and subtract functions, making them generic and
	made the compare, and NEG instructions use (abuse?) these as well -
	probably how the real CPU works, who cares?
	The ADD and SUB functions now have correct flag emulation, verified
	using Judge_'s CPU tester - thanks!

	- Also fixed parity flag for AND,OR and XOR, and fixed MULS also using
	the CPU tester.

	- Removed the sprite hack because it was causing problems with Cotton
	and probably other games. Need to try a new approach to fix "Fatal Fury"

	- Improved games:
	
	Metal Slug (Starts, but freezes on gameplay screen),
	Metal Slug 2 (Intro works, but gameplay is unstable),
	Biomotor Unitron (Fixed missing intro graphics),
	Cotton (Sprites work again, collision detection fixed),
	Fatal Fury (Square wipes are centered properly),
	KOF R-2 (Sprites don't show, some flickering)
	Gals Fighters (Shows title screen, unstable)
	... probably more


v0.31
	- Made some improvements to the timer emulation, supporting all of
	the timers now in a limited capacity.

	- Emulated CPU flags for a large number of instructions. This has
	been the primary reason for any jumps in compatibility.

	- Added several new instructions and fixed some more. Also raising
	compatibility a bit. 

	- Fixed the EXTS instruction which was clearing the remaining
	data instead of preserving it after extension.

	- Fixed the interuppt level register again, I hope for good now.

	- Improvised a sprite priority hack to make "Fatal Fury" display
	the players, but I'm not sure this is correct - it shouldn't
	affect other games, so i'll leave it in for now.
	
	- Improved games:
		
	Dive Alert (starts to play intro),
	Bikkuriman 2000 (runs intro and almost starts!),
	KOF-R2 (shows the intro but isn't playable, title screen doesn't work).
	Neo Baccarat, Neo Twenty One (will start now)
	Pac-Man (black title screen - but game starts if you press a button)
	Sonic (Shows title screen, unplayable though)


v0.3
	- Added preliminary support for timer emulation. This is used by
	the graphics hardware to create some horizontal effects, and the
	sound hardware to run the sound driver code.

	- Fixed communication between the TLCS-900h (main cpu) and z80
	(sound cpu!). No more hacks, proper emulation of the z80 has been
	re-enabled. NOTE: Some roms will crash the emulator due to bad
	z80 code execution that I can't really do much about.

	- Fixed bugs in the interrupt calling instruction 'SWI', and in the
	interrupt level register. EEPROM commands are still ignored as
	they cause games to freeze.

	- Fixed another stupid bug in CPIR/CPDR, thanks Ivan!

	- The state of the message filters in the debugger is now saved to
	the registry.

	- Fixed a bug in the graphics code so zero width windows are supported.

	- Removed the compatibility list. I don't have time to keep this
	current, and it doesn't make for very interesting reading.


v0.2
	- Massive compatibility improvement due to killing lots of bugs:

	- Fixed a bug in LDI/LDIR/LDD/LDDR when in XIX+/XIY+ mode, it was
	changing XDE/XHL instead.

	- Fixed a HUGE bug in CPI/CPIR/CPD/CPDR that was causing comparisons
	from bogus locations and just general flawed behaviour. Stopped the
	hanging	in "Infinity Cure" (still just a black screen though). 
	
	- Rewrote the MUL/DIV instruction set.
	
	- Fixes "Cotton - Magical Night Dreams" - the first "playable" game!!!!

	- "Manic Miner (pd)" now walks left *AND* right.

	- "Neo Derby Champ" now runs with uncorrupted graphics.

	- Fixed 'OR' - makes "Mines (PD)" work properly (I hope! I suck at
	the game so I haven't been able to test it completly)

	- Hacked 'SWI' to ignore some of the bios calls that don't work too
	well. This prevents a lot of lock-ups, especially those related to
	EEPROM functions.

	- Disabled the z80 emulator, replaced it with hacks to fake it, this
	stops many roms crashing the emulator. NeoPop should never crash now
	(I hope).

	- Implemented Foreground/Background swapping. Fixes "Fatal Fury"

	- Made the debugger tidier / better. Added message filters to ignore
	certain	errors (note: all messages off is the same as the release build
	 - it just blindly runs code until something breaks).
	
	- Message filter settings aren't saved in the registry - yet.

	- I've rebuilt the register dialog to use edit boxes, in preparation
	for allowing direct editing of them. This feature has yet to be fully
	implemented.

	- The register values are only shown in the stopped mode. Not while
	running.
	
	- No sound is available yet. None of the roms make any noise for me to
	play.
	
	- That's about it.... probably a few speed-ups etc. that I can't
	remember.


v0.16
	- Tidied up the debugger a little. Added auto address entry to the
	instruction history.


v0.15
	- Redesigned and generally tidied up the debugger, it should be easier to
	use now. Messages are also a little more helpful.

	- All window positions are now stored in the registry.
	
	- History of the last 8 instructions is listed in the new 'code' window.
	
	- Fixed a few bugs and made some small unnoticable optimisations.
	
	- Added stub code to handle DMA and EEPROM commands without causing errors.
	No battery backup feature is available yet though.


v0.14
	- Finished the scanline renderer. The graphics core is almost finished now.

	- Added and fixed a *lot* of instructions.

	- Added memory mapping for 32Mb games - Metal Slug 2 and SNK vs. Capcom 
	both work a _little_ bit! - but not really what you'd call playable!

	- Started implementing accurate CPU timing, not so important just yet - but
	eventually some games may rely on accurate timing.
	
	- Seperate debug build now included. The debugger is not available in the
	release build. The debug build should help people track down bugs in the
	emulation.


v0.13b
	- Improved stability and removed the memory holes (see SMALL NOTE below)

	- Updated the compatibility list with commercial rom information.


v0.13
	- Incorporated the RAZE z80 emulator, no sound yet, but it does boost
	compatibility a little with some commercial roms.

	- Made a start on a scanline based renderer but it still needs more work, so
	the tile based one is used here instead.

	- Fixed and Added a lot of instructions, "Bust-a-Move Pocket" now shows a
	lot of progress - but it is still unplayable.

	- Added manual memory alteration and status flag changes for homebrew
	developers to fiddle with (Hope this helps Flavor :-)

	- SMALL NOTE: A lot of commercial roms exploit a known memory hole in the
	emulator and can corrupt the internal settings. This means that the path,
	zoom and control settings will be forgotten. Sorry about this, but it's not
	a huge problem and simply comes about from incomplete emulation. (This problem
	has existed since v0.111 so it's not really a new thing, it's just that with
	more roms getting further into their execution, there are more that can
	corrupt the settings). I have tried to list all of the roms that cause
	this problem in the compatibility list, but I may have missed some.
	
	I you find a rom that isn't mentioned in the compitability list as
	corrupting settings, then please e-mail me and i'll amend the list for
	the next version.
	
	- A lot of greyed out menu options have been included, these will be enabled
	as the features are added - I have no idea of when though. My focus is on
	compatibility features just now.


v0.112
	- Improved the multiply and divide instructions - fixing the card games!
	Theives and Solitaire now seem to work perfectly.

	- Fixed a stupid bug in the sprite palette lookup. Palettes should now be
	correct.

	- Memory viewer for the debugger, completing functionality in this
	area. Hope all the homebrew coders find this useful.

	- Many bug fixes and some optimisations!


v0.111
	- Fixed a few instructions and got 'Snake v1.2' to work.

	- I've extended automatic address entering to work with disassembled 
	and stepped code in the top debugger window.

	- Emulation settings are stored in the registry. This includes the last
	load path, zoom setting and control configuration.

	- Zipped roms supported.

	- Incompatible roms don't cause any error messages if they fail. If you
	want to see what's going on - load a rom with the debugger open.


v0.110
	- Correct font emulation. Text based roms all look a lot better now.

	- Included a rough compatibility list, as a guide only. Still no
	commercial roms yet.

	- Can now Unload rom.

	- Added an auto disassemble window at the bottom of the debugger.
	It starts at the current instruction, and can point at a breakpoint.
	Clicking on an item in the list fills in the address box.

	- Code tidying and general clean up. Fixed a few little bugs along the way.


v0.104
	- Debugger, with breakpoints, register view, disassembly and stepping.

	- Fixed a few memory leaks and bugs.


v0.103
	- Improvements to the graphics core, fixed sprite colours (mostly).


v0.102
	- Added support for keyboard input.


v0.101
	- Better graphics register emulation has made more roms work
	- Quick fix for black sprites - they are now drawn with random colours
	I'll definately be looking into fixing these properly.
	
	These roms now do something:

	Maze Demo (V1.00) by Jeff Siebold (PD).ngp
	Mersenne Twister Random Number Generator (PD) - Bad font and wrong values
	Squall (PD)
	Starfield Array Test by Roger Bacon (PD)
	TPaint (PD)
	Unnamed Jumpy Platform Game by Roger Bacon (04-18-2001) (PD)
	Unnamed Jumpy Platform Game by Roger Bacon (06-06-2001) (PD)

	(I'll be adding a full compatability list to the web-site eventually)


v0.1
	- Only runs a very small number of PD roms - no commercial titles
	- No Sound or any other nice features, only Joystick Input (no keyboard) 
	- Very basic Graphics emulation
	- Controller settings are not saved
	- Timing is way off

	I recommend these few roms as ones that work best:
		Hello World! (NEO Clock) (PD) - But it has a bad font!
		Neo Centipede by Roger Bacon (PD)
		Lights! by Roger Bacon (PD)


---------------------------------------------------------------------------
System Requirements
---------------------------------------------------------------------------

- Windows 95/98/ME/2000/XP or compatible

- DirectX v8.0 or higher

- Display that runs in 16 or 32-bit colour.


---------------------------------------------------------------------------
Acknowledgments
---------------------------------------------------------------------------

- SNK for making a great handheld, sadly ignored in the UK, and for
    general specifications of the unit.

- Toshiba for making the slightly (VERY) unfriendly TLCS-900h, but at
	least providing easily obtainable technical documentation.

- NeoPocott team for NGPC technical specifications which helped guide
	my early progress.

- NeoGeoPocket Dev'rs (http://www.devrs.com/ngp) for providing me with
	links to various homebrew games and code that have been very useful.

- Jeff Frohwein for writing the 'hardware.inc' and 'system.inc' files
    which continue to help a great deal.
    
- Roger Bacon, Ivan Mackintosh, Tomasz Slanina and all of the other PD
    authors who provide source code with their games. It is very helpful
    to read while trying to work out what's going wrong with my code!

- Richard Mitton for his RAZE z80 emulator. 
	No longer used as it's platform dependent, but very good.

- Flavor for helping out with many good ideas.

- Judge for providing a CPU tester.

- zLIB for allowing zipped rom support.
	Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler

- www.emuxhaven.net for hosting NeoPop and providing a message board.
	- and thanks to all the people who have posted on the forum with
	positive comments and suggestions.

- Ivan Mackintosh for help with sound emulation.

- Fuz for helping me with various things, and writing a lot of complex
	homebrew roms to test.

- Marat Fayzullin for his z80 emulator.
	Copyright (C) Marat Fayzullin 1994-2002  

---------------------------------------------------------------------------
