Это видео недоступно.
Сожалеем об этом.

Easy C Programming on ZX Spectrum Next - How to set up

Поделиться
HTML-код
  • Опубликовано: 23 фев 2022
  • How to set up Z88DK to develop C programs for the ZX Spectrum Next in about 20 minutes.
    This video aims to show how straight forward setting up a modern, easy to use development environment for the ZX Spectrum Next can be.
    I'll show you how to install Z88DK the compiler, set up Visual Studio Code as the editor, CSPect as an emulator and it'll take about 20 minutes! If you've wanted to try out C programming but don't know how to start, this is the video for you.
    If you want C programming tutorials that focus on the style of C programming you'd be using on the Next, let me know. This is mostly ANSI C from the 1990s not modern C++ so things are a bit different to what you might find online.
    To learn how to program for the ZX Spectrum Next, look at some of my other videos where I explain sprites, graphics and fixed point maths.
    Find me online:
    Twitter - @ncot_tech
    Website - ncot.uk
    Github - github.com/nco...
    Chapters
    =======
    Intro 0:17
    Installing Windows Subsystem for Linux 1:57
    Running Ubuntu for first time 2:49
    Installing Z88DK 3:49
    Uncompress Z88DK 6:15
    Compile Z88DK 8:0
    Common build error and how to fix 8:59
    Emulator 14:36
    Code Editor Waffle 16:31
    Installing VS Code 17:27
    Mapping WSL as a drive 18:11
    Updating the tools 18:52
    Future Videos 19:24

