Difference between revisions of "Source Codes"
From CPCWiki - THE Amstrad CPC encyclopedia!
m (→CP/M: - added wikilink to "Programming:A simple 'Hello World' program for CP/M using BIOS") |
m (added "Sound" chapter with links to some articles) |
||
Line 99: | Line 99: | ||
*[[Programming:Dumping the data of BASIC or AMSDOS or an expansion rom|Dumping the data of BASIC or AMSDOS or an expansion rom]] | *[[Programming:Dumping the data of BASIC or AMSDOS or an expansion rom|Dumping the data of BASIC or AMSDOS or an expansion rom]] | ||
*[[Programming:Dumping the data of the lower rom|Dumping the data of the lower rom]] | *[[Programming:Dumping the data of the lower rom|Dumping the data of the lower rom]] | ||
+ | |||
+ | == Sound == | ||
+ | *[[Programming:Source code to show 0x0ff is always returned when reading PSG port B|Source code to show 0x0ff is always returned when reading PSG port B]] | ||
+ | *[[Programming:Source code to show it is possible to store data in PSG register 14 and 15 (port A and port B)|Source code to show it is possible to store data in PSG register 14 and 15 (port A and port B)]] | ||
+ | *[[Programming:Source code to show it is possible to store data in PSG register 14 and 15 even if the port has been set to input|Source code to show it is possible to store data in PSG register 14 and 15 even if the port has been set to input]] | ||
== Cross Development == | == Cross Development == | ||
*[[Programming:Cross Development|Cross Development]] | *[[Programming:Cross Development|Cross Development]] |
Revision as of 15:22, 24 June 2008
This article contains source codes and programming examples. You may also have a look at
Contents
Assembler
Algorithms
- CPC OS floating point routines
- CRC16
- CRC32
- Integer Division
- Integer Multiplication
- Ultrafast Multiplication by Prodatron
- Fast Square Root
- Fast 16 bit Square Root by Executioner
- Filling memory with a byte
- Square Root
- Precalculated square
- Random Number Generator
- Sin/Cos calculation
CP/M
- A simple 'Hello World' program for CP/M using BDOS
- A simple 'Hello World' program for CP/M using BIOS
- Executing firmware functions from within CP/M 2.1
- Executing firmware functions from within CP/M 2.1 or CP/M plus
- Executing firmware functions from within CP/M 2.1
- Executing firmware functions from within CP/M plus
CPC Plus
- Hardware sprites
- Horizontal scroll
- RLE hardware sprites
- Screen splitting
- Unlocking ASIC
- Vertical scroll
- Simple Raster Example 1 (uses CPC plus features)
- Simple Raster Example 2 (uses CPC plus features)
Devices
File access
- An example to read a file byte-by-byte
- An example to write a file byte-by-byte
- A simple file copier using firmware functions (copies byte-by-byte)
- Loading a file
- Saving a file
Floppy disk
- A simple disc copier using BDOS functions
- A simple disc formatter using BDOS functions
- An example loader
- Catalog a disc and retrieve a directory
- Detecting an Amstrad or Vortex disc controler
- Formatting a track on a disc
- Reading a sector from a disc
- Reading and writing the boot sector of a SYSTEM/VENDOR disc
- Writing a sector to disc
Graphics
- Display a 8-bit number in binary
- Display a 8-bit number in hex
- Display a byte as a 3-digit decimal number
- Display and update Scores
- Distorting the screen using register 2 of the CRTC (Horizontal Sync Position)
- Fast plot
- Fast Sprites by Executioner
- Fast Textoutput by Prodatron
- Hardware Scrolling by Executioner
- Hardware Scrolling 2
- Hardware scrolling the screen horizontally byte-by-byte using the CRTC
- Hardware scrolling the screen using the CRTC
- Overscan
- Plotting a sprite using character matrices
- Simple Raster Example
- Simple Split Raster Example
- Synchronising with the CRTC and display
Interrupts
Keyboard
Other routines
- An example boot sector (executed with rsx command CPM)
- An example to define a RSX
- Calling a RSX from outside of BASIC
- Dumping the data of BASIC or AMSDOS or an expansion rom
- Dumping the data of the lower rom
Sound
- Source code to show 0x0ff is always returned when reading PSG port B
- Source code to show it is possible to store data in PSG register 14 and 15 (port A and port B)
- Source code to show it is possible to store data in PSG register 14 and 15 even if the port has been set to input