home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 2: Collection B / 17Bit_Collection_B.iso / files / 2227a.dms / in.adf / SoftwareDebugging.s.pp / SoftwareDebugging.s
Encoding:
Text File  |  1978-01-01  |  32.7 KB  |  1,443 lines

  1. *******************************************************************************
  2. * Hardware Enviroment Framework v3.0c               Copyright © 1992 2-Cool/LSD
  3. * -----------------------------------               ---------------------------
  4. * Amiga Hardware Enviroment frame (OS friendly Shutdown, Recovery & Error
  5. * Protection, Version 3.0c)
  6. *
  7. * Routines are 100% PC-Relative & fully Compatible with ANY Kickstart ROM,
  8. * v1.2/1.3/2.04/3.0/etc.. Including all future releases. Do -NOT- distribute 
  9. * these routines without « GRAPEVINE » Magazine. All Rights are Reserved.
  10. *
  11. * When using this routine, please remember who wrote it!
  12. *******************************************************************************
  13.         section    framework,code_c    ; were using chipmemory
  14.         
  15.         movem.l    a0-a6/d0-d7,-(a7)    ; save old registers to stack
  16.         move.l    a7,d0            ; save stack (temp) to d0
  17.         bsr.b    take_sys        ; save Everthing & disable OS!
  18.         bsr.w    init_screen        ; initialise bplane ptrs.etc.
  19.  
  20.  
  21. ; the 'JMP' below should be removed for normal operation, this is just to show
  22. ; you what happens when a error occurs.
  23.  
  24. ;-CUT---CUT---CUT---CUT---CUT---CUT---CUT---CUT---CUT---CUT---CUT---CUT---CUT
  25.         JMP    1.W            ; CAUSE AN ADDRESS ERROR!
  26.                         ; TESTS DEBUGGER, Remove this
  27.                         ; line for normal operation!
  28. ;-CUT---CUT---CUT---CUT---CUT---CUT---CUT---CUT---CUT---CUT---CUT---CUT---CUT
  29.  
  30. *******************************************************************************
  31. * Main VBL wait 
  32. *******************************************************************************
  33.  
  34. MainLoop:    bsr.b    getvpos            ; get beam wait
  35.  
  36. ;        vbl routines go here
  37.  
  38.         btst.b    #6,$bfe001        ; check left mouse button
  39.         beq.w    Enable_Sys        ; it was pressed, so exit
  40.         bra.s    MainLoop        ; nope so get loopin!
  41.  
  42. *******************************************************************************
  43. * VerticleBlankLoop (VBL)
  44. *******************************************************************************
  45.  
  46. getvpos        move.l    $dff004.l,d7        ;check raster count (vposr)
  47.         and.l    #$1ff00,d7        ;for line 214
  48.         cmp.l    #$3000,d7        ;if not wait around
  49.         bne.s    getvpos
  50.         rts
  51.  
  52. ****************************************************************************
  53. * Lev 3 Interrupt Request ($6c.w)
  54. * -------------------------------
  55. * Only processes correct VBL interrupt, if no request is made, it skips
  56. * processsing of interrupt. Registers are Preserved & Restored on Entry/Exit
  57. ****************************************************************************
  58.  
  59. interrupt    movem.l    d0-d7/a0-a6,-(sp)    ; preserve registers
  60.         move.w    #$2300,sr
  61.         lea    $dff000,a6        ; hardware addr a6
  62.         move.w    intreqr(a6),d0         ; check which int occurred
  63.         and.w    #$20,d0            ; mask out all except vbl req
  64.         tst.w    d0            ; did one occur?
  65.         beq.b    no_request        ; nope, don`t call interrupt!
  66.  
  67. ;        routines go here
  68.  
  69.         move.w    #$20,$dff09c.l        ; clear vbl_request
  70. no_request    movem.l    (sp)+,d0-d7/a0-a6    ; restore registers
  71.         rte                ; exit interrupt
  72.  
  73. *******************************************************************************
  74. * Preserve OS System
  75. * ------------------
  76. * Saves all used system stuff, copperlists,dma,intena,etc & installs debugger
  77. * sound channel volumes are also reset to zero, all dma,etc are configurated.
  78. * Software reset detection removed, it wasn`t really that useful was it ?
  79. *******************************************************************************
  80.  
  81. Take_sys:    lea    Oldstack(pc),a0        ; ptr to stack buffer
  82.         move.l    d0,(a0)            ; save old stack ptr to buffer
  83.  
  84.         move.l    4.w,a6            ; get execbase
  85.         lea    GFXlib(pc),a1        ; point graphics.library name
  86.         jsr    -408(a6)        ; open graphics library
  87.         move.l     d0,a1            ; save gfxbase address
  88.         lea    SysCp1(pc),a0
  89.         move.l    $26(a1),(a0)+        ; restore old workbench copper
  90.         move.l    $32(a1),(a0)        ; restore old workbench copper
  91.         jsr    -414(a6)        ; close gfx library
  92.  
  93.         jsr    -132(a6)        ; forbid () multitasking off
  94.  
  95.         jsr    -150(a6)        ; goto superstate (OS Friendly)
  96.         lea    SysStack(pc),a0        ; save buffer for old ptr
  97.         move.l    d0,(a0)            ; save old system stack
  98.  
  99.         lea    $dff000.l,a5        ; customchip base address in a6
  100.         lea    DMAsave(pc),a0        ; save buffer
  101.         move.w    $2(a5),(a0)+        ; save old DMACONR
  102.         move.w    $1c(a5),(a0)+        ; save old INTENAR
  103.         move.w    $1e(a5),(a0)+        ; save old INTREQ
  104.         move.w    $10(a5),(a0)        ; save old ADKCON
  105.  
  106.         lea    exceptsav(pc),a0    ; ptr to exception save buffer
  107.         lea    $8.w,a1            ; ptr to first exception
  108.         moveq.l    #10-1,d0        ; no. to save
  109. exloop        move.l    (a1)+,(a0)+        ; save old exception ptrs
  110.         dbra    d0,exloop        ; keep on
  111.         move.l    $3c.w,(a0)+        ; uninitialised interrupt save
  112.         move.l    $60.w,(a0)        ; unjustified interrupt save
  113.  
  114.         lea    intersav(pc),a0        ; ptr to exception save buffer
  115.         lea    $64.w,a1        ; ptr to first exception
  116.         moveq.l    #6-1,d0            ; no. to save
  117. interloop    move.l    (a1)+,(a0)+        ; save old interrupt ptrs
  118.         dbra    d0,interloop        ; keep on
  119.  
  120. re_init        move.w    #$7fff,d0        ; kill value in d0
  121.         moveq    #0,d1
  122.         move.w    d0,dmacon(a5)        ; kill INTREQ:
  123.         move.w    d0,intreq(a5)        ; kill INTREQ:
  124.         move.w    d0,intena(a5)        ; kill INTENA:
  125.         move.w    d0,adkcon(a5)        ; kill ADKCON:
  126.         move.w    d1,aud0vol(a5)
  127.         move.w    d1,aud1vol(a5)
  128.         move.w    d1,aud2vol(a5)
  129.         move.w    d1,aud3vol(a5)        ; all sound channels off
  130.  
  131.         move.w    #$c040,intena(a5)    ; Setit:Master Int, enable vbl
  132.         move.w    #$8040,intreq(a5)
  133.         move.w  #$83ff,dmacon(a5)    ; Setit:Dsk/Spr/Cop/Blt/Bpl/Aud
  134.  
  135.  
  136. ; These lines below setup the Debugger...
  137.  
  138.         lea    $8.w,a1            ; ptr to fist exception
  139.         lea    BusErr(pc),a2        ; BusErr ptr to debug routines
  140.         move.l    a2,(a1)+        ; Install our exception+inc ptr
  141.         lea    AddrErr(pc),a2
  142.         move.l    a2,(a1)+
  143.         lea    IllegalErr(pc),a2
  144.         move.l    a2,(a1)+
  145.         lea    DivErr(pc),a2
  146.         move.l    a2,(a1)+
  147.         lea    ChkErr(pc),a2
  148.         move.l    a2,(a1)+
  149.         lea    TrapvErr(pc),a2
  150.         move.l    a2,(a1)+
  151.         lea    PrivErr(pc),a2
  152.         move.l    a2,(a1)+
  153.         lea    TraceErr(pc),a2
  154.         move.l    a2,(a1)+
  155.         lea    LineaErr(pc),a2
  156.         move.l    a2,(a1)+
  157.         lea    LinefErr(pc),a2
  158.         move.l    a2,(a1)+
  159.         lea    UnInitErr(pc),a2
  160.         move.l    a2,$3c.w        ; uninitialised int
  161.         lea    UnJustErr(pc),a2
  162.         move.l    a2,$60.w        ; unjustified int
  163.  
  164. ;
  165.  
  166.         lea    interwait(pc),a0    ; ptr to exception exit!
  167.         lea    $64.w,a1        ; ptr to first exception
  168.         moveq.l    #6-1,d0            ; no. to install
  169. intrloop    move.l    a0,(a1)+        ; install exception wait!
  170.         dbra    d0,intrloop        ; keep on
  171.  
  172.         lea    Interrupt(pc),a0    ; ptr to our new interrupt
  173.         move.l    a0,$6c.w        ; install level 3 interrupt
  174.         rts
  175.  
  176. *******************************************************************************
  177.  
  178. enable_sys    lea    intersav(pc),a1        ; ptr to our saved interrupts
  179.         lea    $64.w,a0        ; ptr to 1st interrupt
  180.         moveq.l    #6-1,d0            ; no. to restore
  181. intloop2    move.l    (a1)+,(a0)+        ; re-enable system interrupts
  182.         dbra    d0,intloop2        ; keep on until done
  183.  
  184.         lea    exceptsav(pc),a1    ; ptr to our saved exceptions
  185.         lea    $8.w,a0            ; ptr to 1st exception
  186.         moveq.l    #10-1,d0        ; no. to restore
  187. exloop3        move.l    (a1)+,(a0)+        ; re-enable system exceptions
  188.         dbra    d0,exloop3        ; keep on until done
  189.         move.l    (a1)+,$3c.w        ; uninitialised interrupt save
  190.         move.l    (a1)+,$60.w        ; unjustified interrupt save
  191.  
  192.         lea    $dff000.l,a5        ; custom base address in a6
  193.         lea    DMAsave(pc),a2        ; addr of old values
  194.         moveq    #$f,d0            ; bit to set in d0
  195.         move.l    SysCp1(pc),$80(a5)    ; restore old workbench copper
  196.         move.l    SysCp2(pc),$84(a5)    ; restore old workbench copper
  197.  
  198.         bset    d0,(a2)            ; set clr/control bit
  199.         move.w    (a2)+,$96(a5)        ; write back OS dma
  200.         bset    d0,(a2)            ; set clr/control bit
  201.         move.w    (a2)+,$9a(a5)        ; write back OS intena
  202.         bset    d0,(a2)            ; set clr/control bit
  203.         move.w    (a2)+,$9c(a5)        ; write back OS intreq
  204.         bset    d0,(a2)            ; set clr/control bit
  205.         move.w    (a2)+,$9e(a5)        ; write back OS adkcon
  206.  
  207.         move.l    4.w,a6            ; get execbase in a6
  208.         move.l    SysStack(pc),d0        ; old system stack in d0
  209.         jsr    -156(a6)        ; go back into userstate
  210.         jsr    -138(a6)        ; permit multitasking
  211.         move.l    OldStack(pc),a7        ; restore old stack ptr
  212.         movem.l    (a7)+,a0-a6/d0-d7    ; restore old regs from stack
  213.         moveq    #0,d0            ; no cli return code for us!
  214.         rts                ; Back to OS, Bye Bye...
  215.  
  216. *****************************************************************************
  217. * Initialise Screen Copperlist, Bitplanes, etc.
  218. *****************************************************************************
  219.  
  220. Init_Screen:    lea    BScript1(pc),a6        ; bitplane script to init!
  221.         bsr.b    scriptplanes        ; call script
  222.  
  223.         lea    copperlist1(pc),a0    ; copperlist to install in a0
  224.         bsr.b    Init_Copperlist        ; install copperlist
  225.         rts
  226.                 
  227. *******************************************************************************
  228. * Bitplane/Sprite initialiation Scripting System
  229. * ----------------------------------------------
  230. * Inputs: a6=ptr to script to initialise
  231. *
  232. * Script Usage:    dc.w    bitplane_ptr,copper_ptr
  233. *        dc.w    size of 1 Bitplane,no of bitplanes-1
  234. *
  235. * Script MUST be terminated with a "-1" after last entry
  236. *******************************************************************************
  237.  
  238. ScriptPlanes    movem.l    d0-d7/a0-a6,-(sp) ;preserve regs on entry
  239. ScriptNext    moveq.l    #0,d1
  240.         move.l    (a6)+,a0    ; extract bitmap ptr
  241.         move.l    (a6)+,a1    ;   "    copperlist ptr
  242.         move.w    (a6)+,a2    ;   "     size of 1 bitplane
  243.         move.w    (a6)+,d1    ;   "     no bplanes to init-1
  244.         cmpa.l    #-1,a0        ; was that last entry in script?
  245.         beq.s    ScriptDone    ; yep, so script is complete!
  246.         pea    ScriptNext(pc)
  247. InitPlanes    move.l    a0,d0        ; bmap/sprite ptr in d0
  248.         swap    d0    
  249.         move.l    d0,a0
  250.         move.w    a0,(a1)        ; lo word
  251.         move.l    a0,d0
  252.         swap    d0
  253.         move.l    d0,a0
  254.         move.w    a0,4(a1)    ; high word
  255.         add.w    a2,a0        ; size
  256.         addq.w    #8,a1        ; next copper ptr
  257.         dbra    d1,InitPlanes    ; loop until all is done
  258.         rts
  259. ScriptDone    movem.l    (sp)+,d0-d7/a0-a6 ;restore regs on exit!
  260.         rts
  261.  
  262. *****************************************************************************
  263. * Installs a New Copperlist pointed to by a0
  264. *****************************************************************************
  265.  
  266. Init_Copperlist    move.l    a5,-(sp)        ; store a5 contents to stack
  267.         lea    (_Custom).l,a5        ; custom base address in a5
  268.         move.w    #$7fff,intena(a5)    ; turn off intena
  269.         clr.l    copjmp1(a5)        ; clear cop1jmp & cop2jmp
  270.         move.l  a0,cop1lch(a5)        ; install custom copperlist
  271.         move.w    #$c020,intena(a5)    ; Set: Master Int, Strt Vbl
  272.         move.w  #$83e0,dmacon(a5)    ; enable dma
  273.         move.l    (sp)+,a5        ; restore old a5 contents
  274.         rts
  275.  
  276. *******************************************************************************
  277. * Main Display Copperlist
  278. *******************************************************************************
  279. noplanes    = $200
  280. mouse_infront    = $024
  281. mouse_behind    = 0
  282. wait        = -2
  283. palenable    = $ffe1fffe
  284. endclist    = -2
  285.  
  286. CopperList1:    dc.w    diwstrt,$2c81,diwstop,$2cc1
  287.         dc.w    ddfstrt,$38,ddfstop,$d0        ; lo-res ddfstart
  288.         dc.w    bpl1mod,0,bpl2mod,0        ; (no moduo)
  289.         dc.w    bplcon1,0,bplcon2,mouse_infront    ; mouse (infront bpl`s)
  290.         dc.w    spr0pth,0,spr0ptl,0,spr1pth,0,spr1ptl,0 ;no sprites
  291.         dc.w    spr2pth,0,spr2ptl,0,spr3pth,0,spr3ptl,0
  292.         dc.w    spr4pth,0,spr4ptl,0,spr5pth,0,spr5ptl,0
  293.         dc.w    spr6pth,0,spr6ptl,0,spr7pth,0,spr7ptl,0
  294.         dc.w    color00,$0000,color01,$0fff
  295.  
  296.         dc.w    bplcon0,$2200            ;2 bitplanes enabled!
  297.         dc.w    bpl1pth                ;1st bplane ptr
  298. Planes1:    dc.w     0,bpl1ptl
  299.         dc.w     0,bpl2pth            ;2nd bplane ptr
  300.         dc.w     0,bpl2ptl
  301.         dc.w     0
  302.  
  303.         dc.l    palenable            ;enable pal screen area
  304.  
  305.         dc.l    endclist            ;terminate copperlist
  306.  
  307. DebugCopper:    dc.w    diwstrt,$2c81,diwstop,$2cc1
  308.         dc.w    ddfstrt,$003c,ddfstop,$00d0
  309.         dc.w    $0108,0,$010a,0,bplcon0,$a200
  310.         dc.w    spr0pth,0,spr0ptl,0,spr1pth,0,spr1ptl,0
  311.         dc.w    spr2pth,0,spr2ptl,0,spr3pth,0,spr3ptl,0
  312.         dc.w    spr4pth,0,spr4ptl,0,spr5pth,0,spr5ptl,0
  313.         dc.w    spr6pth,0,spr6ptl,0,spr7pth,0,spr7ptl,0
  314.         dc.w    color00,3,color01,$fff,color02,0,color03,$fff
  315.         dc.w    bpl1pth
  316. debugplane:    dc.w     0,bpl1ptl
  317.         dc.w     0,bpl2pth
  318.         dc.w     0,bpl2ptl
  319.         dc.w     0
  320.         dc.w    $3c09,wait,color00,$0fff,$3d09,-2,color00,$0006
  321.         dc.l    palenable
  322.         dc.w    $1009,wait,color00,$0fff,$1109,-2,color00,$0003
  323.         dc.w    $2109,wait,bplcon0,noplanes
  324.         dc.l    endclist
  325.  
  326. MemCopper:    dc.w    diwstrt,$2c81,diwstop,$2cc1
  327.         dc.w    ddfstrt,$003c,ddfstop,$00d0
  328.         dc.w    $0108,0,$010a,0,bplcon0,$0200
  329.         dc.w    spr0pth,0,spr0ptl,0,spr1pth,0,spr1ptl,0
  330.         dc.w    spr2pth,0,spr2ptl,0,spr3pth,0,spr3ptl,0
  331.         dc.w    spr4pth,0,spr4ptl,0,spr5pth,0,spr5ptl,0
  332.         dc.w    spr6pth,0,spr6ptl,0,spr7pth,0,spr7ptl,0
  333.         dc.w    color00,$003,color01,$0fff
  334.         dc.w    $2009,-2,bplcon0,$9200
  335.         dc.w    bpl1pth
  336. memplane:    dc.w     0,bpl1ptl
  337.         dc.w     0
  338.         dc.w    $3c09,-2,color00,$0fff,bplcon0,$0200,ddfstrt,$0038
  339.         dc.w    $3d09,-2,color00,6,bplcon0
  340. scrnmode    dc.w    $1200
  341.         dc.w    bpl1pth
  342. sm1h        dc.w     0,bpl1ptl
  343. sm1l        dc.w     0
  344.         dc.l    palenable
  345.         dc.w    $2009,-2,bplcon0,0,color00,$0fff,$2109,-2,color00,3
  346.         dc.l    endclist
  347.  
  348. *******************************************************************************
  349. * Bitplane/Sprite Initialisation Script lists.
  350.  
  351. BScript1:    dc.l    mainpage,planes1    ;raw data ptr, cop ptr
  352.         dc.w    (320/8)*256*2,2-1    ;size,no bplanes-1
  353.  
  354. ;        ... next entry goes here
  355.  
  356.         dc.l    -1            ;terminate script
  357.  
  358.  
  359. *******************************************************************************
  360. * DEBUGGER ERROR HANDLER v3.0c
  361. * ----------------------------
  362. * Function: Show which type of error has occured, display important information
  363. * and allow the user to exit back to the assembler without having to reboot.
  364. *******************************************************************************
  365.  
  366. BusErr        bsr.s    SaveRegs        ; preserve registers
  367.         lea    BusErr.txt(pc),a0    ; error text to show in a4
  368.         jmp    (a1)            ; call Debugger Routines
  369. AddrErr        bsr.s    SaveRegs
  370.         lea    AddrErr.txt(pc),a0
  371.         jmp    (a1)
  372. IllegalErr    bsr.s    SaveRegs
  373.         lea    IllegalErr.txt(pc),a0
  374.         jmp    (a1)
  375. DivErr        bsr.s    SaveRegs
  376.         lea    DivErr.txt(pc),a0
  377.         jmp    (a1)
  378. ChkErr        bsr.s    SaveRegs
  379.         lea    ChkErr.txt(pc),a0
  380.         jmp    (a1)
  381. TrapvErr    bsr.s    SaveRegs
  382.         lea    TrapvErr.txt(pc),a0
  383.         jmp    (a1)
  384. PrivErr        bsr.s    SaveRegs
  385.         lea    PrivErr.txt(pc),a0
  386.         jmp    (a1)
  387. TraceErr    bsr.s    SaveRegs
  388.         lea    TraceErr.txt(pc),a0
  389.         jmp    (a1)
  390. LineaErr    bsr.s    SaveRegs
  391.         lea    LineaErr.txt(pc),a0
  392.         jmp    (a1)
  393. LinefErr    bsr.s    SaveRegs
  394.         lea    LinefErr.txt(pc),a0
  395.         jmp    (a1)
  396. UnInitErr    bsr.s    SaveRegs
  397.         lea    UnInitErr.txt(pc),a0
  398.         jmp    (a1)
  399. UnJustErr    bsr.s    SaveRegs
  400.         lea    UnJustErr.txt(pc),a0
  401.         jmp    (a1)
  402.  
  403. SaveRegs    movem.l    a6-a7,-(a7)
  404.         lea    oldregs(pc),a6
  405.         move.l    d0,(a6)+
  406.         move.l    d1,(a6)+
  407.         move.l    d2,(a6)+
  408.         move.l    d3,(a6)+
  409.         move.l    d4,(a6)+
  410.         move.l    d5,(a6)+
  411.         move.l    d6,(a6)+
  412.         move.l    d7,(a6)+
  413.         move.l    a0,(a6)+
  414.         move.l    a1,(a6)+
  415.         move.l    a2,(a6)+
  416.         move.l    a3,(a6)+
  417.         move.l    a4,(a6)+
  418.         move.l    a5,(a6)+
  419.         move.l    a6,a5
  420.         movem.l    (a7)+,a6-a7
  421.         move.l    a7,d0
  422.         move.l    a6,(a5)+
  423.         move.l    d0,(a5)+
  424.         lea    Oldstack(pc),a1
  425.         move.l    (a1),a0
  426.         move.l    -4(a0),OldPC-Oldstack(a1) ; save Old Program Counter
  427.         move.l    USP,a2
  428.         move.l    a2,OldUSP-Oldstack(a1)    ; save USP into OldSP
  429.         moveq.l    #0,d6
  430.         move.l    d6,d0
  431.         move.w    SR,d0            ; get SR so we can save it
  432.         move.l    d0,OldSR-Oldstack(a1)    ; save SR to OldSR
  433.         lea    INS(pc),a1
  434.         rts
  435.  
  436. INS        lea    $dff000.l,a5        ; customchip base address in a6
  437.         lea    mainpage(pc),a1        ; region to clear
  438.         move.l    #2500-1,d0        ; no times to loop
  439.         move.l    d6,d1            ; clear value in d1
  440. .clrpage    move.l    d1,(a1)+        ; clear screen memory
  441.         move.l    d1,(a1)+        ; clear screen memory
  442.         dbra    d0,.clrpage        ; loop until done
  443.         lea    print(pc),a4
  444.         jsr    (a4)            ; Now we can print error msg
  445.         lea    OldHardRegs(pc),a1
  446.         move.w    2(a5),(a1)+        ; save old dmaconr
  447.         move.w    $e(a5),(a1)+        ; save old clxconr
  448.         move.w    $10(a5),(a1)+        ; save old adkconr
  449.         move.w    $1a(a5),(a1)+        ; save old diskbytr
  450.         move.w    $1c(a5),(a1)+        ; save old intenar
  451.         move.w    $1e(a5),(a1)        ; save old intreq
  452.         lea    OldLevel1(pc),a1
  453.         lea    $64.w,a0
  454.         moveq.l    #6-1,d4
  455. vecloop        move.l    (a0)+,(a1)+        ; save old vectors
  456.         dbra    d4,vecloop    
  457.         lea    OldTraps(pc),a1
  458.         lea    $80.w,a0
  459.         moveq.l    #16-1,d4
  460. traploop    move.l    (a0)+,(a1)+        ; save old traps
  461.         dbra    d4,traploop
  462.         lea    interwait(pc),a0    ; ptr to exception exit!
  463.         lea    $64.w,a1        ; ptr to first exception
  464.         moveq.l    #6-1,d0            ; no. to install
  465. intrexitloop    move.l    a0,(a1)+        ; install exception exit!
  466.         dbra    d0,intrexitloop        ; keep on
  467.         move.w    d6,aud0vol(a5)
  468.         move.w    d6,aud1vol(a5)
  469.         move.w    d6,aud2vol(a5)
  470.         move.w    d6,aud3vol(a5)        ; all sound channels off
  471.         move.w    #$f,dmacon(a5)        ; sound DMA off
  472.         lea    mainpage(pc),a0        ; ptr to bitmap data    
  473.         lea    debugplane(pc),a1    ; ptr in copperlist
  474.         movea.l    #80,a2            ; size of 1 bitplane
  475.         moveq.l    #2-1,d1            ; no of bitplanes-1    
  476.         bsr.w    InitPlanes        ; call blitplane init code
  477.         lea    debugcopper(pc),a0    ; copperlist to install
  478.         bsr.w    Init_Copperlist        ; install it
  479.         lea    regd0(pc),a0
  480.         lea    oldregs(pc),a1
  481.         lea    Convert(pc),a2
  482.         moveq.l    #8-1,d4
  483.         move.b    #32,d5
  484. prtDregs    move.l    (a1)+,d1
  485.         jsr    (a2)            ; get reg d0-d7 ACSII values
  486.         move.b    d5,(a0)+
  487.         dbra    d4,prtDregs
  488.         lea    rega0(pc),a0
  489.         moveq.l    #8-1,d4
  490. prtAregs    move.l    (a1)+,d1
  491.         jsr    (a2)            ; get reg a0-a7 ACSII values
  492.         move.b    d5,(a0)+
  493.         dbra    d4,prtAregs
  494.         lea    regsr(pc),a0
  495.         move.l    (a1)+,d1
  496.         jsr    (a2)
  497.         lea    OldLevel1(pc),a1
  498.         lea    Lev1.txt(pc),a0
  499.         moveq.l    #6-1,d4
  500.         moveq.l    #1,d0
  501. prtvecs        add.l    d0,a0
  502.         move.l    (a1)+,d1
  503.         jsr    (a2)
  504.         dbra    d4,prtvecs
  505.         lea    OldHardRegs(pc),a1
  506.         move.w    (a1)+,d1
  507.         lea    dmacon.txt(pc),a0
  508.         jsr    (a2)
  509.         move.w    (a1)+,d1
  510.         lea    clxcon.txt(pc),a0
  511.         jsr    (a2)
  512.         move.w    (a1)+,d1
  513.         lea    adkcon.txt(pc),a0
  514.         jsr    (a2)
  515.         move.w    (a1)+,d1
  516.         lea    dskbytr.txt(pc),a0
  517.         jsr    (a2)
  518.         move.w    (a1)+,d1
  519.         lea    intena.txt(pc),a0
  520.         jsr    (a2)
  521.         move.w    (a1)+,d1
  522.         lea    intreq.txt(pc),a0
  523.         jsr    (a2)
  524.         move.l    OldPC(pc),d1
  525.         lea    regpc.txt(pc),a0
  526.         jsr    (a2)
  527.         move.l    OldUSP(pc),d1
  528.         lea    regUSP.txt(pc),a0
  529.         jsr    (a2)
  530.         lea    oldtraps(pc),a1
  531.         lea    trap0(pc),a0
  532.         moveq.l    #8-1,d4
  533. prtAtraps    move.l    (a1)+,d1
  534.         jsr    (a2)
  535.         move.b    d5,(a0)+
  536.         dbra    d4,prtAtraps
  537.         lea    trap8(pc),a0
  538.         moveq.l    #8-1,d4
  539. prtBtraps    move.l    (a1)+,d1
  540.         jsr    (a2)
  541.         move.b    d5,(a0)+
  542.         dbra    d4,prtBtraps
  543.  
  544.         move.l    4.w,a6
  545.         move.l    $2a(a6),d1        ; Memptr in APTR coldcapture
  546.         lea    coldcap.txt(pc),a0
  547.         jsr    (a2)
  548.         move.l    $2e(a6),d1        ; Memptr in APTR coldcapture
  549.         lea    coolcap.txt(pc),a0
  550.         jsr    (a2)
  551.         move.l    $32(a6),d1
  552.         lea    warmcap.txt(pc),a0
  553.         jsr    (a2)
  554.         move.l    $222(a6),d1
  555.         lea    kickmem.txt(pc),a0
  556.         jsr    (a2)
  557.         move.l    $226(a6),d1
  558.         lea    kicktag.txt(pc),a0
  559.         jsr    (a2)
  560.         move.l    $22a(a6),d1
  561.         lea    kickchk.txt(pc),a0
  562.         jsr    (a2)
  563.  
  564.         lea    text(pc),a0
  565.         jsr    (a4)
  566.         
  567. waitmouse    btst.b    #2,$16(a5)
  568.         beq.w    meminit
  569.         btst.b    #6,$bfe001.l
  570.         beq.w    enable_sys    ; RETURN FROM PROGRAM ... BYE BYE!!!
  571.         bne.s    waitmouse
  572.         
  573. Print:        move.l    d6,d4        ; a0:ascii text ,a1:fontdata ,a2=screen
  574. grabchar    move.l    d4,a2        ; d6:null value = 0
  575.         move.l    d6,d0
  576.         move.b    (a0)+,d0
  577.         cmp.b    #-1,d0        ; test for print termination
  578.         beq.s    prtdone
  579.         cmp.b    #$a,d0        ; test for newline
  580.         bne.s    printchr
  581.         move.l    d6,d1
  582.         move.l    d1,d2
  583.         move.b    (a0)+,d1    ; get ypos
  584.         move.b    (a0)+,d2    ; get xpos
  585.         move.l    d1,d3        ; save copy of ypos into d3
  586.         lsl    #8,d1
  587.         lsl    #6,d3
  588.         add.l    d3,d1
  589.         add.w    d1,d1
  590.         add.l    d1,d2
  591.         lea    mainpage(pc),a2
  592.         add.l    d2,a2        ; increase xpos
  593.         move.l    a2,d4        ; set text pointer
  594.         bra.s    grabchar
  595. printchr    mulu    #5,d0        ; 8x5 chars dimensions
  596.         lea    fontdata-160(pc),a1
  597.         add.l    d0,a1        ; calc font offset
  598.         move.b    (a1)+,(a2)    ;\
  599.         move.b    (a1)+,80(a2)    ; \
  600.         move.b    (a1)+,160(a2)    ;  \
  601.         move.b    (a1)+,240(a2)    ;   \
  602.         move.b    (a1)+,320(a2)    ;    ¯¯Char-2-Screen
  603.         addq.l    #1,d4        ; increase text pointer
  604.         bra.s    Grabchar
  605.  
  606. Convert        moveq    #8-1,d3
  607. conloop        rol.l    #4,d1
  608.         move    d1,d2
  609.         and    #$f,d2
  610.         add    #$30,d2
  611.         cmpi    #$3a,d2
  612.         bcs.s    ok
  613.         addq.w    #7,d2
  614. ok        move.b    d2,(a0)+
  615.         dbra    d3,conloop
  616.         move.l    d6,d1
  617. prtdone        rts
  618.  
  619. meminit        btst    #2,$16(a5)
  620.         beq.s    meminit
  621.         lea    mainpage(pc),a0        ; ptr to bitmap data    
  622.         lea    memplane(pc),a1        ; ptr in copperlist
  623.         move.l    d6,a2            ; size of 1 bitplane
  624.         move.l    d6,d1            ; no of bitplanes-1    
  625.         bsr.w    InitPlanes        ; call blitplane init code
  626.         lea    memtext(pc),a0
  627.         jsr    (a4)
  628.         lea    MemCopper(pc),a0    ; copperlist to install
  629.         bsr.w    Init_Copperlist        ; install it
  630. memloop        cmpi.b    #255,$6(a5)
  631.         bne.s    memloop
  632.         bsr.s    getmousepos
  633.         bsr.w    mousemove
  634.         btst    #6,$bfe001.l
  635.         bne.s    getmode
  636. MemReturn    btst.b    #6,$bfe001.l        ; go back to debugger screen
  637.         beq.s    MemReturn
  638.         lea    MemPeek.txt(pc),a0
  639.         jsr    (a4)            ; Now we can print error msg
  640.         lea    mainpage(pc),a0        ; ptr to bitmap data    
  641.         lea    debugplane(pc),a1    ; ptr in copperlist
  642.         movea.l    #80,a2            ; size of 1 bitplane
  643.         moveq.l    #2-1,d1            ; no of bitplanes-1    
  644.         bsr.w    InitPlanes        ; call blitplane init code
  645.         lea    debugcopper(pc),a0    ; copperlist to install
  646.         bsr.w    Init_Copperlist        ; install it
  647.         bra.w    waitmouse
  648.  
  649. getmode        btst    #2,$16(a5)
  650.         beq.s    modetoggle
  651.         bne.s    memloop
  652. modetoggle    btst    #2,$16(a5)
  653.         beq.s    modetoggle
  654.         lea    modeflag(pc),a0
  655.         lea    scrnmode(pc),a1
  656.         tst.b    (a0)
  657.         beq.s    LoRes
  658.         move.b    d6,(a0)
  659.         move.b    #$92,(a1)        ; med-res
  660.         bra.s    memloop
  661. LoRes        move.b    #1,(a0)
  662.         move.b    #$12,(a1)        ; lo-res
  663.         bra.s    memloop
  664.         
  665. getmousepos    movem.l    a0-a6/d0-d7,-(a7)    ; preserve all regesters
  666.         move.l    pos(pc),d1
  667.         lea    Addr.txt(pc),a0
  668.         bsr.w    Convert
  669.         lea    memtext(pc),a0
  670.         jsr    (a4)
  671.         movem.l    (a7)+,a0-a6/d0-d7    ; restore regesters
  672.         rts
  673.  
  674. InterWait    move.w    #$20,$dff09c.l        ;clear request
  675.         rte                ;exit interrupt
  676.         
  677. mousemove    move.b    d1,d0
  678.         sub.b    10(a5),d0
  679.         move.b    10(a5),d1
  680.         ext.w    d0
  681.         mulu    #80,d0
  682.         ext.l    d0
  683.         lea    pos(pc),a0
  684.         add.l    d0,(a0)
  685.         move.l    (a0),d2
  686.         cmp.l    d6,d2            ; check for start of chip mem
  687.         ble.s    resetpos
  688.         cmpi.l    #$80000,d2        ; check for end of chip mem
  689.         blt.s    updatepos
  690.         move.l    #$80000,(a0)        ; if so reset pointer to $80000
  691.         bra.s    updatepos
  692. resetpos    lea    pos(pc),a2
  693.         move.l    d6,(a2)            ; if so reset pointer to $0
  694. updatepos    move.l    (a0),d0
  695.         lea    sm1l(pc),a0
  696.         move.w    d0,(a0)
  697.         lea    sm1h(pc),a0
  698.         swap    d0
  699.         move.w    d0,(a0)            ; update bplane pointers
  700.         rts
  701.  
  702. MemText        dc.b    $a,1,0,"MEMORY PEEKER VERSION 1.0C -                  "
  703.         dc.b    "     MEMORY ADDRESS: $"
  704. Addr.txt    dc.b    "00000000",-1
  705. MemPeek.txt    dc.b    $a,1,0,"RETURNED FROM MEMPEEKER...                    "
  706.         dc.b    "                               ",-1
  707. text        dc.b    $a,0,0,"GURU SYSTEM INTERCEPTOR                       "
  708.         dc.b    "                     (GSI V3.0C)",$a
  709.         dc.b    1,0,"GURU TRAPPED! ERROR TYPE:"
  710.         dc.b    $a,3,0,"DATA AND ADDRESS REGISTERS:",$A,4,0,"D0 : "
  711. regd0        dc.b    "                                                                        ",$a,05,0,"A0 : "
  712. rega0        dc.b    "                                                                        ",$a,07,0,"SR : "
  713. regsr        dc.b    "         STATUS REGISTER (.W)",$a,08,0,"US : "
  714. regusp.txt    dc.b    "         USER STACK POINTER (.L)",$a,09,0,"PC : "
  715. regpc.txt    dc.b    "         PROGRAM COUNTER (.L)",$a,11,0,"DMACON ($DFF096): "
  716. dmacon.txt    dc.b    "         (.W)  CLXCON  ($DFF098): "
  717. clxcon.txt    dc.b    "         (.W)",$A,12,0,"INTENA ($DFF09A): "
  718. intena.txt    dc.b    "         (.W)  INTREQ  ($DFF09C): "
  719. intreq.txt    dc.b    "         (.W)",$A,13,0,"ADKCON ($DFF09E): "
  720. adkcon.txt    dc.b    "         (.W)  DSKBYTE ($DFF01A): "
  721. dskbytr.txt    dc.b    "         (.W)",$A,15,0,"INTERRUPT VECTORS: (FROM $64 TO $78) LEVELS 1-6",$A,16,0,"IV :"
  722. lev1.txt    dc.b    "          "
  723. lev2.txt    dc.b    "          "
  724. lev3.txt    dc.b    "          "
  725. lev4.txt    dc.b    "          "
  726. lev5.txt    dc.b    "          "
  727. lev6.txt    dc.b    "          ",$A,18,0,"TRAP INTRUCTION POINTERS: (FROM TRAP #0 TO TRAP #15)",$A,19,0,"T0 : "
  728. trap0        dc.b    "                                                                        ",$a,20,0,"T8 : "
  729. trap8        dc.b    "                                                                        ",$a    
  730.         dc.b    22,0,"EXECBASE STRUCTURES: (CHECK FOR VIRUSES OR RESIDENT PROGRAMS!)",$A
  731.         dc.b    23,0,"COLDCAPTURE : "
  732. coldcap.txt    dc.b    "            COOLCAPTURE  : "
  733. coolcap.txt    dc.b    "            WARM CAPTURE : "
  734. warmcap.txt    dc.b    "        ",$a,24,0,"KICKMEM PTR : "
  735. kickmem.txt    dc.b    "            KICKTAG PTR  : "
  736. kicktag.txt    dc.b    "            KICKCHECKSUM : "
  737. kickchk.txt    dc.b    "        ",$a
  738.         dc.b    26,0,"PRESS RIGHT MOUSE BUTTON FOR MEMORY PEEKER! (MOUSE SCROLLS MEMORY!)",$A
  739.         dc.b    27,0,"WHILE IN MEMPEEKER MODE : LEFT MOUSE EXIT,RIGHT MOUSE - TOGGLE SCREENMODE",$A
  740.         dc.b    29,0,"(GSI) ERROR HANDLER V3.0C COPYRIGHT (C) 1992 WRITTEN BY 2-COOL OF LSD",$a
  741.         dc.b    30,0,"THIS VERSION : 26/08/92 -  LEFT MOUSE EXITS",$a,-1,-1,-1    ;end prt
  742. BusErr.txt    dc.b    $a,1,26,"BUS ERROR ($8)",-1
  743. AddrErr.txt    dc.b    $a,1,26,"ADDRESS ERROR ($C)",-1
  744. IllegalErr.txt    dc.b    $a,1,26,"ILLEGAL INSTRUCTION RAISED ($10)",-1
  745. DivErr.txt    dc.b    $a,1,26,"DIVISION BY ZERO ($14)",-1
  746. ChkErr.txt    dc.b    $a,1,26,"CHK EXCEPTION ($18)",-1
  747. TrapvErr.txt    dc.b    $a,1,26,"TRAPV EXCEPTION ($1C)",-1
  748. PrivErr.txt    dc.b    $a,1,26,"PRIVILEGE EXCEPTION ($20)",-1
  749. TraceErr.txt    dc.b    $a,1,26,"TRACE EXCEPTION ($24)",-1
  750. LineaErr.txt    dc.b    $a,1,26,"LINEA EMULATOR ERROR ($28)",-1
  751. LinefErr.txt    dc.b    $a,1,26,"LINEF EMULATOR ERROR ($2C)",-1
  752. UnInitErr.txt    dc.b    $a,1,26,"UNINITIALIZED EXCEPTION ($3C)",-1
  753. UnJustErr.txt    dc.b    $a,1,26,"UNJUSTIFIED EXCEPTION ($60)",-1
  754.         even
  755. GfxLib        dc.b 'graphics.library',0
  756.         even
  757. OldPC        ds.l    1
  758. OldRegs        ds.l    16    ;holds d0-d7 a0-a6 & USP
  759. OldSR        ds.l    1
  760. OldUSP        ds.l    1
  761. OldTraps    ds.l    16
  762. OldLevel1    ds.l    6
  763. OldHardRegs    ds.l    3
  764. OldStack    ds.l    1
  765. OldCop2        ds.l    1
  766. pos        ds.l    1    ; contains addr of bitplanes
  767. textptr        ds.l    1
  768. exceptsav    ds.l    12
  769. intersav    ds.l    6
  770. SysCp1        ds.l    1
  771. SysCp2        ds.l    1
  772. SysStack    ds.l    1
  773. DMAsave:    ds.l    2
  774. modeflag    ds.b    1
  775.         even
  776. fontdata:    dc.b %00000000    ; ASCII ! STARTS WITH SPACE ($20 DEC:32)
  777.         dc.b %00000000    ; 5*8 POINTS
  778.         dc.b %00000000
  779.         dc.b %00000000
  780.         dc.b %00000000
  781.  
  782.         dc.b %00011000
  783.         dc.b %00011000
  784.         dc.b %00011000
  785.         dc.b %00000000
  786.         dc.b %00011000
  787.  
  788.         dc.b %00110110
  789.         dc.b %00110110
  790.         dc.b %00000000
  791.         dc.b %00000000
  792.         dc.b %00000000
  793.  
  794.         dc.b %00110110
  795.         dc.b %01111111
  796.         dc.b %00110110
  797.         dc.b %01111111
  798.         dc.b %00110110
  799.  
  800.         dc.b %00011110
  801.         dc.b %00100100
  802.         dc.b %00011110
  803.         dc.b %00000101
  804.         dc.b %00111110
  805.  
  806.         dc.b %00000000
  807.         dc.b %00000000
  808.         dc.b %11111110    ;%
  809.         dc.b %11111110
  810.         dc.b %00000000
  811.  
  812.         dc.b %00000000
  813.         dc.b %11111111
  814.         dc.b %00000000    ;&
  815.         dc.b %11111111
  816.         dc.b %00000000
  817.  
  818.         dc.b %00001100
  819.         dc.b %00011000
  820.         dc.b %00000000
  821.         dc.b %00000000
  822.         dc.b %00000000
  823.  
  824.         dc.b %00011000
  825.         dc.b %00110000
  826.         dc.b %00110000
  827.         dc.b %00110000
  828.         dc.b %00011000
  829.  
  830.         dc.b %00011000
  831.         dc.b %00001100
  832.         dc.b %00001100
  833.         dc.b %00001100
  834.         dc.b %00011000
  835.  
  836.         dc.b %00000000
  837.         dc.b %00000000
  838.         dc.b %00000000
  839.         dc.b %00000000
  840.         dc.b %00000000
  841.  
  842.         dc.b %00000000
  843.         dc.b %00011000
  844.         dc.b %01111110
  845.         dc.b %00011000
  846.         dc.b %00000000
  847.  
  848.         dc.b %00000000
  849.         dc.b %00000000
  850.         dc.b %00000000
  851.         dc.b %00011000
  852.         dc.b %00110000
  853.  
  854.         dc.b %00000000
  855.         dc.b %00000000
  856.         dc.b %01111110
  857.         dc.b %00000000
  858.         dc.b %00000000
  859.  
  860.         dc.b %00000000
  861.         dc.b %00000000
  862.         dc.b %00000000
  863.         dc.b %00011000
  864.         dc.b %00011000
  865.  
  866.         dc.b %00000110
  867.         dc.b %00001100
  868.         dc.b %00011000
  869.         dc.b %00110000
  870.         dc.b %01100000
  871.  
  872.         dc.b %00111111
  873.         dc.b %00110011
  874.         dc.b %00110011
  875.         dc.b %00110011
  876.         dc.b %00111111
  877.  
  878.         dc.b %00001100
  879.         dc.b %00011100
  880.         dc.b %00001100
  881.         dc.b %00001100
  882.         dc.b %00011110
  883.  
  884.         dc.b %00111111
  885.         dc.b %00000011
  886.         dc.b %00111111
  887.         dc.b %00110000
  888.         dc.b %00111111
  889.  
  890.         dc.b %00111111
  891.         dc.b %00000011
  892.         dc.b %00001111
  893.         dc.b %00000011
  894.         dc.b %00111111
  895.  
  896.         dc.b %00110011
  897.         dc.b %00110011
  898.         dc.b %00111111
  899.         dc.b %00000011
  900.         dc.b %00000011
  901.  
  902.         dc.b %00111111
  903.         dc.b %00110000
  904.         dc.b %00111111
  905.         dc.b %00000011
  906.         dc.b %00111111
  907.  
  908.         dc.b %00110000
  909.         dc.b %00110000
  910.         dc.b %00111111
  911.         dc.b %00110011
  912.         dc.b %00111111
  913.  
  914.         dc.b %00111111
  915.         dc.b %00000011
  916.         dc.b %00000011
  917.         dc.b %00000011
  918.         dc.b %00000011
  919.  
  920.         dc.b %00111111
  921.         dc.b %00110011
  922.         dc.b %00111111
  923.         dc.b %00110011
  924.         dc.b %00111111
  925.  
  926.         dc.b %00111111
  927.         dc.b %00110011
  928.         dc.b %00111111
  929.         dc.b %00000011
  930.         dc.b %00000011
  931.  
  932.         dc.b %00000000
  933.         dc.b %00011000
  934.         dc.b %00000000
  935.         dc.b %00011000
  936.         dc.b %00000000
  937.  
  938.         dc.b %00000000
  939.         dc.b %00011000
  940.         dc.b %00000000
  941.         dc.b %00011000
  942.         dc.b %00110000
  943.  
  944.         dc.b %00000000
  945.         dc.b %00000000
  946.         dc.b %00000000
  947.         dc.b %00000000
  948.         dc.b %00000000
  949.  
  950.         dc.b %00000000
  951.         dc.b %10101010
  952.         dc.b %11111111
  953.         dc.b %11111111
  954.         dc.b %10101010
  955.  
  956.         dc.b %00000000
  957.         dc.b %00000000
  958.         dc.b %00000000
  959.         dc.b %00000000
  960.         dc.b %00000000
  961.  
  962.         dc.b %00011110
  963.         dc.b %00000011
  964.         dc.b %00001100
  965.         dc.b %00000000
  966.         dc.b %00001100
  967.  
  968.         dc.b %00000000
  969.         dc.b %00000000
  970.         dc.b %00000000
  971.         dc.b %00000000
  972.         dc.b %00000000
  973.  
  974.         dc.b %00011110
  975.         dc.b %00110011
  976.         dc.b %00111111
  977.         dc.b %00110011
  978.         dc.b %00110011
  979.  
  980.         dc.b %00111110
  981.         dc.b %00110011
  982.         dc.b %00111110
  983.         dc.b %00110011
  984.         dc.b %00111110
  985.  
  986.         dc.b %00011110
  987.         dc.b %00110011
  988.         dc.b %00110000
  989.         dc.b %00110011
  990.         dc.b %00011110
  991.  
  992.         dc.b %00111100
  993.         dc.b %00110011
  994.         dc.b %00110011
  995.         dc.b %00110011
  996.         dc.b %00111100
  997.  
  998.         dc.b %00111111
  999.         dc.b %00110000
  1000.         dc.b %00111100
  1001.         dc.b %00110000
  1002.         dc.b %00111111
  1003.  
  1004.         dc.b %00111111
  1005.         dc.b %00110000
  1006.         dc.b %00111100
  1007.         dc.b %00110000
  1008.         dc.b %00110000
  1009.  
  1010.         dc.b %00011110
  1011.         dc.b %00110000
  1012.         dc.b %00110111
  1013.         dc.b %00110011
  1014.         dc.b %00011111
  1015.  
  1016.         dc.b %00110011
  1017.         dc.b %00110011
  1018.         dc.b %00111111
  1019.         dc.b %00110011
  1020.         dc.b %00110011
  1021.  
  1022.         dc.b %00011110
  1023.         dc.b %00001100
  1024.         dc.b %00001100
  1025.         dc.b %00001100
  1026.         dc.b %00011110
  1027.  
  1028.         dc.b %00001111
  1029.         dc.b %00000110
  1030.         dc.b %00000110
  1031.         dc.b %00110110
  1032.         dc.b %00011100
  1033.  
  1034.         dc.b %00110110
  1035.         dc.b %00110110
  1036.         dc.b %00111100
  1037.         dc.b %00110110
  1038.         dc.b %00110011
  1039.  
  1040.         dc.b %00110000
  1041.         dc.b %00110000
  1042.         dc.b %00110000
  1043.         dc.b %00110000
  1044.         dc.b %00111111
  1045.  
  1046.         dc.b %00110011
  1047.         dc.b %00111111
  1048.         dc.b %00110011
  1049.         dc.b %00110011
  1050.         dc.b %00110011
  1051.  
  1052.         dc.b %00110011
  1053.         dc.b %00111011
  1054.         dc.b %00111111
  1055.         dc.b %00110111
  1056.         dc.b %00110011
  1057.  
  1058.         dc.b %00011110
  1059.         dc.b %00110011
  1060.         dc.b %00110011
  1061.         dc.b %00110011
  1062.         dc.b %00011110
  1063.  
  1064.         dc.b %00111110
  1065.         dc.b %00110011
  1066.         dc.b %00111110
  1067.         dc.b %00110000
  1068.         dc.b %00110000
  1069.  
  1070.         dc.b %00011110
  1071.         dc.b %00110011
  1072.         dc.b %00110011
  1073.         dc.b %00110111
  1074.         dc.b %00011111
  1075.  
  1076.         dc.b %00111110
  1077.         dc.b %00110011
  1078.         dc.b %00111110
  1079.         dc.b %00110110
  1080.         dc.b %00110011
  1081.  
  1082.         dc.b %00011110
  1083.         dc.b %00110000
  1084.         dc.b %00011110
  1085.         dc.b %00000011
  1086.         dc.b %00011110
  1087.  
  1088.         dc.b %00111111
  1089.         dc.b %00001100
  1090.         dc.b %00001100
  1091.         dc.b %00001100
  1092.         dc.b %00001100
  1093.  
  1094.         dc.b %00110011
  1095.         dc.b %00110011
  1096.         dc.b %00110011
  1097.         dc.b %00110011
  1098.         dc.b %00011110
  1099.  
  1100.         dc.b %00110011
  1101.         dc.b %00110011
  1102.         dc.b %00110011
  1103.         dc.b %00011110
  1104.         dc.b %00001100
  1105.  
  1106.         dc.b %00110011
  1107.         dc.b %00110011
  1108.         dc.b %00110011
  1109.         dc.b %00111111
  1110.         dc.b %00110011
  1111.  
  1112.         dc.b %00110011
  1113.         dc.b %00011110
  1114.         dc.b %00001100
  1115.         dc.b %00011110
  1116.         dc.b %00110011
  1117.  
  1118.         dc.b %00110011
  1119.         dc.b %00110011
  1120.         dc.b %00011110
  1121.         dc.b %00001100
  1122.         dc.b %00001100
  1123.  
  1124.         dc.b %00111111
  1125.         dc.b %00000110
  1126.         dc.b %00001100
  1127.         dc.b %00011000
  1128.         dc.b %00111111
  1129.         even
  1130.  
  1131. mainpage    ds.b    (320/8)*256*2        ;Lo-Res/ 256 Lines/ 2 Bplane
  1132.  
  1133. ; End of code.
  1134. *******************************************************************************
  1135. * Hardware & Custom equate`s
  1136. * --------------------------
  1137. * For hardware regs, cia`s, raw keypresses, etc..
  1138.  
  1139. _custom=$dff000
  1140. bltddat=0
  1141. dmaconr=$2
  1142. vposr=$4
  1143. vhposr=$6
  1144. dskdatr=$8
  1145. joy0dat=$a
  1146. joy1dat=$c
  1147. clxdat=$e
  1148. adkconr=$10
  1149. pot0dat=$12
  1150. pot1dat=$14
  1151. potgor=$16
  1152. serdatr=$18
  1153. dskbytr=$1a
  1154. intenar=$1c
  1155. intreqr=$1e
  1156. dskpth=$20
  1157. dskptl=$22
  1158. dsklen=$24
  1159. dskdat=$26
  1160. refptr=$28
  1161. vposw=$2a
  1162. vhposw=$2c
  1163. copcon=$2e
  1164. serdat=$30
  1165. serper=$32
  1166. potgo=$34
  1167. joytest=$36
  1168. strequ=$38
  1169. strvbl=$3a
  1170. strhor=$3c
  1171. strlong=$3e
  1172. bltcon0=$40
  1173. bltcon1=$42
  1174. bltafwm=$44
  1175. bltalwm=$46
  1176. bltcpth=$48
  1177. bltcptl=$4a
  1178. bltbpth=$4c
  1179. bltbptl=$4e
  1180. bltapth=$50
  1181. bltaptl=$52
  1182. bltdpth=$54
  1183. bltdptl=$56
  1184. bltsize=$58
  1185. bltcmod=$60
  1186. bltbmod=$62
  1187. bltamod=$64
  1188. bltdmod=$66
  1189. bltcdat=$70
  1190. bltbdat=$72
  1191. bltadat=$74
  1192. dsksync=$7e
  1193. cop1lch=$80
  1194. cop1lcl=$82
  1195. cop2lch=$84
  1196. cop2lcl=$86
  1197. copjmp1=$88
  1198. copjmp2=$8a
  1199. copins=$8c
  1200. diwstrt=$8e
  1201. diwstop=$90
  1202. ddfstrt=$92
  1203. ddfstop=$94
  1204. dmacon=$96
  1205. clxcon=$98
  1206. intena=$9a
  1207. intreq=$9c
  1208. adkcon=$9e
  1209. aud0pth=$a0
  1210. aud0ptl=$a2
  1211. aud0len=$a4
  1212. aud0per=$a6
  1213. aud0vol=$a8
  1214. aud0dat=$aa
  1215. aud1pth=$b0
  1216. aud1ptl=$b2
  1217. aud1len=$b4
  1218. aud1per=$b6
  1219. aud1vol=$b8
  1220. aud1dat=$ba
  1221. aud2pth=$c0
  1222. aud2ptl=$c2
  1223. aud2len=$c4
  1224. aud2per=$c6
  1225. aud2vol=$c8
  1226. aud2dat=$ca
  1227. aud3pth=$d0
  1228. aud3ptl=$d2
  1229. aud3len=$d4
  1230. aud3per=$d6
  1231. aud3vol=$d8
  1232. aud3dat=$da
  1233. bpl1pth=$e0
  1234. bpl1ptl=$e2
  1235. bpl2pth=$e4
  1236. bpl2ptl=$e6
  1237. bpl3pth=$e8
  1238. bpl3ptl=$ea
  1239. bpl4pth=$ec
  1240. bpl4ptl=$ee
  1241. bpl5pth=$f0
  1242. bpl5ptl=$f2
  1243. bpl6pth=$f4
  1244. bpl6ptl=$f6
  1245. bplcon0=$100
  1246. bplcon1=$102
  1247. bplcon2=$104
  1248. bpl1mod=$108
  1249. bpl2mod=$10a
  1250. bpl1dat=$110
  1251. bpl2dat=$112
  1252. bpl3dat=$114
  1253. bpl4dat=$116
  1254. bpl5dat=$118
  1255. bpl6dat=$11a
  1256. spr0pth=$120
  1257. spr0ptl=$122
  1258. spr1pth=$124
  1259. spr1ptl=$126
  1260. spr2pth=$128
  1261. spr2ptl=$12a
  1262. spr3pth=$12c
  1263. spr3ptl=$12e
  1264. spr4pth=$130
  1265. spr4ptl=$132
  1266. spr5pth=$134
  1267. spr5ptl=$136
  1268. spr6pth=$138
  1269. spr6ptl=$13a
  1270. spr7pth=$13c
  1271. spr7ptl=$13e
  1272. spr0pos=$140
  1273. spr0ctl=$142
  1274. spr0data=$144
  1275. spr0datb=$146
  1276. spr1pos=$148
  1277. spr1ctl=$14a
  1278. spr1data=$14c
  1279. spr1datb=$14e
  1280. spr2pos=$150
  1281. spr2ctl=$152
  1282. spr2data=$154
  1283. spr2datb=$156
  1284. spr3pos=$158
  1285. spr3ctl=$15a
  1286. spr3data=$15c
  1287. spr3datb=$15e
  1288. spr4pos=$160
  1289. spr4ctl=$162
  1290. spr4data=$164
  1291. spr4datb=$166
  1292. spr5pos=$168
  1293. spr5ctl=$16a
  1294. spr5data=$16c
  1295. spr5datb=$16e
  1296. spr6pos=$170
  1297. spr6ctl=$172
  1298. spr6data=$174
  1299. spr6datb=$176
  1300. spr7pos=$178
  1301. spr7ctl=$17a
  1302. spr7data=$17c
  1303. spr7datb=$17e
  1304. color00=$180
  1305. color01=$182
  1306. color02=$184
  1307. color03=$186
  1308. color04=$188
  1309. color05=$18a
  1310. color06=$18c
  1311. color07=$18e
  1312. color08=$190
  1313. color09=$192
  1314. color10=$194
  1315. color11=$196
  1316. color12=$198
  1317. color13=$19a
  1318. color14=$19c
  1319. color15=$19e
  1320. color16=$1a0
  1321. color17=$1a2
  1322. color18=$1a4
  1323. color19=$1a6
  1324. color20=$1a8
  1325. color21=$1aa
  1326. color22=$1ac
  1327. color23=$1ae
  1328. color24=$1b0
  1329. color25=$1b2
  1330. color26=$1b4
  1331. color27=$1b6
  1332. color28=$1b8
  1333. color29=$1ba
  1334. color30=$1bc
  1335. color31=$1be
  1336. a=$20
  1337. b=$35
  1338. c=$33
  1339. d=$22
  1340. e=$12
  1341. f=$23
  1342. g=$24
  1343. h=$25
  1344. i=$17
  1345. j=$26
  1346. k=$27
  1347. l=$28
  1348. m=$37
  1349. n=$36
  1350. o=$18
  1351. p=$19
  1352. q=$10
  1353. r=$13
  1354. s=$21
  1355. t=$14
  1356. u=$16
  1357. v=$34
  1358. w=$11
  1359. x=$32
  1360. y=$15
  1361. z=$31
  1362. zero=$a
  1363. one=$1
  1364. two=$2
  1365. three=$3
  1366. four=$4
  1367. five=$5
  1368. six=$6
  1369. seven=$7
  1370. eight=$8
  1371. nine=$9
  1372. f1=$50
  1373. f2=$51
  1374. f3=$52
  1375. f4=$53
  1376. f5=$54
  1377. f6=$55
  1378. f7=$56
  1379. f8=$57
  1380. f9=$58
  1381. f0=$59
  1382. esc=$45
  1383. del=$46
  1384. help=$5f
  1385. enter=$43
  1386. tab=$42
  1387. tabb=$42
  1388. CsrUp=$4c
  1389. CsrDn=$4d
  1390. CsrLt=$4f
  1391. CsrRt=$4e
  1392. Space=$40
  1393. Return=$44
  1394. AmLft=$66
  1395. AmRgt=$67
  1396. Caps=$62
  1397. pad0=$f
  1398. pad1=$1d
  1399. pad2=$1e
  1400. pad3=$1f
  1401. pad4=$2d
  1402. pad5=$2e
  1403. pad6=$2f
  1404. pad7=$3d
  1405. pad8=$3e
  1406. pad9=$3f
  1407. _ciaa=$bfe001
  1408. _ciab=$bfd000
  1409. ciaapra=$bfe001
  1410. ciaaprb=$bfe101
  1411. ciaaddra=$bfe201
  1412. ciaaddrb=$bfe301
  1413. ciaatalo=$bfe401
  1414. ciaatahi=$bfe501
  1415. ciaatblo=$bfe601
  1416. ciaatbhi=$bfe701
  1417. ciaae.lsb=$bfe801
  1418. ciaae.mid=$bfe901
  1419. ciaae.msb=$bfea01
  1420. ciaasp=$bfec01
  1421. ciaaicr=$bfed01
  1422. ciaacra=$bfee01
  1423. ciaacrb=$bfef01
  1424. ciabpra=$bfd000
  1425. ciabprb=$bfd100
  1426. ciabddra=$bfd200
  1427. ciabddrb=$bfd300
  1428. ciabtalo=$bfd400
  1429. ciabtahi=$bfd500
  1430. ciabtblo=$bfd600
  1431. ciabtbhi=$bfd700
  1432. ciaje.lsb=$bfd800
  1433. ciabe.mid=$bfd900
  1434. ciabe.mij=$bfda00
  1435. ciabsp=$bfdc00
  1436. ciabicr=$bfdd00
  1437. ciabcra=$bfde00
  1438. ciabcrb=$bfdf00
  1439. Execbase=4
  1440. _SysBase=4
  1441.  
  1442.  
  1443.