		R.O.M. (Resident Outrageous Monitor) v2.7
		=========================================


The HALF-BRAINS TEAM presents ROM version 2.7 updated as usual by DDT.


- IMPORTANT NOTICE - IMPORTANT NOTICE - IMPORTANT NOTICE - IMPORTANT NOTICE -

This version is PUBLIC-DOMAIN  and can be copied and spreaded, enjoy !
However it must be spreaded with its full documentation and can NOT be
changed, modified, or sold to gain money without the authors written
permission.




WHAT IS ROM ?
=============

R.O.M. stands for Resident Outrageous Monitor, that's more than a normal
Monitor cause it has been expecially designed for total system control.
However almost any kind of programmer can use it: it's a tool for all good
coders, C-Programmers, curious people and, inevitably, filthy lamers.
It may be called "the poors' cartridge" cause it remains resident in
memory, until a Hard-Reset is performed or its code is trashed (of course
it's not a real cartridge, since it's only a software prog).

REMEMBER: in most cases normal resets do nothing to ROM.

ROM has about 115K of Asm-Source that makes up 34K of executable code; mem
used by ROM is allocated, but, if you have FastMem you can load it and then
kill the fastmem expansion. That will make ROM invisible to many programs.
REMEMBER: ROM prefers to run on machines with more than 512K, cause if you
have only this amount of memory many intros and games will load or decrunch
over the ROM code !!!
You must always remember that ROM is allergic to WorkBench, in future we'll
fix this bug (but why should you use the WB ?).
You can install ROM simply loading the file "ROM" from the CLI.     It will
display some messages, then your CLI task will be free again.
There are special commands for extended CPUs such as 68010, 68020, 68030
and 68040; you can obviously use ROM with a shitty 68000 but these special
commands won't work (that does not mean "crash").



HOW DO I INSTALL IT ?
=====================

You just need the ROM executable file to use ROM. Copy it in your favourite
directory.

To run it just call the ROM executable file !

If you want to allocate the ROM code at a specific memory address, just
type it in HEX after the ROM filename; example:

  ROM $c50000

or simply

  ROM c50000

Instead, if you want ROM to choose itself the best address were to be allo-
cated, just type:

  ROM

without any address; ROM will autoallocate.

REMEMBER: Since the release 2.6, ROM has completely new autoalloc
	routine	that avoids many crashes because it uses also Exec's
	AllocMem() system call.
	It behaves this way:
	1: Call AllocMem() requesting FastMem and Reverse_Mode (Rev_Mode
	   will work only with kick 2.0 or greater and tries to allocate
	   ROM from the highest FastMem address). If success then go to
	   step 5..
	2: Hardware check for ECS Agnus. If success then set ROM at address
	   $F0000; go to step 4..
	3: Only 512k of ChipMem disposable; set ROM near $6C000
	4: Try to system-allocate memory where ROM have been set.
	5: Run ROM initial setup and return to CLI.

REMEMBER: In the remote case that ROM fails to alloc itself or crashes your
	machine, you'd better specify the memory address where to alloc ROM
	as described above.




HOW DO I USE IT ?
=================

REMEMBER: To use ROM you NEED a JOYSTICK !!!

When ROM is installed you have the following capabilities:

   JoyLeft			=  Freeze system
   JoyLeft + JoyFire		=  Enter ROM gently (Try to)
   JoyLeft + JoyFire + LMB 	=  Enter ROM badly  (Forced to)
   JoyDown			=  Decrease system speed (if SLOW mode ON)
   JoyUp			=  Increase system speed (if SLOW mode ON)

REMEMBER: LMB stands for Left Mouse Button.
To freeze the system just keep the joystick pressed to left.
The "gentle entry" is used not to interfere with the Operating System,
expecially when disk operations are in execution.
While loading you can enter the ROM using the "gentle entry": ROM will
flash the background color while system interferences may occurr; at the
right moment you will enter the ROM.
ATTENTION: as a precautionary measure don't enter ROM while drive is saving
	or reading important files on an important disk.
