News about Amstrad CPC, PCW, Notepad NC100 NC150 NC200, PDA600 and also Amstrad PC






A fork of Contiki v1.x (an operating system) for Amstrad CPC by Pulkomandy

-

The following lines are directly taken from the Amstrad CPC Contiki port on Github.

Contiki's screenshot, an operating system ported on Amstrad CPC by Pulkomandy

Contiki is a small operating system for embedded devices. While version 2 of the system is designed to run on embedded devices and has an IP and IPv6 stack as the main feature, the 1.x version of the system is better known for being ported to several 8-bit and 16-bit home computers.

Contiki 1.x features a GUI, dynamic loading of executables with runtime relocation, and a cooperative multitasking event-driven kernel. It also includes an IPv4 network stack and a few other things.

This fork is focused on improving the Amstrad CPC port of Contiki. This version was done by Kevin Thacker, but he didn't get it much further than showing the desktop. At the time, problems with the SDCC compiler and lack of proper optimization support led to a Contiki kernel too big and slow to be useful for serious use.

Fast forward some years, and SDCC has improved a lot. While it's still not very good at generating fast code, at least the size is down a bit and we now can run several programs without running out of memory. The linker scripts you will find here were modified to work properly with the current version of SDCC.

However, the dynamic relocatable executables are generated with a patched version of the SDCC linker, as the existing linker doesn't allow output in a suitable format.

Compared to the binaries released by Kevin Thacker, this version has much improved drawing routines. While still using the CPC firmware, the following changes allow for a much better experience :

  • Faster screen clearing using SCR FILL BOX
  • Various optimizations all over the place
  • A better looking color palette
  • Support for bitmap icons

How to build it - Requirements

You will need a patched version of SDCC. The linker was modified to generate relocation information, so the PRG executables can be loaded anywhere in memory and relocated at runtime before starting them. Running Contiki without that on the CPC would be much less interesting, because it is nearly impossible to write position independant z80 code.

A patch for SDCC 3.4.1 (from the current SVN sources) is provided. Get the sources using SVN or a nightly snapshot and apply the patch, then configure SDCC as usual.

You can still use the generated version of SDCC for other projects. The only difference is the addition of the -h flag to the linker. When this flag is set, executables are generated with relocation information.

You will also need cpcgs from the cpctools project.

Steps

Once the patched SDCC is installed, the process is rather simple :

cd contiki-cpc make clean make cpc make programs

This will generate a dsk image with contiki and the various programs.

Be careful to always do things in this order. The "cpc" target compiles the contiki core, and generate a defines file which is then used to have the apps call contiki routines.

However, when contiki is recompiled, stuff move in memory and all programs must be recompiled. This means you should always do a "make clean", until the dependencies are properly defined in the makefiles.

How to use it

Boot your CPC or emulator and insert the disk in drive A (drive B is currently not supported). Then from the BASIC prompt type

run"contiki

The Contiki desktop will start, and will load the "Welcome" program which shows a window with some hints about how to use the system. Once there, you can :

  • Navigate the menus (press F1 then use arrow keys)
  • Run the "Processes" program to see a list of running processes
  • Run the "Directory" program to list the disc contents

Using either Directory or the "Run program" menu, you can start more applications, such as the calculator, the command line shel, the about box, etc. You can start multiple instances of each application, and navigate between their windows using the "Desktop" menu.

Roadmap

This port of Contiki is running fairly well, but we can make it more awesome !

Current status

Contiki currently relies on the CPC firmware for screen drawing and on AMSDOS for disc access. It runs entirely in the 64K base memory and doesn't use the banks or other expansion ROMs.

Contiki uses the space usually reserved to BASIC, from &100 to &3700, for its kernel. Since the Firmware and AMSDOS reserve all memory from &A700 up, this leaves about 28K of free RAM for applications. Not bad, but we can do better.

Firmware-based CTK driver

The screen driver is using the standard "conio" driver from Contiki. This is a textmode based driver which is easily portable between different terminal types. However, the interface of this driver with the CPC firmware results in rather slow screen drawing. The main reason is that some operations (such as erasing or scrolling part of the screen) are done character by character, instead of using the firmware functions which are much faster. Moreover, the portable conio code is written in C, and replacing it with an assembler version would provide another speed boost.