Комментарии • 41

  • @HairyDalek
    @HairyDalek 2 года назад +2

    Coming into this fresh and with little (read: none) real experience of C. As I have a Next 2 on order, I think I should have a go. I’ve done some things in BASIC using VS Code and CSpect, using Remy Sharp’s extension, so I’m not completely in the dark.
    So I’m setting this up. On my Mac. And there are a few things that I have found that may be of use. They may be of use to Linux folk too.
    On a Mac OSX, you need to run CSpect using Mono. The tasks.json file needs a bit of an adjustment:
    {
    "label": "CSpect",
    "type": "process",
    "group": "test",
    "command": "mono",
    "args": [
    "/Applications/CSpect/CSpect.exe",
    "-sound",
    "-w4",
    "-60",
    "-vsync",
    "-zxnext",
    "-nextrom",
    "-basickeys",
    "-mmc=/Applications/CSpect/cspect-next-2gb.img"
    ],
    "options": {
    "cwd": "/Applications/CSpect/"
    },
    "problemMatcher": []
    },
    The key changes to make seem to be:
    1 - "type": "process"
    2 - "command": "mono"
    This is important, as you kick Aspect off in the command line using
    $mono /CSpect.exe [ parameters ]
    3 - in the "args" you have to add the path to the CSpect.exe file.
    4 - I added the -nextrom and -basickeys
    5 - Also full paths to the .img file and "cwd"
    When compiling the test.c file, I was getting error caused by the z80.h file not being found. In workspace.code-workspace updated this section:
    "settings": {
    "C_Cpp.default.includePath": [
    "${default}",
    "/Users/paul/z88dk/include",
    "/Users/paul/z88dk/include/_DEVELOPMENT/sdcc/"
    ]
    I added the full path to the _DEVELOPMENT/sdcc/ folder in the z88dk folder. This may not be entirely necessary, but once it was added, the test.c file compiled without the missing files error.
    While I was at it, removing this line gave me the proper font back:
    "editor.fontFamily": "Source Code Pro for Powerline"
    Also in the workspace file, I was getting a "string expected" error, so putting quotes around the 12000 port value seemed to stop that (but I feel it may be unnecessary).
    "zxnext": {
    "port": "12000",
    }
    So far, so good. Now all I need to figure out is how to get the .nex file into CSpect. That doesn’t seem to be happening at the moment. Remy Sharp’s extension using HDFMonkey.

  • @YesiPleb
    @YesiPleb 10 месяцев назад

    I use Linux as my main PC. Although I'm relatively new to using it on the technical side, I'm not new to the whole bash/CLI interface as I lived in the CLI on the Amiga. Vi is like Ed on the Amiga - press escape and then enter the commands and I used that for many years. I have a Next, I was one of the original backers but I only switched it on to make sure it worked after it arriving, played with it a bit and never used it since. I backed it because it was the machine that got me into programming when I borrowed the neighbour's 48K model. When we moved, my mum bought the neighbour's brother's BBC Model B and surprised me with it. It later had an Acorn DFS interface fitted and I was away. Scroll down past the later C64 and Amstrad CPC 6128 I ended up with an Amiga which got me into assembly language and the demoscene. I always wanted to learn C but never could as I was always unable to get a compiler working. I blame this higher functioning thing I've got which messes up my ability to follow written instructions as I learn by watching so many thanks for this video.

  • @joga2491
    @joga2491 2 года назад

    11 times looking at the video, just for fun and enjoying every single joke over and over. Vi user hostile, keys don’t question them, but the best is about the Microsoft website. So technically is a gem, but so much fun to watch. Thank you.

  • @retrotechnerd
    @retrotechnerd 2 года назад +3

    Maybe would be good to include the site links, Linux instructions etc in the video description for people to copy and paste.

  • @timbuchalka5802
    @timbuchalka5802 Год назад

    absolutely fascinating - totally agree

  • @zombiesbyte331
    @zombiesbyte331 Год назад

    Haha - love the reference to Red Dwarf (Queeg 500)

  • @jonssonj
    @jonssonj 7 месяцев назад

    Super great video, Thanks!

  • @bluein2red423
    @bluein2red423 2 года назад

    Great video, thanks. Looking forward to future instalments, covering syncing etc.

  • @ncot_tech
    @ncot_tech  2 года назад +1

    Links!
    Z88DK - github.com/z88dk/z88dk/wiki/installation
    VS Code - code.visualstudio.com/
    CSpect - cspect.org/
    Setting up Windows Subsystem for Linux - docs.microsoft.com/en-us/windows/wsl/install

  • @fredleckie5880
    @fredleckie5880 2 года назад +2

    Thank you sir, I'm tempted to dig out from the nether recesses of my memory what I remember of C and have a go

    • @ncot_tech
      @ncot_tech  2 года назад

      That's it, now you get to go and trawl the depths of ancient websites looking for 1990s C tutorials. I knew I kept my K&R C Programming book for a reason 😉 Some of the Arduino C programming information is a bit relevant too - the Next is more like an embedded system than a PC.

    • @martin_hansen
      @martin_hansen 2 года назад

      @@ncot_tech with reference to k&r handbook, are you implying that zcc only supports pre c80 or c99 version of C?

  • @adamjones6252
    @adamjones6252 2 года назад

    the fact this looks like a Lord of the Rings style odyssey to get set up makes me want to try it even more :)

  • @zombiesbyte331
    @zombiesbyte331 8 месяцев назад

    My system was complaining about "fatal error: gmp.h: No such file or directory" when trying to build. I found the solution was to "sudo apt install libgmp3-dev". Always worth running "sudo apt upgrade" and "sudo apt update" before everything too. I couldn't even install the package prerequisites until I'd done that, in fact, I even had to update my WSL ("wsl --update") before all that too haha.

  • @DAVIDGREGORYKERR
    @DAVIDGREGORYKERR Год назад

    Mono-develop is a good IDE and you might be able to install a new tool-chain.

  • @DAVIDGREGORYKERR
    @DAVIDGREGORYKERR Год назад

    Fileroller can be used to unarchive any archive but the compression/decompression module needs to be installed.

  • @martin_hansen
    @martin_hansen 2 года назад

    Nice vid, thanks.
    Wrt future videos, one topic that I am interested in is a setup that allows for automated testing of spectrum programs inside an emulator.
    I have not been able to find anything on the subject (maybe missing the right search term).
    And I am looking specifically at emulators as here you in theory would be able to script the inputs keyboard/joystick/tape og whatever input device, with a precision down to clockcykles, and even get persistent results from randomize command.

    • @ncot_tech
      @ncot_tech  2 года назад

      That sounds like you'd need an emulator capable of being scripted and used in the same way the TAS (Tool assisted speedrun) community uses NES ones.
      I don't think there's a Next one that can do that.

  • @MegaRockdemon
    @MegaRockdemon 2 года назад

    Queeg 500. Nice.

  • @danboid
    @danboid 3 месяца назад

    Excellent video! I've only skimmed over it so far but I'm going to be watching all of your Next coding videos properly over the next few weeks.
    Do you know of any open source Next games written in C? All the ones I've found so far are written in Next BASIC or z80. I'm not really interested in NextBASIC but I will have a go a z80, after getting to grips with C coding for the Next.
    I should get my xberry pi on Tuesday.

    • @danboid
      @danboid 3 месяца назад

      I've watched this video "properly" now and stepped through it all.
      This video says to add the environment variables to ~/.bash_profile and then to use source to load them but I prefer to add them to ~/.bashrc instead to have the variables set automatically each time I open a terminal.
      When I build the example Hello world program with zcc v22399 under Debian trixie I get this warning:
      $ zcc +zxn -vn test.c -o test.o
      test.c:3: warning 283: function declarator with no prototype

  • @DAVIDGREGORYKERR
    @DAVIDGREGORYKERR Год назад

    This is how I build Linux Binaries your way might be different.
    create a build directory then do do
    mkdir build
    go into the directory
    then do
    ./configure
    cmake
    sudo make install

  • @DAVIDGREGORYKERR
    @DAVIDGREGORYKERR Год назад

    There must be a way to put windows update on hold but would be nice to update windows from Linux.

  • @aviationmyster
    @aviationmyster 2 года назад

    I followed this all the way through but didn't see where it shows setting up TASKs in VSCode to automate the compiling etc. any info. on the final stage ?

    • @ncot_tech
      @ncot_tech  2 года назад

      I don’t really use tasks, I tend to have the terminal open and just type “make”. I had problems getting vs code to parse the z88dk compiler output to reliably detect errors, so didn’t find it that useful.
      If you wanted to use tasks, all they’d need to do is run make.

  • @SerjCrimea
    @SerjCrimea Год назад

    Hello.
    I am interested in a lot of questions about ZX NEXT.
    There are a lot of graphs with bits and ports in the book ;) Sorry, but I don't use the C language in development.
    1) How to enable layer 2 mode from assembler?
    2) Which memory banks are occupied and not to use them?
    3) The format of sprites (256 colors) and their loading (where and how)?
    I can't write sprites from Aseprite to the SD card image :(

  • @Franc_Net
    @Franc_Net Год назад

    hi. I have completed all the steps described by you. You described the steps in such detail... but in the end, nothing works. At the end, the code from the SOURCE code should be compiled and run on the emulator. There's still the launch setup moment. You skipped the VSCode json :(To link VSCode to the compiler and CSpec. Or everything is like in "vi =esc,:,w,q" :))))
    Question #2: Why is WSL needed in the scheme? (VSCode->compile z88dk->CSpec) If there is a z88dk build under Windows? This moment is unclear. But it has already been installed and you will have to spend time completing your "creation" ;) And if there is no explanation for what WSL is needed, then you will have to remove it:(
    (Translated from Russian, sorry)

  • @DAVIDGREGORYKERR
    @DAVIDGREGORYKERR Год назад

    What about sudo apt-get install comodo-antivirus

  • @mattmyers9351
    @mattmyers9351 2 года назад

    Cool!

  •  2 года назад

    No more unregistered Hyper-cam rubbish :D :D :D

  • @stephenelliott7071
    @stephenelliott7071 2 года назад +1

    Thanks for the video, puzzled why you're using Microsoft Code and Microsoft Windows - but telling us to install everything via Linux.

    • @ncot_tech
      @ncot_tech  2 года назад +1

      It's because z88dk is a Linux program that needs compiling, so getting it to run natively in Windows is a complex mess of trying to get real Visual Studio installed or trying to convince CygWin to use GCC to compile it.
      You can neatly sidestep all that mess just by installing Windows Subsystem for Linux and then everything is contained. I know it sounds a bit strange and backwards, but WSL is a pretty cool thing more people should use in Windows.

    • @danboid
      @danboid 3 месяца назад

      @@ncot_tech Stephen is saying why not run Linux as your main OS. Why not cut out WSL or VMs and run a proper os like Debian? ;)
      I recommend SpiralLinux if using BTRFS and ProxmoxVE if you want to use ZFS, which is the best option for software RAID under Linux. Proxmox has the best ZFS support of any Linux distro I've tried.

  • @PebblesChan
    @PebblesChan Год назад

    Easy? OMG! It seems so complicated & hurts my brain.

  • @ninjazhu
    @ninjazhu Год назад

    I was hoping that "Easy C Programming on ZX Spectrum Next - How to set up" meant "(Easy C Programming on ZX Spectrum Next) - How to set up" and not "((Easy C Programming [On Windows]) on ZX Spectrum Next - How to set up" - how about a tutorial that requires nothing more than a Spectrum Next?

    • @ncot_tech
      @ncot_tech  Год назад

      If someone wants to make a C compiler that will run on a Next, and a text editor then I'll give it a go. It might be a bit beyond the Next's abilities though.

    • @ninjazhu
      @ninjazhu Год назад

      @@ncot_tech the next can have a raspberry pi in it, which becomes part of the next. Perhaps someone can make a raspberry pi in the next do the compiling so no other computers are necessary.

    • @drcherepanov
      @drcherepanov 11 месяцев назад

      @@ninjazhu can raspberry PI inside ZX Spectrum next run ZX Spectrum Next emulator?

  • @TanjoGalbi
    @TanjoGalbi 2 года назад

    At 6:22 you put the tar command on the screen but it has the wrong filename! You put .tar at the end when it's .tgz
    Also, it would have made more sense after telling us that nano is more user friendly to use nano to edit the .bash_profile file! Why make things more complicated for beginners by trying to show them how to use vi?