The "bad entry" is used when you want to enter ROM, no matter what the ope-
rating system will say.  In this case remember that a bad entry while a
disk operation is in execution will (almost surely) crash the system when
you exit ROM and return to system.
If no drive operations are in execution, using the bad entry should not
damage the system and sometimes the bad entry is a must.
Since version 2.51 ROM has a Software-Entry; if you need to force ROM via
Software, just JMP from your prog to the address shown by the "I" command.




MONITOR COMMANDS
================

  When you enter ROM some informations are displayed, then the "ROM>" prompt
appears.  ROM uses DDT's smooth ultrapleasant font.
Press the <HELP> key to display the commands_menu.
Keep <CTRL> pressed to freeze scrolling.

Commands description:
REMEMBER: arguments in square-brackets are optional.
REMEMBER: if the argument is a number you can use an expression.
	Example:   "RIP 5A+%1101"  is like typing  "RIP 67".
	Bases are defined this way: [$]hex, !dec, %bin.


				COMMANDS LIST


> M [addr] : Display the value of 256 bytes starting from addr (in hex and
	ascii format).

> D [addr] : Disassemble 16 instructions starting from addr.

> ? expr : Print the value of the expression in HEX, DEC, and BIN format.

> ! : Exit and destroy ROM (ROM will be definitively discarded.).

> X : Exit from ROM (and set the defined breakpoints).

> R [reg value] : Change the content of the specified register or display
	the registers content if no arguments are given.

> J [addr] : Jump to the subroutine at the specified address (JSR addr).

> G addr : Jump to the specified address (JMP addr).

> SM [addr] : Enter in ShowMem mode to display graphically the content of
	the ChipMem at the specified address.
	Move through ChipMem with the mouse, press the right button to
	increase the scroll speed (horizontal movements will be disabled).
	Press:
		"ESC" = escape from ShowMem
		"H" = switch hires/lores
		"<" and ">" = increase or decrease modulo quickly
		RAmiga and RAlt = increase or decrease modulo step by step
		Cursor Keys = smooth movements
		"HELP" = execute the next instruction of the current prog.
			Keep it pressed if you want to see how the program
			works in memory (program execution is very slow).
			REMEMBER: Interrupts aren't executed.

> W [addr] : Single-Step execution of program starting from current PC or
	specified address. (We call it "Walk").

> S : Skip the next instruction.

> RT addr tn n : Read n tracks starting from track tn at addres addr.
	The drive is always df0:.

> F startaddr endaddr byte[,byte,...] : Fill memory range with the speci-
	fied data.  You can also use strings.
	Example:	F 70000 7A000 'Ciao',!32,'mamma !!'

> C begin end dest : Copy memory range to dest.

> RESET : Try to reset system without clearing memory (no hard-reset)

> I : Gives some infos on hardware, interrupts, registers and ROM's
	SoftwareEntry.

> : addr byte[,byte,...] : Modify memory. Arguments are the same as in the
	Fill instruction.

> B [addr]: Set breakpoint at specified address or display current break-
	point list if no address is specified (max 8 breakpoints).
	REMEMBER: If you notice problems with a 030 or 040 CPU try disa-
	bling the data cache.

> BR [addr | ALL] : Remove breakpoint previously set at specified address.
	Or, if you type "ALL" instead of the address, all breaks will be
	removed.

> TON : Trace mode on.  This is a VERY IMPORTANT COMMAND.  If trace mode is
	on, every instruction is checked to make sure it won't kill the in-
	terrupt requests and, in consequence, deactivate ROM.
	Read the Tricks & Exercises paragraph for a concrete example on the
	usage of TON.
	REMEMBER: When in trace mode the system runs many times slower than
	normally.  Only interrupts runs at normal speed.
	REMEMBER: Some programs are able to cheat the trace mode. So if you
	are a good coder you should help ROM nopping or replacing critical
	instructions. However some of them (expecially games) are too stro-
	ng. (If you have an extended CPU you can try to change the VBR with
	the "VBR" command).

> TOF : Trace mode off.

> BYE : Exit from ROM (without setting the breakpoints).

> NOP addr [n] : Nopper.  Put one or n NOP_instructions starting from addr.
	Useful if you don't want to execute some instruction of a program.
	REMEMBER: Previous instructions are definitively lost.
	REMEMBER: Every NOP instruction is 2 bytes long.

> AF beg end addr : Find in the specified range all the instrucions that
	refer explicitly to the specified address.