Some extra features such as bitmap icons, a custom character set and more can be implemented here.

Make use of memory banks

We can put Contiki in bank C7 and map it in C1 mode. This would free all the low memory for apps. When calling the firmware, we can either use "far calls" so the bank can be unmapped while drawing, or use mode C3 and tell the firmware to draw at address 4000.

Note that the firmware calls are designed not to take direct memory pointers most of the time (eg you can print a single character, not a whole string) to make such schemes workable: The firmware would never need to directly access application memory in the range 4000-7fff. This would leave about 42K of RAM free for apps.

Remove dependencies on firmware

The next step is to completely remove the dependency on the firmware, and instead write our own screen drawing routines. A 4x8 or 6x8 font could be used, as the "80 column" version of Contiki for C64 is doing.

This could further speedup the screen display and allow for a nicer look.

Overscan display

A nice feature on the CPC is the ability to allocate 32K of RAM for the display and have a quite high resolution screen (380x272 or so). However, with the scheme exposed above this would lead to having only 32K of RAM free for applications.

To avoid this, we would run Contiki in C2 banking mode (all memory is mapped in banks) and have the application heap there. Contiki would still be in bank C7 leaving 48K of RAM for apps. When drawing to the screen is needed, Contiki can switch to mode C1 or C3 to access the main memory. A scheme similar to the one used by the firmware needs to be used here: the screen drawing routines must not do direct access to applications.

Pages 0 and 1 in main RAM would be used for the screen. Page 2 will have the screen drawing code. Page 3 can be used for the filesystem, and use the C4-C7 mapping mode to access the banks. When using these modes, converting a pointer to page number + pointer in 4000-7fff is easy. It may be a good idea to tweak malloc so it never allocates a chunk that crosses two banks. But that would mean we can't load apps bigger than 16K. So the disk system will probably have to figure out how to handle allocations that spans two or more banks.

Even more free RAM !

Going even further, Contiki should all be in main RAM, and leave the banks almost completely free for apps. This would need to use an RST (far call or so) to call Contiki methods from apps. Can SDCC handle this? We may need to generate syscall inlines or maybe we can do dirty tricks using the peephole to replace "CALL address" with "RST farcall ; dw address". This could leave 63+K of RAM for apps, and 32K of RAM for Contiki + screen drawing + FS. If space is scarce, it's probably time we try putting Contiki in one or two ROMs instead.

This is similar to the scheme used by CP/M+.

An Amstrad PCW port

The amstrad PCW has a similar, but more flexible, RAM bank system. However, it comes with 256 or 512K of memory, and we must support this!. This means reworking Contiki to handle apps in the different banks, which is not an easy task and may need compiler specific support. But then again, it could be useful for a Thomson MO6/TO8 port...





X-Mass, an flash IDE drive for Amstrad CPC by TotO

-

A new hardware interface by TotO the hero which should be available for Christmas on Cent Pour Cent. See below, it's just a copy and paste of this site about the X-mass.

Shown at the ReSeT #18 event in France, the X-MASS is actually work in progress.

This last MX4 expansion is a mass storage. It embed a 128MB turbo flash drive for storing thousands of files into your CPC and definitively make it autonomous as no PC is required to configure and use it.

Developers will be able to work on more ambitious projects requiring megabytes of resources and code to be compiled, breaking the floppy limitation. Used in conjunction with X-MEM, the cross-dev will be no more the only issue for the future.

Last but not least, users will be able to copy, load, save, run files faster than ever !

By the way, the X-Mass can already be used with SymbOS.





Amstrad CPC floppy disks, Kryoflux and SuperCard Pro

-

The Amstrad CPC use 3" disks because Alan Michael Sugar got a large batch of 3" drives, and then stayed with it for compatibility. Game editors started to add protections to avoid piracy. Amstrad CPC emulators are using the .DSK format to store the content of a disk (but it assumes that each track have only one size). This format can't manage well protections, for this you need the extended DSK format where each track can have a different size to support more protections, but still not all of them. That's why hardware solutions are necessary to preserve the exact content of the original disks in their totality (and then you can write them again to real disks) such as :

