home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / beehive / utilitys / gpatch.arc / GVEC.Z80 < prev   
Text File  |  1990-07-21  |  2KB  |  90 lines

  1. ;Patches to GBASIC. Mar 87. K.C.M. Lau.
  2. ;Assem with ZASM (Cromemco). Overlay HEX file using DDT. Also overlay GNEW.HEX
  3. ;No. of pages to save is 100 dec + (newlen / 100h)
  4.  
  5. ;-------- Modify searchbyte -------
  6.     org    0C8Ch
  7.     db    0A9h    ;search byte at BDOS - 6
  8.  
  9. disp    equ    1FF2h    ;relocation displacement
  10. scrn    equ    8477h    ;runtime position of screen code translation table
  11.  
  12. ;-------- Relocate screen table --------
  13.     org    256Bh
  14.     dw    scrn
  15.     org    2586h
  16.     dw    scrn+1
  17.     org    2593h
  18.     dw    scrn+1
  19.     org    6444h    ;new shortened signon
  20.     db    '[Starcard CP/M Version]',0Dh,0Ah
  21.     db    'Copyright (C) 1980 by Microsoft',0Dh,0Ah
  22.     db    0
  23.     org    scrn-disp ;new screen code translation table
  24.     db    20h,1Bh,0AAh,0D9h,0D4h,0EBh,0EAh,1Eh,0BDh,0Bh,0Ch
  25.  
  26. ;-------- Move GNEW --------
  27. newst    equ    1000h    ;runtime addr of GNEW
  28. newlen    equ    0800h    ;length of GNEW (moved to 1000h at runtime)
  29.  
  30.     org    1000h    ;modify stage 1 relocation (bulk)
  31.     ld    hl,64FFh+newlen
  32.     ld    de,64FFh+newlen+disp
  33.     ld    bc,64FFh+newlen+disp-3000h+1
  34.     lddr
  35.     jp    84D2h
  36.  
  37.     org    84D2h-disp ;add stage 2 relocation (SUBR --> 1000h)
  38.     ld    hl,6500h+disp
  39.     ld    de,newst
  40.     ld    bc,newlen
  41.     ldir
  42.     jp    81D3h
  43.  
  44. ;-------- Patch vectors --------
  45. ;location of command vector is (token - 80h) * 2 + 106h
  46.     org    01A8h
  47.     dw    newst        ;HGR    (token 0D1h)
  48.     dw    newst+06h    ;HPLOT    (token 0D2h)
  49.     dw    newst+03h    ;HCOLOR    (token 0D3h)
  50.     org    3C86h-disp
  51.     dw    newst+09h    ;function HCOLOR
  52.     org    3C90h-disp
  53.     dw    newst+0Ch    ;function HSCRN
  54.     org    0192h
  55.     dw    newst+0Fh    ;TEXT
  56.     org    019Eh
  57.     dw    newst+12h    ;GR
  58.     org    01A0h
  59.     dw    newst+15h    ;COLOR
  60.     org    01A6h
  61.     dw    newst+18h    ;PLOT
  62.     org    3C81h-disp
  63.     dw    newst+1Bh    ;function COLOR
  64.     org    3C8Bh-disp
  65.     dw    newst+1Eh    ;function SCRN
  66.     org    01A2h
  67.     dw    newst+21h    ;HLIN
  68.     org    01A4h
  69.     dw    newst+24h    ;VLIN
  70.     org    021Ah
  71.     dw    newst+27h    ;function PDL ()
  72.     org    021Ch
  73.     dw    newst+2Ah    ;function BUTTON ()
  74.     org    01AEh
  75.     dw    newst+2Dh    ;BEEP
  76.     org    7250h-disp
  77.     dw    newst+30h    ;CALL%
  78.     org    62A6h-disp
  79.     jp    newst+33h    ;EDIT
  80.  
  81.     end
  82. TTON ()
  83.     org    01AEh
  84.     dw    newst+2Dh    ;BEEP
  85.     org    7250h-disp
  86.     dw    newst+30h    ;CALL%
  87.     org    62A6h-disp
  88.     jp    newst+33h    ;EDIT
  89.  
  90.