> P addr lenght period : Play memory starting from addr for the specified
	lenght with the specified period  (Loop on).

> H startaddr endaddr byte[,byte,...] : Search in memory for the specified
	data. (See the Fill instruction for the arguments description).
	(We call it "Hunt").

> VER : Display version of ROM, Chuk, and DisAsm.

> TIME : Display the time passed since you entered ROM.

> SC addr : Use Copperlist at specified address.

> FSM addr : Fix (at the specified addr) and use a mini_CopperList that
	displays the last ShowMem screen.

> FC beg end : Find a Copperlist in the specified memory range.
	If a copperlist is found you can view it (using $DFF084) or fix
	and use it (ROM will strobe using $DFF080).
	REMEMBER: Routines have yet some bugs !

> RL :	You can get a description of the hardware registers any time.
	REMEMBER: Keep CTRL pressed to stop scrolling.
	REMEMBER: It does not support the new chip registers like in AGA !

> SLOW [n | OFF] : Activate the Slow_Motion making a delay every n cycles
	or deactivate it if you type "OFF" instead of the cycles number.
	REMEMBER: When the Slow_Motion is active you can anytime, out of
	ROM, increase or decrease the system speed with Joystick_Up or
	Joystick_Down.
	REMEMBER: SLOW slows down also interrupts.

> HJ :	Search for the nearest JMP instruction close to the current PC.
	Useful to put the correct breakpoint after a decrunch_routine.
	(We call it "HuntJump").
	REMEMBER: Works with almost all the decrunch_routines.

> PAL col0 col1 : Change the ROM screen color (pal0 for background; pal1
	for foreground).

> VBR addr : Change the VectorBaseRegister and copy the Vector_Table.
	Useful if a nasty program loads over the Vector_Table.
	REMEMBER: This commands works only with extended CPUs.

> PEV : Patch exception vectors so that if a system error occurs you will
	enter the ROM and try to debug the prog. (No more guru).
	When an error occurs the CapsLock-LED will blink a few times, then
	the ROM will autoactivate.
	That's called "ROM meditation". Sometimes the instruction that
	caused the error won't be executed and you have to "NOP" it or to
	change the instruction (using the ":" command) before leaving ROM
	to return to system.

> WON <addr | PC> bplane bpmod : Activate the realtime longword watcher.
	You will be able to see the content of an address or the current PC
	while your program is running.
	Bplane is the address of the bitplane where the addr/PC will be
	printed.  Bpmod is the modulo of the bitplane.
	Example:	"WON 54000 70000 !40" shows the content of address
	  $54000 printing it in the bitplane (LowRes) at $70000, modulo 40
	  (320/8=40).
	Example:	"WON PC 70000 !40" show the content of the PC prin-
	ting it in the bitplane (HiRes) at $70000, modulo 80 (640/8=80)

> WOF : Disable realtime longword watcher.

> FIL : Switch the audio filter (ON/OFF).


REMEMBER: Pressing RETURN without typing any command repeats the previous
	one.



TRICKS & EXERCISES
==================

Normal software, some intros and some simple games can be penetrated without
using the trace mode.  This operation is very simple and doesn't require spe-
cial tricks.  (You can try with "Marble Madness").
Then here we'll treat only about programs that are wicked...

REMEMBER: If you have only 512Kb of memory it will be very difficult or sim-
	ply impossible to penetrate some intros or games.

Let's say you want to penetrate into an intro using the ROM.
You can reset your machine, activate the trace mode, load the intro and wait
for some minutes while the intro decrunches. Then you should see the intro
going slower.  So enter the ROM and disassemble or do what you want.
  But you'd better:

	0) Reset the machine.
	1) Load the intro.
	2) Enter ROM while the nasty intro is decrunching (usually when many
		color lines appears on the screen).
	3) Use the HJ command (just type "HJ <RETURN>").
	3.A) If no JMP is found the intro is very troublesome. If you aren't
		a good coder, activate the trace mode ("TON <RETURN>"), exit
		from ROM and wait until the whole intro have been decrun-
		ched (some minutes...) then go to step 6...
		Instead, if you are a good coder you'll understand what to
		do (Haha !).
		See now step 5...
	3.B) If a JMP is found, set a breakpoint to the reported JMP address,
		then exit from ROM.
	4) If all's right when the decrunching is completed you will automa-
		tically enter ROM...  Activate the Trace Mode and exit.
	5) The intro should work (slowly but should work).  If nothing hap-
		pens it's maybe cause the intro is making some setups so wait
		for a minute. If nothing happens enter the ROM and turn off
		the trace mode, then exit.  If nothing happens you should be
		an expert to understand what's the matter.
	6) Once penetrated, try to turn off the trace mode because many in-
		tros will not deactivate ROM now.  But if ROM is deactiva-
		ted you must keep the trace mode on.

