Category:Locomotive Basic: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 1: Line 1:
{{language|Locomotive Basic
{{language|Locomotive Basic
|exec=interpreted
|exec=interpreted
|site=http://www.cpcmania.com/}}
|site=http://www.grimware.org/doku.php/documentations/software/locomotive.basic/}}
{{implementation|BASIC}}
{{implementation|BASIC}}


Line 12: Line 12:
Memory on the CPC 464 and 664 was subdivided into four 16 kB blocks (0 to 3), with block 3 at &c000 normally reserved for the screen. The CPC 6128 featured a second 64 kB bank which could be accessed from BASIC in block 1 of the first bank (&4000 and &7fff) via [[wp:Bank switching|bank switching]]. RSX commands for bank switching are included on the system discs and discussed in chapter 8 of the CPC user manual.<ref>http://www.cpcwiki.eu/index.php/User_Manual</ref> Even on the 64 kB models, it was possible to do [[wp:Multiple buffering|double buffering]] in BASIC by also reserving RAM block 1 for the screen, drawing into the hidden screen, and then setting the CRTC screen address to the currently hidden screen with the BASIC [[wp:I/o port|port I/O]] command <tt>OUT</tt>.
Memory on the CPC 464 and 664 was subdivided into four 16 kB blocks (0 to 3), with block 3 at &c000 normally reserved for the screen. The CPC 6128 featured a second 64 kB bank which could be accessed from BASIC in block 1 of the first bank (&4000 and &7fff) via [[wp:Bank switching|bank switching]]. RSX commands for bank switching are included on the system discs and discussed in chapter 8 of the CPC user manual.<ref>http://www.cpcwiki.eu/index.php/User_Manual</ref> Even on the 64 kB models, it was possible to do [[wp:Multiple buffering|double buffering]] in BASIC by also reserving RAM block 1 for the screen, drawing into the hidden screen, and then setting the CRTC screen address to the currently hidden screen with the BASIC [[wp:I/o port|port I/O]] command <tt>OUT</tt>.


Locomotive BASIC served as a sort of primitive operating system for the CPC and was also used (together with AMSDOS RSX commands<ref>http://cpcwiki.eu/index.php/RSX</ref>) for disk and tape operations. As on many other 8-bit machines of the era, it was common to extend BASIC programs by <tt>READ</tt>-ing Z80 machine code from <tt>DATA</tt> statements, <tt>[[wp:PEEK and POKE|POKE]]</tt>-ing it to RAM, and then <tt>CALL</tt>-ing the code, an approach especially popular with type-in games from old CPC magazines.
Locomotive BASIC served as a sort of primitive operating system for the CPC and was also used (together with AMSDOS RSX commands<ref>http://www.cpcwiki.eu/index.php/RSX</ref>) for disk and tape operations. As on many other 8-bit machines of the era, it was common to extend BASIC programs by <tt>READ</tt>-ing Z80 machine code from <tt>DATA</tt> statements, <tt>[[wp:PEEK and POKE|POKE]]</tt>-ing it to RAM, and then <tt>CALL</tt>-ing the code, an approach especially popular with type-in games from old CPC magazines.

The extensive CPC user manual features a finely written introduction to BASIC that does not feel as rushed or dumbed-down as in some other manuals of the time. Obviously Amstrad expected many customers would want to program their CPCs themselves, not just use them with off-the-shelf software. There are some pretty decent BASIC type-in games in appendix 3, such as clones of the classic arcade games ''[[wp:Breakout (video game)|Breakout]]'' and ''[[wp:Pong|Pong]]''.


==References==
==References==
Line 20: Line 22:
==See Also==
==See Also==
* [[wp:Locomotive BASIC|Locomotive BASIC]] at Wikipedia
* [[wp:Locomotive BASIC|Locomotive BASIC]] at Wikipedia
* [http://www.grimware.org/doku.php/documentations/software/locomotive.basic/ Command reference with code examples] (based on the official documentation)
* [http://www.grimware.org/doku.php/documentations/software/locomotive.basic/ Locomotive BASIC command reference with code examples] (based on the official documentation)
* [http://www.cpcwiki.eu/index.php/User_Manual Scanned CPC user manuals]
* [http://sourceforge.net/projects/javacpc/ JavaCPC emulator]
* [http://cpcbox.com/ Amstrad CPC emulator in JavaScript] (best performance in Google Chrome, but sound only works in Firefox right now)
* [http://cpcbox.com/ Amstrad CPC emulator in JavaScript] (best performance in Google Chrome, but sound only works in Firefox right now)
* [http://www.cpcwiki.eu/index.php/Emulators List of other CPC emulators] at the [http://www.cpcwiki.eu/ Amstrad CPC Wiki]
* [http://www.cpcwiki.eu/index.php/Emulators List of CPC emulators] and [http://www.cpcwiki.eu/index.php/Locomotive_BASIC Locomotive BASIC] at the [http://www.cpcwiki.eu/ Amstrad CPC Wiki]