home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 17 / CD_ASCQ_17_101194.iso / vrac / cpcemu12.zip / ROMGET.BAS < prev   
BASIC Source File  |  1994-09-03  |  3KB  |  75 lines

  1. 100 REM ROMGET (v2.0)
  2. 110 REM 3.9.1994
  3. 120 REM
  4. 130 MODE 1: CLEAR: DEFINT a-z
  5. 140 PRINT"ROMGET v2.0":PRINT"Run on a CPC to save the ROMs as files.": 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 (CPCXXXX.ROM) ..."
  14. 230 SAVE"!CPCXXXX.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 (CPCADOS.ROM) ..."
  18. 270 SAVE"!CPCADOS.ROM",b,&6000,&4000
  19. 280 PRINT"Trying to find some other ROMs ..."
  20. 290 FOR i=1 TO 251:PRINT HEX$(i);
  21. 300 IF i=7 THEN 360
  22. 310 POKE k,i:CALL adr
  23. 320 IF PEEK(&6000)=&80 THEN 360
  24. 330 PRINT" ROM found -- ";
  25. 340 PRINT"Saving MYROM";HEX$(i,2);".ROM ..."
  26. 350 SAVE"!MYROM"+HEX$(i,2)+".ROM",b,&6000,&4000:PRINT
  27. 360 PRINT CHR$(13);:NEXT
  28. 370 PRINT:PRINT"bye."
  29. 380 MEMORY h!: END
  30. 390 DATA 21,00,C0,11,00,20,01,00,40,DF,0D,A0,C9,10,A0,00,ED,B0,C9
  31. 400 '
  32. 410 '****  end of program  ***
  33. 420 '
  34. 430 'ROMGET - written to save the CPC-ROM in a file, which can be used
  35. 440 'by CPCEMU (transfer Z80CPC.ROM, Z80DISK.ROM to a PC).
  36. 450 '
  37. 460 'If you input this program, you can leave all REM- and PRINT - lines.
  38. 470 'Some annotations:
  39. 480 ' line 200 : copy low-rom &0000-&3fff to ram &2000-&5fff
  40. 490 ' line 210 : copy high-rom &c000-&ffff to ram &6000-&9fff
  41. 500 ' line 240 : copy amsdos-rom &c000-&ffff to ram &6000-&9fff
  42. 510 '
  43. 520 'The assembler-module in data-line 300 :
  44. 530 '
  45. 540 ';ROMGET2 (v1.2)
  46. 550 ';17.1.1993 (26.,27.6.1989)
  47. 560 ';
  48. 570 ';Program to copy the CPC-ROMs to RAM, so you can save them in a file.
  49. 580 ';Run this on a CPC
  50. 590 ';
  51. 600 ';usage:
  52. 610 '; adr = &a000
  53. 620 '; poke adr+&02 , source-address (hi-byte)
  54. 630 '; poke adr+&05 , destionation-address (hi-byte)
  55. 640 '; poke adr+&0F , rom/ram-configuration
  56. 650 '; call adr       'to copy &4000-byte-bank
  57. 660 ';
  58. 670 '; (rom/ram-config -  0..251 = ROM-number, 252=lower,upper rom enabled, ...)
  59. 680 'ORG #A000
  60. 690 'LD HL,#C000               ;source-address (ROM or RAM)
  61. 700 'LD DE,#2000               ;destination-address (RAM)
  62. 710 'LD BC,#4000               ;length of bank
  63. 720 'RST #18
  64. 730 'DEFW RSTTAB
  65. 740 'RET
  66. 750 '
  67. 760 'RSTTAB DEFW BLOCK         ;jump to prg
  68. 770 'DEFB 0                    ;rom/ram-configuration
  69. 780 '
  70. 790 'BLOCK LDIR                ;copy the bank
  71. 800 'RET
  72. 810 '
  73. 820 'END
  74. 830 ';
  75.