REMEMBER: A few intros (and a few games) do not have a CopperList but write
	directly into the hardregs.    Some of them do that only one time,
	during the setup.
	So if you enter the ROM and then exit it you will loose the old vals
	in the hardregs cause they aren't restored; that causes the current
	image to be lost. (Many times you'll see only a "Crazy DMA" effect).
	Don't worry, re-enter the ROM and use the ShowMem to find what you
	want to be displayed; then use the "FSM" command.




VERSION 2.0 UPDATES
===================

1) Chuk (that is the ROM core, handles all interrupts, exceptions, tracing
   and is the "master of the system") have been strenghtened.
2) Some ShowMem bugs fixed, now it should detect if you have 1MB of ChipRAM.
   In addition you can decide the starting address using the command:
   "SM addr".
3) The single-step command of the ShowMem have been debugged.
4) The Ripper have been improved and can now play the module it finds.
5) Added the "FC" command to search for CopperLists.
6) Added the "SC" command to set a CopperList starting from a specified addr.
7) Added the "HJ" command to search for the nearer JMP instruction (useful
   to set quickly the right breakpoint in decrunch-routines).
8) Added the "FSM" command to display the ShowMem current screen also when
   out of ROM.
9) Added the "SLOW" command to slow down the system at a decided speed.
A) Added the "RL" command to show the hardware registers description.
B) The "H" (hunt) command now works properly and better (see descriprion
   above).
C) Now you can exit from the ROM pressing the LMB (in case the keyboard is
   freezed).
D) Added the "PAL" command to modify the ROM-screen palette.
E) The WHO command displays a never-boring (?!) message with greetings and
   fuckings.
F) New ROM_colorpalette (Bleuuurgh !).


VERSION 2.51 UPDATES
====================
1) Extended CPUs supported.
2) New commands "WON","WOF","VBR","PEV".
3) Error handler with ROM_Meditation (with blinking capslock !!!!  We are the
   only people capable of doing that, thanx to Pitagora !!!!).
4) Special Software-Entry to activate ROM via software too.
5) New ROM_colorpalette (Ah yeaah !).
6) Keyboard handler works also with the old Amiga 2000a  (Anche sul tuo, Da-
   rio, HAHHHA !!)
7) DisAsm disassembles also some extended CPUs opcodes.


VERSION 2.6 UPDATES
===================
1) You can now use ROM even if your kickstart is not located in the usual
   space $f80000 to $ffffff (compatible with Rekick, ZKick and some new
   Amiga models).
   REMEMBER: That implies that ROM won't check if it's already active;
             If you try to install ROM two times then... blame on you !
2) No more emergency-exit from ROM only pressing the left mouse button:
   you have to press also the right mouse button. (That's to fix a nasty bug
   that caused the exit from ROM when you have just entered it with BadEntry
   mode).
3) Now the package includes the SYS64738 program that's useful if you
   have an hard disk and want to boot from a floppy disk but you must set
   some parameters (like trace mode) before booting starts.
   The SYS64738 will reset without booting from your harddrive... you will
   see the kickstart screen.
   (Not checked with all configurations).
4) ShowMem deeply debugged and improved:
   - Unsupported bugged alpha Fisho code for advanced copperlists handling
     removed.
   - DDFSTRT bug fixed.
   - Use cursor keys for accurate movements
   - New hardware check for 1Meg of chip mem.
5) Replaced the "." key with the "FIL" command to switch audio filter (the
   amiga 600 hasn't the numeric keypad).
6) Improved hardware keyboard handler (fast and exciting key response).
   Maybe it won't work with old keyboards (2000A) but I DONT CARE, OK ?!??
   I simply cant check the program on all machines ! Ask commodore to make
   compatible machines !!!  8^)
