├── .cpcec.txt.~undo-tree~ ├── .cpcecrc ├── .gitignore ├── README.md ├── c1541.rom ├── c64en.rom ├── cpc464.rom ├── cpc6128.rom ├── cpc664.rom ├── cpcados.rom ├── cpcec-a4.h ├── cpcec-a8.h ├── cpcec-ay.h ├── cpcec-d7.h ├── cpcec-k7.h ├── cpcec-m6.h ├── cpcec-m8.h ├── cpcec-os.h ├── cpcec-os.rc ├── cpcec-ox.h ├── cpcec-rt.h ├── cpcec-wd.h ├── cpcec-ym.h ├── cpcec-yo.h ├── cpcec-z8.h ├── cpcec.c ├── cpcec.ico ├── cpcec.png ├── cpcec.rc ├── cpcec.txt ├── cpcplus.rom ├── csfec-3b.vpl ├── csfec-a4.h ├── csfec.c ├── csfec.ico ├── csfec.png ├── csfec.rc ├── gpl.txt ├── msx.rom ├── msx2.rom ├── msx2p.rom ├── msxdisk.rom ├── msxec-3b.vpl ├── msxec-a4.h ├── msxec.c ├── msxec.ico ├── msxec.png ├── msxec.rc ├── msxec.sha ├── runec.c ├── sccplus.rom ├── spec-p-2.rom ├── spec-p-3.rom ├── spec128k.rom ├── spectrum.rom ├── trdos.rom ├── xrfec.c ├── zxsec-a4.h ├── zxsec.c ├── zxsec.ico ├── zxsec.png └── zxsec.rc /.cpcec.txt.~undo-tree~: -------------------------------------------------------------------------------- 1 | (undo-tree-save-format-version . 1) 2 | "6c6ab480c86eb2c565c10715f183df4871d66976" 3 | [nil current nil nil (26149 9941 682403 211000) 0 nil] 4 | nil 5 | -------------------------------------------------------------------------------- /.cpcecrc: -------------------------------------------------------------------------------- 1 | type 0 2 | crtc 1 3 | bank 1 4 | fdcw 3 5 | misc 2 6 | plct 0 7 | file /org/gourichon/localdata/stephane/SG/project/retrocomputing/bydate/2021/2021-09-12/csw2cdt-20210329-2555/block_from_tape.wav 8 | snap 9 | tape /org/gourichon/localdata/stephane/SG/project/retrocomputing/bydate/2021/2021-09-12/csw2cdt-20210329-2555/block_from_tape.wav 10 | disc /home/stephane/today/retrocomputing/cookie_-_the_doctor.dsk 11 | card /org/gourichon/localdata/stephane/SG/project/retrocomputing/bydate/2020/2020-05-09/cpcec/cpc464.rom 12 | dntr 13 | palette 2 14 | casette 5 15 | debug 0 16 | film 3 17 | info 1 18 | polyphony 1 19 | softaudio 0 20 | scanlines 0 21 | softvideo 0 22 | zoomvideo 0 23 | safevideo 1 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.exe 2 | *.elf 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CPCEC 2 | 3 | An emulator by CNGSOFT under GPLv3 license. 4 | 5 | This repository was created by a script turning the zip files available on http://cngsoft.no-ip.org/cpcec.htm into a git history. 6 | 7 | The emulator can compile on Windows and SDL2-supported platforms including Linux desktop. 8 | 9 | See [cpcec.txt](cpcec.txt) for instructions in English, including build instructions. 10 | 11 | Below is a snapshot of http://cngsoft.no-ip.org/cpcec.htm turned into markdown format. 12 | 13 | ## Foreword 14 | 15 | **CPCEC** is an emulator of the family of home microcomputers **Amstrad CPC** (models 464, 664, 6128 and Plus) whose goal is to be loyal to the original hardware and efficient in standard modern systems. Thus it brings a faithful emulation of the Z80 microprocessor and it replicates the behavior of the CRTC 6845 and Gate Array video chips, the PSG AY-3-8912 sound chip, the remaining circuits found in the original hardware, and the tape deck and floppy disc drive that made possible loading and running software. 16 | 17 | **ZXSEC** is an emulator of the **Sinclair Spectrum** family (48k, 128k, +2/Plus2 and +3/Plus3) based on the components it shared with the Amstrad CPC family: the Z80 microprocessor, the PSG AY-3-8192 sound chip, the tape system and the NEC765 disc drive controller. 18 | 19 | CPCEC requires a Microsoft Windows 2000 operating system or later. The minimal hardware requirements are those fitting the operating system, and it's advised that the main microprocessor runs at 400 MHz at least. Screen resolution in pixels must be 800x600 at least. A sound card is optional. Using a joystick is optional, too. 20 | 21 | The source code of CPCEC and its binaries follow the **GNU General Public License** v3, described in the file GPL.TXT within the package. 22 | 23 | ## Gallery 24 | 25 | | | | | | 26 | | --- | --- | --- | --- | 27 | | ![screenshot](http://cngsoft.no-ip.org/image_2019-01-07_00-43-04.png) *Arkanoid 2 (1988 Imagine) CPC 464* | ![screenshot](http://cngsoft.no-ip.org/image_2019-03-01_01-18-38.png) *Skweek (1989 Loriciels) CPC 6128* | ![screenshot](http://cngsoft.no-ip.org/image_2019-03-03_02-24-13.png) *Cobra (1986 Ocean) Spectrum 48k* | ![screenshot](http://cngsoft.no-ip.org/image_2019-03-06_22-28-31.png) *Zub (1987 Mastertronic) Spectrum 128k* | 28 | | ![screenshot](http://cngsoft.no-ip.org/image_2019-01-02_13-19-16.png) *Mega Phoenix (1991 Dinamic) CPC 464* | ![screenshot](http://cngsoft.no-ip.org/image_2019-02-07_21-16-00.png) *Beast Preview (1992 Overflow) CPC 6128* | ![screenshot](http://cngsoft.no-ip.org/image_2019-03-16_21-28-00.png) *Dark Star (1984 Design Design) Spectrum 48k* | ![screenshot](http://cngsoft.no-ip.org/image_2019-03-03_18-15-06.png) *Deliverance (1990 Hewson) Spectrum 128k* | 29 | | ![screenshot](http://cngsoft.no-ip.org/image_2018-12-29_01-21-51.png) *Mission Genocide (1987 Firebird) CPC 464* | ![screenshot](http://cngsoft.no-ip.org/image_2019-01-30_19-53-25.png) *Logon's Run (2017 Logon System) CPC 6128* | ![screenshot](http://cngsoft.no-ip.org/image_2019-03-02_22-35-43.png) *Starion (1985 Melbourne House) Spectrum 48k* | ![screenshot](http://cngsoft.no-ip.org/image_2019-03-15_13-23-17.png) *Mot (1989 Opera Soft) Spectrum Plus3* | 30 | | ![screenshot](http://cngsoft.no-ip.org/image_2019-01-07_00-40-36.png) *Samurai Trilogy (1987 Gremlin) CPC 464* | ![screenshot](http://cngsoft.no-ip.org/image_2019-01-07_13-12-09.png) *PhX (2018 Condense) CPC 6128* | ![screenshot](http://cngsoft.no-ip.org/image_2019-03-02_22-35-58.png) *Vectron (1988 Firebird) Spectrum 48k* | ![screenshot](http://cngsoft.no-ip.org/image_2019-03-06_22-53-09.png) *Cray 5 (2011 Retroworks) Spectrum Plus3* | 31 | 32 | ## Acknowledgements 33 | 34 | This emulator owes its existence to a series of people and societies that are listed as follows: 35 | 36 | * The firmware files included in the package are **Amstrad's** properties, who allows the emulation of their old computer systems and supports the distribution of their firmwares as long as their authorship and contents are respected, and whom I wholeheartedly thank the creation of those magnificent computers and the good will towards their emulation. 37 | * This emulator was my final project for the Computer Engineering postdegree at the **Distance-Learning National University (Universidad Nacional de Enseñanza a Distancia, UNED)**, a project directed by professor **José Manuel Díaz Martínez** and ultimately awarded a 100% and the right to a honorable mention. 38 | * The documentation about the system comes from **cpcwiki.eu**, **cpc-power.com**, **cpcrulez.fr** and **quasar.cpcscene.net**. 39 | * The alpha tests were handled by the faithful and loyal **Denis Lechevalier**. 40 | 41 | ## Version log 42 | 43 | See https://github.com/cpcitor/cpcec/commits 44 | -------------------------------------------------------------------------------- /c1541.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpcec/388d149130075234228b15fd395fcd69515a53d0/c1541.rom -------------------------------------------------------------------------------- /c64en.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpcec/388d149130075234228b15fd395fcd69515a53d0/c64en.rom -------------------------------------------------------------------------------- /cpc464.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpcec/388d149130075234228b15fd395fcd69515a53d0/cpc464.rom -------------------------------------------------------------------------------- /cpc6128.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpcec/388d149130075234228b15fd395fcd69515a53d0/cpc6128.rom -------------------------------------------------------------------------------- /cpc664.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpcec/388d149130075234228b15fd395fcd69515a53d0/cpc664.rom -------------------------------------------------------------------------------- /cpcados.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpcec/388d149130075234228b15fd395fcd69515a53d0/cpcados.rom -------------------------------------------------------------------------------- /cpcec-a4.h: -------------------------------------------------------------------------------- 1 | 0X0000,0X0000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0X0000,0X0000, 2 | 0X0000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0X0000, 3 | 0XF000,0XF000,0XF000,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF800,0XF080,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF080,0XF048,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000,0XF000, 4 | 0XF000,0XF000,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF800,0XF080,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF080,0XF048,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 5 | 0XF000,0XF000,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF800,0XF080,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF080,0XF048,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 6 | 0XF000,0XF000,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF800,0XF080,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF080,0XF048,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 7 | 0XF000,0XF000,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF800,0XF080,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF080,0XF048,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 8 | 0XF000,0XF000,0XFF00,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF800,0XF080,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF080,0XF048,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF08F,0XF000,0XF000, 9 | 0XF000,0XF000,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XF800,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF048,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF000,0XF000, 10 | 0XF000,0XF000,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XF800,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF048,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF000,0XF000, 11 | 0XF000,0XF000,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XF800,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF048,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF000,0XF000, 12 | 0XF000,0XF000,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XF800,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF048,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF000,0XF000, 13 | 0XF000,0XF000,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XF800,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF048,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF000,0XF000, 14 | 0XF000,0XF000,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XF800,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF048,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF000,0XF000, 15 | 0XF000,0XF000,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XF800,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF048,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF000,0XF000, 16 | 0XF000,0XF000,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XF800,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF048,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF000,0XF000, 17 | 0XF000,0XF000,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XF800,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF048,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF000,0XF000, 18 | 0XF000,0XF000,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XF800,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF048,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF000,0XF000, 19 | 0XF000,0XF000,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XF800,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF048,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF000,0XF000, 20 | 0XF000,0XF000,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XF800,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF048,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF000,0XF000, 21 | 0XF000,0XF000,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XF800,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF048,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF000,0XF000, 22 | 0XF000,0XF000,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XF800,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF048,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF000,0XF000, 23 | 0XF000,0XF000,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XF800,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF048,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF000,0XF000, 24 | 0XF000,0XF000,0XF800,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XF800,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF048,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF048,0XF000,0XF000, 25 | 0XF000,0XF000,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF000,0XF000, 26 | 0XF000,0XF000,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF000,0XF000, 27 | 0XF000,0XF000,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF000,0XF000, 28 | 0XF000,0XF000,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF000,0XF000, 29 | 0XF000,0XF000,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF000,0XF000, 30 | 0XF000,0XF000,0XF000,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF000,0XF000,0XF000, 31 | 0X0000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0X0000, 32 | 0X0000,0X0000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0X0000,0X0000, 33 | 34 | -------------------------------------------------------------------------------- /cpcec-a8.h: -------------------------------------------------------------------------------- 1 | const unsigned char onscreen_chrs[]={ 2 | 0,124,68,68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124,0, 3 | 0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124, 4 | 0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124, 5 | 0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124, 6 | 0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124, 7 | 0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124, 8 | 0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124, 9 | 0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124, 10 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,6,6,204,108,56,24,0,0,0,0,0,0,0, 11 | 0,0,0,0,0,0,0,0,0,0,60,126,126,126,126,60,0,0,0,0,124,68,68,68,68,68, 12 | 68,68,124,0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68, 13 | 68,68,124,0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,0,1,3,7,15,31,63, 14 | 0,63,0,0,0,0,128,192,224,240,248,252,0,252,0,0,0,0,63,0,63,31,15,7,3, 15 | 1,0,0,0,0,252,0,252,248,240,224,192,128,0,0,0,124,68,68,68,68,68,68, 16 | 68,124,0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68, 17 | 68,124,0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,0,0,0,0,0,0,0,0,0,0, 18 | 0,0,16,16,16,16,16,16,16,0,16,0,0,68,68,68,0,0,0,0,0,0,0,0,0,0,68,68, 19 | 124,68,68,68,124,68,68,0,0,16,16,60,68,64,56,4,68,120,16,16,0,0,64,64, 20 | 68,8,16,32,68,4,4,0,0,0,56,68,68,68,62,68,68,68,62,0,0,16,16,16,0,0, 21 | 0,0,0,0,0,0,0,0,8,16,32,32,32,32,32,16,8,0,0,0,32,16,8,8,8,8,8,16,32, 22 | 0,0,0,0,16,84,40,16,40,84,16,0,0,0,0,0,0,16,16,124,16,16,0,0,0,0,0,0, 23 | 0,0,0,0,0,0,16,16,32,0,0,0,0,0,0,124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16, 24 | 16,0,0,0,4,4,8,8,16,32,32,64,64,0,0,0,56,68,68,76,68,100,68,68,56,0, 25 | 0,0,16,112,16,16,16,16,16,16,124,0,0,0,56,68,4,4,24,32,64,68,124,0,0, 26 | 0,56,68,4,4,24,4,4,68,56,0,0,0,4,12,20,36,68,124,4,4,4,0,0,0,124,68, 27 | 64,64,120,4,4,68,56,0,0,0,56,68,64,64,120,68,68,68,56,0,0,0,124,68,4, 28 | 4,8,16,16,16,16,0,0,0,56,68,68,68,56,68,68,68,56,0,0,0,56,68,68,68,60, 29 | 4,4,68,56,0,0,0,0,0,0,16,16,0,0,16,16,0,0,0,0,0,0,16,16,0,0,16,16,32, 30 | 0,0,4,8,16,32,64,32,16,8,4,0,0,0,0,0,0,124,0,124,0,0,0,0,0,0,64,32,16, 31 | 8,4,8,16,32,64,0,0,0,56,68,4,4,8,16,16,0,16,0,0,0,56,68,92,84,84,84, 32 | 92,64,56,0,0,0,16,40,68,68,124,68,68,68,68,0,0,0,120,68,68,68,120,68, 33 | 68,68,120,0,0,0,56,68,64,64,64,64,64,68,56,0,0,0,112,72,68,68,68,68, 34 | 68,72,112,0,0,0,124,64,64,64,112,64,64,64,124,0,0,0,124,64,64,64,112, 35 | 64,64,64,64,0,0,0,56,68,64,64,76,68,68,68,60,0,0,0,68,68,68,68,124,68, 36 | 68,68,68,0,0,0,124,16,16,16,16,16,16,16,124,0,0,0,28,4,4,4,4,4,4,68, 37 | 56,0,0,0,68,68,68,72,112,72,68,68,68,0,0,0,64,64,64,64,64,64,64,64,124, 38 | 0,0,0,68,108,108,84,84,68,68,68,68,0,0,0,68,68,100,100,76,76,68,68,68, 39 | 0,0,0,56,68,68,68,68,68,68,68,56,0,0,0,120,68,68,68,120,64,64,64,64, 40 | 0,0,0,56,68,68,68,68,68,84,76,60,0,0,0,120,68,68,68,120,72,68,68,68, 41 | 0,0,0,56,68,64,64,56,4,4,68,56,0,0,0,124,16,16,16,16,16,16,16,16,0,0, 42 | 0,68,68,68,68,68,68,68,68,56,0,0,0,68,68,68,68,68,68,68,40,16,0,0,0, 43 | 68,68,68,68,84,84,108,108,68,0,0,0,68,68,68,40,16,40,68,68,68,0,0,0, 44 | 68,68,68,40,16,16,16,16,16,0,0,0,124,4,4,8,16,32,64,64,124,0,0,0,56, 45 | 32,32,32,32,32,32,32,56,0,0,0,64,64,32,32,16,8,8,4,4,0,0,0,56,8,8,8, 46 | 8,8,8,8,56,0,0,16,40,68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254, 47 | 32,16,8,0,0,0,0,0,0,0,0,0,0,0,0,0,56,4,60,68,68,60,0,0,0,64,64,64,120, 48 | 68,68,68,68,120,0,0,0,0,0,0,56,68,64,64,68,56,0,0,0,4,4,4,60,68,68,68, 49 | 68,60,0,0,0,0,0,0,56,68,124,64,68,56,0,0,0,56,68,64,112,64,64,64,64, 50 | 64,0,0,0,0,0,0,60,68,68,68,60,4,68,56,0,64,64,64,120,68,68,68,68,68, 51 | 0,0,0,0,16,0,112,16,16,16,16,124,0,0,0,0,4,0,28,4,4,4,4,4,68,56,0,64, 52 | 64,64,68,68,120,68,68,68,0,0,0,112,16,16,16,16,16,16,16,124,0,0,0,0, 53 | 0,0,104,84,84,68,68,68,0,0,0,0,0,0,120,68,68,68,68,68,0,0,0,0,0,0,56, 54 | 68,68,68,68,56,0,0,0,0,0,0,120,68,68,68,68,120,64,64,0,0,0,0,60,68,68, 55 | 68,68,60,4,4,0,0,0,0,120,68,64,64,64,64,0,0,0,0,0,0,56,64,56,4,68,56, 56 | 0,0,0,64,64,64,112,64,64,64,68,56,0,0,0,0,0,0,68,68,68,68,68,60,0,0, 57 | 0,0,0,0,68,68,68,68,40,16,0,0,0,0,0,0,68,68,84,84,84,44,0,0,0,0,0,0, 58 | 68,68,56,68,68,68,0,0,0,0,0,0,68,68,68,68,60,4,68,56,0,0,0,0,124,4,56, 59 | 64,64,124,0,0,0,12,16,16,16,96,16,16,16,12,0,0,0,16,16,16,16,16,16,16, 60 | 16,16,0,0,0,96,16,16,16,12,16,16,16,96,0,0,36,72,0,0,0,0,0,0,0,0,0,0, 61 | 0,0,0,0,0,0,0,0,66,66,0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68, 62 | 68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68, 63 | 68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68, 64 | 68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68, 65 | 68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68, 66 | 68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68, 67 | 68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68, 68 | 68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68, 69 | 68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68, 70 | 68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68, 71 | 68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68, 72 | 68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68, 73 | 68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68, 74 | 68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68, 75 | 68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68, 76 | 68,68,68,68,68,68,124,0,0,0,124,68,68,68,68,68,68,68,124,0,0,0,124,68, 77 | 68,68,68,68,68,68,124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,16,16,16,16, 78 | 16,16,16,0,0,0,0,16,56,68,64,64,68,56,16,0,0,0,56,68,64,64,112,64,64, 79 | 64,124,0,0,0,0,68,56,68,68,68,56,68,0,0,0,0,68,68,68,40,16,124,16,16, 80 | 16,0,0,0,16,16,16,16,0,16,16,16,16,0,0,0,56,68,64,120,68,60,4,68,56, 81 | 0,0,68,68,0,0,0,0,0,0,0,0,0,0,56,68,64,64,68,56,0,0,0,0,0,0,56,4,60, 82 | 68,60,0,124,0,0,0,0,0,0,0,0,20,40,80,40,20,0,0,0,0,0,0,0,0,124,4,4,0, 83 | 0,0,0,0,0,0,0,0,0,56,0,0,0,0,0,0,120,68,68,120,68,68,0,0,0,0,0,0,124, 84 | 0,0,0,0,0,0,0,0,0,0,0,56,68,68,68,56,0,0,0,0,0,0,0,0,0,16,16,124,16, 85 | 16,0,124,0,0,0,120,4,56,64,124,0,0,0,0,0,0,0,120,4,24,4,120,0,0,0,0, 86 | 0,0,0,8,16,32,0,0,0,0,0,0,0,0,0,0,0,0,0,68,68,68,68,68,120,64,64,0,60, 87 | 120,120,120,56,8,8,8,8,0,0,0,0,0,0,16,16,16,0,0,0,0,0,0,0,0,0,0,0,0, 88 | 0,0,16,16,32,16,112,16,16,124,0,0,0,0,0,0,0,56,68,68,68,56,0,124,0,0, 89 | 0,0,0,0,0,0,80,40,20,40,80,0,0,0,0,64,192,64,68,232,16,40,74,14,2,2, 90 | 0,64,192,64,68,232,16,44,66,4,8,14,0,192,32,64,36,200,16,40,74,14,2, 91 | 2,0,0,16,0,16,16,32,64,64,68,56,0,0,112,0,16,40,68,68,124,68,68,68,0, 92 | 0,28,0,16,40,68,68,124,68,68,68,0,0,124,0,16,40,68,68,124,68,68,68,0, 93 | 0,36,72,16,40,68,68,124,68,68,68,0,0,68,0,16,40,68,68,124,68,68,68,0, 94 | 0,16,0,16,40,68,68,124,68,68,68,0,0,0,60,80,80,80,120,80,80,80,92,0, 95 | 0,0,56,68,64,64,64,64,64,68,56,16,32,112,0,124,64,64,112,64,64,64,124, 96 | 0,0,28,0,124,64,64,112,64,64,64,124,0,0,124,0,124,64,64,112,64,64,64, 97 | 124,0,0,68,0,124,64,64,112,64,64,64,124,0,0,112,0,124,16,16,16,16,16, 98 | 16,124,0,0,28,0,124,16,16,16,16,16,16,124,0,0,124,0,124,16,16,16,16, 99 | 16,16,124,0,0,68,0,124,16,16,16,16,16,16,124,0,0,0,112,72,68,68,100, 100 | 68,68,72,112,0,0,124,0,68,68,100,100,76,76,68,68,0,0,112,0,56,68,68, 101 | 68,68,68,68,56,0,0,28,0,56,68,68,68,68,68,68,56,0,0,124,0,56,68,68,68, 102 | 68,68,68,56,0,0,36,72,56,68,68,68,68,68,68,56,0,0,68,0,56,68,68,68,68, 103 | 68,68,56,0,0,0,0,0,68,40,16,40,68,0,0,0,0,0,60,68,76,76,68,100,100,68, 104 | 120,0,0,112,0,68,68,68,68,68,68,68,56,0,0,28,0,68,68,68,68,68,68,68, 105 | 56,0,0,124,0,68,68,68,68,68,68,68,56,0,0,68,0,68,68,68,68,68,68,68,56, 106 | 0,0,28,0,68,68,68,40,16,16,16,16,0,0,0,64,64,120,68,68,68,120,64,64, 107 | 0,0,0,56,68,68,68,88,68,68,68,88,0,0,32,16,8,0,56,4,60,68,68,60,0,0, 108 | 8,16,32,0,56,4,60,68,68,60,0,0,16,40,68,0,56,4,60,68,68,60,0,0,36,72, 109 | 0,0,56,4,60,68,68,60,0,0,68,68,0,0,56,4,60,68,68,60,0,0,16,16,0,0,56, 110 | 4,60,68,68,60,0,0,0,0,0,0,120,20,60,80,84,56,0,0,0,0,0,0,56,68,64,64, 111 | 68,56,16,32,32,16,8,0,56,68,124,64,68,56,0,0,8,16,32,0,56,68,124,64, 112 | 68,56,0,0,16,40,68,0,56,68,124,64,68,56,0,0,68,68,0,0,56,68,124,64,68, 113 | 56,0,0,32,16,8,0,112,16,16,16,16,124,0,0,8,16,32,0,112,16,16,16,16,124, 114 | 0,0,16,40,68,0,112,16,16,16,16,124,0,0,68,68,0,0,112,16,16,16,16,124, 115 | 0,0,36,72,4,4,60,68,68,68,68,60,0,0,36,72,0,0,120,68,68,68,68,68,0,0, 116 | 32,16,8,0,56,68,68,68,68,56,0,0,8,16,32,0,56,68,68,68,68,56,0,0,16,40, 117 | 68,0,56,68,68,68,68,56,0,0,36,72,0,0,56,68,68,68,68,56,0,0,68,68,0,0, 118 | 56,68,68,68,68,56,0,0,0,0,16,16,0,124,0,16,16,0,0,0,0,0,0,0,60,68,76, 119 | 100,68,120,0,0,32,16,8,0,68,68,68,68,68,60,0,0,8,16,32,0,68,68,68,68, 120 | 68,60,0,0,16,40,68,0,68,68,68,68,68,60,0,0,68,68,0,0,68,68,68,68,68, 121 | 60,0,0,8,16,32,0,68,68,68,68,60,4,68,56,0,64,64,64,120,68,68,68,120, 122 | 64,64,64,68,68,0,0,68,68,68,68,60,4,68,56, 123 | }; 124 | -------------------------------------------------------------------------------- /cpcec-ay.h: -------------------------------------------------------------------------------- 1 | // #### ###### #### ####### #### ------------------------- // 2 | // ## ## ## ## ## ## ## # ## ## CPCEC, plain text Amstrad // 3 | // ## ## ## ## ## # ## CPC emulator written in C // 4 | // ## ##### ## #### ## as a postgraduate project // 5 | // ## ## ## ## # ## by Cesar Nicolas-Gonzalez // 6 | // ## ## ## ## ## ## # ## ## since 2018-12-01 till now // 7 | // #### #### #### ####### #### ------------------------- // 8 | 9 | // The General Instruments PSG AY-3-8910 sound chip (together with 10 | // compatible replacements such as the YM2149) that plays the sound in 11 | // the Amstrad CPC machines was popular in arcade games of the 1980s, 12 | // as well in home computers: Spectrum 128, +2 and +3, Atari ST, etc. 13 | 14 | // YM3 format output can be shared with other chips (cfr. cpcec-ym.h) 15 | 16 | // BEGINNING OF PSG AY-3-8910 EMULATION ============================== // 17 | 18 | int psg_outputs[17]={0,(PSG_MAX_VOICE*65536)>>23,(PSG_MAX_VOICE*46341)>>22,(PSG_MAX_VOICE*65536)>>22, // 16 static levels... 19 | (PSG_MAX_VOICE*46341)>>21,(PSG_MAX_VOICE*65536)>>21,(PSG_MAX_VOICE*46341)>>20,(PSG_MAX_VOICE*65536)>>20, 20 | (PSG_MAX_VOICE*46341)>>19,(PSG_MAX_VOICE*65536)>>19,(PSG_MAX_VOICE*46341)>>18,(PSG_MAX_VOICE*65536)>>18, 21 | (PSG_MAX_VOICE*46341)>>17,(PSG_MAX_VOICE*65536)>>17,(PSG_MAX_VOICE*46341)>>16,PSG_MAX_VOICE,0}; // + dynamic level 22 | 23 | void psg_weight(int v) // for systems where extra devices may tone the PSG down 24 | { 25 | psg_outputs[16]=(psg_outputs[16]*v+(psg_outputs[15]>>1))/psg_outputs[15],psg_outputs[15]=v; 26 | for (int i=0;i<7;++i) psg_outputs[i*2+1]=(v*65536)>>(23-i),psg_outputs[i*2+2]=(v*46341)>>(22-i); 27 | } 28 | 29 | const BYTE psg_valid[16]={ 255,15,255,15,255,15,31,255,31,31,31,255,255,15,255,255 }; // bit masks 30 | BYTE psg_index,psg_table[16]; // index and table 31 | BYTE psg_hard_log=0xFF; // default mode: drop and stay 32 | #define PSG_ULTRASOUND (PSG_KHZ_CLOCK*256/AUDIO_PLAYBACK) 33 | int psg_ultra_beep,psg_ultra_hits; // ultrasound/beeper filter 34 | 35 | const BYTE psg_envelope[8][32]= // precalc'd tables, better than calculating these values on the fly 36 | { 37 | { 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, // \\\\ // 38 | { 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // \... // 39 | { 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15 }, // \/\/ // 40 | { 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15 }, // \''' // 41 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15 }, // //// // 42 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15 }, // /''' // 43 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }, // /\/\ // 44 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // /... // 45 | }; 46 | 47 | // frequencies (or more properly, wave lengths) are handled as counters 48 | // that toggle the channels' output status when they reach their current limits. 49 | int psg_tone_count[3]={0,0,0},psg_tone_state[3]={0,0,0}; 50 | int psg_tone_limit[3],psg_tone_power[3],psg_tone_mixer[3]; 51 | int psg_noise_limit,psg_noise_count=0; 52 | int psg_hard_limit,psg_hard_count; char psg_hard_style,psg_hard_level; 53 | #if !AUDIO_ALWAYS_MONO 54 | int psg_stereo[3][2]; // the three channels' LEFT and RIGHT weights 55 | #endif 56 | void psg_reg_update(int c) 57 | { 58 | switch (c) 59 | { 60 | case 0: case 2: case 4: // LO wavelengths 61 | case 1: case 3: case 5: // HI wavelengths 62 | // catch overflows, either bad (buggy music in "Thing on a Spring" for CPC) 63 | // or good (pipe sound effect in its sequel "Thing Bounces Back" for CPC) 64 | c>>=1; if (psg_tone_count[c]>(psg_tone_limit[c]=psg_table[c*2]+psg_table[c*2+1]*256)) 65 | if ((psg_tone_count[c]=psg_tone_limit[c])<=PSG_ULTRASOUND) // ensure count<=limit 66 | psg_tone_state[c]=psg_ultra_beep; // is it an ultrasound? catch it already! 67 | break; 68 | case 6: // noise wavelength 69 | if (psg_noise_count>(psg_noise_limit=psg_table[6]&31)) 70 | psg_noise_count=psg_noise_limit; // cfr. nota supra 71 | break; 72 | case 7: // mixer bits 73 | for (c=0;c<3;++c) 74 | psg_tone_mixer[c]=psg_table[7]>>c; // 8+1, 16+2, 32+4 75 | break; 76 | case 8: case 9: case 10: // amplitudes 77 | if ((psg_tone_power[c-8]=psg_table[c])&16) // hard envelope? 78 | psg_tone_power[c-8]=16; 79 | break; 80 | case 11: case 12: // envelope wavelength 81 | if (psg_hard_count>(psg_hard_limit=psg_table[11]+psg_table[12]*256)) 82 | psg_hard_count=psg_hard_limit; // cfr. nota supra 83 | break; 84 | case 13: // envelope bits 85 | c=psg_table[13]/*&15*/; psg_hard_count=psg_hard_level=0; 86 | psg_hard_log=psg_hard_style=c<4?1:c>=8?c&7:7; // unify styles! 87 | break; 88 | } 89 | } 90 | void psg_all_update(void) // recalc everything 91 | { 92 | for (int i=0;i<14;++i) 93 | { 94 | psg_table[i]&=psg_valid[i]; 95 | if (i!=0&&i!=2&&i!=4&&i!=11) // don't update the same 16-bit register twice 96 | psg_reg_update(i); 97 | } 98 | } 99 | 100 | INLINE void psg_table_sendto(BYTE x,BYTE i) 101 | { 102 | if (x<16) // reject invalid index! the limit isn't 14, tho': the CPC+ demo "PHAT" relies on writing and reading R15! 103 | { 104 | if (x==7) // detect Spectrum-like CPC beepers such as "Stormbringer" and "Terminus": 105 | psg_ultra_hits?(psg_ultra_hits=0):(psg_ultra_beep=0); // PSG-based beepers repeatedly hit the mixer! 106 | else 107 | psg_ultra_hits=psg_ultra_beep=-1; // normal audio playback pokes more registers than just the mixer! 108 | if (psg_table[x]!=(i&=psg_valid[x])||x==13) // monitor register clobbering; exception is reg.13 (envelope retrigger) 109 | psg_table[x]=i,psg_reg_update(x); 110 | } 111 | } 112 | #define psg_table_select(i) (psg_index=(i)) // "NODES OF YESOD" for CPC needs all bits because of a programming error! 113 | #define psg_table_send(i) psg_table_sendto(psg_index,(i)) 114 | #define psg_table_recv() (psg_index<16?psg_table[psg_index]:0xFF) 115 | #define psg_port_a_lock() (psg_table[7]&64) // used on CPC for the keyboard and on Spectrum 128K for the printer 116 | #define psg_port_b_lock() (psg_table[7]&128) // used on CPC by the PLUS demo "PHAT", unused on Spectrum (AFAIK) 117 | 118 | #define psg_setup() 119 | 120 | // The CPC PlayCity, Spectrum Turbosound and MSX Second PSG require their own logic, as they're more than an extra set of AY chips! 121 | // Enable then with #define PSG_PLAYCITY 1..n (though right now only CPCEC requires two extra chips; ZXSEC and MSXEC just equip one) 122 | 123 | #ifdef PSG_PLAYCITY 124 | BYTE playcity_table[PSG_PLAYCITY][16],playcity_index[PSG_PLAYCITY],playcity_hard_new[PSG_PLAYCITY]; 125 | int playcity_hard_style[PSG_PLAYCITY],playcity_hard_count[PSG_PLAYCITY],playcity_hard_level[PSG_PLAYCITY]; 126 | #if !AUDIO_ALWAYS_MONO 127 | int playcity_stereo[PSG_PLAYCITY][3][2]; 128 | #endif 129 | void playcity_select(BYTE x,BYTE b) 130 | { 131 | #if PSG_PLAYCITY == 1 132 | if (!x) 133 | #else 134 | if (x=8?b&7:7; 152 | } 153 | } 154 | } 155 | BYTE playcity_recv(BYTE x) 156 | { 157 | return ( 158 | #if PSG_PLAYCITY == 1 159 | !x 160 | #else 161 | x=AUDIO_LENGTH_Z||(r+=t<>23)^(crash>>18))&1); // 23-bit LFSR randomizer 221 | } 222 | //} 223 | //else // update hard envelope, at half the rate 224 | //{ 225 | psg_outputs[16]=psg_outputs[psg_envelope[psg_hard_style][psg_hard_level]]; 226 | if (--psg_hard_count<=0) 227 | { 228 | psg_hard_count=psg_hard_limit; 229 | if (++psg_hard_level>=32) // end of hard envelope? 230 | psg_hard_level=(psg_hard_style&1)?16:0; // stop or loop! 231 | } 232 | } 233 | for (int c=0;c<3;++c) 234 | if (--psg_tone_count[c]<=0) // update channel; ultrasound/beeper filter 235 | psg_tone_state[c]=(psg_tone_count[c]=psg_tone_limit[c])<=PSG_ULTRASOUND?psg_ultra_beep:~psg_tone_state[c]; 236 | } 237 | for (int c=0;c<3;++c) 238 | if ((psg_tone_mixer[c]&1)|psg_tone_state[c]) // is the channel active? 239 | if ((psg_tone_mixer[c]&8)|smash) // is the channel noisy? 240 | #if !AUDIO_ALWAYS_MONO 241 | { 242 | int o=psg_outputs[psg_tone_power[c]]; 243 | o0+=o*psg_stereo[c][0], 244 | o1+=o*psg_stereo[c][1]; 245 | } 246 | o0+=d, 247 | o1+=d; 248 | #else 249 | o+=psg_outputs[psg_tone_power[c]]; 250 | o+=d; 251 | #endif 252 | ++n; 253 | static int b=0; if ((b-=(AUDIO_PLAYBACK*PSG_TICK_STEP)>>PSG_MAIN_EXTRABITS)<=0) 254 | { 255 | b+=TICKS_PER_SECOND; 256 | #if AUDIO_CHANNELS > 1 257 | #if !AUDIO_ALWAYS_MONO 258 | int dd=n<<(24-AUDIO_BITDEPTH),qq; 259 | *audio_target++=(qq=o0/dd)+AUDIO_ZERO,o0-=qq*dd, // rounded average (left) 260 | *audio_target++=(qq=o1/dd)+AUDIO_ZERO,o1-=qq*dd; // rounded average (right) 261 | #else 262 | int dd=n<<(16-AUDIO_BITDEPTH),qq; 263 | *audio_target++=(qq=o/dd)+AUDIO_ZERO, // rounded average (left) 264 | *audio_target++=qq+AUDIO_ZERO,o-=qq*dd; // rounded average (right) 265 | #endif 266 | #else 267 | int dd=n<<(16-AUDIO_BITDEPTH),qq; 268 | *audio_target++=(qq=o /dd)+AUDIO_ZERO,o -=qq*dd; // rounded average 269 | #endif 270 | if (n=0,++audio_pos_z>=AUDIO_LENGTH_Z) r%=PSG_TICK_STEP; // end of buffer! 271 | } 272 | } 273 | while ((r-=PSG_TICK_STEP)>=0); 274 | } 275 | 276 | // Again, the PlayCity extension requires its own logic, as it "piggybacks" on top of the central AY chip; 277 | // notice how there are several differences in the timing (configurable), the mixing and the streamlining. 278 | 279 | #ifdef PSG_PLAYCITY 280 | void playcity_main(AUDIO_UNIT *t,int l) 281 | { 282 | int playcity_tone_limit[PSG_PLAYCITY][3],playcity_tone_power[PSG_PLAYCITY][3],playcity_tone_mixer[PSG_PLAYCITY][3],playcity_noise_limit[PSG_PLAYCITY],playcity_hard_limit[PSG_PLAYCITY]; 283 | static int playcity_tone_count[PSG_PLAYCITY][3],playcity_noise_count[PSG_PLAYCITY],playcity_hard_power[PSG_PLAYCITY]; 284 | #if PSG_PLAYCITY == 1 285 | static int playcity_tone_state[PSG_PLAYCITY][3]={{0,0,0}}; static unsigned int smash[PSG_PLAYCITY]={0},crash[PSG_PLAYCITY]={1}; 286 | if (playcity_table[0][7]==0XFF||l<=0) return; // nothing to do? quit! 287 | const int x=0; 288 | #else 289 | static int playcity_tone_state[PSG_PLAYCITY][3]={{0,0,0},{0,0,0}}; static unsigned int smash[PSG_PLAYCITY]={0,0},crash[PSG_PLAYCITY]={1,1}; 290 | int dirty_l=playcity_table[0][7]==0XFF,dirty_h=playcity_table[1][7]!=0XFF; 291 | if (dirty_l>dirty_h||l<=0) return; // disabled chips? no buffer? quit! 292 | for (int x=dirty_l;x<=dirty_h;++x) 293 | #endif 294 | { 295 | for (int c=0;c<3;++c) // preload channel limits 296 | { 297 | playcity_tone_power[x][c]=playcity_table[x][c*1+8]; 298 | playcity_tone_mixer[x][c]=playcity_table[x][7]>>c; 299 | if ((playcity_tone_limit[x][c]=playcity_table[x][c*2+0]+playcity_table[x][c*2+1]*256)<=PSG_ULTRASOUND) 300 | playcity_tone_mixer[x][c]|=1; // catch ultrasounds! 301 | } 302 | if (!(playcity_noise_limit[x]=playcity_table[x][6])) // noise limits 303 | playcity_noise_limit[x]=1; 304 | if (!(playcity_hard_limit[x]=playcity_table[x][11]+playcity_table[x][12]*256)) // hard envelope limits 305 | playcity_hard_limit[x]=1; 306 | } 307 | #if !AUDIO_ALWAYS_MONO 308 | static int n=0,o0=0,o1=0; // output averages 309 | #else 310 | static int n=0,o=0; // output average 311 | #endif 312 | for (;;) 313 | { 314 | const int hiclk=playcity_hiclock,loclk=playcity_loclock; // redundant in systems where these values are constant 315 | static int p=0; p+=hiclk; while (p>=0) 316 | { 317 | #if PSG_PLAYCITY == 1 318 | static char q=0; // see below 319 | #else 320 | static char q=0; q=~q; // toggle once for ALL chips! 321 | for (int x=dirty_l;x<=dirty_h;++x) // update all chips 322 | #endif 323 | { 324 | #if PSG_PLAYCITY == 1 325 | if (q=~q) // update noises, half the rate 326 | #else 327 | if (q) // see above 328 | #endif 329 | { 330 | if (--playcity_noise_count[x]<=0) 331 | { 332 | playcity_noise_count[x]=playcity_noise_limit[x]; 333 | smash[x]=crash[x]&1; crash[x]<<=1; crash[x]+=(((crash[x]>>23)^(crash[x]>>18))&1); // 23-bit LFSR 334 | } 335 | //} 336 | //else // update hard envelopes, half the rate 337 | //{ 338 | playcity_hard_power[x]=psg_envelope[playcity_hard_style[x]][playcity_hard_level[x]]; 339 | if (--playcity_hard_count[x]<=0) 340 | { 341 | playcity_hard_count[x]=playcity_hard_limit[x]; 342 | if (++playcity_hard_level[x]>=32) // end of hard envelope? 343 | playcity_hard_level[x]=(playcity_hard_style[x]&1)?16:0; // stop or loop! 344 | } 345 | } 346 | for (int c=0;c<3;++c) // update channels and render output 347 | { 348 | if (--playcity_tone_count[x][c]<=0) // end of count? 349 | playcity_tone_count[x][c]=playcity_tone_limit[x][c], 350 | playcity_tone_state[x][c]=~playcity_tone_state[x][c]; 351 | if (playcity_tone_state[x][c]|(playcity_tone_mixer[x][c]&1)) // active channel? 352 | if (smash[x]|(playcity_tone_mixer[x][c]&8)) // noisy channel? 353 | { 354 | int z=playcity_tone_power[x][c]; 355 | if (z&16) 356 | z=playcity_hard_power[x]; 357 | #if !AUDIO_ALWAYS_MONO 358 | int o=PSG_PLAYCITY_XLAT(z); 359 | o0+=o*playcity_stereo[x][c][0], 360 | o1+=o*playcity_stereo[x][c][1]; 361 | #else 362 | o+=PSG_PLAYCITY_XLAT(z); 363 | #endif 364 | } 365 | } 366 | } 367 | ++n; p-=loclk; 368 | } 369 | // generate negative samples (-50% x2) to avoid overflows against the central AY chip (+100%) 370 | if (n) // enough data to write a sample? unlike the basic PSG, `n` is >1 at 44100 Hz (5 or 6) 371 | { 372 | #if AUDIO_CHANNELS > 1 373 | #if !AUDIO_ALWAYS_MONO 374 | int dd=n<<(24-AUDIO_BITDEPTH),qq; 375 | *t++-=qq=o0/dd,o0-=qq*dd, // rounded average (left) 376 | *t++-=qq=o1/dd,o1-=qq*dd; // rounded average (right) 377 | #else 378 | int dd=n<<(16-AUDIO_BITDEPTH),qq; 379 | *t++-=qq=o/dd, // rounded average (left) 380 | *t++-=qq,o-=qq*dd; // rounded average (right) 381 | #endif 382 | #else 383 | int dd=n<<(16-AUDIO_BITDEPTH),qq; 384 | *t++-=qq=o /dd,o -=qq*dd; // rounded average 385 | #endif 386 | if (n=0,!--l) break; 387 | } 388 | } 389 | } 390 | #endif 391 | 392 | // =================================== END OF PSG AY-3-8910 EMULATION // 393 | -------------------------------------------------------------------------------- /cpcec-m8.h: -------------------------------------------------------------------------------- 1 | // #### ###### #### ####### #### ------------------------- // 2 | // ## ## ## ## ## ## ## # ## ## CPCEC, plain text Amstrad // 3 | // ## ## ## ## ## # ## CPC emulator written in C // 4 | // ## ##### ## #### ## as a postgraduate project // 5 | // ## ## ## ## # ## by Cesar Nicolas-Gonzalez // 6 | // ## ## ## ## ## ## # ## ## since 2018-12-01 till now // 7 | // #### #### #### ####### #### ------------------------- // 8 | 9 | // The MOS Technology 6581 sound chip and its updated 8580 version are 10 | // better known as the SID chips that gave the Commodore 64 its famed 11 | // acoustics and made it the most powerful musical chip of 1982. 12 | 13 | // This module can emulate up to three SID chips at the same time; 14 | // it can also generate a pseudo YM channel log (cfr. cpcec-ym.h). 15 | 16 | // BEGINNING OF MOS 6581/8580 EMULATION ============================== // 17 | 18 | char sid_tone_shape[3][3],sid_tone_noisy[3][3],sid_tone_stage[3][3]; // oscillator + ADSR short values 19 | int sid_tone_count[3][4],sid_tone_limit[3][3],sid_tone_pulse[3][3],sid_tone_value[3][3],sid_tone_power[3][3]; // oscillator long values 20 | int sid_tone_cycle[3][3],sid_tone_adsr[3][4][3],*sid_tone_syncc[3][3],*sid_tone_ringg[3][3]; // ADSR long values, counters and pointers 21 | const int sid_adsr_table[16]={ 1,4,8,12,19,28,34,40,50,125,250,400,500,1500,2500,4000 }; // official milliseconds >>1 22 | #if !AUDIO_ALWAYS_MONO 23 | int sid_stereo[3][2]; // the three chips' LEFT and RIGHT weights 24 | #else 25 | int sid_weight; // the SID chips' weights, always equally distributed in single, double or triple modes. 26 | #endif 27 | char sid_chips=1; // emulate just the first chip by default; up to three chips are supported 28 | char sid_nouveau=1; // MOS 8580 (new) and 6581 (old) have slighly different wave shape tables and filters 29 | #ifdef DEBUG 30 | BYTE sid_quiet[3]={0,0,0}; // optional muting of channels 31 | #endif 32 | 33 | #define SID_STEP_FAST_ADSR (128+9) 34 | #define SID_STEP_SLOW_ADSR (512-6) 35 | 36 | // the normalised range [-128..+127] is a reasonable margin, but the mixer must remember to shift right! 37 | const INT8 sid_shape_model[2][4][256]={ // crudely adapted from several tables: FRODO 4.1, SIDPLAYER 4.4... 38 | { // MOS 6581 39 | { // 3: hybrid 40 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 41 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 42 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 43 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-120, 44 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 45 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 46 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 47 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-112,- 68, 48 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 49 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 50 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 51 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-120, 52 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 53 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 54 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 55 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-112,- 68, 56 | }, 57 | { // 5: pulse + triangle 58 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 59 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 60 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 61 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 62 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 63 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,+ 0, 64 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,+ 0, 65 | -128,-128,-128,-128,-128,-128,+ 0,+ 64,-128,+ 0,+ 0,+ 96,+ 0,+ 96,+112,+124, 66 | +127,+124,+122,+112,+118,+ 96,+ 96,+ 0,+110,+ 96,+ 96,+ 0,+ 64,-128,-128,-128, 67 | + 94,+ 64,+ 64,-128,+ 0,-128,-128,-128,+ 0,-128,-128,-128,-128,-128,-128,-128, 68 | + 62,+ 0,+ 0,-128,+ 0,-128,-128,-128,+ 0,-128,-128,-128,-128,-128,-128,-128, 69 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 70 | - 2,- 64,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 71 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 72 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 73 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 74 | }, 75 | { // 6: pulse + sawtooth 76 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 77 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 78 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 79 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 80 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 81 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 82 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 83 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,- 8, 84 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 85 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 86 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 87 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 88 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 89 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 90 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 91 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,- 8, 92 | }, 93 | { // 7: pulse + hybrid 94 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 95 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 96 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 97 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 98 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 99 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 100 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 101 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 102 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 103 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 104 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 105 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 106 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 107 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 108 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 109 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 110 | }, 111 | }, 112 | { // MOS 8580 113 | { // 3: hybrid 114 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 115 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 116 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 117 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-120, 118 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 119 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 120 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 121 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-104,- 68, 122 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 123 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 124 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 125 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-100, 126 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 127 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 128 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,+ 0,-128,+ 0,+ 0, 129 | + 64,+ 64,+ 64,+ 64,+ 64,+ 64,+ 64,+ 96,+112,+112,+112,+112,+120,+120,+124,+126, 130 | }, 131 | { // 5: pulse + triangle 132 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 133 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 134 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 135 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 136 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 137 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 138 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 139 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 140 | +127,+124,+120,+112,+116,+112,+112,+ 96,+108,+ 96,+ 96,+ 64,+ 96,+ 64,+ 64,+ 64, 141 | + 92,+ 64,+ 64,+ 64,+ 64,+ 64,+ 0,+ 0,+ 64,+ 0,+ 0,+ 0,+ 0,+ 0,-128,-128, 142 | + 62,+ 32,+ 0,+ 0,+ 0,+ 0,+ 0,-128,+ 0,+ 0,-128,-128,-128,-128,-128,-128, 143 | + 0,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 144 | - 2,- 16,- 32,-128,- 64,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 145 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 146 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 147 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 148 | }, 149 | { // 6: pulse + sawtooth 150 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 151 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 152 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 153 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 154 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 155 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 156 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 157 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 158 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 159 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 160 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,+ 0, 161 | -128,-128,-128,-128,-128,-128,+ 0,+ 0,-128,+ 0,+ 0,+ 0,+ 0,+ 0,+ 48,+ 62, 162 | -128,-128,-128,-128,-128,-128,-128,+ 0,-128,-128,-128,+ 0,+ 0,+ 0,+ 0,+ 64, 163 | -128,+ 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 64,+ 0,+ 0,+ 64,+ 64,+ 64,+ 64,+ 64,+ 92, 164 | + 0,+ 0,+ 0,+ 64,+ 64,+ 64,+ 64,+ 64,+ 64,+ 64,+ 64,+ 96,+ 96,+ 96,+ 96,+108, 165 | + 64,+ 96,+ 96,+ 96,+ 96,+112,+112,+116,+112,+112,+120,+120,+120,+124,+126,+127, 166 | }, 167 | { // 7: pulse + hybrid 168 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 169 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 170 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 171 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 172 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 173 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 174 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 175 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 176 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 177 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 178 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 179 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 180 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 181 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128, 182 | -128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,-128,+ 0,+ 0, 183 | + 0,+ 0,+ 0,+ 0,+ 0,+ 0,+ 64,+ 64,+ 64,+ 64,+ 96,+ 96,+ 96,+112,+120,+124, 184 | }, 185 | }, 186 | }; 187 | INT8 sid_shape_table[8][512]; // shapes: +1 TRIANGLE +2 SAWTOOTH +4 PULSE; +8 NOISE goes elsewhere 188 | void sid_shape_setup(void) 189 | { 190 | sid_nouveau&=1; for (int i=0;i<512;++i) 191 | { 192 | sid_shape_table[0][i]=+0; // 0: none (all +0) 193 | sid_shape_table[1][i]=i<256?i-128:255-i+128; // 1: triangle (-128..+127,+127..-128) 194 | sid_shape_table[2][i]=i/2-128; // 2: sawtooth (-128..+127) 195 | sid_shape_table[3][i]=sid_shape_model[sid_nouveau][0][i>>1]; 196 | sid_shape_table[4][i]=+127; // 4: pulse + none (all +127) 197 | sid_shape_table[5][i]=sid_shape_model[sid_nouveau][1][i>>1]; 198 | sid_shape_table[6][i]=sid_shape_model[sid_nouveau][2][i>>1]; 199 | sid_shape_table[7][i]=sid_shape_model[sid_nouveau][3][i>>1]; 200 | } 201 | } 202 | 203 | BYTE sid_mute_i8[256],sid_mute_h8[256],sid_mute_m8[256],sid_mute_l8[256]; // noise precalc'd tables, see below 204 | void sid_setup(void) 205 | { 206 | MEMZERO(sid_tone_power); MEMZERO(sid_tone_count); // the fourth channel is the dummy reference when flag bits 1 and 2 are not used 207 | for (int x=0;x<3;++x) 208 | sid_tone_syncc[x][0]=sid_tone_syncc[x][1]=sid_tone_syncc[x][2]=sid_tone_ringg[x][0]=sid_tone_ringg[x][1]=sid_tone_ringg[x][2]=&sid_tone_count[x][3]; // ditto 209 | //sid_mute_byte27[x]=((u>>13)&128)+((u>>12)&64)+((u>> 9)&32)+((u>> 7)&16)+((u>> 6)&8)+((u>> 3)&4)+((u>> 1)&2)+((u>>0)&1); // scramble bits! 210 | for (int i=0;i<256;++i) // let's hope the new docs are right this time... the old expression was set two bits too far to the right :-( 211 | sid_mute_i8[i]=((i>>(22-16))^(i>>(17-16)))&1, 212 | sid_mute_h8[i]=((i<<1)&128)+((i<<2)&64)+((i<<5)&32), // .7.6...5 213 | sid_mute_m8[i]=((i>>1)& 16) +((i<<0)& 8), // ........:..4.3... 214 | sid_mute_l8[i]=((i>>5)& 4)+((i>>3)& 2)+((i>>2)& 1); // ........:........:2..1.0.. 215 | sid_shape_setup(); 216 | } 217 | 218 | BYTE sid_filters=1,sid_samples=1,sid_delay[3]; INT8 sid_filter_raw[3][3],sid_filter_flt[3][3]; // filter states, mixing bitmasks and output values 219 | int sid_voice[3],sid_mixer[3],sid_filtered[3]; // sampled speech and digidrums 220 | double sid_filter_hw[3],sid_filter_bw[3],sid_filter_lw[3]; // I hate mixing [long] ints and [double] floats... 221 | double sid_filter_qu[3],sid_filter_fu[3]; // Chamberlin filter parameters; they're always above 0.0 and below 2.0 but they need precision 222 | double sid_filter_h[3],sid_filter_b[3],sid_filter_l[3],sid_filter_m[3]; // Chamberlin temporary values; `int` causes noisy precision loss 223 | #define sid_filter_zero(x) (sid_filter_h[x]=sid_filter_b[x]=sid_filter_l[x]=sid_filter_m[x]=0) 224 | 225 | void sid_reg_update(int x,int i) 226 | { 227 | int c=i/7; switch (i) 228 | { 229 | case 0: case 7: case 14: // voice frequency lo-byte 230 | case 1: case 8: case 15: // voice frequency hi-byte 231 | sid_tone_limit[x][c]=SID_TABLE[x][c*7+0]+SID_TABLE[x][c*7+1]*256; break; // voice frequency 232 | case 2: case 9: case 16: // pulse wave duty lo-byte 233 | case 3: case 10: case 17: // pulse wave duty hi-byte 234 | if ((sid_tone_pulse[x][c]=(SID_TABLE[x][c*7+2]+(SID_TABLE[x][c*7+3]&15)*256)<<8)>=0XFFF00) sid_tone_pulse[x][c]=0X100000; // voice duty cycle; pad it if required 235 | break; 236 | case 4: case 11: case 18: // voice control 237 | i=SID_TABLE[x][i]; 238 | sid_tone_syncc[x][c>0?c-1:2]=&sid_tone_count[x][(i&2)?c:3]; // SYNC target (bit 1) 239 | sid_tone_ringg[x][c]=&sid_tone_count[x][(i&4)?c>0?c-1:2:3]; // RING source (bit 2) 240 | if (i&1) // attack/release trigger (bit 0) 241 | { if (sid_tone_stage[x][c]>=2) sid_tone_cycle[x][c]=0,sid_tone_stage[x][c]=0; } 242 | else 243 | { if (sid_tone_stage[x][c]< 2) sid_tone_cycle[x][c]=0,sid_tone_stage[x][c]=2; } 244 | if (i&8) // TEST mode (bit 3) locks the channel! it can be used to play samples in two ways: 245 | { 246 | // 1.- "CHIMERA" (Spectrum-like speech in menu and game over) sends $41 (PULSE+NONE) and $49 (PULSE+NONE+TEST), playing a loud 1-bit sample; 247 | // the setup enables PULSE (bit 6) and sets its parameter to $FFF (max) 248 | // 2.- "LMAN - AMAZING DISCOVERIES" writes $11 and $09 to reg.18, then a byte to reg.15, and finally $01 to reg.18, playing an 8-bit sample (reg.15) as a TRIANGLE wave; 249 | // the setup disables PULSE and sets it to $000 (min); the samples rely on 0 (NONE) behaving like TEST (at least for a short while) if it was its previous state; 250 | sid_tone_value[x][c]=(i<64?SID_TABLE[x][c*7+1]-128:127)*sid_tone_power[x][c],sid_tone_count[x][c]=0; // i<64:"LMAN":"CHIMERA" 251 | sid_tone_shape[x][c]=(i>>4)+16; // "ALL ROADS LEAD TO UIT" uses the same player from "LMAN..." with sampled speech at the beginning of the song. 252 | } 253 | else sid_tone_shape[x][c]=i>>4; // set the wave type: 0..3 NONE/TRIANGLE/SAWTOOTH/HYBRID, +4 PULSE, +8 NOISE 254 | break; 255 | case 5: case 12: case 19: // ADSR attack/decay 256 | sid_tone_adsr[x][0][c]=sid_adsr_table[SID_TABLE[x][i]>>4]; // attack delay (high nibble) 257 | sid_tone_adsr[x][1][c]=sid_adsr_table[SID_TABLE[x][i]&15]; // + decay delay (low nibble) 258 | if ((i=sid_tone_stage[x][c])<2&&sid_tone_cycle[x][c]>sid_tone_adsr[x][i][c]) sid_tone_cycle[x][c]=sid_tone_adsr[x][i][c]; // catch overflow! 259 | break; 260 | case 6: case 13: case 20: // ADSR sustain/release 261 | sid_tone_adsr[x][2][c]=sid_adsr_table[SID_TABLE[x][i]&15]; // release delay (low nibble) 262 | sid_tone_adsr[x][3][c]=((SID_TABLE[x][i]>>4)*SID_MAX_VOICE+7)/15; // + sustain level (high nibble); it goes last to make the indices match the stage 263 | if (sid_tone_stage[x][c]==2&&sid_tone_cycle[x][c]>sid_tone_adsr[x][2][c]) sid_tone_cycle[x][c]=sid_tone_adsr[x][2][c]; // catch overflow! 264 | break; 265 | case 24: // filter mode/volume control 266 | i=SID_TABLE[x][24]; sid_filter_hw[x]=(i>>6)&1,sid_filter_bw[x]=(i>>5)&1,sid_filter_lw[x]=(i>4)&1; 267 | if (sid_samples) if (sid_delay[x]!=(i&=15)) 268 | { 269 | sid_delay[x]=16; // out of range! 270 | // a linear table makes "STORMLORD" (range 5-12) and "TURBO OUT RUN" MENU (range 4-11) sound softer than expected. 271 | // (question: why does "TURBO OUT RUN" TITLE use the full range 0-15!?) 272 | const INT8 k[16]={ -126,-122,-116,-108,-96,-80,-56,-24,+24,+56,+80,+96,+108,+116,+122,+126 }; 273 | sid_voice[x]=k[i]*(SID_MAX_VOICE*2); // empirical multiplier, mostly comparing "STORMLORD" and "ECHOFIED" 274 | } 275 | // no `break`! 276 | case 23: // filter resonance control 277 | for (c=0,i=(sid_filters&&(SID_TABLE[x][24]&112))?SID_TABLE[x][23]:0;c<3;i>>=1,++c) 278 | sid_filter_flt[x][c]=~(sid_filter_raw[x][c]=(i&1)-1); // channel output masks 279 | if (SID_TABLE[x][24]&128) sid_filter_raw[x][2]=sid_filter_flt[x][2]=0; // bit 7: channel 3 is disabled!! 280 | #ifdef DEBUG 281 | if (!x) for (c=0;c<3;++c) if (sid_quiet[c]) sid_filter_raw[x][c]=sid_filter_flt[x][c]=0; 282 | #endif 283 | // the following expression is just a guess :-( 284 | sid_filter_qu[x]=1.44-(SID_TABLE[x][23]>>4)/16.0; // "Eliminator", "LED Storm" and "Turbo Out Run" are very sensible to this! 285 | break; 286 | case 22: // filter cutoff frequency: hi-byte 287 | //case 21: // filter cutoff frequency: lo-byte. Attention: the valid bits (bottom 3) are ALMOST always zero! 288 | i=(SID_TABLE[x][22]<<3);//+(SID_TABLE[x][21]&7); // i.e. 0..2047 289 | // the following expressions are guesses, too :-( 290 | //sid_filter_fu[x]=i*0.480/2048.0; 291 | //sid_filter_fu[x]=SDL_sin(i*M_PI*0.480/4096.0); // noise appears if SIN(x) can reach 1.0, cfr. "Swingers" 292 | sid_filter_fu[x]=SDL_pow(i/2048.0,1.25); // the wind in the intro of "Last Ninja 3" relies on this! 293 | break; 294 | } 295 | } 296 | void sid_update(int x) 297 | { 298 | for (int i=1;i<25;++i) // i=0;... 299 | if (i!= 2&&i!= 7&&i!= 9&&i!=14&&i!=16&&i!=21) // i!= 0&&... 300 | sid_reg_update(x,i); // don't hit register pairs twice 301 | } 302 | void sid_all_update(void) 303 | { for (int x=0;x<3;++x) sid_update(x); } 304 | void sid_reset(int x) 305 | { sid_mixer[x]=255; memset(SID_TABLE[x],0,32); sid_voice[x]=0,sid_filter_zero(x); sid_update(x); } 306 | void sid_all_reset(void) 307 | { for (int x=0;x<3;++x) sid_reset(x); } 308 | 309 | // audio output ----------------------------------------------------- // 310 | 311 | void sid_main(int t/*,int d*/) 312 | { 313 | static int r=0; // audio clock is slower, so remainder is kept here 314 | if (audio_pos_z>=AUDIO_LENGTH_Z||(r+=t<>23)^(crash[x]>>18))&1); // 23-bit LFSR randomizer 335 | // "On shifting, bit 0 is filled with bit 22 EXOR bit 17." ( http://www.oxyron.de/html/registers_sid.html ) 336 | for (int c=0,u,v;c<3;++c) 337 | { 338 | if (--sid_tone_cycle[x][c]<=0) // update the channels' ADSR? 339 | switch (sid_tone_stage[x][c]) // notice that the SID is internally handling the amplitudes as 8-bit values 340 | { 341 | case 0: // ATTACK 342 | sid_tone_cycle[x][c]=sid_tone_adsr[x][0][c]; 343 | if ((sid_tone_power[x][c]+=(SID_MAX_VOICE+64)/SID_STEP_FAST_ADSR)>=SID_MAX_VOICE) 344 | sid_tone_stage[x][c]=1,sid_tone_power[x][c]=SID_MAX_VOICE; // rise is linear 345 | break; 346 | case 1: // DECAY + SUSTAIN 347 | sid_tone_cycle[x][c]=sid_tone_adsr[x][1][c]; // float towards the right volume (NOT linear though) 348 | if (LIKELY((/*u=*/(v=sid_tone_adsr[x][3][c])-sid_tone_power[x][c])<0)) 349 | { if ((sid_tone_power[x][c]=(sid_tone_power[x][c]*SID_STEP_SLOW_ADSR)>>9)0)) 351 | //{ if ((sid_tone_power[x][c]+=(SID_MAX_VOICE+64)/SID_STEP_FAST_ADSR)>v) sid_tone_power[x][c]=v; } // rise!? 352 | else 353 | sid_tone_cycle[x][c]=1<<9; 354 | break; 355 | case 2: // RELEASE 356 | sid_tone_cycle[x][c]=sid_tone_adsr[x][2][c]; 357 | if ((sid_tone_power[x][c]=(sid_tone_power[x][c]*SID_STEP_SLOW_ADSR)>>9)>0) break; // fall is NOT linear either 358 | sid_tone_stage[x][c]=3; // no `break`! 359 | default: // SILENCE 360 | sid_tone_power[x][c]=0,sid_tone_cycle[x][c]=1<<9; 361 | } 362 | if ((u=sid_tone_shape[x][c])<16) // update the channels' wave generators? TEST mode must be off! 363 | { 364 | if ((sid_tone_count[x][c]=(v=sid_tone_count[x][c])+sid_tone_limit[x][c])&~0XFFFFF) // OVERFLOW? 365 | *sid_tone_syncc[x][c]=sid_tone_count[x][c]&=0XFFFFF; 366 | if (u<4) // TRIANGLE/SAWTOOTH/HYBRID? (NONE is already set by sid_reg_update) 367 | { if (u) sid_tone_value[x][c]=sid_shape_table[u][((*sid_tone_ringg[x][c]&0X80000)^sid_tone_count[x][c])>>11]*sid_tone_power[x][c]; } 368 | else if (u<8) // PULSE? 369 | sid_tone_value[x][c]=(sid_tone_count[x][c]>=sid_tone_pulse[x][c]?sid_shape_table[u][sid_tone_count[x][c]>>11]:-128)*sid_tone_power[x][c]; 370 | else // NOISE? beware, a noisy channel pointed by "ringg" cannot do `sid_tone_count[x][c]&=0XFFFF`: "Rasputin", "Swingers"... 371 | { { if ((v^sid_tone_count[x][c])&~0XFFFF) sid_tone_noisy[x][c]=(INT8)crash[x]; } sid_tone_value[x][c]=sid_tone_noisy[x][c]*sid_tone_power[x][c]; } 372 | } 373 | } 374 | //if (sid_mixer[x]) // skip calculations if the chip is muted // the digis must play in "PULSOID" despite the bogus filter! 375 | { 376 | static int w[3]={0,0,0}; // minimal antialiasing; it helps! 377 | sid_filtered[x]=(w[x]+sid_voice[x]+(w[x]>1; 378 | if (sid_filters) // skip the calculations if filters are off 379 | { 380 | w[x]=sid_filtered[x]; // 2nd degree 381 | // the Chamberlin expressions merged in a single big block! 382 | int i=(sid_filter_flt[x][0]&sid_tone_value[x][0])+(sid_filter_flt[x][1]&sid_tone_value[x][1])+(sid_filter_flt[x][2]&sid_tone_value[x][2]); 383 | sid_filter_b[x]+=sid_filter_fu[x]*(sid_filter_h[x]=(sid_filter_m[x]=i-sid_filter_qu[x]*sid_filter_b[x])-(sid_filter_l[x]+=sid_filter_fu[x]*sid_filter_b[x])); 384 | int m=sid_filter_h[x]*sid_filter_hw[x]+sid_filter_b[x]*sid_filter_bw[x]+sid_filter_l[x]*sid_filter_lw[x]+.5; 385 | sid_filtered[x]+=(sid_nouveau?m+((i-m)>>8):(m+i)>>1); // 8580: source <<< filter; 6581: 50% source, 50% filter; yet another guess :-/ 386 | } 387 | else w[x]=sid_voice[x]; // 1st degree 388 | } 389 | } 390 | } 391 | // mix all channels' output together! 392 | #define SID_MIX_CHANNEL(x,c) (sid_filter_raw[x][c]&sid_tone_value[x][c]) 393 | for (int x=sid_chips;x--;) 394 | { 395 | int m=((SID_MIX_CHANNEL(x,0)+SID_MIX_CHANNEL(x,1)+SID_MIX_CHANNEL(x,2)+sid_filtered[x])*sid_mixer[x])>>8; // reduce signal loss, split >>16 into two >>8 396 | #if !AUDIO_ALWAYS_MONO 397 | o0+=(m*sid_stereo[x][0])>>8; 398 | o1+=(m*sid_stereo[x][1])>>8; 399 | #else 400 | o+=(m*sid_weight)>>8; 401 | #endif 402 | } 403 | /* 404 | #if !AUDIO_ALWAYS_MONO 405 | o0+=d, 406 | o1+=d; 407 | #else 408 | o+=d; 409 | #endif 410 | */ 411 | ++n; 412 | static int b=0; if ((b-=(AUDIO_PLAYBACK*SID_TICK_STEP)>>SID_MAIN_EXTRABITS)<=0) 413 | { 414 | b+=TICKS_PER_SECOND; 415 | #if AUDIO_CHANNELS > 1 416 | #if !AUDIO_ALWAYS_MONO 417 | int dd=n<<(24-AUDIO_BITDEPTH),qq; 418 | *audio_target++=(qq=o0/dd)+AUDIO_ZERO,o0-=qq*dd, // rounded average (left) 419 | *audio_target++=(qq=o1/dd)+AUDIO_ZERO,o1-=qq*dd; // rounded average (right) 420 | #else 421 | int dd=n<<(24-AUDIO_BITDEPTH),qq; 422 | *audio_target++=(qq=o/dd)+AUDIO_ZERO; // rounded average 423 | *audio_target++=qq+AUDIO_ZERO,o-=qq*dd; // rounded average 424 | #endif 425 | #else 426 | int dd=n<<(24-AUDIO_BITDEPTH),qq; 427 | *audio_target++=(qq=o/dd)+AUDIO_ZERO,o-=qq*dd; // rounded average 428 | #endif 429 | if (n=0,++audio_pos_z>=AUDIO_LENGTH_Z) r%=SID_TICK_STEP; // end of buffer! 430 | } 431 | } 432 | while ((r-=SID_TICK_STEP)>=0); 433 | } 434 | 435 | // other operations ------------------------------------------------- // 436 | 437 | // even when the SID is inactive or disabled by the user, ports 27 and 28 still generate values; 438 | // and unlike the SID sound playback, they need to be precisely calculated to a single-T degree. 439 | 440 | #define sid_mute_tick() (sid_randomize=sid_randomize*2+sid_mute_i8[(sid_randomize>>16)&255]) 441 | int sid_randomize=1; // all SID chips share the same LFSR >:-) 442 | int sid_mute_t=0,sid_mute_r=0; // major+minor counters 443 | int sid_mute_int27[3]; BYTE sid_mute_bit27[3],sid_mute_byte27[3]; 444 | int sid_mute_int28[3]; BYTE sid_mute_bit28[3],sid_mute_byte28[3]; 445 | void sid_mute(void) // emulate ports 27 and 28 until we catch up to the SID_MUTE_TIME clock 446 | { 447 | unsigned int t=SID_MUTE_TIME-sid_mute_t; sid_mute_t=SID_MUTE_TIME; 448 | sid_mute_r+=t*2; unsigned int tt=sid_mute_r/SID_TICK_STEP; sid_mute_r%=SID_TICK_STEP; // the "t*2" is important, calculations aren't the same as above! 449 | for (int x=sid_chips;--x>=0;) 450 | { 451 | // update oscillator, either noise or tone 452 | if (sid_mute_bit27[x]) // noise! "MAZEMANIA" checks this in $4E33 and others, "REWIND" in $1167 and $12CF, "4KRAWALL" in the final screen... 453 | sid_mute_byte27[x]=sid_mute_h8[(sid_randomize>>16)&255]+sid_mute_m8[(sid_randomize>>8)&255]+sid_mute_l8[sid_randomize&255]; // precalc'd tables 454 | else // note! "BOX CHECK TEST" relies on it in $C091; "TO NORAH" expects valid extra SID chips to return zero when BYTE +18 is completely empty! 455 | { 456 | unsigned int u=sid_mute_int27[x]+tt*sid_tone_limit[x][2]; // regular wave generator: overflows aren't important, only the lowest twenty-something bits matter. 457 | sid_mute_byte27[x]=(!x||SID_TABLE[x][18])? // "ENCHANTED FOREST" aka "EF BY SAMAR" expects the extra SIDs to react slightly differently to the built-in chip! 458 | (((t=sid_tone_shape[x][2]&7)&4)&&(u&0X1FFFFF)>12)&511]+128:0; // 8580 copies the value before updating it, 6581 updates it before copying it! 460 | sid_mute_int27[x]=u; // the final scene of "REWIND" sets the whole SID chip to zero but still relies on the LFSR randomizer, so this must stick! 461 | } 462 | t=tt+sid_mute_int28[x]; // update envelope, as defined by the ADSR 463 | BYTE k; if ((k=SID_TABLE[x][18]&1)>sid_mute_bit28[x]) // attack? 464 | { 465 | int i=sid_adsr_table[SID_TABLE[x][19]>>4]; 466 | i<<=4; while (t>=i&&sid_mute_byte28[x]<255-16) // 1<<4=16 ticks/step 467 | sid_mute_byte28[x]+=16,t-=i; // save cycles, if possible 468 | i>>=4; while (t>=i) // single-tick step 469 | { 470 | if ((t-=i),sid_mute_byte28[x]>=255) 471 | { sid_mute_bit28[x]=1; break; } 472 | ++sid_mute_byte28[x]; 473 | } 474 | } 475 | if (k<=sid_mute_bit28[x]) // decay or release? (notice the `break` above) 476 | { 477 | BYTE j=(k?(SID_TABLE[x][20]>>4)*17:0); 478 | if (sid_mute_byte28[x]>j) // fall to level? 479 | { 480 | int i=(k?sid_adsr_table[SID_TABLE[x][19]&15]:sid_adsr_table[SID_TABLE[x][20]&15])*2; 481 | k=sid_mute_byte28[x]; 482 | while (t>=i) 483 | if ((t-=i),(k-=(k<160?1:k<224?2:3))<=j) // this has an impact on the SFX of "CLOUD KINGDOMS", but I don't know the right values :-( 484 | { sid_mute_byte28[x]=j; t=0; break; } 485 | sid_mute_byte28[x]=k; 486 | } 487 | else t=0; // we reached the limit, nothing left to do! 488 | } 489 | else t=0; // nothing to do! 490 | sid_mute_int28[x]=t; 491 | } 492 | } 493 | #define sid_mute_peek27(x) (sid_mute(),sid_mute_byte27[x]) // returns value of port 27 of SID chip `x` 494 | #define sid_mute_peek28(x) (sid_mute(),sid_mute_byte28[x]) // ditto, port 28 495 | //#define sid_mute_dumb18(x) sid_mute() // redundant, now one function updates all chips 496 | void sid_mute_poke18(int x,int b) // traps writes to port 18: they can trigger the oscillator and the envelope! 497 | { 498 | sid_mute(); 499 | if ((b^SID_TABLE[x][18])&(128+1)) // catch when we toggle ADSR or noise! 500 | sid_mute_int27[x]=sid_mute_bit27[x]=b>=128?1:0; // AFAIK the wave itself is NOT reset when we toggle ADSR only :-/ 501 | if ((b^SID_TABLE[x][18])&1) // catch when we toggle ADSR! 502 | sid_mute_int28[x]=sid_mute_bit28[x]=0; // not sure if we should check this more carefully... 503 | } 504 | 505 | void sid_frame(void) // the equivalent of dac_frame() in other machines 506 | { 507 | for (int x=sid_chips;--x>=0;) // possibly redundant AFAIK: samples are always played with just the built-in SID 508 | { 509 | int z=(SID_TABLE[x][24]&15)*17; if (sid_mixer[x]>2; // f.e. the intro of "Stormlord" plays samples ($35..$3C) but the menu just clobbers the mixer ($3F) 511 | z=SID_TABLE[x][24]&15; // clobbering the mixer must keep the "dac_voice", f.e. noise in "International Karate 1/2/Plus" ($04 in IK, $14 in IK+) 512 | if (sid_delay[x]<16) sid_voice[x]=sid_voice[x]*63/64; else sid_delay[x]=SID_TABLE[x][24]&15; 513 | } 514 | sid_mute(); // update mute timers 515 | } 516 | 517 | // =================================== END OF MOS 6581/8580 EMULATION // 518 | -------------------------------------------------------------------------------- /cpcec-os.rc: -------------------------------------------------------------------------------- 1 | #include // STYLE, FONT... 2 | 3 | 34003 DIALOG 0, 0, 320, 256 4 | STYLE WS_CAPTION | DS_CENTER | DS_3DLOOK | DS_SETFONT // | WS_POPUP | WS_SYSMENU | DS_MODALFRAME | WS_VISIBLE // 5 | //CAPTION "" 6 | FONT 8, "Ms Shell Dlg 2" 7 | { 8 | LISTBOX 12345, 0, 0, 320, 240, WS_TABSTOP | WS_VSCROLL | LBS_NOTIFY // | LBS_SORT 9 | DEFPUSHBUTTON "OK", IDOK, 0, 240, 160, 16, 0 10 | PUSHBUTTON "Cancel", IDCANCEL, 160, 240, 160, 16, 0 11 | } 12 | 13 | 34004 DIALOG 0, 0, 320, 32 14 | STYLE WS_CAPTION | DS_CENTER | DS_3DLOOK | DS_SETFONT // | WS_POPUP | WS_SYSMENU | DS_MODALFRAME | WS_VISIBLE // 15 | //CAPTION "" 16 | FONT 8, "Ms Shell Dlg 2" 17 | { 18 | EDITTEXT 12345, 0, 0, 320, 16, ES_AUTOHSCROLL 19 | DEFPUSHBUTTON "OK", IDOK, 0, 16, 160, 16, 0 20 | PUSHBUTTON "Cancel", IDCANCEL, 160, 16, 160, 16, 0 21 | } 22 | 23 | 34005 DIALOG 0, 0, 120, 12 24 | STYLE WS_CAPTION | DS_CENTER | DS_3DLOOK | DS_SETFONT // | WS_POPUP | WS_SYSMENU | DS_MODALFRAME | WS_VISIBLE // 25 | //CAPTION "" 26 | FONT 12, "Ms Shell Dlg 2" 27 | { 28 | CTEXT "", 12345, 0, 1, 120, 10 29 | } 30 | -------------------------------------------------------------------------------- /cpcec-wd.h: -------------------------------------------------------------------------------- 1 | // #### ###### #### ####### #### ------------------------- // 2 | // ## ## ## ## ## ## ## # ## ## CPCEC, plain text Amstrad // 3 | // ## ## ## ## ## # ## CPC emulator written in C // 4 | // ## ##### ## #### ## as a postgraduate project // 5 | // ## ## ## ## # ## by Cesar Nicolas-Gonzalez // 6 | // ## ## ## ## ## ## # ## ## since 2018-12-01 till now // 7 | // #### #### #### ####### #### ------------------------- // 8 | 9 | // The Western Digital diskette chip family can be found inside the MSX 10 | // disc drive (MSX-DOS) and the ZX Spectrum extension BETA128 (TR-DOS), 11 | // but unlike the NEC 765 it had a comparatively simple interface. 12 | 13 | // Disc files are simple dumps of all their sectors: 14 | // - MSX-DOS discs (".DSK") are either 360k (N=1) or 720k (N=2) long; 15 | // the layout is 80 tracks x N sides x 9 sectors x 512 bytes. 16 | // - TR-DOS discs (".TRD") are 640k long; ".SCL" is a packed variation; 17 | // both feature 80 tracks x 2 sides x 16 sectors x 256 bytes. 18 | 19 | // In practice the discs are handled as pre-loaded sector dumps that 20 | // get specially tagged if modified; hence the use of allocated memory 21 | // instead of file handles. This also means that the emulator must do 22 | // the memory (alloc+free) and file (open+read+write+close) work. 23 | // Think of all this stuff here as more like a Flash card. 24 | 25 | // Ports STATUS/COMMAND (0), TRACK (1), SECTOR (2) and DATA (3) always 26 | // behave the same way, but the BUSY port is different on each machine 27 | // and so are the write-only MOTOR, DRIVE and SIDE ports; they must be 28 | // either received (BUSY) or sent (MOTOR, DRIVE, SIDE) by the caller. 29 | 30 | // BEGINNING OF DISKETTE SUPPORT ==================================== // 31 | 32 | #define diskette_setup() ((void)0) 33 | 34 | // these variables must be manually set by the caller; there's also "diskette_drives" that can be a variable or a constant! 35 | 36 | int diskette_size[4]={0,0,0,0}; char diskette_canwrite[4]; 37 | BYTE *diskette_mem[4]={NULL,NULL,NULL,NULL},diskette_tracks[4],diskette_motor,diskette_drive,diskette_side,diskette_sides[4]; 38 | 39 | // the following variables are internally used by this module 40 | 41 | int diskette_offset,diskette_target,diskette_length; 42 | BYTE diskette_buffer[DISKETTE_PAGE],diskette_cursor[4],diskette_status,diskette_sector,diskette_track,diskette_command; 43 | 44 | void diskette_reset(void) 45 | { diskette_target=-1; diskette_status=0X04,diskette_sector=diskette_track=diskette_command=diskette_length=diskette_motor=diskette_drive=diskette_side=0; MEMZERO(diskette_cursor); } 46 | 47 | #define diskette_recv_busy() (diskette_length>0?1:0) // TODO: return -1 if the operation suffered an error! 48 | #define diskette_recv_data() (diskette_length?--diskette_length,diskette_buffer[diskette_offset++]:255) 49 | #define diskette_recv_sector() (diskette_sector) 50 | #define diskette_recv_track() (diskette_track) 51 | #define diskette_recv_status() ((diskette_command>=0X08&&diskette_command<=0X0F)?diskette_command=0,0X02:diskette_length?0X02:diskette_status) 52 | #define diskette_send_busy(b) (diskette_status=diskette_cursor[diskette_drive&3]?0X00:0X04) // TRACK 0, OK // MSX-DOS relies on this 53 | 54 | void diskette_send_data(BYTE b) // send a byte to DATA port 55 | { 56 | if (diskette_length) 57 | { 58 | diskette_buffer[diskette_offset++]=b; 59 | b=diskette_drive&3; if (!--diskette_length&&diskette_target>=0&&diskette_mem[b]&&diskette_canwrite[b]) 60 | { 61 | if (diskette_size[b]>0) // tag disc as modified! 62 | diskette_size[b]=-diskette_size[b]; 63 | if (diskette_command>=0XF0) // cheating the WRITE TRACK operation! see below! 64 | memset(&diskette_mem[b][diskette_target],diskette_buffer[192],DISKETTE_SECTORS*DISKETTE_PAGE*diskette_sides[b]); 65 | else 66 | MEMSAVE(&diskette_mem[b][diskette_target],diskette_buffer); 67 | } 68 | } 69 | else 70 | *diskette_buffer=b; // the parameter of the SEEK command 71 | } 72 | void diskette_send_sector(BYTE b) // send a byte to SECTOR port 73 | { 74 | if (!diskette_length) // ignore if busy! 75 | diskette_sector=b; 76 | } 77 | void diskette_send_track(BYTE b) // send a byte to TRACK port 78 | { 79 | if (!diskette_length) // ignore if busy! 80 | diskette_track=b>DISKETTE_TRACK99?DISKETTE_TRACK99:b; // is the maximum checked here? see also the SEEK command 81 | } 82 | void diskette_send_command(BYTE b) // send a byte to COMMAND/STATUS port 83 | { 84 | cprintf("%08X: DISKETTE %02X %02X:%02X:%02X:%02X",DISKETTE_PC,b,diskette_track,diskette_side*16+diskette_drive,diskette_sector,*diskette_buffer); 85 | if (b>=13*16&&b<14*16) // command is FORCED INTERRUPTION? this is why there's no "case 13:" below! 86 | diskette_length=0,diskette_status=0; 87 | else if (!diskette_length) // ignore if busy! 88 | { 89 | char d=diskette_drive&3; // the disc side is chosen from outside the command itself, thru the system config 90 | char s=diskette_sides[d]>1?diskette_side&1:0; // the disc drive is chosen from outside too 91 | diskette_target=-1; // tag operation as non-writing 92 | switch (b>>4) 93 | { 94 | case 0: // RESTORE 95 | diskette_cursor[d]=diskette_track=0X00; 96 | diskette_status=diskette_drive>=diskette_drives?0X05:0X04; // used by MSX-DOS to detect whether a drive is plugged // TRACK 0 97 | break; 98 | case 1: // SEEK 99 | diskette_cursor[d]=diskette_track=*diskette_buffer>DISKETTE_TRACK99?DISKETTE_TRACK99:*diskette_buffer; // is the maximum checked here? see also the TRACK port 100 | diskette_status=diskette_track>diskette_tracks[d]?0X10:diskette_track?0X00:0X04; // SEEK ERROR, TRACK 0, OK 101 | break; 102 | case 12: // READ ADDRESS 103 | if (!diskette_motor||!diskette_mem[d]) 104 | diskette_status=0X80; // DISC MISSING? 105 | else if (diskette_track>=diskette_tracks[d]||diskette_sector<1||diskette_sector>DISKETTE_SECTORS) 106 | diskette_status=0X10; // RECORD NOT FOUND 107 | else 108 | { 109 | diskette_buffer[0]=diskette_track; 110 | diskette_buffer[1]=s; 111 | diskette_buffer[2]=diskette_sector=(diskette_sector%DISKETTE_SECTORS)+1; // follow sectors 112 | diskette_buffer[4]=//~diskette_crc16>>8; 113 | diskette_buffer[5]=//~diskette_crc16; 114 | diskette_buffer[3]=//0X00; // 0X00 means 256 bytes 115 | diskette_status=//0X00; // OK 116 | diskette_offset=0; diskette_length=6; 117 | } 118 | break; 119 | case 8: // READ SECTOR 120 | if (!diskette_motor||!diskette_mem[d]) 121 | diskette_status=0X80; // DISC MISSING? 122 | else if (/*diskette_cursor[d]!=diskette_track||*/diskette_track>=diskette_tracks[d]||diskette_sector<1||diskette_sector>DISKETTE_SECTORS) 123 | diskette_status=0X10; // RECORD NOT FOUND 124 | else 125 | { 126 | int i=((diskette_track*diskette_sides[d]+s)*DISKETTE_SECTORS+diskette_sector-1)*DISKETTE_PAGE; 127 | MEMLOAD(diskette_buffer,&diskette_mem[d][i]); 128 | diskette_length=DISKETTE_PAGE, 129 | diskette_offset=//0; 130 | diskette_status=0X00; // OK 131 | cprintf(" RECV %08X:%04X",i,diskette_length); 132 | } 133 | break; 134 | case 10: // WRITE SECTOR 135 | if (!diskette_motor||!diskette_mem[d]) 136 | diskette_status=0X80; // DISC MISSING? 137 | else if (!diskette_canwrite[d]&&!(diskette_filemode&2)) 138 | diskette_status=0X40; // WRITE PROTECT 139 | else if (/*diskette_cursor[d]!=diskette_track||*/diskette_track>=diskette_tracks[d]||diskette_sector<1||diskette_sector>DISKETTE_SECTORS) 140 | diskette_status=0X10; // RECORD NOT FOUND 141 | else 142 | { 143 | diskette_target=((diskette_track*diskette_sides[d]+s)*DISKETTE_SECTORS+diskette_sector-1)*DISKETTE_PAGE; 144 | diskette_length=DISKETTE_PAGE, 145 | diskette_offset=//0; 146 | diskette_status=0X00; // OK 147 | cprintf(" SEND %08X:%04X",diskette_target,diskette_length); 148 | } 149 | break; 150 | case 15: // WRITE TRACK 151 | if (!diskette_motor||!diskette_mem[d]) 152 | diskette_status=0X80; // DISC MISSING? 153 | else if (!diskette_canwrite[d]&&!(diskette_filemode&2)) 154 | diskette_status=0X40; // WRITE PROTECT 155 | else if (/*diskette_cursor[d]!=diskette_track||*/diskette_track>=diskette_tracks[d]) 156 | diskette_status=0X10; // RECORD NOT FOUND 157 | else 158 | { 159 | diskette_target=((diskette_track*diskette_sides[d])*DISKETTE_SECTORS)*DISKETTE_PAGE; 160 | diskette_length=DISKETTE_PAGE, // we are cheating! see above! 161 | diskette_offset=//0; 162 | diskette_status=0X00; // OK 163 | } 164 | break; 165 | // TR-DOS and MSX-DOS operate a subset of the WD1793 disc controller command set: 166 | // neither TR-DOS 5.03 or MSX-DOS 2.2 use the following operations... AFAIK! 167 | case 2: // STEP 168 | case 3: // STEP (bis) 169 | if ((b=diskette_command)&32) // redo STEP-OUT? 170 | case 6: // STEP-OUT 171 | case 7: // STEP-OUT (bis) 172 | { 173 | if (diskette_track>1) diskette_cursor[d]=--diskette_track,diskette_status=0X00; // OK 174 | else diskette_cursor[d]=diskette_track=0,diskette_status=0X04; // TRACK 0 175 | break; 176 | } 177 | else // redo STEP-IN 178 | // no `break`! 179 | case 4: // STEP-IN // a version of MSX-DOS actually uses this! 180 | case 5: // STEP-IN (bis) 181 | { 182 | if (diskette_track>4)==11&&!diskette_canwrite[d]&&!(diskette_filemode&2)) 193 | diskette_status=0X40; // WRITE PROTECT 194 | else //if (diskette_track>=diskette_tracks[d]) 195 | diskette_status=0X10; // RECORD NOT FOUND 196 | cprintf(" *UNSUPPORTED!"); 197 | } 198 | } 199 | cprintf(" %02X\n",diskette_status); diskette_command=b; 200 | } 201 | 202 | // ========================================== END OF DISKETTE SUPPORT // 203 | -------------------------------------------------------------------------------- /cpcec-ym.h: -------------------------------------------------------------------------------- 1 | // #### ###### #### ####### #### ------------------------- // 2 | // ## ## ## ## ## ## ## # ## ## CPCEC, plain text Amstrad // 3 | // ## ## ## ## ## # ## CPC emulator written in C // 4 | // ## ##### ## #### ## as a postgraduate project // 5 | // ## ## ## ## # ## by Cesar Nicolas-Gonzalez // 6 | // ## ## ## ## ## ## # ## ## since 2018-12-01 till now // 7 | // #### #### #### ####### #### ------------------------- // 8 | 9 | // The YM3 file format can naturally record the contents of a YM2149 10 | // audio chip, that happens to be fully compatible with the AY-3-8910, 11 | // but also a handy "virtual" format for other three-voice sound chips. 12 | 13 | // This module includes functions to export the current chip registers 14 | // into a YM3 file that can be read by platform-independent players. 15 | 16 | // BEGINNING OF YM3 FILE FORMAT OUTPUT =============================== // 17 | 18 | // YM3 file logging ------------------------------------------------- // 19 | 20 | char ym3_tmpname[STRMAX]=""; 21 | FILE *ym3_file=NULL,*ym3_dump; int ym3_nextfile=1,ym3_count; 22 | unsigned char ym3_tmp[14<<9],ym3_log[1<<9]; // `ym3_tmp` must be 14 times as big as `ym3_log`! 23 | int ym3_close(void) 24 | { 25 | if (!ym3_file) 26 | return 1; // nothing to do! 27 | fwrite("YM3!",1,4,ym3_file); 28 | fwrite1(ym3_tmp,ym3_count,ym3_dump); 29 | fclose(ym3_dump); 30 | if (ym3_dump=fopen(ym3_tmpname,"rb")) 31 | { 32 | for (int c=0,l,o;c<14;++c) // arrange byte dumps into long byte channels 33 | { 34 | fseek(ym3_dump,0,SEEK_SET); 35 | while (l=fread1(ym3_tmp,sizeof(ym3_log)*14,ym3_dump)) 36 | { 37 | o=0; for (int i=c;i=sizeof(ym3_tmp)) fwrite1(ym3_tmp,sizeof(ym3_tmp),ym3_dump),ym3_count=0; } 61 | void ym3_write_ay(BYTE *s,BYTE *t,int k) // default operation, where `s`, `t` and `k` are normally &psg_table[0], &psg_hard_log and PSG_KHZ_CLOCK 62 | { 63 | int i; // we must adjust YM values to a 2 MHz clock. 64 | i=((s[0]+s[1]*256)*2000+k/2)/k; // channel 1 wavelength 65 | ym3_tmp[ym3_count++]=i; ym3_tmp[ym3_count++]=i>>8; 66 | i=((s[2]+s[3]*256)*2000+k/2)/k; // channel 2 wavelength 67 | ym3_tmp[ym3_count++]=i; ym3_tmp[ym3_count++]=i>>8; 68 | i=((s[4]+s[5]*256)*2000+k/2)/k; // channel 3 wavelength 69 | ym3_tmp[ym3_count++]=i; ym3_tmp[ym3_count++]=i>>8; 70 | ym3_tmp[ym3_count++]=s[6]; // noise wavelength 71 | ym3_tmp[ym3_count++]=s[7]; // mixer 72 | ym3_tmp[ym3_count++]=s[8]; // channel 1 amplitude 73 | ym3_tmp[ym3_count++]=s[9]; // channel 2 amplitude 74 | ym3_tmp[ym3_count++]=s[10]; // channel 3 amplitude 75 | i=((s[11]+s[12]*256)*2000+k/2)/k; // hard envelope wavelength 76 | ym3_tmp[ym3_count++]=i; ym3_tmp[ym3_count++]=i>>8; 77 | ym3_tmp[ym3_count++]=*t; // hard envelope type 78 | *t=0xFF; // 0xFF means the hard envelope doesn't change 79 | } 80 | 81 | // ===================================== END OF YM3 FILE FORMAT OUTPUT // 82 | -------------------------------------------------------------------------------- /cpcec-yo.h: -------------------------------------------------------------------------------- 1 | // #### ###### #### ####### #### ------------------------- // 2 | // ## ## ## ## ## ## ## # ## ## CPCEC, plain text Amstrad // 3 | // ## ## ## ## ## # ## CPC emulator written in C // 4 | // ## ##### ## #### ## as a postgraduate project // 5 | // ## ## ## ## # ## by Cesar Nicolas-Gonzalez // 6 | // ## ## ## ## ## ## # ## ## since 2018-12-01 till now // 7 | // #### #### #### ####### #### ------------------------- // 8 | 9 | // The Yamaha FM-Operator Type-L (YM2143/OPLL) sound chip is a cutdown 10 | // version of Yamaha's own YM3812/OPL2. We find these chips in several 11 | // systems of the late 1980s and early 1990s, such as the arcade games 12 | // "Rampart" and "Time Soldiers" and the MSX2+ home computers. 13 | 14 | // Because the OPLL is poorly suited for rapid changes (unlike the PSG 15 | // AY or the MOS SID) and machines cannot "see" what the OPLL is doing 16 | // the emulation can afford several simplifications and optimisations. 17 | // Its output "piggybacks" the audio signal, shared with other chips. 18 | 19 | // BEGINNING OF YAMAHA OPLL YM2413 EMULATION ========================= // 20 | 21 | BYTE opll_table[64],opll_index; // register table (64 entries, not 256) 22 | BYTE opll_playing; // zero on reset, one when a channel is first enabled 23 | BYTE opll_ampl[14]; int *opll_smpl[14]; // channel amplitudes and samples 24 | BYTE opll_adsr[14]; int opll_time[14]; // ADSR stage and timer 25 | BYTE opll_loud[14]; // instrument/drum amounts and status 26 | int opll_wave[14]; // cycle within the sample 27 | #define OPLL_SINE_BITS 10 28 | int opll_sine[4][1<=32&&opll_index<32+9) 85 | { 86 | opll_playing=1; // notes are playing, the OPLL is active! 87 | if ((~opll_table[opll_index])&b&16) opll_adsr[c]=opll_time[c]=opll_ampl[c]=0,opll_loud[c]=c<((opll_table[14]&32)?6:9),opll_load_instr(c,c?0:opll_table[47+c]>>4); // set ATTACK! 88 | else if ((~b)&opll_table[opll_index]&16) opll_adsr[c]=2; // reset ATTACK! 89 | } 90 | else if (opll_index>=48&&opll_index<48+9) 91 | { 92 | // TODO... 93 | } 94 | opll_table[opll_index]=b; 95 | } 96 | void opll_reset(void) 97 | { MEMZERO(opll_table); MEMZERO(opll_loud); opll_index=opll_playing=0; } // everything disabled on reset! 98 | 99 | void opll_setup(void) 100 | { 101 | for (int i=0,j;i<(1<0?j:0, // half sinus, half zero 104 | opll_sine[2][i]= // triangular wave 105 | i<(1<<(OPLL_SINE_BITS-2))?(i*OPLL_MAX_VOICE)>>(OPLL_SINE_BITS-2): // 1/4: rise from zero to max 106 | i<(2<<(OPLL_SINE_BITS-2))?OPLL_MAX_VOICE-opll_sine[2][i-(1<<(OPLL_SINE_BITS-2))]: // 2/4: fall from max to zero 107 | i<(3<<(OPLL_SINE_BITS-2))?-opll_sine[2][i-(2<<(OPLL_SINE_BITS-2))]: // 3/4: fall from zero to min 108 | opll_sine[2][i-(3<<(OPLL_SINE_BITS-2))]-OPLL_MAX_VOICE; // 4/4: rise from min to zero 109 | } 110 | #define opll_update() ((void)0) // nothing to do... yet 111 | 112 | void opll_main(AUDIO_UNIT *t,int l) // "piggyback" the audio output for nonzero `l` samples! 113 | { 114 | int e=(TICKS_PER_SECOND+OPLL_TICK_STEP/2)/OPLL_TICK_STEP,s[14]={ 115 | ((opll_table[32+0]&1)*256+opll_table[16+0])<<((opll_table[32+0]&14)>>1), 116 | ((opll_table[32+1]&1)*256+opll_table[16+1])<<((opll_table[32+1]&14)>>1), 117 | ((opll_table[32+2]&1)*256+opll_table[16+2])<<((opll_table[32+2]&14)>>1), 118 | ((opll_table[32+3]&1)*256+opll_table[16+3])<<((opll_table[32+3]&14)>>1), 119 | ((opll_table[32+4]&1)*256+opll_table[16+4])<<((opll_table[32+4]&14)>>1), 120 | ((opll_table[32+5]&1)*256+opll_table[16+5])<<((opll_table[32+5]&14)>>1), 121 | ((opll_table[32+6]&1)*256+opll_table[16+6])<<((opll_table[32+6]&14)>>1), 122 | ((opll_table[32+7]&1)*256+opll_table[16+7])<<((opll_table[32+7]&14)>>1), 123 | ((opll_table[32+8]&1)*256+opll_table[16+8])<<((opll_table[32+8]&14)>>1)}; 124 | do 125 | { 126 | static int o=0; 127 | #if OPLL_MAIN_EXTRABITS 128 | for (char n=0;n<(1<>(19-OPLL_SINE_BITS))&((1<>(OPLL_MAIN_EXTRABITS))+*t)>>1; ++t; 142 | #if AUDIO_CHANNELS > 1 143 | *t=((o >>(OPLL_MAIN_EXTRABITS))+*t)>>1; ++t; 144 | #endif 145 | o &=(1<0); 148 | } 149 | 150 | // ============================== END OF YAMAHA OPLL YM2413 EMULATION // 151 | -------------------------------------------------------------------------------- /cpcec.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpcec/388d149130075234228b15fd395fcd69515a53d0/cpcec.ico -------------------------------------------------------------------------------- /cpcec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpcec/388d149130075234228b15fd395fcd69515a53d0/cpcec.png -------------------------------------------------------------------------------- /cpcec.rc: -------------------------------------------------------------------------------- 1 | #include "cpcec-os.rc" 2 | 3 | 34002 ICON "cpcec.ico" 4 | -------------------------------------------------------------------------------- /cpcplus.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpcec/388d149130075234228b15fd395fcd69515a53d0/cpcplus.rom -------------------------------------------------------------------------------- /csfec-3b.vpl: -------------------------------------------------------------------------------- 1 | # CSFEC palette: simple RGB333 2 | 00 00 00 # black 3 | FF FF FF # white 4 | B6 24 24 # red 5 | 49 DB DB # cyan 6 | B6 24 B6 # magenta 7 | 49 DB 49 # green 8 | 24 24 DB # blue 9 | FF FF 49 # yellow 10 | B6 49 00 # orange 11 | 6D 24 00 # dark red 12 | FF 6D 6D # high red 13 | 49 49 49 # dark grey 14 | 92 92 92 # grey 15 | B6 FF 92 # high green 16 | 6D 6D FF # high blue 17 | B6 B6 B6 # high grey 18 | -------------------------------------------------------------------------------- /csfec-a4.h: -------------------------------------------------------------------------------- 1 | 0X0000,0X0000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0X0000,0X0000, 2 | 0X0000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0X0000, 3 | 0XF000,0XF000,0XF000,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000,0XF000, 4 | 0XF000,0XF000,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 5 | 0XF000,0XF000,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 6 | 0XF000,0XF000,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 7 | 0XF000,0XF000,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF000,0XF000, 8 | 0XF000,0XF000,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF000,0XF000, 9 | 0XF000,0XF000,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 10 | 0XF000,0XF000,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 11 | 0XF000,0XF000,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 12 | 0XF000,0XF000,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFF80,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 13 | 0XF000,0XF000,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF840,0XF000,0XF000, 14 | 0XF000,0XF000,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF000,0XF000, 15 | 0XF000,0XF000,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 16 | 0XF000,0XF000,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 17 | 0XF000,0XF000,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 18 | 0XF000,0XF000,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 19 | 0XF000,0XF000,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF000,0XF000, 20 | 0XF000,0XF000,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF000,0XF000, 21 | 0XF000,0XF000,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 22 | 0XF000,0XF000,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 23 | 0XF000,0XF000,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 24 | 0XF000,0XF000,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 25 | 0XF000,0XF000,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF000,0XF000, 26 | 0XF000,0XF000,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF000,0XF000, 27 | 0XF000,0XF000,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 28 | 0XF000,0XF000,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 29 | 0XF000,0XF000,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 30 | 0XF000,0XF000,0XF000,0XF048,0XF048,0XF048,0XF048,0XF048,0XF048,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XF08F,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000,0XF000, 31 | 0X0000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0X0000, 32 | 0X0000,0X0000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0X0000,0X0000, 33 | 34 | -------------------------------------------------------------------------------- /csfec.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpcec/388d149130075234228b15fd395fcd69515a53d0/csfec.c -------------------------------------------------------------------------------- /csfec.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpcec/388d149130075234228b15fd395fcd69515a53d0/csfec.ico -------------------------------------------------------------------------------- /csfec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpcec/388d149130075234228b15fd395fcd69515a53d0/csfec.png -------------------------------------------------------------------------------- /csfec.rc: -------------------------------------------------------------------------------- 1 | #include "cpcec-os.rc" 2 | 3 | 34002 ICON "csfec.ico" 4 | -------------------------------------------------------------------------------- /gpl.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /msx.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpcec/388d149130075234228b15fd395fcd69515a53d0/msx.rom -------------------------------------------------------------------------------- /msx2.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpcec/388d149130075234228b15fd395fcd69515a53d0/msx2.rom -------------------------------------------------------------------------------- /msx2p.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpcec/388d149130075234228b15fd395fcd69515a53d0/msx2p.rom -------------------------------------------------------------------------------- /msxdisk.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpcec/388d149130075234228b15fd395fcd69515a53d0/msxdisk.rom -------------------------------------------------------------------------------- /msxec-3b.vpl: -------------------------------------------------------------------------------- 1 | # MSXEC palette: simple RGB333 2 | # values # colour 3 | 00 00 00 # black 4 | 24 DB 24 # green 5 | 6D FF 6D # high green 6 | 24 24 FF # blue 7 | 49 6D FF # high blue 8 | B6 24 24 # brown 9 | 49 DB FF # cyan 10 | FF 24 24 # red 11 | FF 6D 6D # high red 12 | DB DB 24 # yellow 13 | DB DB 92 # high yellow 14 | 24 92 24 # dark green 15 | DB 49 B6 # magenta 16 | B6 B6 B6 # grey 17 | FF FF FF # white 18 | -------------------------------------------------------------------------------- /msxec-a4.h: -------------------------------------------------------------------------------- 1 | 0X0000,0X0000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0X0000,0X0000, 2 | 0X0000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0X0000, 3 | 0XF000,0XF000,0XF000,0XF888,0XF888,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF888,0XF888,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF888,0XF888,0XF000,0XF000,0XF000, 4 | 0XF000,0XF000,0XF888,0XF888,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF888,0XF888,0XF000,0XF000, 5 | 0XF000,0XF000,0XF888,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF888,0XF000,0XF000, 6 | 0XF000,0XF000,0XF888,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF888,0XF000,0XF000, 7 | 0XF000,0XF000,0XF888,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF000,0XF000,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF000,0XF000,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF888,0XF000,0XF000, 8 | 0XF000,0XF000,0XF888,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000,0XF000,0XF000,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000,0XF000,0XF000,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF888,0XF000,0XF000, 9 | 0XF000,0XF000,0XF888,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000,0XF000,0XF000,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000,0XF000,0XF000,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF888,0XF000,0XF000, 10 | 0XF000,0XF000,0XF888,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000,0XF000,0XF000,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000,0XF000,0XF000,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF888,0XF000,0XF000, 11 | 0XF000,0XF000,0XF888,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000,0XF000,0XF000,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000,0XF000,0XF000,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF888,0XF000,0XF000, 12 | 0XF000,0XF000,0XF888,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF000,0XF000,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF000,0XF000,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF888,0XF000,0XF000, 13 | 0XF000,0XF000,0XF888,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF888,0XF000,0XF000, 14 | 0XF000,0XF000,0XF888,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF888,0XF000,0XF000, 15 | 0XF000,0XF000,0XF048,0XF888,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF888,0XF048,0XF000,0XF000, 16 | 0XF000,0XF000,0XF048,0XF048,0XF888,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF888,0XF888,0XF888,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF888,0XF888,0XF048,0XF048,0XF000,0XF000, 17 | 0XF000,0XF000,0XF048,0XF048,0XF840,0XF840,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF840,0XF840,0XF048,0XF048,0XF000,0XF000, 18 | 0XF000,0XF000,0XF048,0XF840,0XF840,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF840,0XF840,0XF048,0XF000,0XF000, 19 | 0XF000,0XF000,0XF840,0XF840,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF840,0XF840,0XF000,0XF000, 20 | 0XF000,0XF000,0XF840,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF840,0XF000,0XF000, 21 | 0XF000,0XF000,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF000,0XF000, 22 | 0XF000,0XF000,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF000,0XF000, 23 | 0XF000,0XF000,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF000,0XF000, 24 | 0XF000,0XF000,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF000,0XF000, 25 | 0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000, 26 | 0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000, 27 | 0XF000,0XF000,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF000,0XF000, 28 | 0XF000,0XF000,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF000,0XF000, 29 | 0XF000,0XF000,0XF880,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF880,0XF000,0XF000, 30 | 0XF000,0XF000,0XF000,0XF880,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF880,0XF000,0XF000,0XF000, 31 | 0X0000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0X0000, 32 | 0X0000,0X0000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0X0000,0X0000, 33 | 34 | -------------------------------------------------------------------------------- /msxec.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpcec/388d149130075234228b15fd395fcd69515a53d0/msxec.ico -------------------------------------------------------------------------------- /msxec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpcec/388d149130075234228b15fd395fcd69515a53d0/msxec.png -------------------------------------------------------------------------------- /msxec.rc: -------------------------------------------------------------------------------- 1 | #include "cpcec-os.rc" 2 | 3 | 34002 ICON "msxec.ico" 4 | -------------------------------------------------------------------------------- /msxec.sha: -------------------------------------------------------------------------------- 1 | 00000000206b2a47f437ba9dfc85f6d01c9e2c18 3 2 | 0000000055adf3b4576b370dd2680d80c333ebde 4 3 | 000000009ce36aeaa93f969b6c2ea91598b0b014 2 4 | 0099492bd11dfa3ddf87af3aeb4c92b29f78bd82 4 5 | 00c70cf37c71cb8f99567ae407ff6dd52c4774c2 4 6 | 022a53d79bb72c736a5fdad6d82434a98f33e6e7 4 7 | 028eb2de64ee129f9403d114b3059e8b62fef6c2 4 8 | 02c3ec94190c6fce6fa4984d92be48b2697e7706 4 9 | 02cfc41132d518e2b9fc632ec6ad00656bd9ec92 3 10 | 030557706d72199acf17df4480f6b1a8ff798d1e 3 11 | 03b42b77b1a7412f1d7bd0998cf8f2f003f77d0a 3 12 | 0413bb3aeacb0c28429b8c85b42796dbe48bef6d 2 13 | 0442dd29ea0f7b78c9cd5849ec7ef5bb21ec0bf5 5 14 | 048737f995eecb1dd8dd341d750efd005267796f 4 15 | 04a135910588ef8753b04a49c66d138c081284d2 3 16 | 04e4eb1cae7cf379977d238b74d727bb929c8d23 2 17 | 05280f0a26ac5c42ab63b80a487bb909683e7461 4 18 | 05767fec34beaaee390a86be496d98d2b27de641 5 19 | 05a531043d13ba261b0db37e4ef8b257986ce05f 3 20 | 06132ead4caadb2395302381bf72c60831500dce 4 21 | 06aa7bdc1d8f01e67d1a1736084384393074e613 2 22 | 06c527db4fbe929b4da005e7463078c05944f477 4 23 | 0733cd627467a866846e15caf1770a5594eaf4cc 4 24 | 076c45e152598777cdb1ace82b11994018bfed83 2 25 | 07793d57b00ad8927a3c1f0b1ed61c606441dbbb 4 26 | 07c4c39c6e6c03241d2353300f630b367322e78a 4 27 | 0809b47cf385328c3faa6a80f8378fa5c6690829 2 28 | 093d5ab39878ed4cdd42fb7c2a1502b7e65b17c0 2 29 | 094d11ebf8a20b6bfc07902c7f136bdd18b1e7ca 4 30 | 0a7bed652592ed6325acd037f1f5bbbd1d31b239 4 31 | 0b02dda5316a318a7f75a811aa54200ddd7abc30 4 32 | 0b3f5dbdbf5636e22b3a6bc12eeb4ac64b0501e5 2 33 | 0c425d8fc1ad36c9b8e248e477b1796cd62d9bed 3 34 | 0c62591033aa4e5e6b9eeb21eb2e5e60dcd8ee8e 2 35 | 0cb11c766bd357d203879bd6bee041a4690cc3df 5 36 | 0cc6c30c6918fcf780e57d40f58a4cf2a82225cd 7 37 | 0d2f86dbb70f4b4a4e4dc1bc95df232f48856037 5 38 | 0d459788b6c464b50cbc2436e67a2cef248e0c4a 2 39 | 0d76a069726fec7326541f75b809b8b72148ed3a 4 40 | 0d9c472cf7687b86f3fe2e5af6545a26a0efd5fc 5 41 | 0eb3a48a8ab90826726f0c06daadf4bf13390758 8 42 | 0ec71916791e05d207d7fe0a461a79a76eab52c5 3 43 | 0f10d77d1536993b8455b3b47278ca5782ef9275 4 44 | 0f298581b85e838c1fbaa24273d292217f81662c 2 45 | 1064aa5c8a884dddc0a27147ca70881e04988725 5 46 | 10758fb5d42b97a05b537db9b009bd644c153c93 4 47 | 108e9164ef6cf1ffe6e3c5303bfbbc3bd807b6df 4 48 | 10907d8e9845d8f9d8b5283affd7bb824963194f 4 49 | 10c38f91d8f5db2438414ea58f26dcac78352088 8 50 | 11b712633bd0e44e8d59ceba5a2d6b1c20a43ef9 5 51 | 11f1b9fda9a44f59a6de479aebc18fbc6347f5a7 4 52 | 122f659250a0ae10ce0be0dde626dd3e384affa7 5 53 | 12b3c31f0fd10ff5823dcc8bf6dfeb785a8af2f7 7 54 | 12f6f31f495bfb384c9ca9067bfbf8f98af6adf9 5 55 | 1302d258c952e93666ecec12429d6d2c2f841f43 4 56 | 13c59dd8f7320856b15c834038af3c846db33e4e 3 57 | 13fbb273a95481330d33c9edc4263e30ccf1774d 4 58 | 1417f9e8ca99deb3b422c5968fdfa03cfa633ec6 3 59 | 14403ca71d287084569e6c2f4124d2712c665219 4 60 | 14537ad9a551245261776bf9b64068fe4921ad47 5 61 | 1463f1e0216ad9f944bb1da748a01034da445cef 5 62 | 14faf5da6ab76de0b62f1ede91e27d46b9db77a2 4 63 | 14ff6fe464362c6b7dbb47b2ecda3a8c5f05ef79 4 64 | 1545566bd7decb1612009daa2daa71758fa6e4a1 4 65 | 16351e6a7d7fc38c23b54ee15ac6f0275621ba96 4 66 | 1642891b693df616f27431299352e1d7750ac94b 4 67 | 168d59fca3170f56858f39d0b53067c0c0d414a8 2 68 | 16c3ced0fb2e360bc7c43d372a0a30eb6bd3963d 5 69 | 16c692a2c9babfdadd8408d2f0f8fae3a8d96fd5 4 70 | 16f06109c57de5a39fbe150de9c25754483ee9fb 4 71 | 17583adb63d16d64ae51820055cd32c0e935425a 2 72 | 176ec8e65a9fdbf59edc245b9e8388cc94195db9 4 73 | 17dcbe8e9ab792483a542b0230897baf0240dcc9 3 74 | 1833ffc252d43d3d8239e57d5ac2c015b4367988 3 75 | 18be429f8b5c7bc4775c99292110aa09341cd644 4 76 | 18eada2178fc1a89895087aa513305d1ba73c926 3 77 | 19e79a79be13ac62bb002ed3323502be97886e17 3 78 | 1ab38b014480745eaae143c9e6f67b542e62442f 3 79 | 1aeae1180471e9a6e8e866993031b881a341f921 5 80 | 1aee947b1ad6d478c0def550868a3851c2910809 4 81 | 1ba6b699b4e34c23ee60db4e58e1265dc03f0b50 4 82 | 1c0c81e7809cedad16385153c7660b5c864de9f6 5 83 | 1c17e58f1a602e07f185bce1aa8589fae76e8b44 4 84 | 1c238009e77c5536d0059631954c2c4a52527283 2 85 | 1c462c3629d43297a006ba9055b39a2dccba9f6c 4 86 | 1ccac7caeaaa1c5a89503221b0a5eec2f34b1c91 2 87 | 1d129bde09c9db2433b334d36762704de94983ba 3 88 | 1d97922a5ab63e73611d0edbe952f041af3385b3 4 89 | 1e7ac21796642c3ccb66b0ef0f00ba4752428aca 5 90 | 1ec94d049fcbf59c5493d5de76bdfb891d24249e 2 91 | 1f17e46190635a3214057d33ad4a768939d5a071 5 92 | 1f26dfa026b116c80c951a995633b4c2f7fa033d 4 93 | 1f39c472f1e02511fa7eaaf8ed9fcce4d45861b9 5 94 | 1f3f586255dd49b0f912bf41e07e88fe3eb3fb61 4 95 | 1f3fb7c72c49ffb1c6dd43a6f8b2d1f5eed99bbc 5 96 | 1ff0afe393f89b6517025dc39a282c11c7da87ca 4 97 | 2111cec4b5ea698d772bb80664f6be690b47391c 2 98 | 2117a3375684fa3c5bedebced4d7c1019a1ccdca 5 99 | 21380bee0748625e9951a7a924016cc6cec46fb8 3 100 | 216b2c181c9ee0fb48e2d9efdb88ea918c8ff04f 3 101 | 217b21d10d80fe2d5d04636ee8c2f97f6edfe34a 4 102 | 219e9acc2c023c25a8bbe9fb7d1764ffcff66034 4 103 | 21ac0ae7da47abf30986b479489134c79405f95d 2 104 | 2220363ae56ef707ab2471fcdb36f4816ad1d32c 2 105 | 22d8ac99ef692675210f101eb4e688cde9b2d7f5 2 106 | 22f5998b4de47bf2ccc077d5881ac448e6b0484d 7 107 | 22f9b0238ff48840fb7d45ac93a7f15495393920 3 108 | 2300aa82bfcbcf95329eb04e58bcd7e4ca0a7889 3 109 | 2312bff70c83e60d1ca0fb9ca78a50637d02771c 2 110 | 23e702084e3031158a50a0560746767bbc1b7bee 5 111 | 23f3e1b597bee95375f380638340995b55232e7c 3 112 | 240a23b63e901b988951dda1ded561c281ccbbc1 2 113 | 240e15fb5d918aa821f226002772dc800d9f20a4 4 114 | 2418c0302abbce8b0f8556b63169c60a849f60ee 4 115 | 24384e63bfe450bce6abd327eae3e27969025379 4 116 | 244399d67d7851f3daa9bb87a14f5b8ef6d8c160 3 117 | 2588b9ade775b93f03fd4b17fd3f78ba70b556d6 5 118 | 25b28cfe8d6d51f619d182c774f6ceb05b577eeb 5 119 | 25b80aa670e7fdc84b51628b6dbe930eb234beb7 5 120 | 25f5adeca8a2ddb754d25eb18cff0d84e5b003bc 3 121 | 25ffc7e8ca90274566c31e10b5998cca6522673a 7 122 | 2639792df6f7c7cfaffc2616b0e1849f18897ace 5 123 | 26a7b0118d158e9bd3ea947fbe68f57b54e0b847 5 124 | 2724871629b46e05a0c8b5554a962211e700de0e 3 125 | 273a3dab994b5b9c975fd12711dd19e0c6367caa 4 126 | 2761df1ff6bf826e00dbd4f9a346aa145e91c6c6 5 127 | 2799d221d5486d48226bbbd3941207e1fc7c985e 5 128 | 27f9144fb24b434f7a75737aa694283084782766 0 129 | 289ac36381905685dda39946127ab2af3317a010 5 130 | 28b54294007ec345aef7322a2fcaa18d3363a73e 5 131 | 29a42c2b679bac55a0318ce8c97708e402e2779b 4 132 | 2a1c91bcc9b1b621773232061d74b7098420f1d4 4 133 | 2a3c7ad70e34989fa5170028bad760e65ebe9d57 5 134 | 2a4aef32db28c059c30f5f972f1c09708ef6ce62 7 135 | 2ae97f3c8152f56695c3d3a2dedaa781bf0a15f1 2 136 | 2b10234debd2a6a9a02e0750ba6563768bc4a2f3 4 137 | 2b255c3e5615b2f5e2365419a35e4115a060e93c 4 138 | 2b4c386a56dddd2a3354bdf1a0041d3faa0ccc72 3 139 | 2bb837a9051277ba574d8351a9f91f9e57033074 4 140 | 2bd311a4baf59cb85b839cca1f55b7462aa96952 3 141 | 2bfa08db95502ee9bde61c5fe7b6557c0e4aef5a 4 142 | 2cea9cdd501d77f2b6bd78ae2ae9a63aba64cfed 4 143 | 2dfbca8f5cc3a9e9d151382ebe0da410f5393eaf 4 144 | 2e0436303648097e8e936c5467574aff5e3f1517 2 145 | 2e2543ac99193f76b4f35463142294c016f0cf3d 4 146 | 2e388978f765bc5fe1fa9a42e1f059de5053721d 3 147 | 2f0db48fbcf3444f52b9c7c76ba9c4bd38bc2a15 5 148 | 2f2c7559a5ba7fb938aba152bd84879c0bd3cae2 5 149 | 2fc050dbc44ba9dfb72299129d48e5e5e1c892c3 4 150 | 2fc15ef2c728a2472cfa3a34053e07f821dc18d4 3 151 | 300f20adde3941ab10eb158db48250e8e856a911 3 152 | 30a7f3ea1612f20c0f62b1a121bc7d79ae515e89 3 153 | 30b41d0e9b3c59e8826112c618206e12e187fb5d 4 154 | 3194153a9c93aa24b37804a764f112bdef091bf8 4 155 | 31b8b69de88d84aabdb762af1adeac815723562c 4 156 | 31dbd1c08659c649c49da8d2e6b80328cb6b59e8 3 157 | 3202af113265e67e130a0b948dc167a9f9e9cc79 4 158 | 32151ddc4303290c09889bf8107493dd34296043 4 159 | 32210a9cbbb51e30ff59ed44bf32e628fdf6c42c 3 160 | 3243a5cc562451de527917e9ca85657286b2852f 5 161 | 32cdc5c98915ba035865fb134e08ce5b75084099 2 162 | 32dd4df2b39461c0694f6bb84de0709478a69d31 5 163 | 338460029d65ebce0d9119d811187a35c866a958 4 164 | 3425eea336140da03d7d7f09a94fd928d70e2212 5 165 | 34635bf3518c7b33164f3d96da769c7a01102d28 7 166 | 356a936987e62967597ec64a0d35a1e8ad1aa20b 4 167 | 357c0c2e9b3b2970c587c96f86a6b7272160f54a 3 168 | 35c02d8d590d92053f083b0c0c897277a5375af6 4 169 | 3626b5dd3188ec2a16e102d05c79f8f242fbd892 9 170 | 36eda820b734ac7a42653af370a475f36bd36b1b 5 171 | 3739d841abfef971db76ba10915b19b9df833476 4 172 | 37bd4680a36c3a1a078e2bc47b631d858d9296b8 5 173 | 3837d3a72498caa070866d947956a2e30fb94fbe 5 174 | 3880b064dcb851ca221ff67e435137a7cf1141f8 4 175 | 38a103e540eb5fbe2627fab2991bda08092635e0 4 176 | 390fb09a9d944d1d17c328ae138325751d1b4203 2 177 | 39bc111c953bdf25683db7ff4c0bad79b5c49958 4 178 | 39d500fbf22168be2a12ac89ff5a50131bb1c30b 4 179 | 3a0b0bdd77a1f3a11533f5ef030370bcc90c6334 2 180 | 3b1fc45b04bd03f21d5b88330a0c5d16a9bd2d65 4 181 | 3b4143e5769d6235bca8977b41241295493eaf5e 2 182 | 3b6200f88561a59ae5d2b3e94515b89cdb96044b 3 183 | 3b6f140c99cba5bfa510200df49d1e573d687e4d 3 184 | 3bb2f9f4be38b5b08da03ee190c39caec30e2f08 4 185 | 3caeec19423a960d98e4719b301a3d276339e5ae 4 186 | 3df7c19f739d74d6efdfd8151343e5a55d4ac842 4 187 | 3e57fad130be79223068ab29f1e77ecb7f2ad237 4 188 | 3f072673752badfbd234d6005ddad60a494a9438 4 189 | 3f741ba2ab08c5e9fb658882b36b8e3d01682f58 4 190 | 3f87c3413c8cc2a25e1f64cfdcd01155a13711f0 4 191 | 3f9d72bdafecfa640639cf66721e7380e41c6e6d 3 192 | 3ff276af654c7dc712abed79d9123317ce79b4e4 2 193 | 40a0f35dccc7572ae53bcd4be70abfe477d49bc9 2 194 | 4127844955388f812e33437f618936dc98944c0a 2 195 | 414fd2a22076f45502c2329b45bda9f8730dcaae 4 196 | 4164dcdfe0613d0f4c53b6f3581548bbbad5eb43 9 197 | 4180544158a57c99162269e33e4f2c77c9fce84e 5 198 | 418f6248221c79039fe6c44fc5a9514842e3ec71 4 199 | 424320762bcbbb6081b1e186e21accf758aeb935 2 200 | 428fe64e121b1067b8100b298ecfa384990b5429 2 201 | 42fbb18722df3e34e5b0f935a2dc0ce0d85099e9 2 202 | 43084db72dd13112450a7af4b513e13e9266defb 3 203 | 4323eb37b9a795be32a2b64824fc4acd7afe4e9d 3 204 | 4340a2580c949d498d2c8e71699fff860214e9ea 5 205 | 4376342bf42334d98dbd3e35ef35460974269c58 3 206 | 438bbb3367db4938b3d90fa9d2cfb1f08c072bb7 3 207 | 441dacb74a47ca4b7d1ce47300d182bc7424ffac 2 208 | 442a39b196f19a22fc7fb8f14bf17386a292b60e 3 209 | 44b23a175d04ca21236a5fef18600b01b12aaf4d 4 210 | 452deac5b3341437e70c5b2726aa26cc1d074fba 4 211 | 453eac7568d5d04c8cf7da86f2e8dc79777343da 4 212 | 45760316a4ebc74ddd55ee163c5aeaaafe965d2c 4 213 | 46062d3393c49884f84c2dc437ff27854e9d2e49 5 214 | 4607ed284bd4602affa00600c749ce43b2b89b6d 5 215 | 4690b2f6ce28e55d56ab185c573fc27a9b414468 4 216 | 46c98a3143f5a80b2090311a770f9b73000881c0 5 217 | 46f995308d736da235ba7f17841d8afeff403c99 2 218 | 473bc0ea85ed1b218974796d819416e711ac193f 4 219 | 475c3af7495922759a5f424d2e22d7e4073d5992 7 220 | 47de7524c32e72e849daee4d7f3e6cf393e3b7dc 4 221 | 482cd650220e6931f85ee8532c61dac561365e30 4 222 | 495876c504bdc4de24860ea15b25dda8f3b06c49 4 223 | 495eb918ced94ef47885df40ceceef8b56e96691 4 224 | 4a8eed643993b86e71ea46098a580ec15038cbba 4 225 | 4ad4898db3bdcf87b2acd5755e06d45c73d338cd 4 226 | 4b138e041947990309c228890914689908d46685 3 227 | 4b506234dfd3b6aa1c315b40cd8ddca024dd15c9 3 228 | 4b78514753008cabda2ff3d3cb537b2429efd7d2 2 229 | 4b872dac11a720e2b9e86f22df1e2214c1059281 3 230 | 4bd533cd7859489a3b26787fb5c7e4d8662cc420 4 231 | 4c15375910461a7a34a2fd54c7f51e712f06bc69 2 232 | 4c2a8cde9b40c4936f512365a7cd6c8cef92095e 3 233 | 4c2f015685a17db7a8c3893e868e0a84a8dbf1e5 2 234 | 4c44939a95a20d701f60830499254e5dabedeeaa 4 235 | 4cc5f197d2bd3f0306c07a880590b4b4a5574e12 4 236 | 4d51d3c5036311392b173a576bc7d91dc9fed6cb 3 237 | 4e864cc0045c85c4f5c5c0efcdf26340a178686a 2 238 | 4edb5ed12c1b9bc7efa571ca67ffc732f53d3a4a 0 239 | 4ee3e785e6949bd535804a32c6a1a31eeef30031 3 240 | 4f35f676d2f382078078343921374c2889d06e11 3 241 | 4fe1d66e8f3cbd5ecd9b22b6aea2b37a604f2492 3 242 | 4ff2aad8371e382e203c7f29b665612a8c9d937c 3 243 | 500d7a1d81621adf8c6914c6a42d65aa44ad4588 2 244 | 502d7cf7bc2595af6f83bb2b95baa4db5b0f6a4d 3 245 | 50422ba24fd158ca5f0b9728b8e41829048cfdfd 5 246 | 50efb7040339632cf8bddbc1d3eaae1fb2e2188f 4 247 | 510f6d854f813269f67ee15a4cc2ed77d96d2903 4 248 | 51e4231e245ffd733590e3205fa3ffea92ad509f 4 249 | 520739caa1e0aac1b8eabc4305556aa75f3f5a3b 2 250 | 522a53034cf40448d441683f3308fcb4b65e6d7c 7 251 | 523330d609ca0e527f3e28a078635b3d28489ec9 5 252 | 5261006ca4245653f5153074dfcc8ca27315bb59 2 253 | 52a9173b22c8a72376003764d73e07579dc2015d 2 254 | 5380e913d8dac23470446844cab21f6921101af8 5 255 | 53e1fb8ee77757cd20bf4c7aa4a5c6c786c664d6 2 256 | 5460a88c25386b1b950b57fc1325fd75587cc825 3 257 | 54a1d356fd7bc6098f5c3d94f9d8bfcc2c6d5935 2 258 | 54b05b9c064232d75299fd31b53335f530c20aea 3 259 | 55183b7b7df66950dbb65ef1065d7d987e0fdf5a 5 260 | 552a758f77a7c35969523dbaca74587f0b59eb2b 3 261 | 5577e483caca553cfbfc0cba26f3ab2444569f81 4 262 | 55bad6c00e6a676efc7ff349fa1b5422d624f5ef 3 263 | 55fb4e3d3a762b613b635ee9745d92f0f3711272 4 264 | 5692e41b3a4c5e767cf290fd6c24942d0fd7b2e3 2 265 | 585ca5e4515a53dc9a3d3b547b37815f63e395f4 5 266 | 598eb258cbe532e98b4a3c8d87ecd9536d09ce56 3 267 | 599c824ec92be0369accaaaf31340df6f471f202 4 268 | 59e35d24ab5f8e3b812ba4a1a4feb5be1ab269fe 2 269 | 59f679c5ebf75de98b5e909da9182dbd80413364 4 270 | 5a12439f74ca5d1c2664f01ff6a8302d3ce907a8 4 271 | 5b25d93259a358f2064adc44f6382c91c9394861 4 272 | 5bb1be67984903649f2e8ec5bb3e559945a36f43 2 273 | 5c00f9e3a48411e08fac89b1dfdd2a6e95853919 6 274 | 5c278deb1390eb45c79b7667b1ea1c54183123ac 4 275 | 5d2062ecc7176ca2b100724c2a17f877878d721d 3 276 | 5d55fc272184d160af6318855c9d2f728b3f25c0 3 277 | 5d65a308bb9ec8c4b4ce334b18d699b1f53227ef 3 278 | 5d82713f36e9395092f16663084fbc85f05c664a 4 279 | 5ec8811254dc762c6852289a08acf22954404f0d 2 280 | 5ef7d03b138a2023f6def241b671c666f97ed83b 3 281 | 5fd07ed5b7c0492d42ed91a54a0fe80ce6e4e40d 8 282 | 5ff1254dccd5dde58d3475a468178738d6260b05 3 283 | 6030005c4401b3cbcb09f802cd48f5c1c585303b 3 284 | 6075cd96bc85864f22c643b023302f006b565049 3 285 | 612c18616bc800d9eb69b9da3cd29eca31f50c1c 3 286 | 6159cdfc79c68bf7dfe2653fc0b5893ae913c72b 4 287 | 632bdb164acab52ee715c7eefed60e0b1ae629e0 3 288 | 632cb0834441626d20cc113cfad2e3a7ec0e0dc7 3 289 | 633824fa00e519ecfff36be7cf6adb9e587f4db6 3 290 | 63d4e39c59f24f880809caa534d7a46ae83f4c9f 5 291 | 6420d61002da325403fcb6f41afb1d348eeba3b4 7 292 | 64321138e03337d0e6178ac30bb98e6623c640ba 5 293 | 64c49fdabbdd5e13c4310b03a183ea1a018154a4 4 294 | 65040fb1e9bc4b2d027d7d81e44be30e7620e368 3 295 | 65160f0d59068dbbf76b11bc79e17a9369c8dcee 2 296 | 655b15e8fd81866492bcf2b1d6609211b30efce1 2 297 | 65a5bda34d1e1b22cfa697e4e7fdf1829cf2238d 3 298 | 65da0e5c5de057a1ed836ec19b1f07e10f4b738f 4 299 | 66508bbdc3b133b9a69ea96789bc134eea46796a 5 300 | 66620207ca6c21bcbae8f868bb55532e72e521a6 3 301 | 66802dd98370da809250367365df234f9a6422b7 5 302 | 6715aea31525869220d7acb638b6a432875e85a1 4 303 | 678efe599b8085bd27f9d3d42cfbbd7ca74ceb89 5 304 | 67fa6e9005d23d9c49f77884a856cfb376194083 3 305 | 68158290666f4d7ac1ada40d674a1160c162b193 4 306 | 6844758ff5c2c410115d4d7cf12498c42e931732 2 307 | 6868e7050d989d1ecbd13393ed360addefa4bcd3 4 308 | 68691348a29ce59046f993e9abaf3c8651bdda3c 3 309 | 688b70e60dc272654ac6b0a72237fefdce2ef9ff 4 310 | 6933de9a128e90a34383f3a9b2660d5bae5d9fe3 4 311 | 6a95b7f3a4cff9c9b3d7b8b30b0b0f752dadaa37 5 312 | 6a98d5787dd0e76f04283ce0aec55d45ba81565d 3 313 | 6bde4e6761286a2909858ecef04155e17072996e 4 314 | 6c1814c70d69a50ec60e39ef281f0b8cd7bf8598 7 315 | 6d3008b97b48d99522e45056f52ed944e3d8e208 3 316 | 6d72a04ef018fa1fa3708c8b5ed3333b2c5e8ead 4 317 | 6d7a8ea1b283ecc1cc94c359e5f053a6e82ab3f5 4 318 | 6d800787f5f5d63827b841aa29fe26ed89ea2cef 4 319 | 6dd28797f9d1fe7cc041077ebe77d08f2ccc0937 4 320 | 6e1d2d5b0688860b0a04d53fe9e5e3939dfba547 4 321 | 6e5acdfb1c1610257a7aabf3d5aa858866dbcf2e 2 322 | 6fd90e7573abdb5a7bd6e4e8dc44db80fc163e30 4 323 | 6fe7a6bb86897e579393e70961a3a3204adfa48b 3 324 | 6fefbe448674b6ea846d0c6b9c8a0d57a11aa410 5 325 | 709fb35338f21897e275237cc4c5615d0a5c2753 4 326 | 720b629e2e22e0af15b482b154a1473e8ab6627c 2 327 | 721a2ded692d34d864d0440ac347c60880942d19 4 328 | 72783ba5a0b9f33b4573952a1c721fc5d5025fd5 4 329 | 72815a7213f899a454bcf76733834ba499d35cd8 5 330 | 728340e95ad58ab989a59f61317a45ab1f6b0bdc 2 331 | 72afbebb12098ade1ec26dcd65890b60b2c705d0 2 332 | 7341efc039394ec159feebcfaa9d4a61ebf08a18 3 333 | 7393f677e0fae5fc83071c6b74756117b7d75e2d 2 334 | 74ae85d44cb8ef1bae428c90200cb74be6d56d3a 4 335 | 74d1c7f66242335c736da29413037bd23384efaa 7 336 | 74e9ea381e2fed07d989d1056002de5737125aaf 4 337 | 75d3b72d9ceeaa55c76223d935629a30ae4124d6 2 338 | 75eb441c8298b7fd3982999f772e4c8b983ef17f 2 339 | 76666da5870d1901026e3dded3f22ce7a706689d 2 340 | 76b7a5e75d5091f0482746e5a0c0a71de07ddf83 4 341 | 772ad4eabbf0941a9b4655f5615f2a5cf22246b1 4 342 | 7752b6624fb80d9499aaad28dd5776ec74565576 4 343 | 77d95640c80bc4868d04a913f9dbf4b5f6d877d2 5 344 | 77f2d9d27724a7c71c688a598d34bd0c8a8e56d0 2 345 | 77fcce7b7c9c915fb0adff059141d4d4307f5a22 4 346 | 78507f3f8b8601d99bbedb6517bec6cddf0bd5b4 4 347 | 788c53657d9ea180d04f29ccaf1f1c29a9b75519 5 348 | 795d47c6aae378d0d5bedc9f104a597bcc1ee16b 4 349 | 7964ba4c3c27b6a32d397157fd38dd1dc2f1e543 2 350 | 7a0a1c5570a3361ad75406eea07c93fdad9fde02 3 351 | 7a4126934f9e68c34bf00dd3d9a9e753c05ee73f 5 352 | 7a786959d8fc0b518b35341422f096dd6019468d 3 353 | 7abf89652396a648a84ae06e6dabc09735a75798 4 354 | 7ad40ae512bbf4ba688467ba23e16354b8421d0a 3 355 | 7b8015f919c8dd95db683f3f3d0799cf7ef1bc22 2 356 | 7b94a728a5945a53d518c18994e1e09a09ec3c1b 4 357 | 7b959c609deaf67d29e3f79f55a03f53961f129e 3 358 | 7be2f14fd0df5718cdb69b972c5f7c1f284b03e6 2 359 | 7c066cb763f7a4fec0474b5a09e3ef43bbf9248b 4 360 | 7c3aa9cca2f1f6e81ae9d24b3a3c675f08a203ea 3 361 | 7c7d0bff4a51bb0f1f0cdb4132fdb11f8a71c623 3 362 | 7d07fdf58c7a86d9f93af35a35acf2d7ded02ff1 3 363 | 7d685547c2a4b92fa62e00854e4a9689d495f93d 3 364 | 7dc7f7e3966943280f34836656a7d1bd3ace67cd 4 365 | 7e5024e6e6aecd05ec6c885786a4aac287ed110b 3 366 | 7e9a9ce7c18206b325830e9cdcbb27179118de96 3 367 | 7ed1308179c41ae62cfb46124ab0ce22d8b0513b 5 368 | 7fe5f17ad7e6b70dd56cad2c8bdc516a86f03207 4 369 | 804be21493a151a0be2075e86c94759dd96f0bf7 3 370 | 81143d2a8ef7cc593a604f3cc890312b42bdff01 8 371 | 818d91505ad39bba2eaf7f4857c7d41e95fcb233 4 372 | 81b85b1152a59bb10d0e0118f80f0a4ed363c785 3 373 | 81bbbd4ea86350ebba03e8d8cb29f050a3d93a83 4 374 | 81befaa45ee3f1196b0e1ea657b0161495601a87 3 375 | 82397096d5ef436b99b943c2a52d6eff87694183 5 376 | 8262ac069e395ba020025caf0519e8eb5a63a0b8 4 377 | 82cf4caa78571a750403e592e3ac87c249ac4604 5 378 | 842009e0f7d0e977e47be7a56fe60707f477ed93 3 379 | 8449cdf161babec85508c35c8ca64a5c1fd7671d 3 380 | 84566b5f37ab4f04a2e5b950c5beecbd27b88ea0 3 381 | 845b9263d75d89ef02c23fd05cccc13db5d512ea 4 382 | 847841ad88ff2eff6602f03b7231cd1e03f89ffc 3 383 | 84831671935bf80c250aff223a99684669a0ce72 2 384 | 8557dcdb4cf1e15180d17acc8e6d515bf7bf7e7c 4 385 | 855cabd1ad1abae3a9d26999d48c66de8096d7c5 5 386 | 8666f3109ad01093b0afab11986cfd60ba37d2a0 5 387 | 86fdfe9e26d6e77f41cbcb47e10e2f32e5518549 3 388 | 875a262be44a27a8357f170080fb8466c9599b62 5 389 | 875bbb27f6a54e5d123dc8a6df4bf46f97c23a57 3 390 | 87a7fa43602f74c47151e79f1aaf7f641331ba51 4 391 | 87b7c80069a15fdb90b40dfed736fb8492104cd9 2 392 | 88cd90595fbb7dbabd73ac9c0985c0a013992dc6 4 393 | 89073c052b0fe29b6de077c8bdf5373474081edf 4 394 | 898bda19f882c6d1dffdb2173db84a97dc21f7d6 3 395 | 89943ae938fb308f4b5149ebc0cbea597b9b0223 7 396 | 8a25afaed4bf87468ad7a0c5cf12375554d67741 4 397 | 8a4bcf0f38c9f243443a4d4865278f695bd83dc8 7 398 | 8a65786d9c6b2fe7c1643c27316d6cbb35fbfd24 3 399 | 8afe57c287adc0f93f234e8e8c136ae3c00947c1 5 400 | 8b252fe784692fc15290a04fa59848f609216f16 2 401 | 8b7e4bc408a8c715943bfa00069f2d517b39a748 5 402 | 8c218c317e1e213e1c5e9439870929009d645a47 4 403 | 8c609b8bee4245a1bb81e37d888ac5efb66533cf 3 404 | 8cbfd94324f297a418e7eec6920dfead7b9bed08 4 405 | 8dfe236a6a5734824035725a4f513b8fd31b310a 3 406 | 8e66731c99f4d041ddcd33088d0ab0d4cae8bf75 5 407 | 90003c78975d00b1e5612fd00dffabb70d616ecd 2 408 | 90722d413913ab18462aa741f85b820e751bb50f 3 409 | 908bb09ba2883c3ecdec96ed7e0211ccb05c5018 2 410 | 90b57b582675360916ad68ba65e9284926d93f4a 3 411 | 90ea059c57f011a4fb33a558e868ee639882fe5e 3 412 | 910b156b562880ace789fb3f9b11848163c2df20 3 413 | 91505fccdcc43230550d101967010bed27f9b573 3 414 | 91afe2ee3a5b8e80d67f6c7a30bafbc2d63b2421 3 415 | 91d3f1463dac4d5fed8d4ff34bed0d388c61f164 2 416 | 9200fd6f1e92f78e3d9c6d082837f719ad0500d4 5 417 | 920f141db0d42952130855ac1dce446c327e7d9c 5 418 | 924fcf87b3747dae06e621975903ee73c42016f2 4 419 | 92bada2d019fcd6eee6d332a8068a9ddfa30d518 4 420 | 930df58762e7b5bcf2d362462f03335bad732398 5 421 | 9347890b025cc8c521a4abbff309ffc0466f22b3 4 422 | 937464eb371c68add2236bcef91d24a8ce7c4ed1 2 423 | 937f8d412e9810c8aeb9d92182cd3b007ace30d2 3 424 | 93b07e3cd5ae2f00b36824a74f83a3ef0d65d0d5 2 425 | 9447e50d1266b7cb96a414eaf9ee16c0f99e55f3 2 426 | 94d7a756e199457ea9958c8f5d6860c9bf334126 2 427 | 959a2ddefc9dc1a751cf30779b1aaac775f1612f 5 428 | 96e2a7163c755fbea77abfd9d09a798687a5a993 3 429 | 970e26f3c2c085e39267115991add6ccc6e9ff80 5 430 | 97e173dac64dbde7d6a60de7606cba0c860813db 4 431 | 983eb5deeb61af5ce82ad598692192b8ae8a2a08 2 432 | 98748c364e7bff50cf073c1a421ebe5b5d8b7025 3 433 | 98b7a6ac44b82ccfc45eb51595e2905adabac1c7 5 434 | 98f6769741a1c9df4fd203ed19d70b283c94e41a 3 435 | 99330820cf8aef8bb34d56a666accb4b1ca90e30 4 436 | 9a611007b58a001639676728614ffea61cd5ff85 2 437 | 9afdee40e7b243f99cc50dd1ad710ab0928dd820 4 438 | 9bafce699964f4aabc6b60c71a71c9ff5b0cc82d 4 439 | 9c544426a02312b7148249ef20ae6e2021b45db4 3 440 | 9c5c1c40ec30c34b1b436cf8cc494c0b509e81fc 5 441 | 9c89215dd36eded769691708eb8c82dec1ce5109 5 442 | 9e0312e72f30a20f556b64fe37dbbfe0d4471823 5 443 | 9e790499af6916f82809e35d68cc159efe580f99 3 444 | 9f2fb5f31c2bcff949e08449f197b0c31bdebe50 2 445 | a0c486d0f25a3dc586717d5d3e1f5a46d36735fc 5 446 | a1830ad66feb55f471d52210c6f07937f38238fe 2 447 | a21adba681956ec35816af673a9d4f6c7743253a 4 448 | a2ca7e6e216f8b450eb8db10a4120f0353275b6b 5 449 | a322d4e572467be5e1b452214143f88db526b49f 4 450 | a3537934a4d9dfbf27aca5aaf42e0f18e4975366 5 451 | a3de07612da7986387a4f5c41bbbc7e3b244e077 8 452 | a3e8e076b9c8d4060082233a2f16184cf4911a85 3 453 | a3fbf7c2392c1f97d3a0946a5d1654bf4f7d9b0a 3 454 | a3fc0a55a91ed0041221f8da788d824d9d795913 3 455 | a40674b5e0ba449078cbb07406edfd2627306122 3 456 | a52021f1b257c7c35d626d5d642134091c45e4f4 3 457 | a52c37c1f16ba13d3f39bb5403c82c0187cbff51 5 458 | a53feafa4c70d2378998f0dcb837905e5070c541 4 459 | a553c3f204c105c23b227a1e5aeb290671ccdbeb 4 460 | a57f8ec4f89ab84936f46821969de6bca9f46d8e 4 461 | a58ca651f4c12bf07cf3840d5e37b534f5fc075e 5 462 | a5963fa6c95fbe34482862b0f7221b7766e3a194 3 463 | a5f3ada0610ad32f59d2f114167612d4f62bec4e 3 464 | a676173780dc3ef4523ff3123fdf179279d22932 2 465 | a6d285e515ad1e2c15b4352d9b699ebe060b1dba 5 466 | a731d3d3b5badf33c7602febd32cc4e6ec98c646 3 467 | a7b196f7e934faa76602c8c00bd2f6e6d2d70787 2 468 | a8059dc1820b461418713acf2af14f3a25734bd3 4 469 | a80b5426fd0f4ab19eba1c06620f5efb8fbade3a 3 470 | a8186cd3ef78662c87665df52026ecbae4866bfd 5 471 | a8ac24a702d2c850c7a15b5196893817b0c93123 4 472 | a8eeac428a5992a2390b1827db1358f4c733e200 3 473 | aa13b346e11644f8426fc546b359bc6fd7c6b357 3 474 | aa6055ba0e433aa9c93df4444783cacb9628a7e2 2 475 | aa881a2936f368ab887c296b837a8f7f553a3fb2 3 476 | ab087d04eb5c2c8894758c7cee32ccafd80989a7 4 477 | ab30cdeaacbdf14e6366d43d881338178fc665cb 2 478 | ab3f375b6890b2a9bb1b6124f0fa690950c749f2 5 479 | aba839d554733850902f3073f7974e2e87c488ba 4 480 | abe52920e895c148851649ecb9c029fdc41a275f 5 481 | abeccfe49a6874702d65eb4d06a970d8fcf55123 2 482 | ac109dac24df4dae813ca5d9f0938cc48a162bb1 5 483 | ac71117eb20ec8a84035acbbd380df8235a5c665 4 484 | ac76be83faa34f9c7b9b3c89bd3ee4f450b3027b 2 485 | ad1081f398ac69c0c92e4afadde482574fe875bb 2 486 | ad3d8fc2201a245e352875918e421b42764e4148 4 487 | ad621247f95f80a1a32e67def5e978c845d19208 2 488 | ad995ede603a28c72dad06c245fc7d4dad85d230 2 489 | ae3c3c2c022f566d2e790aba193470d5826f36cf 5 490 | ae6ad52d5ebcad7722ea070109a286fe13b06cb7 4 491 | ae8172bcf76adfa3d401467cbc89cbec2db86ee2 4 492 | af310ee21b5534f32ea92c0ae34a44d828d157a7 4 493 | af3524caccd33ccb7a5b42b1ce4314d055e01672 4 494 | af567ea6e27912d6d5bf1c8e9bc18e9b393fd1ab 2 495 | afb693fd0a138cfc59a2bf81eabd7ca2abd4e162 4 496 | b07e5cde5fc0b0fe79038e929bd148551d532ed6 2 497 | b11c0ded529af18c29ec46b9e0a795ed0405e7ec 4 498 | b188980c998d1dfb5dfbc21837ffbbb5affdbb3c 4 499 | b18d36cc60d0e3b325138bb98472b685cca89f90 5 500 | b1cf453206beef8ab2ede2b061ed95a3cd91eae3 3 501 | b20e02cbffef692c7aee6281eb36729ee1e928ef 4 502 | b210047af5ccc352cc044bf6c1419552223bf8dc 3 503 | b2cca92b7a51a43c310e58e011f3ede1e7125a96 5 504 | b2ce0bc86f82f727db956dfbbe2a3fd0cb72f5fc 7 505 | b45172e4628f68c32cd13c73cf17c4dd1bed1bb2 3 506 | b4788d85e67950177882ea4cf6a5fa3219f3fbd0 2 507 | b493dd7d082e25fc40ad1cccc364e1945590a2f9 2 508 | b550757c8f5b55dbde16b4a7888f10999f01acfd 3 509 | b5749b4cac530e261da9acc0d494a81766d2acc3 3 510 | b58e77f819dfbde72845801cff4b4e0a2f20ef5f 3 511 | b5acea41aeabb5daa4183953f800d47db0c39fb5 2 512 | b5bcbe2dfeaf7cc156c0d8bbf4fdcbe97b2007d4 2 513 | b63fc17c1d004ca4d7f3b1ef8962210a779ca665 5 514 | b656bd19df58fc1ba4628342b87beeec5948e0b3 3 515 | b6a5552effcee708b665fa74e5ce7b0fa2541c03 3 516 | b7104477c8801fe54d1ba91f3a77ac6e4f399f52 5 517 | b74f759ba3837968a04e9b64321b47cf087e76ff 4 518 | b7f36450d1ac76834046fd582d6e77a6d3881a8c 2 519 | b81dd702afaaa5946e4ec065042c891ad2f76c2b 3 520 | b8f4ee146c3cdb8f506371d001e6398ecda85251 2 521 | ba07b1b585386f887d4c7e457210b3fce819709a 3 522 | badcb43e490e3713bf291e83cff204e1c57ecdfe 4 523 | bae8548faded657cca06c2b02a59e00cf1e55484 3 524 | bb902e82a2bdda61101a9b3646462adecdd18c8d 9 525 | bb99fe7702733ab0f9e8856e91f5ddcb55d30b5f 5 526 | bc06bd3d6f138da8f5d38b47e459b4d1942e49e4 2 527 | bd1435a19ba895149fa5b88425316171d165c323 3 528 | bd70b00ccb8fafca883c7160585e9c5920cca58f 5 529 | bd9852ea114e8b8ff781115d1d6e6da6f8dfafff 3 530 | be2d023f5f1ee4cfbdc712c8ef9eda9d07278d88 5 531 | bf0014ca7dd0815b2385a778c5328ae63c692229 2 532 | bf96a360083c5c26430940546827e91a69ade63e 4 533 | bfe8046f8ccc6d6016d7752c04f0654420ef81e7 5 534 | c08a3c1478e51db62624814acbf36c198d6561e6 4 535 | c1219e0735d31f1c41995795e58b04b97bf1b71a 2 536 | c18adae0ca1243e13a15d381a431cc0dfc68223b 2 537 | c1923ab5c5dcaf67af3e23fd1ac42e2d4c61aca7 4 538 | c19f67882b2586c4ba577ffc5d04197e757e19a5 2 539 | c2f4df1bd91f7dee1536774b9d7089086b9bf835 4 540 | c34a1c225d1a5fc41a998e23d1209b59b3b759bb 3 541 | c3ab3edb7f9ba31124092dc0f1dd2f13d3b52f8f 4 542 | c3c67787e2a69e2fdc739d8d1542726ec4ee7c47 5 543 | c461efa942e1a3a1e580f9d04bf8d15c5e834f8b 3 544 | c4a919f31d20008b5d6540aa5d2be59aa4cef5cf 4 545 | c570eccb1bf0c993e375e094d803ef112d0763ad 3 546 | c5b4cd4b49144e8f77455e9ff9077ff840ab278c 3 547 | c5e3845c74da6aea2cb68ccd765e4f606f10b5b6 5 548 | c5edd1c74e72ddaeba1027da1e848e2c4fda94f5 4 549 | c654b842cff7227d9e85fda25279259e837cee9e 2 550 | c66483cd0d83292e4f2b54a3e89bd96b8bf9abb2 2 551 | c69165e84e8350a6726901f2ab6e4688f38f03fc 3 552 | c6d2aa3e7303e0e2244256bfcfc113bafe2d6b59 3 553 | c7377eaeb7f91639296c3df095ba403dbf4f8e79 2 554 | c74a5a6164536750d6b3ea90e19798ab6fad79d7 4 555 | c74c0a9b973f4dbfc132b60fe4d666600ae12552 3 556 | c82c6e054313f4c8864e64897baea8b63776020d 4 557 | c843b8b0e5ed98d3bae68e701fb709ea178ed968 3 558 | c84ea9e7a02609c71ff75893cbb948fc1f1cf21c 2 559 | c9135b1e451193bd4c06d8143eaca934cc89fe05 4 560 | c95f8edb24edca9f5d38c26d0e8a34c6b61efb0c 5 561 | c960c1b895557ef1b336035029d5c6d553c64085 2 562 | c9c272ffa69d3e0af5be42e7636b02dc2af6ea8c 5 563 | ca45da2f9cd8edf4ab04ffd542b9c60ef6a9a254 2 564 | caeca37113c56e696d7053d90f5f9f3e02de8ad1 4 565 | cb544661b6da6a35c20bfe503974f2b79a3c4550 4 566 | cb6bd26961387def757c7faeec7563d77d404d01 7 567 | cbe6c0db6201f8ac09310c788adc634873251164 3 568 | cbec713b32517a503ae6c02497357a8361eccb76 3 569 | cc46a737acd729b2839ecd237d38b4a63cfb16cb 2 570 | cd8ee800822ff0cd295621faafafc73be4bacad0 4 571 | cdeadd6cf7bf5b53aa7d901446b0ce586542c580 4 572 | ce3f9356eaa5fd6c1b5ff1ade244ebd9130f1ceb 4 573 | ce4c5ce07afd297156899eb6c1056eef3f83b803 5 574 | cf088b4eefe7f426e438dd2fe7a3433140abba52 4 575 | cf344e0f58fd918c089c4d4575caec8843944ff6 5 576 | cf6fe49b28fcf81511f39fdf68f37af82bd724c0 3 577 | cfd872d005b7bd4cdd6e06c4c0162191f0b0415d 2 578 | d0706fd10e418eba2929d515cc0994f49376a63f 3 579 | d076d7185078b8adddbacfee7e46c61e3e02fe7e 3 580 | d09d75c7f242a696931407458e717c9bdaadb7d9 5 581 | d0bbf730725806384756f5306ceccd91dc01d975 3 582 | d0dfc1927461d9473d0ed471375dcedddba42279 3 583 | d147f2cac0600527ce49bfffc865c54eb783e5e5 5 584 | d17acc97bf2f853a5fff58da733e4cd53cdaa3ed 5 585 | d1cc2a77fb17608d542c50e2a1404cf5b4231521 8 586 | d1fbdbdf2e830139584d7dc796806aa3327720dd 5 587 | d2ccc4a8de5da21745209d0731671e8f3cbea515 5 588 | d30c17109fa1c4a81e39dca57b79464b0aa0b7c2 2 589 | d33508c89656b18063893cadb74573e0b656792d 4 590 | d3a936e5ef24fdbc7a02a81644ab6cd4b88119d3 3 591 | d3d411c8b7891aef9c59cbc20bb4fa3ff0ca03ea 3 592 | d441ccfede2c089fbef54e20b90c0d4b513c5196 2 593 | d452a79b25f18e6a6eadc5c592d5101f115ef0f0 3 594 | d4da7236bd09d735dcb92127c73e43b3ca94dd7f 4 595 | d526249c1a35cf1174300df75bc28662f579290a 5 596 | d53a8efefe3714269538a91e5256c2938fe13239 4 597 | d53e0c8bcd98820afe820f756af35cc97911bfe4 3 598 | d554710317482127f2e1597e91e72be5ee0726ce 4 599 | d57fc4121d716182a091bb53c666b46c10142668 4 600 | d5902afbd8dfb1ea96fc8cf4d62cf6e4fa40d4f7 4 601 | d5b164797bc969b55c1a6f4006a4535c3fb03cf0 3 602 | d605458c96bbb538c4624deeeed3294ea489a61e 2 603 | d63e20369f98487767810a0c57603bef6a2a07e5 2 604 | d66068f5a8b6cad09ed57893ceb0f3dd37ce8715 3 605 | d7109cf20a22558f923c833ff0b4e2311340acb1 5 606 | d723f2eb1c887db5448fd56be5e7c57e60d88e63 3 607 | d76c7a5c2d28684f0d67114cc7b9707b296e68a2 4 608 | d78293133b075f48c9dc5c4cf0c4a985ae964b08 8 609 | d78d763e72e23418f31dc3ce91deea1e8ee10490 4 610 | d7b46aece68c924e09f07e3df45711f337d35d6a 4 611 | d7e85888117188a6d6f7914e9649fc4821c594a2 3 612 | d7f8c34e3ae9dea51d0c87857e0ff78028d402b7 4 613 | d7fb2ca6004c5fdf77c42a5eab102b95a9a862d7 3 614 | d82135a5e28b750c44995af116db890a15f6428a 4 615 | d89922ed43ea4fc0b87d7e5baef3f072bb566849 2 616 | d94327745bbb865a394e31e150a6c77263ee95da 3 617 | d9826cb2044ed0224124f2f31d0bdc1fb840d81c 4 618 | da397e783d677d1a78fff222d9d6cb48b915dada 4 619 | da4b44c734029f60388b7cea4ab97c3d5c6a09e9 8 620 | dab5a9f93a35fcb92c01e4250b01928fe8bd294b 7 621 | dacc9ed6a80fb15c3e82c4081c07211e033ba820 3 622 | db1513dff6dd456fc973286816129ace81bcdfdd 5 623 | db22cd03db61a495d55c460cfaa266271c8a5926 3 624 | db33011d006201b3bd3bbc4c7c952da2990f36e4 0 625 | db7e4c8dc56a0e8e0e3df08b14a65030738d5ac4 2 626 | dbcfa55870a267112c9a71bcf85b481b11d98e04 3 627 | dbed87a53c604f7140577d6707ca0fc8490463a6 2 628 | dc56cff1211bacd94f59e188e44a58d6f40a0c26 5 629 | dcc1ecdd0e3a2a33b994e472ea367a1637cc3799 3 630 | dccdb2d18c70a94e48b3ec5e0cb986c5d708bbc9 3 631 | dd1e87a16e5fb38d9d729ef7edc6da21146a99fe 3 632 | de0eb1c46c47924879e2a49f9eafba0ab344fe5f 5 633 | de2349227d765db73cdc44efc6338f6b530eb133 3 634 | de251a0af1df3be18469578dc00d414e572ee33e 7 635 | de95b99dffeab5c2b453778dbdc8723dc15cbfd7 3 636 | df10b3c8470acebbc445f7c24a50b4f24db0187d 5 637 | df15daf1e68e9c8cd95c4431803d86fe6c2f985e 2 638 | e003d57d2102e8fdf5d9eea7bd78a3cf67d75778 4 639 | e065238580b9e118b6c9e789d797cdd99e0a1c69 5 640 | e0a8aff980ed84ec12acbf63b40cf9895997faf3 4 641 | e11afc03db4e1d03976d02796b29da9c65d4ff3d 4 642 | e171d0cec1d32aaf084e3c8150705c177522cbe6 3 643 | e178917d1974ac85fd58cb93b936eb9a6f44ba0d 3 644 | e19cfcbe92ec3682bee869dfad5f6b4058b1f2ce 4 645 | e22a6317747903475095008d0d5ad9427ddb34af 2 646 | e3036a7bc6ed3ece1c85d5e37fb2ff39ba98ba47 4 647 | e31ac6520e912c27ce96431a1dfb112bf71cb7b9 3 648 | e32d7334ace26a570a08fe7c01ad01a2c08b1991 4 649 | e36e16acfdfa76fa72b218da2bebc668db39d21e 5 650 | e388e8d8546e329d2c58269d4fa026624a640f1b 4 651 | e4401a78869ffa879a55f239e5da4990cb6797a6 2 652 | e58c1dd46067e2abaaf3ee6a70a7e5541a32017e 3 653 | e6419519c2d3247ea395e4feaa494a2e23e469ce 4 654 | e6ba7a6ecda80a1c844542be0b2a44a4a33dc113 3 655 | e6c01bd90cf0b2793282fc53e9a3150a6d7804c5 5 656 | e6de8bbd60123444de2a90928853985ceb0b4cbf 7 657 | e7273feaa30b676941b25061ef0631ec09ccdb7c 3 658 | e7351ef9606bd6d5f38acb7c17aed8a00170b85d 4 659 | e73946f1f26589d77926276ca4f9dbee60c53fde 4 660 | e78511a2b8cca37a96aa396c938863c92a20c797 3 661 | e7b8574a42b1029539632ce0f5161b1c38d5e95f 2 662 | e839f3ac7d52c427ecc011d01e6e241f88ca850c 4 663 | e87e5431ea2ba6cd367ad8bfaa859dae5b297ad4 3 664 | e89fc7437d8f9aed1640689a32ebbf047699b147 4 665 | e8ab46785e75e19dac497c4a82ac2f5b37ac0580 5 666 | e8e416977f5dae3635362c513bba004ea89a0bf4 5 667 | e92baa5fdfb2715e68700024d964098ef35704d9 5 668 | e96888c96c3044ca7ce57dbdf1744df7469f7465 4 669 | e9e778c3d103cc8c32093cd6880fa8d7238bbd9e 2 670 | ea0824ea0692d2cdff816a2b3c3eb9a587a5f536 2 671 | ead699582641d103a94775a08121ecc336b99eae 4 672 | eb58b57f468e12c4300d3a88337e6c45e532c7d3 3 673 | ebceb3de22e4c0444a969d83ee487f8ee34204e4 5 674 | ebe20c85c5314957fafc223c26bf393847e3bb03 5 675 | ebed19269b7625c93eccefc2bd758555e2027431 3 676 | ec1bb5c36952b12e6c0805e9a8d5bf31c20a68c4 4 677 | eca36fe80a916eb6b196ec56edfc1296d793e350 3 678 | ecb538238fc7c5e374d723f4d6120d1b2ef5d80e 4 679 | ecbf33a376a7a108176f8d1009d042e01519241c 4 680 | edc238c1eb254cbf90f1dfdc276ff7ccc93a940e 2 681 | ee095ee6361f0a767250fe19c9bc805bba8da4e9 3 682 | ee501fde62b25ddd1c82798ee1b233b8813e717b 4 683 | ee533b8e4bdd6cdf2c273f7c80753cf8db60f545 3 684 | ee60e88ae409ddd93d4259b79586dacb2e5ee372 4 685 | ee66334fbac1c926ed05c1c3f38df3920f501fe6 2 686 | efdf63f01293251dc593163a42f31556fd042282 4 687 | efed48854beb2803d9f2b5644edff2aacf7c6af9 4 688 | f04f5c6936301eed31a79c23571f8fc497864dbb 3 689 | f0be97ceca47b65b46c9518e6157b295f8c99c38 2 690 | f0e4168ea18188fca2581526c2503223b9a28581 3 691 | f0fee046198a076e664811f4e3a788d5f0b47183 2 692 | f100a76117e95ab0335e89a901e47d844bbc0ab6 4 693 | f12ad34dc3b4279da0fc7094f3d50d6b8bb517dc 4 694 | f182d4785e3eed00292f7ff4795c9dcc6c990a0a 4 695 | f1de76dfcd8c4e354a8a8058a76191167fd112e3 2 696 | f2361230358bd945690ca1c2a9dcc1cbce83941b 5 697 | f25628e474035e6bf0440b274c5df04f94c49fb8 4 698 | f2a39aaf548bc470d551d7ab303f3742fd26d4cf 2 699 | f2eef7402d2e6e7f7c15a1f3d8bd251603eabf12 2 700 | f312d6a8858cb773d1b3152099a24960e433ff9c 2 701 | f3306e6f25d111da21ce66db3404f5f48acb25a1 4 702 | f416b424fb913ca067fe75279c924a20fac5c6a1 4 703 | f4a1e82c533677ed9923b11a0b970264d9ecf8ca 3 704 | f4da2be2ee712ba2e7cccf56fcd15483fe0023ed 5 705 | f4dba5ba267b5dd1a35eb74a6ec4fd4d5ca9a1b4 5 706 | f4f7c789dd320192fd544c666ceab720c7f3a747 5 707 | f5009c44ba1e72b64e29fc734741d518b4167aea 3 708 | f50d0c66b08c47b59925952276243e2008668185 4 709 | f52690157a51c662ffdf4ae3592ada93d7be4032 4 710 | f57b46154cf0711e3f5218e00f67c375d95d1d5d 4 711 | f5e199a5b39bad10256d8e963f0da272ad359517 3 712 | f6199f48ff994fc9a8e33a8581bb3bb16dd301ab 2 713 | f6e0dff9f8674383a866902fddb72a280d331d9d 3 714 | f787271597abbcb1297e4e8a4a9561959a195649 4 715 | f7dd6841d280cbffa9f0f2da7af3549f23270ddb 4 716 | f84d7fc089b31440cac1f4fbee3d45b2f6c90e37 5 717 | f90064fe4ffed170f9e9c79196aa0b17e0bbd86b 2 718 | f924980511d2ea191481c1e4ff5ab7adc3f082ab 3 719 | f9486dd810d6321bad4bc9d7703a67d630167f98 4 720 | f999e0187023413d839a67337d0595e150b2398f 4 721 | f9e8cc6e47d5632e3b28500197f8e9187295c52b 4 722 | fa2d5f56273a0faa5b39096448f82998655de60d 3 723 | fa6c059e14092d023b1f9f2df28e482f966287db 4 724 | faa5f0bf79fde9ce74b91a7091d203771cae8499 2 725 | facb967717c21fed9b375481908aa337b3361c45 5 726 | fb053becf87f12e196e00b3e153ec8029ebf1ff8 3 727 | fbb22cea9227f6f40080a42a1a169c0747129c95 5 728 | fbfdd89ec183ceae63d3d66b0ab45faa951b525a 7 729 | fc9adbd816109f7705f342c01f168bb09ca4b2ff 4 730 | fcdbc5e15dd6b973e0f1112f4599dad985f48042 3 731 | fd0e46e4aef2d9713d20b51d2ba57d55bde7dcee 2 732 | fd1eecd9c89f47741276433b99b75eca2930b58d 2 733 | fd71df03b0e9f3caf701ecfc6d5232060cab3b13 3 734 | fd7b23a4f1c2058b966b5ddd52cf7ae44a0eebb0 4 735 | fda4422b86daa233fa4e6104e45305e7cb383053 5 736 | fe39af5eb457bba8c5b96b5b500120cfc05c265e 2 737 | fe4bd35e87dd50fddd255172129b9bec38691188 3 738 | fe8aae62fdec28631d8f7b6659dd95135c1bcbb7 5 739 | fed52c0455ce1e7cef80cd144c3d0ef3636134e5 3 740 | ff72a1788d47f9876d9fabd720f6a289fb409090 2 741 | -------------------------------------------------------------------------------- /runec.c: -------------------------------------------------------------------------------- 1 | // #### ###### #### ####### #### ----------------------- // 2 | // ## ## ## ## ## ## ## # ## ## CPCEC, plain text Amstrad // 3 | // ## ## ## ## ## # ## CPC emulator written in C // 4 | // ## ##### ## #### ## as a postgraduate project // 5 | // ## ## ## ## # ## by Cesar Nicolas-Gonzalez // 6 | // ## ## ## ## ## ## # ## ## since 2018-12-01 till now // 7 | // #### #### #### ####### #### ----------------------- // 8 | 9 | /* This notice applies to the source code of CPCEC and its binaries. 10 | 11 | This program is free software: you can redistribute it and/or modify 12 | it under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | This program is distributed in the hope that it will be useful, 17 | but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | GNU General Public License for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with this program. If not, see . 23 | 24 | Contact information: */ 25 | 26 | // RUNEC is a basic file runner for CPCEC, ZXSEC, CSFEC and MSXEC: 27 | // when the type of a file can't be identified from its extension, 28 | // magic numbers are checked to detect which emulator can read it. 29 | 30 | #include 31 | #include // strchr.. 32 | #include // system.. 33 | 34 | unsigned char tmp[1<<15]=""; // 32K 35 | int endswith(char *s,char *t) // ZERO if the path "s" doesn't end in "t"; comparison is case-insensitive 36 | { 37 | if (!s||!t||!*s||!*t) return 0; 38 | int n=0; while (*s) ++s; while (*t) ++n,++t; 39 | while (n--) if (((*--s)^(*--t))&~32) return 0; 40 | return 1; 41 | } 42 | int c64chr(unsigned char *s,unsigned char *t,int l) // ZERO if s[0..l[ isn't the complement of t[0..l[ 43 | { 44 | for (;l>0;--l) if (*s+++*t++!=255) return 0; 45 | return 1; 46 | } 47 | int main(int argc,char *argv[]) 48 | { 49 | const char exe[][6]={"cpcec","zxsec","csfec","msxec"}; // respectively 0, 1, 2 and 3 50 | FILE *f; int o=-1; for (int i=1;i='0'&&u<='9')||((u|=32)>='a'&&u<='f')) ++n; 79 | while (tmp[t]>=' '&&++t=0X2000&&( 88 | (!memcmp(tmp,"AB",2)&&(!tmp[3]||(tmp[3]>=64&&tmp[3]<192)))|| // MSX cartridge (99% titles) (1/3) 89 | (l>=0X8000&&!memcmp(&tmp[0x4000],"AB",2)&&tmp[0x4003]>=64&&tmp[0x4003]<192)|| // MSX cartridge (2/3) 90 | (l>=0X8000&&!memcmp(&tmp[0],"\010\200\151\215",4))|| // MSX cartridge (special case "R-TYPE"!) (3/3) 91 | !memcmp(&tmp[4],"\277\033\230\230",4))) // MSX firmware 92 | o=3; 93 | else // CPC Dandanator cartridges must include FDFDFD71 and FDFDFD77 somewhere in their first 4K block 94 | { 95 | o=0; for (int t=0;t. 33 | 34 | Contact information: */ 35 | 36 | // XRFEC is a small tool that reads the temporary XOR-RLE-FILM files 37 | // generated by CPCEC, ZXSEC etc. and decodes them into video and audio 38 | // that can be processed by conventional codecs such as ZMBV and XVID. 39 | // The Windows version relies on the Video For Windows (VFW) interface; 40 | // other systems will get RGB24+PCM AVI files to feed FFMPEG with. 41 | 42 | #include // printf... 43 | #include // strcmp... 44 | #include // malloc... 45 | 46 | #ifdef _WIN32 // "BYTE", "WORD", "DWORD" and (unused) "QWORD" are always exactly 8, 16, 32 and 64 bits long 47 | 48 | #ifndef RAWWW // disable VFW! 49 | #define WIN32_LEAN_AND_MEAN 1 50 | #include 51 | #include 52 | #endif 53 | 54 | #else // "char", "short int" and "long long int" are 8, 16 and 64 bits, but "long int" can be 32 or 64 bits 55 | 56 | #include 57 | #define BYTE uint8_t // can this be safely reduced to "unsigned char"? 58 | #define WORD uint16_t // can this be safely reduced to "unsigned short"? 59 | #define DWORD uint32_t // this CANNOT be safely reduced to "unsigned int"! 60 | 61 | #endif 62 | 63 | #if __GNUC__ >= 4 // optional branch prediction hints 64 | #define LIKELY(x) __builtin_expect(!!(x),1) // see 'likely' from Linux 65 | #define UNLIKELY(x) __builtin_expect((x),0) // see 'unlikely' 66 | #else // branch prediction hints are unreliable outside GCC!! 67 | #define LIKELY(x) (x) // not ready, fall back 68 | #define UNLIKELY(x) (x) // ditto 69 | #endif 70 | 71 | // common data types -- mostly based on ARGB32 video and lLrR32 audio // 72 | 73 | #define MAXVIDEOBYTES (32<<16) // 2 MB > one frame of video at 800x600px 32bpp 74 | #define MAXAUDIOBYTES (1<<16) // 64 kB > 1/3 seconds of audio at 48000x2ch 16b 75 | BYTE flags_audio[4]={1,2,2,4}; // sample size according to 16bits (bit 0) and stereo (bit1) 76 | BYTE wave32[MAXAUDIOBYTES]; // the current audio frame 77 | 78 | int video_x,video_y,audio_z,clock_z,flags_z,count_z; // dimensions and features of the video and audio streams 79 | 80 | // open and read a XRF file ----------------------------------------- // 81 | 82 | FILE *xrf_file=NULL; int xrf_length,xrf_cursor,xrf_count,xrf_dummy; 83 | BYTE *xrf_argb32=NULL,*xrf_diff32=NULL,*xrf_chunk=NULL; // buffers 84 | int xrf_version; // experimental support for additional encodings!! 85 | int xrf_chunksize(void) // get the maximum chunk length in bytes 86 | { 87 | return xrf_version?MAXVIDEOBYTES+MAXAUDIOBYTES+8*8: // all 100% literal streams (video R,G,B + audio l,L,r,R) plus headers and footers 88 | ((MAXVIDEOBYTES+MAXAUDIOBYTES)*19/16+8*4); // pathological case xxxxxxxx.xxxxxxxx -> 1xxxxxxxx.1xxxxxxxx.0 plus 8 end markers 89 | } 90 | int xrf_decodebool(BYTE **s,BYTE *a,BYTE *b) // fetch zero or nonzero 91 | { { if (UNLIKELY(!(*a>>=1))) *b=*((*s)++),*a=128; } return *b&*a; } 92 | int xrf_decode1(BYTE *t,int o,BYTE *s,int *l,int x) // equally hacky decoder based on an 8-bit RLE and an interleaved pseudo Huffman filter! 93 | { 94 | #define xrf_decode1n() (xrf_decodebool(&v,&a,&b)?*v++:0) 95 | BYTE *v=s,*w=t,a=0,b=0; for (int m=-1;o>=0;) 96 | { 97 | int n; if (xrf_decodebool(&v,&a,&b)) // special case of xrf_decode1n() 98 | { if (!(n=*v++)) return *l=(w-t)/x,v-s; } // long zero "100000000" is EOF! 99 | else n=0; // short zero 100 | --o,*w=n,w+=x; if (n==m) // string? 101 | { 102 | n=xrf_decode1n(); if (n==255) n=510+(xrf_decode1n()<<8); 103 | if (n>=254) n+=xrf_decode1n(); 104 | if ((o-=n)>=0) for (;n;--n) *w=m,w+=x; // avoid overruns; the error is handled later 105 | m=-1; // avoid accidental repetitions 106 | } 107 | else m=n; // new literal 108 | } 109 | #undef xrf_decode1n 110 | return *l=-1; // false values = automatic errors! 111 | } 112 | int xrf_decode2(BYTE *t,int o,BYTE *s,int *l,int x) // slightly improved version of the original hacky decoder! 113 | { 114 | #define xrf_decode1n() xrf_decodebool(&v,&a,&b) 115 | BYTE *v=s,*w=t,a=0,b=0,r=128; for (;o>=0;) 116 | { 117 | int n=1; while (n>0&&xrf_decode1n()) if ((n<<=1)<1) goto failure; else if (xrf_decode1n()) ++n; 118 | if ((o-=--n)<0) break; else for (;n;--n) *w=*v++,w+=x; // avoid overruns! 119 | BYTE c=xrf_decode1n(); // 00: fetch byte; 01: reuse byte; 10: set 0; 11: set 255 120 | n=1; while (n>0&&xrf_decode1n()) if ((n<<=1)<1) goto failure; else if (xrf_decode1n()) ++n; 121 | if (c) c=xrf_decode1n()?255:0; else if (xrf_decode1n()) c=r; else 122 | if ((c=*v++)==255) break; else if (!c) return *l=(w-t)/x,v-s; else r=c; 123 | if ((o-=++n)<0) break; else do *w=c,w+=x; while (--n); // avoid overruns! 124 | } 125 | failure: return *l=1; // false values = automatic errors! 126 | #undef xrf_decode1n 127 | } 128 | int xrf_decode(BYTE *t,int o,BYTE *s,int *l,int x) 129 | { return xrf_version?xrf_decode2(t,o,s,l,x):xrf_decode1(t,o,s,l,x); } 130 | 131 | #define xrf_fgetc() fgetc(xrf_file) 132 | int xrf_fgetcc(void) { int m=xrf_fgetc()<<8; return m+xrf_fgetc(); } // Motorola order, (*(WORD*))(x) is no use 133 | int xrf_fgetcccc(void) { int m=xrf_fgetc()<<24; m+=xrf_fgetc()<<16; m+=xrf_fgetc()<<8; return m+xrf_fgetc(); } 134 | //int xrf_fread(BYTE *t,int l) { int i=0,j; while (i1|| 160 | strcmp(id,"XRF1!\015\012\032")?fclose(xrf_file),1:0; 161 | } 162 | int xrf_read(void) // reads a XRF chunk and decodes the current video and audio frames; !0 ERROR/EOF 163 | { 164 | if (!xrf_file) return 1; // file not open! 165 | if (xrf_count>=count_z) return 1; // EOF! 166 | //if (!xrf_chunk||!xrf_chunk2) return 1; // buffer error! 167 | int i,j,l=xrf_fgetcccc(); 168 | { 169 | if (l<1||l>xrf_chunksize()) return 1; // improper chunk size! 170 | if (xrf_fread(xrf_chunk,l)!=l) return 1; // file is truncated! 171 | } 172 | xrf_cursor+=4+l; 173 | BYTE *s=xrf_chunk; i=0; l=video_x*video_y>>((flags_z&12)==4); 174 | s+=xrf_decode(&xrf_diff32[0],l,s,&j,4); i+=j; // B 175 | s+=xrf_decode(&xrf_diff32[1],l,s,&j,4); i+=j; // G 176 | s+=xrf_decode(&xrf_diff32[2],l,s,&j,4); i+=j; // R 177 | // s+=xrf_decode(&xrf_diff32[3],l,s,&j,4); i+=j; // A 178 | if (!i) ++xrf_dummy; // empty frame 179 | else if (i!=l*3) return 1; // damaged video frame! 180 | else // apply changes! 181 | { 182 | int zi=0,zo=video_y*video_x; // doing the vertical flipping here saves some overhead later 183 | if ((flags_z&12)==4) // vertical scaling? 00xx = normal, 01xx = vertical scaling, 1Zxx = interleaved 184 | for (zo-=video_x*2;zo>=0;zo-=video_x*3) for (int z=video_x;z;++zi,++zo,--z) 185 | ((DWORD*)xrf_argb32)[zo+video_x]=((DWORD*)xrf_argb32)[zo]^=((DWORD*)xrf_diff32)[zi]; 186 | else // no vertical scaling, copy 187 | for (zo-=video_x*1;zo>=0;zo-=video_x*2) for (int z=video_x;z;++zi,++zo,--z) 188 | ((DWORD*)xrf_argb32)[zo]^=((DWORD*)xrf_diff32)[zi]; 189 | } 190 | if (audio_z) 191 | { 192 | switch(flags_z&3) 193 | { 194 | case 0: // 8-bit mono 195 | i=audio_z; 196 | s+=xrf_decode(&wave32[0],audio_z,s,&j,1); i-=j; // M 197 | break; 198 | case 1: // 16-bit mono 199 | case 2: // 8-bit stereo: equal to 16-bit mono on the lil-endian AVI! 200 | i=audio_z*2; 201 | s+=xrf_decode(&wave32[0],audio_z,s,&j,2); i-=j; // m/L 202 | s+=xrf_decode(&wave32[1],audio_z,s,&j,2); i-=j; // M/R 203 | break; 204 | case 3: // 16-bit stereo 205 | i=audio_z*4; 206 | s+=xrf_decode(&wave32[0],audio_z,s,&j,4); i-=j; // l 207 | s+=xrf_decode(&wave32[1],audio_z,s,&j,4); i-=j; // L 208 | s+=xrf_decode(&wave32[2],audio_z,s,&j,4); i-=j; // r 209 | s+=xrf_decode(&wave32[3],audio_z,s,&j,4); i-=j; // R 210 | break; 211 | } 212 | if (i) return 1; // damaged audio frame! 213 | } 214 | return ++xrf_count,0; 215 | } 216 | int xrf_close(void) // close and clean up; always 0 OK 217 | { 218 | if (xrf_argb32) free(xrf_argb32),xrf_argb32=NULL; 219 | if (xrf_diff32) free(xrf_diff32),xrf_diff32=NULL; 220 | if (xrf_chunk) free(xrf_chunk),xrf_chunk=NULL; 221 | if (xrf_file) fclose(xrf_file),xrf_file=NULL; 222 | return 0; 223 | } 224 | 225 | int avi_videos,avi_audios; // video/audio counters 226 | 227 | #ifdef _WIN32 228 | #ifndef RAWWW // disable VFW! 229 | 230 | // create and write an AVI file through Windows' AVIFILE API -------- // 231 | 232 | char vfw_fourcc[5]=""; // uncompressed "DIB " is even worse than RGB24: it's ARGB32! 233 | PAVIFILE vfw_file=NULL; IAVIStream *vfw_video,*vfw_codec,*vfw_audio; 234 | 235 | int vfw_create(char *s) // !0 ERROR 236 | { 237 | if (vfw_file) return 1; 238 | avi_videos=avi_audios=0; vfw_video=vfw_codec=vfw_audio=NULL; 239 | AVIFileInit(); remove(s); // VFW needs erasing the file beforehand! 240 | if (AVIFileOpen(&vfw_file,s,OF_CREATE|OF_WRITE,NULL)) 241 | return AVIFileExit(),1; 242 | AVISTREAMINFO vhdr; memset(&vhdr,0,sizeof(vhdr)); 243 | vhdr.fccType=streamtypeVIDEO; 244 | //vhdr.fccHandler=0; 245 | vhdr.dwRate=(vhdr.dwScale=1)*clock_z; 246 | vhdr.dwSuggestedBufferSize=video_x*video_y*4; 247 | //vhdr.rcFrame.left=vhdr.rcFrame.top=0; 248 | vhdr.rcFrame.right=video_x; 249 | vhdr.rcFrame.bottom=video_y; 250 | if (AVIFileCreateStream(vfw_file,&vfw_video,&vhdr)) 251 | vfw_video=NULL; 252 | AVICOMPRESSOPTIONS vopt; memset(&vopt,0,sizeof(vopt)); 253 | vopt.fccHandler=mmioFOURCC(vfw_fourcc[0],vfw_fourcc[1],vfw_fourcc[2],vfw_fourcc[3]); 254 | vopt.dwFlags=AVICOMPRESSF_KEYFRAMES; vopt.dwKeyFrameEvery=clock_z*10; // 10 s/keyframe 255 | BITMAPINFO bmi; memset(&bmi,0,sizeof(bmi)); bmi.bmiHeader.biSize=sizeof(BITMAPINFOHEADER); 256 | bmi.bmiHeader.biPlanes=1; bmi.bmiHeader.biBitCount=32; bmi.bmiHeader.biCompression=BI_RGB; 257 | bmi.bmiHeader.biWidth=video_x; bmi.bmiHeader.biHeight=video_y; 258 | // negative values mean top-to-bottom; Windows' default is bottom-to-top 259 | if (AVIMakeCompressedStream(&vfw_codec,vfw_video,&vopt,NULL)) 260 | vfw_codec=NULL; 261 | else 262 | AVIStreamSetFormat(vfw_codec,0,&bmi,sizeof(bmi)); 263 | if (audio_z) 264 | { 265 | AVISTREAMINFO ahdr; memset(&ahdr,0,sizeof(ahdr)); 266 | ahdr.fccType=streamtypeAUDIO; 267 | ahdr.dwRate=(ahdr.dwSampleSize=ahdr.dwScale=flags_audio[flags_z&3])*clock_z*audio_z; 268 | ahdr.dwQuality=(DWORD)-1; 269 | WAVEFORMATEX wfex; memset(&wfex,0,sizeof(wfex)); wfex.wFormatTag=WAVE_FORMAT_PCM; 270 | wfex.nAvgBytesPerSec=(wfex.nBlockAlign=(wfex.wBitsPerSample=(flags_z&1)?16:8)/8*(wfex.nChannels=(flags_z&2)?2:1)) 271 | *(wfex.nSamplesPerSec=audio_z*clock_z); 272 | if (AVIFileCreateStream(vfw_file,&vfw_audio,&ahdr)) 273 | vfw_audio=NULL; 274 | else 275 | AVIStreamSetFormat(vfw_audio,0,&wfex,sizeof(wfex)); 276 | } 277 | return 0; 278 | } 279 | int vfw_write(void) // !0 ERROR 280 | { 281 | if (!vfw_file) return 1; 282 | if (vfw_video&&vfw_codec) 283 | { 284 | // unlike in past versions, the bitmap is already upside down :-) 285 | AVIStreamWrite(vfw_codec,avi_videos++,1,xrf_argb32,video_x*video_y*4,0,NULL,NULL); 286 | if (vfw_audio) 287 | { 288 | AVIStreamWrite(vfw_audio,avi_audios,audio_z,wave32,audio_z*flags_audio[flags_z&3],0,NULL,NULL); 289 | avi_audios+=audio_z; 290 | } 291 | return 0; 292 | } 293 | return 1; 294 | } 295 | int vfw_finish(void) // close and clean up; always 0 OK 296 | { 297 | if (vfw_audio) AVIStreamRelease(vfw_audio),vfw_audio=NULL; 298 | if (vfw_codec) AVIStreamRelease(vfw_codec),vfw_codec=NULL; 299 | if (vfw_video) AVIStreamRelease(vfw_video),vfw_video=NULL; 300 | if (vfw_file) AVIFileRelease(vfw_file),vfw_file=NULL; 301 | AVIFileExit(); return 0; 302 | } 303 | 304 | #endif 305 | #endif 306 | 307 | // create and write an AVI file by hand, no compression ------------- // 308 | 309 | FILE *avi_file=NULL; long long int avi_length=0; 310 | 311 | BYTE avi_header[0x0200]= // padding is doubtful. VirtualDub uses 0x2000, VFW.DLL uses 0x0800... 312 | { 313 | 0x52,0x49,0x46,0x46, 64, 64, 64, 64,0x41,0x56,0x49,0x20,0x4C,0x49,0x53,0x54, // 0x000# 314 | 0x24,0x01,0x00,0x00,0x68,0x64,0x72,0x6C,0x61,0x76,0x69,0x68,0x38,0x00,0x00,0x00, // 0x001# 315 | 0, 0, 0, 0, 0, 0, 0, 0,0x00,0x00,0x00,0x00,0x10,0x01,0x00,0x00, // 0x002# 316 | 64, 64, 64, 0,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0x003# 317 | 0, 0,0x00,0x00, 0, 0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0x004# 318 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4C,0x49,0x53,0x54,0x74,0x00,0x00,0x00, // 0x005# 319 | 0x73,0x74,0x72,0x6C,0x73,0x74,0x72,0x68,0x38,0x00,0x00,0x00,0x76,0x69,0x64,0x73, // 0x006# 320 | 0x44,0x49,0x42,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0x007# 321 | 0x01,0x00,0x00,0x00, 0, 0,0x00,0x00,0x00,0x00,0x00,0x00, 64, 64, 64, 0, // 0x008# 322 | 0, 0, 0, 0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0x009# 323 | 0, 0, 0, 0,0x73,0x74,0x72,0x66,0x28,0x00,0x00,0x00,0x28,0x00,0x00,0x00, // 0x00A# 324 | 0, 0,0x00,0x00, 0, 0,0x00,0x00,0x01,0x00,0x18,0x00,0x00,0x00,0x00,0x00, // 0x00B# 325 | 0, 0, 0, 0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0x00C# 326 | 0x00,0x00,0x00,0x00,0x4C,0x49,0x53,0x54,0x5C,0x00,0x00,0x00,0x73,0x74,0x72,0x6C, // 0x00D# 327 | 0x73,0x74,0x72,0x68,0x38,0x00,0x00,0x00,0x61,0x75,0x64,0x73,0x00,0x00,0x00,0x00, // 0x00E# 328 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00, // 0x00F# 329 | 0, 0, 0, 0,0x00,0x00,0x00,0x00, 64, 64, 64, 8, 0, 0, 0, 0, // 0x010# 330 | 0xFF,0xFF,0xFF,0xFF,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0x011# 331 | 0x73,0x74,0x72,0x66,0x10,0x00,0x00,0x00,0x01,0x00, 2,0x00, 0, 0, 0, 0, // 0x012# 332 | 0, 0, 0, 0, 0,0x00, 0,0x00,0x4A,0x55,0x4E,0x4B, 0, 0, 0, 0, // 0x013# 333 | }; 334 | BYTE avi_h_mute[0x0200]= // see above 335 | { 336 | 0x52,0x49,0x46,0x46, 64, 64, 64, 64,0x41,0x56,0x49,0x20,0x4C,0x49,0x53,0x54, // 0x000# 337 | 0xC0,0x00,0x00,0x00,0x68,0x64,0x72,0x6C,0x61,0x76,0x69,0x68,0x38,0x00,0x00,0x00, // 0x001# 338 | 0, 0, 0, 0, 0, 0, 0, 0,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00, // 0x002# 339 | 64, 64, 64, 0,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0x003# 340 | 0, 0,0x00,0x00, 0, 0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0x004# 341 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4C,0x49,0x53,0x54,0x74,0x00,0x00,0x00, // 0x005# 342 | 0x73,0x74,0x72,0x6C,0x73,0x74,0x72,0x68,0x38,0x00,0x00,0x00,0x76,0x69,0x64,0x73, // 0x006# 343 | 0x44,0x49,0x42,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0x007# 344 | 0x01,0x00,0x00,0x00, 0, 0,0x00,0x00,0x00,0x00,0x00,0x00, 64, 64, 64, 0, // 0x008# 345 | 0, 0, 0, 0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0x009# 346 | 0, 0, 0, 0,0x73,0x74,0x72,0x66,0x28,0x00,0x00,0x00,0x28,0x00,0x00,0x00, // 0x00A# 347 | 0, 0,0x00,0x00, 0, 0,0x00,0x00,0x01,0x00,0x18,0x00,0x00,0x00,0x00,0x00, // 0x00B# 348 | 0, 0, 0, 0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0x00C# 349 | 0x00,0x00,0x00,0x00,0x4A,0x55,0x4E,0x4B, 0, 0, 0, 0,0x00,0x00,0x00,0x00, // 0x00D# 350 | }; 351 | BYTE avi_canvas[1<<12]; // scanline interleaving buffer -- no need to allocate a whole frame! 352 | 353 | #define avi_fputc(x) fputc(x,avi_file) 354 | int avi_fputcccc(int i) { avi_fputc(i); avi_fputc(i>>8); avi_fputc(i>>16); return avi_fputc(i>>24); } 355 | void avi_mputcc(BYTE *x,int i) { *x=i; x[1]=i>>8; } // compatible, rather than ((*(WORD*))(x))=i) 356 | void avi_mputcccc(BYTE *x,int i) { *x=i; x[1]=i>>8; x[2]=i>>16; x[3]=i>>24; } // ditto, for DWORD 357 | //int avi_fwrite(BYTE *t,int l) { int i=0,j; while (iRGB24 clipping :-( 434 | int l=(video_x*3+3)&-4; 435 | avi_fputcccc(0x62643030); // "00db" 436 | avi_fputcccc(l*video_y); 437 | for (int y=0;yargc) 515 | { 516 | printf(MY_CAPTION " " MY_VERSION " " MY_LICENSE "\n" 517 | "\n" 518 | "usage: " my_caption " source.xrf [target.avi" 519 | #ifdef _WIN32 520 | #ifndef RAWWW // disable VFW! 521 | " [fourcc]" 522 | #endif 523 | #endif 524 | "]\n" 525 | " " my_caption " source.xrf - | ffmpeg [filters] -i - [options] target\n" 526 | "\n" 527 | GPL_3_INFO 528 | "\n"); 529 | #ifdef _WIN32 530 | #ifndef RAWWW // disable VFW! 531 | ICINFO lpicinfo; ICInfo(0,-1,&lpicinfo); int n=lpicinfo.fccHandler; 532 | for (int j=0;j>8),(BYTE)(lpicinfo.fccHandler>>16),(BYTE)(lpicinfo.fccHandler>>24)); 535 | printf("\n"); 536 | #endif 537 | #endif 538 | return 1; 539 | } 540 | if (xrf_open(s)) 541 | return xrf_close(),fprintf(stderr,"error: cannot open source!\n"),1; 542 | //if (!count_z) return xrf_close(),fprintf(stderr,"error: source is empty!\n"),1; 543 | fprintf(stderr,audio_z?"VIDEO %dx%dpx %dHz - AUDIO %dx%02db %dHz\n":"VIDEO %dx%dpx %dHz - NO AUDIO\n", 544 | video_x,video_y,clock_z,(flags_z&2)?2:1,(flags_z&1)?16:8,audio_z*clock_z); 545 | #define filesize_style "%d.%02d Mbytes" 546 | #define filesize_upper(x) ((int)(x>>20)) 547 | #define filesize_lower(x) ((((int)(x>>15))&31)*3+3) 548 | if (t) // process 549 | { 550 | if (!(xrf_chunk=malloc(xrf_chunksize()))) 551 | return xrf_close(),avi_finish(),fprintf(stderr,"error: cannot setup decoder!\n"),1; 552 | if (avi_create(t)) 553 | return xrf_close(),avi_finish(),fprintf(stderr,"error: cannot create target!\n"),1; 554 | while (!xrf_read()&&!avi_write()) 555 | if (!(xrf_count&15)) fprintf(stderr,"%d/%d\015",xrf_count,count_z);//(stderr,"%05.02f\015",xrf_cursor*100.0/xrf_length) 556 | if (avi_finish(),xrf_cursor!=xrf_length) 557 | return xrf_close(),fprintf(stderr,"error: something went wrong!\n"),1; 558 | else 559 | { 560 | #ifdef _WIN32 561 | #ifndef RAWWW // disable VFW! 562 | if (!avi_length) // using VFW32.DLL means we cannot know the output length in advance 563 | if (avi_file=fopen(t,"rb")) 564 | fseek(avi_file,0,SEEK_END),avi_length=ftell(avi_file),fclose(avi_file); 565 | #endif 566 | #endif 567 | fprintf(stderr,"%d frames (%d unused), " filesize_style ".\n",xrf_count,xrf_dummy,filesize_upper(avi_length),filesize_lower(avi_length)); 568 | } 569 | } 570 | else // examine 571 | { 572 | int llv=video_x*video_y*3,lla=audio_z*flags_audio[flags_z&3]; avi_length=(long long int)(llv+lla)*count_z; 573 | printf("%d frames x (%d+%d video+audio bytes) ~ " filesize_style ".\n",count_z,llv,lla,filesize_upper(avi_length),filesize_lower(avi_length)); 574 | } 575 | return xrf_close(); // always 0 OK 576 | } 577 | -------------------------------------------------------------------------------- /zxsec-a4.h: -------------------------------------------------------------------------------- 1 | 0X0000,0X0000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0X0000,0X0000, 2 | 0X0000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0X0000, 3 | 0XF000,0XF000,0XF000,0XFF00,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF800,0XF800,0XF880,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF880,0XF000,0XF000,0XF000, 4 | 0XF000,0XF000,0XFF00,0XFF00,0XFF00,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF800,0XF800,0XF880,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF880,0XF880,0XF080,0XF000,0XF000, 5 | 0XF000,0XF000,0XF800,0XFF00,0XFF00,0XFF00,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF800,0XF800,0XF880,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF880,0XF880,0XF080,0XFFFF,0XF000,0XF000, 6 | 0XF000,0XF000,0XF800,0XF800,0XFF00,0XFF00,0XFF00,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF800,0XF800,0XF880,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF880,0XF880,0XF080,0XFFFF,0XFFFF,0XF000,0XF000, 7 | 0XF000,0XF000,0XF800,0XF800,0XF800,0XFF00,0XFF00,0XFF00,0XFF00,0XFF00,0XF800,0XF800,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF080,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 8 | 0XF000,0XF000,0XF800,0XF800,0XF800,0XF800,0XFF00,0XFF00,0XFF00,0XF800,0XF800,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF080,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 9 | 0XF000,0XF000,0XF800,0XF800,0XF800,0XF800,0XFF00,0XFF00,0XF800,0XF800,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF080,0XF0F0,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 10 | 0XF000,0XF000,0XF800,0XF800,0XF800,0XF800,0XFF00,0XF800,0XF800,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF080,0XF0F0,0XF0F0,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 11 | 0XF000,0XF000,0XF800,0XF800,0XF800,0XF800,0XF800,0XF800,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF080,0XF0F0,0XF0F0,0XF0F0,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 12 | 0XF000,0XF000,0XF800,0XF800,0XF800,0XF800,0XF800,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 13 | 0XF000,0XF000,0XF800,0XF800,0XF800,0XF800,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 14 | 0XF000,0XF000,0XF800,0XF800,0XF800,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 15 | 0XF000,0XF000,0XF800,0XF800,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 16 | 0XF000,0XF000,0XF800,0XF880,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XFFFF,0XFFFF,0XFFFF,0XF080,0XF000,0XF000, 17 | 0XF000,0XF000,0XF880,0XF880,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XFFFF,0XFFFF,0XF080,0XF080,0XF000,0XF000, 18 | 0XF000,0XF000,0XF880,0XF880,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XFFFF,0XF080,0XF080,0XF088,0XF000,0XF000, 19 | 0XF000,0XF000,0XF880,0XF880,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF080,0XF088,0XFFFF,0XF000,0XF000, 20 | 0XF000,0XF000,0XF880,0XF880,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF080,0XF088,0XFFFF,0XFFFF,0XF000,0XF000, 21 | 0XF000,0XF000,0XF880,0XF880,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF080,0XF088,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 22 | 0XF000,0XF000,0XF880,0XF880,0XF880,0XF880,0XFFF0,0XFFF0,0XFFF0,0XF880,0XF880,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF080,0XF088,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 23 | 0XF000,0XF000,0XF880,0XF880,0XF880,0XF880,0XFFF0,0XFFF0,0XF880,0XF880,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF080,0XF088,0XF0FF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 24 | 0XF000,0XF000,0XF880,0XF880,0XF880,0XF880,0XFFF0,0XF880,0XF880,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF080,0XF088,0XF0FF,0XF0FF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 25 | 0XF000,0XF000,0XF880,0XF880,0XF880,0XF880,0XF880,0XF880,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF080,0XF088,0XF0FF,0XF0FF,0XF0FF,0XFFFF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 26 | 0XF000,0XF000,0XF880,0XF880,0XF880,0XF880,0XF880,0XF080,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF0F0,0XF080,0XF080,0XF088,0XF0FF,0XF0FF,0XF0FF,0XF0FF,0XF0FF,0XFFFF,0XFFFF,0XFFFF,0XF000,0XF000, 27 | 0XF000,0XF000,0XF880,0XF880,0XF880,0XF880,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF088,0XF088,0XF088,0XF088,0XF088,0XF0FF,0XF0FF,0XF0FF,0XFFFF,0XFFFF,0XF000,0XF000, 28 | 0XF000,0XF000,0XF880,0XF880,0XF880,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF088,0XF088,0XF088,0XF088,0XF088,0XF088,0XF088,0XF0FF,0XF0FF,0XF0FF,0XFFFF,0XF000,0XF000, 29 | 0XF000,0XF000,0XF880,0XF880,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF088,0XF088,0XF088,0XF088,0XF088,0XF088,0XF088,0XF088,0XF088,0XF0FF,0XF0FF,0XF0FF,0XF000,0XF000, 30 | 0XF000,0XF000,0XF000,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF080,0XF088,0XF088,0XF088,0XF088,0XF088,0XF088,0XF088,0XF088,0XF088,0XF088,0XF088,0XF0FF,0XF000,0XF000,0XF000, 31 | 0X0000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0X0000, 32 | 0X0000,0X0000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0XF000,0X0000,0X0000, 33 | 34 | -------------------------------------------------------------------------------- /zxsec.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpcec/388d149130075234228b15fd395fcd69515a53d0/zxsec.ico -------------------------------------------------------------------------------- /zxsec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cpcitor/cpcec/388d149130075234228b15fd395fcd69515a53d0/zxsec.png -------------------------------------------------------------------------------- /zxsec.rc: -------------------------------------------------------------------------------- 1 | #include "cpcec-os.rc" 2 | 3 | 34002 ICON "zxsec.ico" 4 | --------------------------------------------------------------------------------