NTC BASIC – new targets, chip libraries and a game on two new machines
NTC BASIC now builds for 16 targets from one compiler, with Z80, 68000 and 45GS02 back ends.
NOTE: What are the ports that the Powergraph card is on for the CPC? And the MSX ones when used with the AMSDAP?
New targets
Z80:
- msx – MSX1 / MSX2 / MSX2+ / turbo R cartridge ROM. The console uses the MSX’s own video chip, with 80 columns on an MSX2.
- msxcard – MSX with a V9938 card at #88 for the console.
- msx9990 – MSX with a V9990 (GFX9000, Video9000, Powergraph) for the console.
- sc3000 – Sega SC-3000 (or an SG-1000 with the SK-1100 keyboard), as a cartridge ROM.
- cpccard – Amstrad CPC with an MSX V9938 card through the AMSDAP adapter.
- cpc9990 – Amstrad CPC with a V9990 (AMSDAP or the CPC Powergraph).
Non-Z80:
- md – Sega Mega Drive / Genesis. NTC on the 68000, with its own keyword library. Classes: Vdp, Pad, Psg, StdIO, System.
- m65 – MEGA65. NTC on the 45GS02. Classes: Vic (320x200, 256 colours, two buffers, sprites drawn by the CPU and DMA), Joy, Sid, StdIO, System.
New classes:
- VDP (TMS9918 / V9938 / V9958) and V9990 for the MSX, the SC-3000, and every CPC platform through AMSDAP.
- Keys (keys held down, joysticks) for msx and sc3000, as well as the CPC and Next.
hwlib – game libraries per chip (optional)
For native games you write for the hardware, not for a lowest common denominator. hwlib has one class per graphics chip, named after the chip, so a chip that’s in more than one machine has one library. Where a chip differs between machines, that’s handled inside the chip’s class at compile time.
- Zxn – ZX Spectrum Next: 128 hardware sprites.
- Cpc – plain CPC: masked software sprites, double buffered.
- Asic – CPC Plus / GX4000: 16 hardware sprites.
- Tms9918 – MSX1, SC-3000.
- V9938 – MSX2.
- V9990 – MSX GFX9000 and CPC V9990 boards.
They all share the same core calls (Init, Pattern, Put, Hide, Anim, Move, Bounds, Frame), plus each chip’s own extras on top. There are also StdIO consoles for the chips with no firmware, and Vec for 3D. All optional: add the ones you want to your project.
Each machine has two test programs. One bounces spinning balls using the chip’s own sprites. The other draws a filled, lit cube, with back faces removed and double buffering. Cube speeds in emulators:
- Next: 49 a second
- V9990: 10.5
- CPC: 9.5
- MSX2: 9
- MSX1: 7.5
Not checked yet:
- The CPC Plus builds haven’t run (no CPC Plus emulator to hand).
- The CPC V9990 builds are build-only until the board’s port address is set.
CYBORG SWARM on the Mega Drive and the MEGA65
A Galaga-style shooter written in NTC BASIC, built for both machines from the same game logic. It has formations, dives, bonus stages, the tractor beam, capture, rescue and the dual fighter.
A bot plays 20,000 frames on each machine. Both reach stage 17 with no frames lost (Mega Drive 80,320 points, MEGA65 81,100). So far it has run in emulators only (Genesis Plus GX and Xemu), not on real hardware.
Fixes
- The keyword library ROM (Library: ROM) builds again for the CPC platforms. The Next port added Next-only code to the shared memory code, and the ROM builder was leaving that whole section out. Program addresses in the ROM are unchanged.
- All three regression suites pass: Z80 887/887, Mega Drive 13/13, MEGA65 13/13.