7) Hardware check and infoz on custom chips.
8) Infoz on the CPU (not yet hardware check, simply ask to system).
9) Autoalloc routine completely rewritten; now compatible with almost all
   amiga models and configurations.
A) Fixed a bug from previous release that sometimes caused the AllocMem()
   and/or FreeMem() of memory allocated by ROM to fail.
B) New colorpalette.


VERSION 2.7 UPDATES
===================
1) AGA compatibility: should run on most AGA machines.
2) MC68030 and MC68040 are detected (only with kickstart 2.0 or greater).
   If a 040 is found the instruction cache is disabled.
   Since the test is made using Exec's AttnFlags, if you have a kickstart
   version lower than 2.0 you will get a 68020+ CPU type evenif you have
   a 030 or 040.
   REMEMBER: in this case if you have a 040 you MUST disable the instruc-
             tion cache with other programs like "SetCPU" or similar.
3) Should be compatible on MC68040 (with instruction cache disabled) but I
   got problems on some A4000, try using the ECS instead of AGA if ROM will
   crash.
4) R.O.M. Disasm major update v2.00:
	o  Supports all new 68020+ addressing modes.
	o  Changed "xx(a0)" addressing mode to the official Motorola
	   "(xx,A0)".
	o  MOVEC instructions disassembly supports all new control regs
	   up to MC68040.
	o  Added some new 68020+ instructions:
		- LINK.l
		- CHK.l
		- CALLM, RTM
		- PACK, UNPK
		- MOVE CCR,<ea>
	o  If an instructions is longer than 5 words then its hex dump
	   will show a "+" after the 5th word.
	o  Minor fixes
5) Patched also FORMAT ERROR, FPU ERROR, MMU ERROR exceptions.
6) Breakpoints are no more implemented with the ILLEGAL code but using the
   proper "BKPT #n" instruction.
   It allows 8 different breakpoints and acts differently depending on the
   CPU type:
	o MC68000: Take a normal ILLEGAL instruction exception.
	o MC68010: Run breakpoint acknowledge cycle with function codes
		driven high and zeros on all address lines.
		take an ILLEGAL instruction exception.
	o MC68020,MC68030,CPU32: Run breakpoint acknowledge cycle with the
		immediate data (bkpoint number) on bits 2-4 of the address
		bus and zeros on bits 0-1.
		If the external hardware terminates the cycle with DSACKx
		or STERM, the data on the bus (instruction word) is inser-
		ted onto the instruction pipe and is executed after the
		BKPT instruction. Instead, if the external hardware termi-
		nates the breakpoint cycle with BERR the processor takes an
		ILLEGAL instruction exception.
	o MC68040: Run Breakpoint aknowledge cycle, then take an ILLEGAL
		instruction exception.
   The number of breakpoints has been reduced to 8 instead of the previous
   80 (Have you ever used more than 2 ?).
   A nasty bug that caused R.O.M. to crash when quitting with some bkpts set
   was smashed !
7) RIP command removed (for it was old and seldom used), therefore I gained
   2 KBytes on executable R.O.M. lenght.
8) Now also CACR and CAAR registers (68020+) are shown.
9) Now when disassembling or dumping memory you can just press <RETURN> to
   go on.
A) Source ported to ASMONE v1.16+... No more bugged MASTERSEKAs !
B) The pakage includes also the "ROM.guide" hypertext file for all AmigaGu-
   ide fans !
C) Changed a 3 years old hidden text. (Yup!)
D) There is at least another feature I added but I cant remember... [grin].



BUGS
====

Since I own a normal Amiga 2000 with MC68000 I simply cant fix most bugs
dued to strange hardware configurations (include AGA machines)... Further-
more I am very lazy so here we go:

0) ROM is allergic to WorkBench.
1) I couldn't get ROM to work with some Amiga 4000/040, although it
   should work with an A2000/A3000 with a 040 CPU. Sorry but I have no
   A4000/040 to fix it.
2) Some problems may be caused by the "SetPatch" program. If you cant get
   ROM working, try booting without executing "SetPatch". Better try booting
   without startup-sequence.