There is a problem to create .IPF for Amstrad CPC programs, the real disks have been either :

  • written in an usine so they will be seens as originals and IPF will be created
  • written on a real Amstrad CPC, so they will be seens as copies and IPF wont be created

Every emulator can use the raw or CT Raw kryoflux files if using the SPS decoder library. If an emulator doesnt use this library, then the best thing is to use .DSK created from kryoflux files with Samdisk like those dumped by Maxit on CPC-Power. SuperCard Pro support must be added internally into an emulator. Sugarbox already supports the SCP and of course the kryoflux (from a kryoflux raw or CT Raw, sugarbox can create a SCP file). Samdisk will soon support the SCP hardware, so it will be possible to read one track only.



The Amstrad notepad NC100, original software, ZCN (CP/M) or Fuzix (unix) ?

-

The Amstrad notepad NC100 was out in 1992 with the protext word processing (already on Amstrad CPC and Amstrad PCW). But it's also possible to use it with ZCN by Mark Russel wich is a native CP/M, or use the all new Fuzix (fuzix announced on google+), this time an unix (system 5) by Alan Cox. You can emulate an Amstrad NC100 (and also NC150 and NC200) with nc100em (still by Mark Russel) for linux or ms-dos, and since start of 2014 as I just discovered for windows (port by Stefano Bodrato). The MESS emulator also supports the 3 Amstrad notepad NC. If you dont have the original NC100 ROM, you will need the ZCN.BIN file included in ZCN v1.3. You will find more informations about the Amstrad Notepad NC on the excellent Tim's Amstrad NC users site (see ZCN page).



New version v0.23 of the Amstrad CPC emulator Sugarbox

-

Today a new version of the Amstrad CPC emulator Sugarbox is out :

  • [TAPE] : Tape support : CDT/WAV/VOC/CSW(v1.1 & v2.0, with or without Z-RLE encoding) files are supported
  • [TAPE] : Possibility to save Tape as WAV, CDT (with only DRB or CSW blocks), CSW (v1.1 or 2.0 compressed). Preliminary, maybe unexpected results can occurs !
  • [FDC] : Head is no longer forced to track 0 when a disk is ejcted. This fix a bug in disk swapping for Targhan.
  • [FDC] : Track delay time added. This fixed a weird protection scheme on Daley Thompson Olymic Challenge
  • [FDC] : The US1 FDC bit is no longer wired. This fixed « Sphaira » original game.
  • [FDC] : When « Read id » is performed on a not formatted track, the track was incorrect in the result. This is now fixed, fixing « Return of the jedi ».
  • [FDC] : Fixed a bug that only load up to 42 tracks per side for a disk. Now, 720k disk (with 82 tracks) can be loaded again correctly
  • [FDC] : Fixed a bug that prevent « motor » command to be taken in account
  • [FDC] : Fixed a bug related to BC bit in register 2, making « Starfox » game to work.
  • [GUI] : Added protection button for the disks
  • [FDC-eDSK] : Correctly save tracks that are not formatted
  • [FDC-DSK] : Close dsk file correctly.
  • [SHORTCUTS] : added ctrl+f9 -> Reset
  • ctrl+f1 : insert disk drive A:
  • ctrl+f2 : insert disk drive B:
  • [Gate array] : Fixed a bug that was displaying incorrect colors when using the ghost registers
  • [General] : On exit, if a disk has been modified without being saved, user is asked about it.
  • [General] : Fixed some rare crash that can occurs
  • [General] : A click on speed on status bar now toggle the emulation speed between « 100% » and « No speed limit »
  • [General] : Some architecture and code optimization, increasing overall emulation speed (about +25% speed)


The prisoner, a new text adventure game for the Amstrad CPC in spanish and english

-

The prisoner is a new text adventure game about the famous TV serie with Patrick McGoohan in the sixties.

First on C64 and C64 plus, an Amstrad CPC (conversion by Miguel Sky, ESP Soft) spanish version is available since October 2013 and an english version just came out.

loading screen of the Amstrad CPC text adventure game : the Prisoner