25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.7KB

  1. @echo off
  2. setlocal
  3. REM ------------------------------------------------------------------
  4. REM Build the vim editor with Spinnaker Power C on a private copy of
  5. REM the system disk at ..\reference\POWERc.d81.
  6. REM
  7. REM The editor is two source files because Power C's compiler reports
  8. REM "program too big" when the whole thing is one unit; both objects
  9. REM are linked into vim.
  10. REM
  11. REM Power C is interactive: "cc" asks for the source, compiler and
  12. REM object disks, and "link" prompts for object files, the "^" library
  13. REM line and the output file name. -keybuf answers all of it; the runs
  14. REM of \n are those prompts. -keybuf-delay spaces the answers out: fed
  15. REM all at once they land before the later disk prompts appear and are
  16. REM lost, which leaves cc waiting for the object disk.
  17. REM ------------------------------------------------------------------
  18. set "VICE=C:\Program Files\GTK3VICE-3.10-win64\bin"
  19. set "HERE=%~dp0"
  20. set "BASE=%HERE%..\reference\POWERc.d81"
  21. set "IMG=%HERE%vim.d81"
  22. if not exist "%VICE%\x64sc.exe" goto novice
  23. if not exist "%BASE%" goto nobody
  24. echo === fresh work disk
  25. copy /y "%BASE%" "%IMG%" >nul
  26. echo === ASCII source -^> PETSCII
  27. powershell -NoProfile -ExecutionPolicy Bypass -File "%HERE%to-petscii.ps1" "%HERE%vim.c" "%HERE%vim.pet"
  28. if errorlevel 1 goto bad
  29. powershell -NoProfile -ExecutionPolicy Bypass -File "%HERE%to-petscii.ps1" "%HERE%vscreen.c" "%HERE%vscreen.pet"
  30. if errorlevel 1 goto bad
  31. echo === write both sources to the disk
  32. for %%f in (vim.c vim.o vscreen.c vscreen.o vim) do "%VICE%\c1541.exe" "%IMG%" -delete %%f >nul 2>&1
  33. "%VICE%\c1541.exe" "%IMG%" -write "%HERE%vim.pet" "vim.c,s" >nul
  34. if errorlevel 1 goto bad
  35. "%VICE%\c1541.exe" "%IMG%" -write "%HERE%vscreen.pet" "vscreen.c,s" >nul
  36. if errorlevel 1 goto bad
  37. echo === cc vim.c (a minute or so in warp mode)
  38. "%VICE%\x64sc.exe" -8 "%IMG%" -autostart "%IMG%:shell" -autostart-warp -warp -sounddev dummy -keybuf-delay 300 -keybuf "cc vim.c\n\n\n\n\n\n\n\n\n\n\n\n" -limitcycles 600000000
  39. echo === cc vscreen.c
  40. "%VICE%\x64sc.exe" -8 "%IMG%" -autostart "%IMG%:shell" -autostart-warp -warp -sounddev dummy -keybuf-delay 300 -keybuf "cc vscreen.c\n\n\n\n\n\n\n\n\n\n\n\n" -limitcycles 600000000
  41. echo === link -s -^> vim
  42. "%VICE%\x64sc.exe" -8 "%IMG%" -autostart "%IMG%:shell" -autostart-warp -warp -sounddev dummy -keybuf-delay 300 -keybuf "link -s\nvim.o\nvscreen.o\n^\n\nvim\n\n\n" -limitcycles 600000000
  43. del "%HERE%vim.pet" >nul 2>&1
  44. del "%HERE%vscreen.pet" >nul 2>&1
  45. echo === disk contents
  46. "%VICE%\c1541.exe" "%IMG%" -list | findstr /i "vim vscreen"
  47. echo.
  48. echo Run it with:
  49. echo x64sc -autostart "%IMG%:vim"
  50. exit /b 0
  51. :novice
  52. echo x64sc.exe not found in "%VICE%"
  53. exit /b 1
  54. :nobody
  55. echo %BASE% not found - is the repository complete?
  56. exit /b 1
  57. :bad
  58. echo BUILD FAILED
  59. exit /b 1

Powered by TurnKey Linux.