home *** CD-ROM | disk | FTP | other *** search
/ TopWare Tools / TOOLS.iso / tools / top1290 / romget2.asc < prev    next >
Encoding:
Text File  |  1993-01-18  |  2.2 KB  |  65 lines

  1. 100 REM ROMGET (v1.2)
  2. 110 REM 17.1.1993
  3. 120 REM
  4. 130 MODE 1: CLEAR: DEFINT a-z
  5. 140 PRINT"ROMGET v1.2":PRINT"Run on CPC to save the ROMs in a file.": PRINT
  6. 150 PRINT"Insert disk with >= 50K free space": PRINT"and press a key ..."
  7. 160 CALL &BB18
  8. 170 adr=&A000: sh=adr+2: dh=adr+5: k=adr+15
  9. 180 h!=HIMEM: MEMORY &1FFF
  10. 190 FOR i=adr TO adr+&12: READ a$: POKE i,VAL("&"+a$): NEXT
  11. 200 POKE sh,0: POKE dh,&20: POKE k,&FC: CALL adr
  12. 210 POKE sh,&C0: POKE dh,&60: CALL adr
  13. 220 PRINT"Saving lower&upper-ROM (Z80CPC.ROM) ..."
  14. 230 SAVE"!Z80CPC.ROM",b,&2000,&8000
  15. 240 POKE k,7: CALL adr
  16. 250 IF PEEK(&6000)<>1 THEN PRINT"No AMSDOS-ROM found.": GOTO 280
  17. 260 PRINT"Saving AMSDOS-ROM (Z80DISK.ROM) ..."
  18. 270 SAVE"!Z80DISK.ROM",b,&6000,&4000
  19. 280 PRINT"bye."
  20. 290 MEMORY h!: END
  21. 300 DATA 21,00,C0,11,00,20,01,00,40,DF,0D,A0,C9,10,A0,00,ED,B0,C9
  22. 310 '
  23. 320 '****  end of program  ***
  24. 330 '
  25. 340 'ROMGET - written to copy the CPC-ROM to a file, which can be used
  26. 350 'by CPCEMU (transfer Z80CPC.ROM, Z80DISK.ROM to a PC).
  27. 360 '
  28. 370 'If you input this program, you can leave all REM- and PRINT - lines.
  29. 380 'Some annotations:
  30. 390 ' line 200 : copy low-rom &0000-&3fff to ram &2000-&5fff
  31. 400 ' line 210 : copy high-rom &c000-&ffff to ram &6000-&9fff
  32. 410 ' line 240 : copy amsdos-rom &c000-&ffff to ram &6000-&9fff
  33. 420 '
  34. 430 'The assembler-module in data-line 300 :
  35. 440 ' 
  36. 450 ';ROMGET2 (v1.2)
  37. 460 ';17.1.1993 (26.,27.6.1989)
  38. 470 ';
  39. 480 ';Program to copy the CPC-ROMs to RAM, so you can save them in a file.
  40. 490 ';Run this on a CPC
  41. 500 ';
  42. 510 ';usage:
  43. 520 '; adr = &a000
  44. 530 '; poke adr+&02 , source-address (hi-byte)
  45. 540 '; poke adr+&05 , destionation-address (hi-byte)
  46. 550 '; poke adr+&0F , rom/ram-configuration
  47. 560 '; call adr       'to copy &4000-byte-bank
  48. 570 ';
  49. 580 '; (rom/ram-config -  0..251 = ROM-number, 252=lower,upper rom enabled, ...)
  50. 590 'ORG #A000
  51. 600 'LD HL,#C000               ;source-address (ROM or RAM)
  52. 610 'LD DE,#2000               ;destination-address (RAM)
  53. 620 'LD BC,#4000               ;length of bank
  54. 630 'RST #18
  55. 640 'DEFW RSTTAB
  56. 650 'RET
  57. 660 '
  58. 670 'RSTTAB DEFW BLOCK         ;jump to prg
  59. 680 'DEFB 0                    ;rom/ram-configuration
  60. 690 '
  61. 700 'BLOCK LDIR                ;copy the bank
  62. 710 'RET
  63. 720 '
  64. 730 'END
  65. 740 ';