home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / alt / sys / amiga / demos / 1959 < prev    next >
Encoding:
Internet Message Format  |  1992-12-12  |  3.4 KB

  1. Path: sparky!uunet!enterpoop.mit.edu!snorkelwacker.mit.edu!ai-lab!hal.gnu.ai.mit.edu!psteffn
  2. From: psteffn@hal.gnu.ai.mit.edu (Paul Steffen)
  3. Newsgroups: alt.sys.amiga.demos
  4. Subject: Amiga Action Replay in Software
  5. Date: 12 Dec 1992 08:30:16 GMT
  6. Organization: /etc/organization
  7. Lines: 133
  8. Message-ID: <1gc7uoINN1j0@life.ai.mit.edu>
  9. NNTP-Posting-Host: hal.gnu.ai.mit.edu
  10.  
  11. Newsgroups: alt.sys.amiga.demos
  12. Subject: Action Replay emulator?  (src)
  13. Summary: 
  14. Expires: 
  15. Sender: 
  16. Followup-To: 
  17. Distribution: Tibetan Peach Pie Inc.
  18. Organization: /etc/organization
  19. Keywords: 
  20.  
  21.  
  22. It's been a long time since I read alt.sys.amiga.demos!  Anyway,
  23. I noticed some mention of utilizing the 68010 relocatable vector table
  24. capability as a 'software Amiga Replay'to break most games and demos.
  25. I've been using this trick to display system info (i.e. dma channels,
  26. exception vectors, etc) in real-time on a terminal connected to the
  27. Amiga via RS232.
  28.  
  29. Here's some tacky source that I wrote some time ago.  I cleaned it up
  30. a bit and added comments where necessary.  Modify VECTOR to point to
  31. high fast mem for your system (if necessary), assemble and execute.
  32. The computer should pause whenever both the left mouse and fire buttons
  33. are pressed, even in just about all Amiga demos with the exception of
  34. few '010+ aware ones like Cube-O-Matic.
  35.  
  36. The original version I wrote was MUCH smaller because it only used a
  37. single exception handler and used the unused upper 8-bits of the '10
  38. program counter to store exception number.  This version is an untested
  39. but I'm assuming this will run on an 68020-68040 with cache off and
  40. initial VBR at 0 (which should NEVER be a problem under AmigaDOS).
  41.  
  42. Watch out for the "Americans Can't Code" demo by TPPi.  d:^)
  43.  
  44. Happy gurus!
  45.  
  46.  
  47. *    VBR-base handler generator!  by STratoHAK/TPPi
  48. *    Paul Steffen/psteffn@gnu.ai.mit.edu/4086332274
  49. *       9/5/92
  50. *
  51. *    
  52. *  monitor =  0 to just halt / 1 to jmp to adrs in monitor_entry
  53. *  monitor_entry = entry for monitor/debugger
  54. *  vectors = new vector base + irq handlers {very top of FAST mem is best}
  55.  
  56. vectors = $3b0000
  57. monitor = 0
  58. monitor_entry = $3e0008
  59.  
  60.     lea    check_user(pc),a0
  61.     lea    vectors,a1
  62.     move.l    #irq_e-interrupt_handler,d0
  63.     lsl.w    #8,d0
  64.     add.l    #1024,d0
  65.     add.l    d0,a1
  66.     lea    chk_e(pc),a2
  67. copy_subrout
  68.     move.w    (a0)+,(a1)+
  69.     cmp.l    a0,a2
  70.     bne.s    copy_subrout
  71.  
  72.     lea    vectors,a1    ; interrupt vector table
  73.     lea    256*4(a1),a2    ; interrupt handlers
  74.     lea    irq_e(pc),a4
  75.     moveq    #0,d0
  76.     
  77. build_irq_table    
  78.  
  79.  
  80.     lea    interrupt_handler(pc),a0
  81.     move.l    a2,(a1)+
  82.  
  83.     move.w    d0,relocat-interrupt_handler+2(a0)
  84.     lea    relocat-interrupt_handler+10(a2),a3
  85.     move.l    a3,relocat-interrupt_handler+4(a0)
  86. make_irq
  87.     move.w    (a0)+,(a2)+
  88.     cmp.l    a0,a4
  89.     bne.s    make_irq
  90.     addq.w    #4,d0
  91.     cmp.w    #1024,d0
  92.     bne.s    build_irq_table
  93.  
  94.     lea    set_vbr(pc),a0    ; set vector base register
  95.     move.l    a0,$80.w
  96.     trap    #0
  97.     clr.l    d0
  98.     rts
  99.  
  100. *    Actual IRQ interception handler...
  101. *    (odd, but no register usage)
  102.  
  103. interrupt_handler
  104. *
  105. * anything can go here but to save space, JSR
  106. *
  107.     jsr    check_user
  108. relocat    move.l    0.w,0.l        ; modify following opcode
  109.     jmp    0.l
  110. irq_e
  111.  
  112. *    Test left mousebutton/joystick 1 fire for press & release
  113.  
  114. check_user
  115.     btst    #6,$bfe001
  116.     bne.s    no_button
  117.     btst    #7,$bfe001
  118.     bne.s    no_button
  119. depress    btst    #6,$bfe001
  120.     beq.s    depress
  121.     btst    #7,$bfe001
  122.     beq.s    depress
  123.  
  124.     ifne    monitor
  125.     jsr    monitor_entry
  126.     endif
  127.  
  128. no_button
  129.     rts
  130.  
  131. set_vbr    lea    vectors,a0
  132.     dc.l    $4e7b8801    * movec a0,vbr *
  133.     rte
  134.  
  135. reset_vbr
  136.     sub.l    a0,a0
  137.     dc.l    $4e7b8801    * movec a0,vbr *
  138.     rte    
  139. chk_e
  140.  
  141. ----------------------------------------------------------------------
  142.  
  143.  
  144.