R.O.M. v2.6 USER'S DOCUMENTATION ================================= 18/05/1994 The HALF-BRAINS TEAM presents ROM version 2.6 updated as usual by DDT. This version is Public-Domain and can be copied and spreaded. Enjoy ! WHAT'S 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 an 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 120K of SEKA-Source that makes up 36K 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 com- mands won't work (that does not mean "crash"). If you want to allocate the ROM code from 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 this new release 2.6, ROM has completely new autoalloc routine that avoids many crashes because it uses also the AllocMem() system call. It behaves this way: 1: Call AllocMem() requesting FastMem and Reverse_Mode (Reverse_mode will work only with kick 2.0 or greater; it tries to allocate ROM from the highest FastMem address). If success then go to step 4.. 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. 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. 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 is on) JoyUp = Increase system speed (if SLOW mode is 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, expe- cially 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 dama- ge 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 (see the following command description). INSIDE R.O.M. ============= When you enter ROM some informations are displayed, then the "ROM>" prompt appears. ROM uses DDT's smooth ultrapleasant font. Press the key to display the commands_menu. Keep 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 2000*2-A8" is like typing "RIP 67 3F58". Bases are defined this way: [$]hex, !dec, %bin. > 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 incre- ase 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 program. 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 specified 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 breakpoint list if no address is specified. > BR [addr | ALL] : Remove breakpoint previously set at specified address. Or, if you type "ALL" instead of the address, all breaks will be removed. > RIP beg end: Search for a soundtracker/noisetracker module in the specified memory range. If the ripper finds a song you can try to play it with the NoiseTracker1.2_replay routine. > 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 AND EXERCISES" paragraph for a concrete use 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 re- fer 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 dis- plays the last ShowMem screen. > FC beg end : Find a CopperList in the specified memory range. If a Copper- List is found you can view it (using $DFF084) or fix and use it (using $DFF080). REMEMBER: Routines have yet some bugs ! > RL : At last you can get a description of the hardware registers any time. REMEMBER: Keep CTRL pressed to stop scrolling. (We call it "RegList"). > 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 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 prin- ted. 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 AND 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 "). 3.A) If no JMP is found the intro is very troublesome. If you aren't a good coder, activate the trace mode ("TON "), 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. Let's say now that you want to RIP a module from an intro or a game. Penetrate the intro as described before and enter the ROM. Type now: RIP 0 80000 That starts the Ripper that will search for a module between the specified memory range. If it finds a module press "P" to play it (press the Right Mouse Button to stop). If it wasn't the right module search further pressing "S"... If it was the right module write down the starting location and the lenght. If you think that resetting the machine the module will be damaged then copy the module into a FastMem location (If you have got other FastMem than that at $c00000 (fake fastmem) remember to use the former !!!). Now type: RESET The Amiga will be resetted. Now load a monitor or the SEKA and save the range of memory where the module should be. REMEMBER: Some modules are modified not to be ripped. REMEMBER: Some songs are not ST/NT modules. The Ripper doesn't work with Startrekker/Protracker-modules yet. It doesn't work with strange or old versions of the ST. 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. BUGS ==== 1) ROM is allergic to WorkBench. 2) 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. 3) Joystick can't be obviously used normally. But it's not a true bug: DDT's ROM version 1.2 needed the RMB pressed to activate joystick's ROM funcs 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 ? 4) 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. 5) Argh ! With ECS machines the ShowMem's address number display will show much trash under the number. That's due to a lame sprite routine by Pitagora. 6) CapsLockLedBLink routine doesn't work with all Amiga models. 7) 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. 8) Maybe the routine that makes ROM resident at reset won't work on all machines. FUTURE VERSIONS =============== We are working for a new ROM version; soon on your ROM screens: 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) Ripper will find Startrekker and Protracker modules too. 6) Realtime ShowMem. 7) Printer support 8) Support for 3rd mouse button README ====== 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. We are searching for someone who can help us to make a Cartridge_R.O.M. We hope that ROM will help you above all when debugging your C programs (Bleeurgh @*# !!!) or your 680x0 code (K0000000L !!!). If you find any considerable bug write to: DDT (D.Paccaloni), via Agadir 10/A 20097 S.Donato Milanese (MI) ITALY Or contact me in the HBT WHQ: ____________/\_______ __ ---/\ _________ ____ ---\ __ _/\__/ /____/ // //\ -/ // /_ _ //_ / -- \// // \/ / ____\/ \// \/ / \/ / / \/_ / / Amiga 3000T - / // /\ / / __/ /\ / /\ //\ / / / _/ \/ 1 GByte HD -- /\/ // / / / / / / // / / // / / / / /_/\_ 4 Nodes (5th private) -- /_____// \/ \/ --\// / \/ \/ \/ \_____/ --\/[SP] -- \/_______ ____ ______ --/\ _____ -- \__/\_ \/\\__ \\____/\ /\ /\/ \ /\\_ / 1200 to 16800 HST-DS --- / / \ \/__/ /___ / // \/ /\ \ / /__\/ Programmers BBS - / / / // __// _/ \// /\ \/\/ \ \\/__ \ ~~~~~~~~~~~~~~~ -- / /__/ / \ \_/ /_/\ / /_/\ \_____\ \__/ / Sysop:SHARK - \/____/ \__\_____\\____/\_______\/___/ __ __ __ __ ___ __ |__| | ||\ ||_ |__ |__ \_/|__ | |_ |\/| | |__ || \||__ __| __| / __| | |__ | | __ __ __ __ ___ __ |__| /\ | |_ __ |_/|_/ /\ ||\ ||__ | |_ /\ |\/| | |/~~\|__| |_\| \/~~\|| \| __| | |__/~~\| | __ __ _ __ _ __ __ ___ __ __ __ | || ||_/| | \ |__||_ /\ | \ | || | /\ |_/ | |_ |_/|__ |/\||__|| \|__|__| | ||__/~~\|__||_\||__|/~~\| \ | |__| \ __| +39-2-58105803 : 4 Nodes Roll Over LATEST PUBLIC DOMAIN AND DEMOS Assembler / C / Rexx / Music / Images Conferences and ONLINE HELP FOR CODERS !