3) If you find a CopperList with the FC command, then fix it, then exit from
   ROM and re-enter it and use again the FC command, when you try to view
   the CopperList found sometimes you get the old fixed CopperList.
4) Joystick can't be obviously used normally.  But it's not a true bug:
   My own ROM version 1.2 needed the RMB pressed to activate joystick's ROM
   functions but you had to be a polyp to use it.
   That's why you can't play some games while ROM v2.5 is installed but...
   do you need to ? Are you yet playing games like a child ?? I am ! :-)
5) If you have 2Megs of ChipMem you can watch it with the ShowMem but the
   address number display will reset if you go past the 1st MegaByte.
6) Argh ! On ECS/AGA machines the ShowMem's address number display will show
   much trash under the number. That's due to a lame sprite routine by
   Pitagora.
7) CapsLockLedBLink routine doesn't work with all Amiga models.
8) On some powerful CPUs the routine that checks if the current program is
   in Kickstart_ROM fails. That means you will ever enter the ROM with the
   gently_entry or ever enter the ROM -only- with bad_entry (See above...).
   That should be a cache memory problem.
9) Maybe the routine that makes ROM resident at reset won't work on all
   machines.
A) The disassembler shows always absolute values
   (i.e.   JMP -2(a6)    =    JMP $fffe(A6))
B) The find copperlist routine MAY not work with some AGA copperlists.
C) With 030 or 040 CPUs the data cache should be disabled when entering ROM
   or there can be problems with breakpoints (this will be fixed in the next
   release). Thus if you notice problems try disabling the data cache.




FUTURE RELEASES
===============

We are working for a new ROM version; soon on your ROM screens:
0) Probably the next versions will be only for MC68010 CPUs or greater omes.
1) The ROMASM (line assembler).
2) Full AmigaDOS support.
3) "SW" ShowWave command (that's a ShowMem for samples).
4) Commandline history and editing.
5) Realtime ShowMem.
6) Printer support.
7) Support for 3rd mouse button.
8) MMU support with memory protection.
9) Stack frames format implemented for improved debugging.
A) Extended disassembler for all MC680x0 and various coprocessors instruct-
   ions.
B) FPU support.
C) Extended Amiga character fonts.

We are also searching for someone who can help us to make a Cartridge_R.O.M.




RIVAL MONITORS
==============

ROM has many rivals:
* Intuition monitors (RossiMon, ROMwack, AMon, AmigaMonitor, etc.): they are
  useful but can't compete with the ROM as "no-system" features.
* Resident monitors (Romcrack and others): ROM is far better  8^) .
* SimBug : A very good monitor with direct assembler, DOS support, beautiful
  editor and many interesting commands.
  Yet it's good only for debugging normal progs. It's not resident and it
  hasn't savage, incredible, commands like ROM has to take control over the
  system.  With SimBug you can't enter into intros, games and demos and it
  hasn't a powerful trace mode.
* Cartridges monitors (Action Replay I to III): I owned one and found it
  very useful cause it penetrate almost any software, has full DOS support,
  has a pretty good (argh no mouse) grafix searcher... BUT....
  ...but it doesn't work with extended CPUs, (I had to throw away my dear
  68010, sigh !), it hasn't commands like "HJ","WON","J"(!!), etc.
  Please, Lord Olaf, make an Action Replay that does that.
* BeerMon : Nice but it has sum bugs.. and it requires additional hardware
  to be "Outrageous".




CONTACT ME
==========

Normal Mail:

		DDT (D.Paccaloni), via Agadir 10/A
		   20097 S.Donato Milanese (MI)
			       ITALY



EMail (Do not use if possible: I very seldom read it !):

		paccalon@ghost.dsi.unimi.it



BBS:			      DDT (CoSysop)
		  In "INFINITE DREAMS", +39-2-58105803
		----------------------------------------
		4 Nodes Roll Over, 1200 to 16800, HST DS
			 Amiga 3000T, 1GByte HD
                     LATEST PUBLIC DOMAIN AND DEMOS
                          Many conferences on:
              Assembler / C / Rexx / Music & MIDI / Images
                     Amiga,SNES,PC,C64 Public Domain
                   Official italian "K" magazine board
                And ONLINE HELP FOR AMIGA & SNES CODERS !
