1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-04-09 21:37:31 +00:00

Improved doxygen documentation. #672

This commit is contained in:
jespergravgaard 2021-06-19 22:11:26 +02:00
parent b337ff6f33
commit 78e6ef761f
185 changed files with 1354 additions and 1251 deletions

View File

@ -1,18 +1,15 @@
/// @file
/// @brief Simple functions wrapping 6502 instructions
/// @brief Set the processor interrupt flag - disabling IRQ's.
///
/// Set the processor interrupt flag - disabling IRQ's.
/// Uses the SEI instruction
inline void SEI();
/// @brief Clear the processor interrupt flag - enabling IRQ's.
///
/// Clear the processor interrupt flag - enabling IRQ's.
/// Uses the CLI instruction
inline void CLI();
/// @brief Add a KickAssembler breakpoint.
///
/// Add a KickAssembler breakpoint.
/// The breakpoint is compiled be KickAssembler to the output files.
/// If you use VICE or C64Debugger they can automatically load the breakpoints when starting.
inline void BREAK();

View File

@ -2,14 +2,12 @@
/// Find atan2(x, y) using the CORDIC method
/// See http://bsvi.ru/uploads/CORDIC--_10EBA/cordic.pdf
/// @brief Find the atan2(x, y) - which is the angle of the line from (0,0) to (x,y)
///
/// Find the atan2(x, y) - which is the angle of the line from (0,0) to (x,y)
/// Finding the angle requires a binary search using CORDIC_ITERATIONS_16
/// Returns the angle in hex-degrees (0=0, 0x8000=PI, 0x10000=2*PI)
unsigned int atan2_16(signed int x, signed int y);
/// @brief Find the atan2(x, y) - which is the angle of the line from (0,0) to (x,y)
///
/// Find the atan2(x, y) - which is the angle of the line from (0,0) to (x,y)
/// Finding the angle requires a binary search using CORDIC_ITERATIONS_8
/// Returns the angle in hex-degrees (0=0, 0x80=PI, 0x100=2*PI)
char atan2_8(signed char x, signed char y);

View File

@ -1,119 +1,121 @@
/// @file
/// ATARI Graphic Television Interface Adaptor (GTIA)
/// Used in Atari 5200 and the 8-bit series (400, 800, XL, XE)
/// https://en.wikipedia.org/wiki/CTIA_and_GTIA
/// ATARI Graphic Television Interface Adaptor (GTIA)
struct ATARI_GTIA_READ {
// Missile 0 to Playfield collisions Read $D000
/// Missile 0 to Playfield collisions Read $D000
char M0PF;
// Missile 1 to Playfield collisions Read $D001
/// Missile 1 to Playfield collisions Read $D001
char M1PF;
// Missile 2 to Playfield collisions Read $D002
/// Missile 2 to Playfield collisions Read $D002
char M2PF;
// Missile 3 to Playfield collisions Read $D003
/// Missile 3 to Playfield collisions Read $D003
char M3PF;
// Player 0 to Playfield collisions Read $D004
/// Player 0 to Playfield collisions Read $D004
char P0PF;
// Player 1 to Playfield collisions Read $D005
/// Player 1 to Playfield collisions Read $D005
char P1PF;
// Player 2 to Playfield collisions Read $D006
/// Player 2 to Playfield collisions Read $D006
char P2PF;
// Player 3 to Playfield collisions Read $D007
/// Player 3 to Playfield collisions Read $D007
char P3PF;
// Missile 0 to Player collisions Read $D008
/// Missile 0 to Player collisions Read $D008
char M0PL;
// Missile 1 to Player collisions Read $D009
/// Missile 1 to Player collisions Read $D009
char M1PL;
// Missile 2 to Player collisions Read $D00A
/// Missile 2 to Player collisions Read $D00A
char M2PL;
// Missile 3 to Player collisions Read $D00B
/// Missile 3 to Player collisions Read $D00B
char M3PL;
// Player 0 to Player collisions Read $D00C
/// Player 0 to Player collisions Read $D00C
char P0PL;
// Player 1 to Player collisions Read $D00D
/// Player 1 to Player collisions Read $D00D
char P1PL;
// Player 2 to Player collisions Read $D00E
/// Player 2 to Player collisions Read $D00E
char P2PL;
// Player 3 to Player collisions Read $D00F
/// Player 3 to Player collisions Read $D00F
char P3PL;
// Joystick 0 trigger. Read $D010
/// Joystick 0 trigger. Read $D010
char TRIG0;
// Joystick 1 trigger. Read $D011
/// Joystick 1 trigger. Read $D011
char TRIG1;
// Joystick 2 trigger. Read $D012
/// Joystick 2 trigger. Read $D012
char TRIG2;
// Joystick 3 trigger. Read $D013
/// Joystick 3 trigger. Read $D013
char TRIG3;
// flags. Read $D014
/// flags. Read $D014
char PAL;
// Unused READ registers
/// Unused READ registers
char UNUSED[10];
// Console Keys Read $D01F
/// Console Keys Read $D01F
char CONSOL;
};
struct ATARI_GTIA_WRITE {
// Horizontal Position of Player 0 Write $D000
/// Horizontal Position of Player 0 Write $D000
char HPOSP0;
// Horizontal Position of Player 1 Write $D001
/// Horizontal Position of Player 1 Write $D001
char HPOSP1;
// Horizontal Position of Player 2 Write $D002
/// Horizontal Position of Player 2 Write $D002
char HPOSP2;
// Horizontal Position of Player 3 Write $D003
/// Horizontal Position of Player 3 Write $D003
char HPOSP3;
// Horizontal Position of Missile 0 Write $D004
/// Horizontal Position of Missile 0 Write $D004
char HPOSM0;
// Horizontal Position of Missile 1 Write $D005
/// Horizontal Position of Missile 1 Write $D005
char HPOSM1;
// Horizontal Position of Missile 2 Write $D006
/// Horizontal Position of Missile 2 Write $D006
char HPOSM2;
// Horizontal Position of Missile 3 Write $D007
/// Horizontal Position of Missile 3 Write $D007
char HPOSM3;
// Size of Player 0 Write $D008
/// Size of Player 0 Write $D008
char SIZEP0;
// Size of Player 1 Write $D009
/// Size of Player 1 Write $D009
char SIZEP1;
// Size of Player 2 Write $D00A
/// Size of Player 2 Write $D00A
char SIZEP2;
// Size of Player 3 Write $D00B
/// Size of Player 3 Write $D00B
char SIZEP3;
// Size of all Missiles Write $D00C
/// Size of all Missiles Write $D00C
char SIZEM;
// Graphics pattern for Player 0 Write $D00D
/// Graphics pattern for Player 0 Write $D00D
char GRAFP0;
// Graphics pattern for Player 1 Write $D00E
/// Graphics pattern for Player 1 Write $D00E
char GRAFP1;
// Graphics pattern for Player 2 Write $D00F
/// Graphics pattern for Player 2 Write $D00F
char GRAFP2;
// Graphics pattern for Player 3 Write $D010
/// Graphics pattern for Player 3 Write $D010
char GRAFP3;
// Graphics pattern for all Missiles Write $D011
/// Graphics pattern for all Missiles Write $D011
char GRAFM;
// Color/luminance of Player and Missile 0. Write $D012
/// Color/luminance of Player and Missile 0. Write $D012
char COLPM0;
// Color/luminance of Player and Missile 1. Write $D013
/// Color/luminance of Player and Missile 1. Write $D013
char COLPM1;
// Color/luminance of Player and Missile 2. Write $D014
/// Color/luminance of Player and Missile 2. Write $D014
char COLPM2;
// Color/luminance of Player and Missile 3. Write $D015
/// Color/luminance of Player and Missile 3. Write $D015
char COLPM3;
// Color/luminance of Playfield 0. Write $D016 53270
/// Color/luminance of Playfield 0. Write $D016 53270
char COLPF0;
// Color/luminance of Playfield 1. Write $D017 53271
/// Color/luminance of Playfield 1. Write $D017 53271
char COLPF1;
// Color/luminance of Playfield 2. Write $D018 53272
/// Color/luminance of Playfield 2. Write $D018 53272
char COLPF2;
// Color/luminance of Playfield 3. Write $D019 53273
/// Color/luminance of Playfield 3. Write $D019 53273
char COLPF3;
// Color/luminance of Playfield background. Write $D01A
/// Color/luminance of Playfield background. Write $D01A
char COLBK;
// Priority selection, fifth player, and GTIA modes Write
/// Priority selection, fifth player, and GTIA modes Write
char PRIOR;
// Vertical Delay P/M Graphics Write $D01C
/// Vertical Delay P/M Graphics Write $D01C
char VDELAY;
// Graphics Control. Write $D01D
/// Graphics Control. Write $D01D
char GRACTL;
// Clear Collisions Write $D01E
/// Clear Collisions Write $D01E
char HITCLR;
// Console Speaker Write $D01F
/// Console Speaker Write $D01F
char CONSPK;
};

View File

@ -1,71 +1,74 @@
/// @file
/// ATARI Graphic Television Interface Adaptor (GTIA)
/// Used in Atari 5200 and the 8-bit series (400, 800, XL, XE)
/// https://en.wikipedia.org/wiki/CTIA_and_GTIA
/// ATARI Graphic Television Interface Adaptor (GTIA)
struct ATARI_POKEY_READ {
// Potentiometer (Paddle) 0 Read $D200 53760 PADDL0 $0270 624
/// Potentiometer (Paddle) 0 Read $D200 53760 PADDL0 $0270 624
char POT0;
// Potentiometer (Paddle) 1 Read $D201 53761 PADDL1 $0271 625
/// Potentiometer (Paddle) 1 Read $D201 53761 PADDL1 $0271 625
char POT1;
// Potentiometer (Paddle) 2 Read $D202 53762 PADDL2 $0272 626
/// Potentiometer (Paddle) 2 Read $D202 53762 PADDL2 $0272 626
char POT2;
// Potentiometer (Paddle) 3 Read $D203 53763 PADDL3 $0273 627
/// Potentiometer (Paddle) 3 Read $D203 53763 PADDL3 $0273 627
char POT3;
// Potentiometer (Paddle) 4 Read $D204 53764 PADDL4 $0274 628
/// Potentiometer (Paddle) 4 Read $D204 53764 PADDL4 $0274 628
char POT4;
// Potentiometer (Paddle) 5 Read $D205 53765 PADDL5 $0275 629
/// Potentiometer (Paddle) 5 Read $D205 53765 PADDL5 $0275 629
char POT5;
// Potentiometer (Paddle) 6 Read $D206 53766 PADDL6 $0276 630
/// Potentiometer (Paddle) 6 Read $D206 53766 PADDL6 $0276 630
char POT6;
// Potentiometer (Paddle) 7 Read $D207 53767 PADDL7 $0277 631
/// Potentiometer (Paddle) 7 Read $D207 53767 PADDL7 $0277 631
char POT7;
// Read 8 Line POT Port State Read $D208 53768
/// Read 8 Line POT Port State Read $D208 53768
char ALLPOT;
// Keyboard Code Read $D209 53769 CH $02FC 764
/// Keyboard Code Read $D209 53769 CH $02FC 764
char KBCODE;
// Random Number Generator Read $D20A 53770
/// Random Number Generator Read $D20A 53770
char RANDOM;
// Unused read registers $D20B-C
/// Unused read registers $D20B-C
char UNUSED[2];
// Serial Port Data Input Read $D20D 53773
/// Serial Port Data Input Read $D20D 53773
char SERIN;
// IRQ Status Read $D20E 53774
/// IRQ Status Read $D20E 53774
char IRQST;
// Serial Port Status Read $D20F 53775
/// Serial Port Status Read $D20F 53775
char SKSTAT;
};
/// ATARI Graphic Television Interface Adaptor (GTIA)
struct ATARI_POKEY_WRITE {
// Audio Channel 1 Frequency Write $D200 53760
/// Audio Channel 1 Frequency Write $D200 53760
char AUDF1;
// Audio Channel 1 Control Write $D201 53761
/// Audio Channel 1 Control Write $D201 53761
char AUDC1;
// Audio Channel 2 Frequency Write $D202 53762
/// Audio Channel 2 Frequency Write $D202 53762
char AUDF2;
// Audio Channel 2 Control Write $D203 53763
/// Audio Channel 2 Control Write $D203 53763
char AUDC2;
// Audio Channel 3 Frequency Write $D204 53764
/// Audio Channel 3 Frequency Write $D204 53764
char AUDF3;
// Audio Channel 3 Control Write $D205 53765
/// Audio Channel 3 Control Write $D205 53765
char AUDC3;
// Audio Channel 4 Frequency Write $D206 53766
/// Audio Channel 4 Frequency Write $D206 53766
char AUDF4;
// Audio Channel 4 Control Write $D207 53767
/// Audio Channel 4 Control Write $D207 53767
char AUDC4;
// Audio Control Write $D208 53768
/// Audio Control Write $D208 53768
char AUDCTL;
// Start Timers Write $D209 53769
/// Start Timers Write $D209 53769
char STIMER;
// Reset Serial Status (SKSTAT) Write $D20A 53770
/// Reset Serial Status (SKSTAT) Write $D20A 53770
char SKREST;
// Start POT Scan Sequence Write $D20B 53771
/// Start POT Scan Sequence Write $D20B 53771
char POTGO;
// Unused write register $D20C
/// Unused write register $D20C
char UNUSED;
// Serial Port Data Output Write $D20D 53773
/// Serial Port Data Output Write $D20D 53773
char SEROUT;
// Interrupt Request Enable Write $D20E 53774 POKMSK $10 16
/// Interrupt Request Enable Write $D20E 53774 POKMSK $10 16
char IRQEN;
// Serial Port Control Write $D20F 53775 SSKCTL $0232 562
/// Serial Port Control Write $D20F 53775 SSKCTL $0232 562
char SKCTL;
};

View File

@ -1,3 +1,4 @@
/// @file
/// Atari Television Interface Adaptor (TIA)
/// https://en.wikipedia.org/wiki/Television_Interface_Adaptor
/// http://www.qotile.net/minidig/docs/stella.pdf
@ -15,128 +16,130 @@ char* const TIA_RESP1 = (char*)0x11;
/// The TIA HMP0 register (for access from inline ASM)
char* const TIA_HMP0 = (char*)0x20;
/// Atari Television Interface Adaptor (TIA)
struct ATARI_TIA_WRITE {
// $00 0000 00x0 Vertical Sync Set-Clear
/// $00 0000 00x0 Vertical Sync Set-Clear
char VSYNC;
// $01 xx00 00x0 Vertical Blank Set-Clear
/// $01 xx00 00x0 Vertical Blank Set-Clear
char VBLANK;
// $02 ---- ---- Wait for Horizontal Blank
/// $02 ---- ---- Wait for Horizontal Blank
char WSYNC;
// $03 ---- ---- Reset Horizontal Sync Counter
/// $03 ---- ---- Reset Horizontal Sync Counter
char RSYNC;
// $04 00xx 0xxx Number-Size player/missle 0
/// $04 00xx 0xxx Number-Size player/missle 0
char NUSIZ0;
// $05 00xx 0xxx Number-Size player/missle 1
/// $05 00xx 0xxx Number-Size player/missle 1
char NUSIZ1;
// $06 xxxx xxx0 Color-Luminance Player 0
/// $06 xxxx xxx0 Color-Luminance Player 0
char COLUP0;
// $07 xxxx xxx0 Color-Luminance Player 1
/// $07 xxxx xxx0 Color-Luminance Player 1
char COLUP1;
// $08 xxxx xxx0 Color-Luminance Playfield
/// $08 xxxx xxx0 Color-Luminance Playfield
char COLUPF;
// $09 xxxx xxx0 Color-Luminance Background
/// $09 xxxx xxx0 Color-Luminance Background
char COLUBK;
// $0A 00xx 0xxx Control Playfield, Ball, Collisions
/// $0A 00xx 0xxx Control Playfield, Ball, Collisions
char CTRLPF;
// $0B 0000 x000 Reflection Player 0
/// $0B 0000 x000 Reflection Player 0
char REFP0;
// $0C 0000 x000 Reflection Player 1
/// $0C 0000 x000 Reflection Player 1
char REFP1;
// $0D xxxx 0000 Playfield Register Byte 0
/// $0D xxxx 0000 Playfield Register Byte 0
char PF0;
// $0E xxxx xxxx Playfield Register Byte 1
/// $0E xxxx xxxx Playfield Register Byte 1
char PF1;
// $0F xxxx xxxx Playfield Register Byte 2
/// $0F xxxx xxxx Playfield Register Byte 2
char PF2;
// $10 ---- ---- Reset Player 0
/// $10 ---- ---- Reset Player 0
char RESP0;
// $11 ---- ---- Reset Player 1
/// $11 ---- ---- Reset Player 1
char RESP1;
// $12 ---- ---- Reset Missle 0
/// $12 ---- ---- Reset Missle 0
char RESM0;
// $13 ---- ---- Reset Missle 1
/// $13 ---- ---- Reset Missle 1
char RESM1;
// $14 ---- ---- Reset Ball
/// $14 ---- ---- Reset Ball
char RESBL;
// $15 0000 xxxx Audio Control 0
/// $15 0000 xxxx Audio Control 0
char AUDC0;
// $16 0000 xxxx Audio Control 1
/// $16 0000 xxxx Audio Control 1
char AUDC1;
// $17 000x xxxx Audio Frequency 0
/// $17 000x xxxx Audio Frequency 0
char AUDF0;
// $18 000x xxxx Audio Frequency 1
/// $18 000x xxxx Audio Frequency 1
char AUDF1;
// $19 0000 xxxx Audio Volume 0
/// $19 0000 xxxx Audio Volume 0
char AUDV0;
// $1A 0000 xxxx Audio Volume 1
/// $1A 0000 xxxx Audio Volume 1
char AUDV1;
// $1B xxxx xxxx Graphics Register Player 0
/// $1B xxxx xxxx Graphics Register Player 0
char GRP0;
// $1C xxxx xxxx Graphics Register Player 1
/// $1C xxxx xxxx Graphics Register Player 1
char GRP1;
// $1D 0000 00x0 Graphics Enable Missile 0
/// $1D 0000 00x0 Graphics Enable Missile 0
char ENAM0;
// $1E 0000 00x0 Graphics Enable Missile 1
/// $1E 0000 00x0 Graphics Enable Missile 1
char ENAM1;
// $1F 0000 00x0 Graphics Enable Ball
/// $1F 0000 00x0 Graphics Enable Ball
char ENABL;
// $20 xxxx 0000 Horizontal Motion Player 0
/// $20 xxxx 0000 Horizontal Motion Player 0
char HMP0;
// $21 xxxx 0000 Horizontal Motion Player 1
/// $21 xxxx 0000 Horizontal Motion Player 1
char HMP1;
// $22 xxxx 0000 Horizontal Motion Missile 0
/// $22 xxxx 0000 Horizontal Motion Missile 0
char HMM0;
// $23 xxxx 0000 Horizontal Motion Missile 1
/// $23 xxxx 0000 Horizontal Motion Missile 1
char HMM1;
// $24 xxxx 0000 Horizontal Motion Ball
/// $24 xxxx 0000 Horizontal Motion Ball
char HMBL;
// $25 0000 000x Vertical Delay Player 0
/// $25 0000 000x Vertical Delay Player 0
char VDELP0;
// $26 0000 000x Vertical Delay Player 1
/// $26 0000 000x Vertical Delay Player 1
char VDELP1;
// $27 0000 000x Vertical Delay Ball
/// $27 0000 000x Vertical Delay Ball
char VDELBL;
// $28 0000 00x0 Reset Missile 0 to Player 0
/// $28 0000 00x0 Reset Missile 0 to Player 0
char RESMP0;
// $29 0000 00x0 Reset Missile 1 to Player 1
/// $29 0000 00x0 Reset Missile 1 to Player 1
char RESMP1;
// $2A ---- ---- Apply Horizontal Motion
/// $2A ---- ---- Apply Horizontal Motion
char HMOVE;
// $2B ---- ---- Clear Horizontal Move Registers
/// $2B ---- ---- Clear Horizontal Move Registers
char HMCLR;
// $2C ---- ---- Clear Collision Latches
/// $2C ---- ---- Clear Collision Latches
char CXCLR;
};
/// Atari Television Interface Adaptor (TIA)
struct ATARI_TIA_READ {
// bit 7 bit 6
// $00 xx00 0000 Read Collision M0-P1 M0-P0
/// bit 7 bit 6
/// $00 xx00 0000 Read Collision M0-P1 M0-P0
char CXM0P;
// $01 xx00 0000 Read Collision M1-P0 M1-P1
/// $01 xx00 0000 Read Collision M1-P0 M1-P1
char CXM1P;
// $02 xx00 0000 Read Collision P0-PF P0-BL
/// $02 xx00 0000 Read Collision P0-PF P0-BL
char CXP0FB;
// $03 xx00 0000 Read Collision P1-PF P1-BL
/// $03 xx00 0000 Read Collision P1-PF P1-BL
char CXP1FB;
// $04 xx00 0000 Read Collision M0-PF M0-BL
/// $04 xx00 0000 Read Collision M0-PF M0-BL
char CXM0FB;
// $05 xx00 0000 Read Collision M1-PF M1-BL
/// $05 xx00 0000 Read Collision M1-PF M1-BL
char CXM1FB;
// $06 x000 0000 Read Collision BL-PF -----
/// $06 x000 0000 Read Collision BL-PF -----
char CXBLPF;
// $07 xx00 0000 Read Collision P0-P1 M0-M1
/// $07 xx00 0000 Read Collision P0-P1 M0-M1
char CXPPMM;
// $08 x000 0000 Read Pot Port 0
/// $08 x000 0000 Read Pot Port 0
char INPT0;
// $09 x000 0000 Read Pot Port 1
/// $09 x000 0000 Read Pot Port 1
char INPT1;
// $0A x000 0000 Read Pot Port 2
/// $0A x000 0000 Read Pot Port 2
char INPT2;
// $0B x000 0000 Read Pot Port 3
/// $0B x000 0000 Read Pot Port 3
char INPT3;
// $0C x000 0000 Read Input (Trigger) 0
/// $0C x000 0000 Read Input (Trigger) 0
char INPT4;
// $0D x000 0000 Read Input (Trigger) 1
/// $0D x000 0000 Read Input (Trigger) 1
char INPT5;
};

View File

@ -1,3 +1,4 @@
/// @file
/// Atari 8-bit 400/800/XL/XE Registers and Constants
/// https://en.wikipedia.org/wiki/Atari_8-bit_family
@ -24,7 +25,6 @@ struct ATARI_POKEY_READ * const POKEY_READ = (struct ATARI_POKEY_READ *)0xd200;
/// Atari ANTIC registers
struct ATARI_ANTIC * const ANTIC = (struct ATARI_ANTIC *)0xd400;
/// Atari ZP registers
/// 1-byte cursor row
char * ROWCRS = (char*)0x54;

View File

@ -1,6 +1,5 @@
/// @file
///
/// @brief Atari 2600 Registers and Constants
/// Atari 2600 Registers and Constants
/// https://web.archive.org/web/20170215054248/http://www.atariguide.com/pdfs/Atari_2600_VCS_Domestic_Field_Service_Manual.pdf
#ifndef __ATARI2600__

View File

@ -1,3 +1,4 @@
/// @file
/// Commodore 128 Registers and Memory
/// https://archive.org/details/C128_Programmers_Reference_Guide_1986_Bamtam_Books/page/n299/mode/2up
#ifndef __C128__

View File

@ -1,3 +1,4 @@
/// @file
/// Library wrapping the BASIC floating point functions
/// See https://www.c64-wiki.com/wiki/Floating_point_arithmetic
/// See http://www.pagetable.com/c64rom/c64rom_sc.html

View File

@ -1,3 +1,4 @@
/// @file
/// Simple single-color (320x200) bitmap routines
/// Initialize bitmap plotting tables
void bitmap_init(char* gfx, char* screen);

View File

@ -1,3 +1,4 @@
/// @file
/// Simple Keyboard Input Library
/// C64 Keyboard Matrix Reference - from http://codebase64.org/doku.php?id=base:reading_the_keyboard
/// Keyboard Codes are %00rrrccc, where rrr is the row ID (0-7) and ccc is the column ID (0-7)

View File

@ -1,3 +1,4 @@
/// @file
/// A flexible sprite multiplexer routine for 32 sprites.
/// Usage:
/// - Once:

View File

@ -1,3 +1,4 @@
/// @file
/// A lightweight library for printing on the C64.
/// Printing with this library is done by calling print_ function for each element

View File

@ -1,3 +1,4 @@
/// @file
/// C standard library time.h
/// Functions to get and manipulate date and time information.

View File

@ -1,15 +1,16 @@
/// @file
/// Time-of-day helper
/// Uses the MOS6526 CIA#1 on Commodore 64
/// Time-of-day 24 hour format
struct TIME_OF_DAY {
// Time-of-day real-time-clock tenth seconds (BCD)
/// Time-of-day real-time-clock tenth seconds (BCD)
char TENTHS;
// Time-of-day real-time-clock seconds (BCD)
/// Time-of-day real-time-clock seconds (BCD)
char SEC;
// Time-of-day real-time-clock minutes (BCD)
/// Time-of-day real-time-clock minutes (BCD)
char MIN;
// Time-of-day real-time-clock hours (BCD) (bit 7 is AM/PM)
/// Time-of-day real-time-clock hours (BCD) (bit 7 is AM/PM)
char HOURS;
};

View File

@ -1,5 +1,5 @@
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
#ifndef __C64__
#error "Target platform must be C64"
#endif
@ -82,18 +82,15 @@ const char LIGHT_GREEN = 0xd;
const char LIGHT_BLUE = 0xe;
const char LIGHT_GREY = 0xf;
/// @brief Get the value to store into D018 to display a specific screen and charset/bitmap
///
/// Get the value to store into D018 to display a specific screen and charset/bitmap
/// Optimized for ASM from (char)((((unsigned int)screen&0x3fff)/0x40)|(((unsigned int)charset&0x3fff)/0x400));
char toD018(char* screen, char* gfx);
/// @brief Get the value to store into DD00 (CIA 2 port A) to choose a specific VIC bank
///
/// Get the value to store into DD00 (CIA 2 port A) to choose a specific VIC bank
/// Optimized for ASM from %00000011 ^ (char)((unsigned int)gfx/0x4000)
char toDd00(char* gfx);
/// @brief Get the sprite pointer for a sprite.
///
/// Get the sprite pointer for a sprite.
/// The sprite pointer is the index of the sprite within the graphics bank and equal to the sprite (char)(sprite_addr/64)
/// The sprite pointers are stored SCREEN+0x3f8+sprite_id to set the pointer of each sprite
char toSpritePtr(char* sprite);
@ -104,7 +101,6 @@ void vicSelectGfxBank(char* gfx);
/// Initialize SID voice 3 for random number generation
void sid_rnd_init();
/// @brief Get a random number from the SID voice 3,
///
/// Get a random number from the SID voice 3,
/// Must be initialized with sid_rnd_init()
char sid_rnd();

View File

@ -1,3 +1,4 @@
/// @file
/// C64 DTV version 2 Registers and Constants
//
/// Sources

View File

@ -1,3 +1,4 @@
/// @file
/// Commodore Kernal functions
/// See http://www.c64os.com/post/c64kernalrom#iec_acptr
/// Compatible with https://github.com/cc65/cc65/blob/master/include/cbm.h

View File

@ -1,3 +1,4 @@
/// @file
/// Provides provide simple horisontal/vertical lines routines on top of conio.h
/// For compatibility with CC65 https://github.com/cc65/cc65/blob/master/include/conio.h

View File

@ -1,3 +1,4 @@
/// @file
/// Provides provide console input/output
/// Implements similar functions as conio.h from CC65 for compatibility
/// See https://github.com/cc65/cc65/blob/master/include/conio.h

View File

@ -1,3 +1,4 @@
/// @file
/// Functions that are useful for testing and mapping characters.
/// Convert lowercase alphabet to uppercase

View File

@ -1,3 +1,4 @@
/// @file
/// Plot and line drawing routines for HIRES bitmaps
/// Currently it can only plot on the first 256 x-positions.

View File

@ -1,3 +1,4 @@
/// @file
/// Kernal SETNAM function
/// SETNAM. Set file name parameters.
void setnam(char* filename);

View File

@ -1,3 +1,4 @@
/// @file
/// Commander X16 VERA (Versatile Embedded Retro Adapter) Video and Audio Processor
/// https://github.com/commanderx16/x16-docs/blob/master/VERA%20Programmer's%20Reference.md
@ -242,24 +243,24 @@ const unsigned long VERA_SPRITE_ATTR = 0x1fc00;
/// The VERA structure of a sprite (8 bytes)
/// 128*8 bytes located at $1FC00-$1FFFF
struct VERA_SPRITE {
// 0-1 ADDRESS Address and mode
// - bits 0-11: Address (16:5)
// - bits 15: Mode (0:4 bpp 1:8 bpp)
/// 0-1 ADDRESS Address and mode
/// - bits 0-11: Address (16:5)
/// - bits 15: Mode (0:4 bpp 1:8 bpp)
unsigned int ADDR;
// 2-3 X (9:0)
/// 2-3 X (9:0)
unsigned int X;
// 4-5 Y (9:0)
/// 4-5 Y (9:0)
unsigned int Y;
// 6 CTRL1 Control 1
// - bits 4-7 Collision mask
// - bits 2-3 Z-depth ( 0:Sprite disabled, 1:Sprite between background and layer 0, 2:Sprite between layer 0 and layer 1, 3:Sprite in front of layer 1 )
// - bits 1 V-flip
// - bits 0 H-flip
/// 6 CTRL1 Control 1
/// - bits 4-7 Collision mask
/// - bits 2-3 Z-depth ( 0:Sprite disabled, 1:Sprite between background and layer 0, 2:Sprite between layer 0 and layer 1, 3:Sprite in front of layer 1 )
/// - bits 1 V-flip
/// - bits 0 H-flip
char CTRL1;
// 7 CTRL2 Control 2
// - bits 6-7 Sprite height ( 0:8 pixels, 1:16 pixels, 2:32 pixels, 3:64 pixels )
// - bits 4-5 Sprite width ( 0:8 pixels, 1:16 pixels, 2:32 pixels, 3:64 pixels )
// - bits 0-3 Palette offset (if 4bpp Color index 1-15 is modified by adding 16 x palette offset)
/// 7 CTRL2 Control 2
/// - bits 6-7 Sprite height ( 0:8 pixels, 1:16 pixels, 2:32 pixels, 3:64 pixels )
/// - bits 4-5 Sprite width ( 0:8 pixels, 1:16 pixels, 2:32 pixels, 3:64 pixels )
/// - bits 0-3 Palette offset (if 4bpp Color index 1-15 is modified by adding 16 x palette offset)
char CTRL2;
};

View File

@ -1,3 +1,4 @@
/// @file
/// Commander X16 VERA (Versatile Embedded Retro Adapter) Video and Audio Processor
/// https://github.com/commanderx16/x16-docs/blob/master/VERA%20Programmer's%20Reference.md

View File

@ -1,3 +1,4 @@
/// @file
/// Commander X16
/// https://www.commanderx16.com/forum/index.php?/about-faq/
/// https://github.com/commanderx16/x16-docs/blob/master/Commander%20X16%20Programmer's%20Reference%20Guide.md

View File

@ -1,3 +1,4 @@
/// @file
/// Simple binary division implementation
/// Follows the C99 standard by truncating toward zero on negative results.
/// See http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf section 6.5.5

View File

@ -1,3 +1,4 @@
/// @file
/// Library Implementation of the Seriously Fast Multiplication
/// See http://codebase64.org/doku.php?id=base:seriously_fast_multiplication
/// Utilizes the fact that a*b = ((a+b)/2)^2 - ((a-b)/2)^2

View File

@ -0,0 +1 @@
/// @file

View File

@ -1,3 +1,4 @@
/// @file
/// Functions for using the F018 DMA for very fast copying or filling of memory
#include <mega65.h>

View File

@ -1,3 +1,4 @@
/// @file
/// MEGA65 DMA
/// Appendix J in https://mega.scryptos.com/sharefolder-link/MEGA/MEGA65+filehost/Docs/MEGA65-Book_draft.pdf
/// C65 Manual http://www.zimmers.net/cbmpics/cbm/c65/c65manual.txt
@ -9,102 +10,102 @@
/// Registers of the MEGA65 enchanced F018 DMAgic Controller
struct F018_DMAGIC {
// $D700 ADDRLSBTRIG DMAgic DMA list address LSB, and trigger DMA (when written).
// We also clear out the upper address bits in case an enhanced job had set them.
/// $D700 ADDRLSBTRIG DMAgic DMA list address LSB, and trigger DMA (when written).
/// We also clear out the upper address bits in case an enhanced job had set them.
char ADDRLSBTRIG;
// $D701 ADDRMSB DMA list address high byte (address bits 8 -- 15).
/// $D701 ADDRMSB DMA list address high byte (address bits 8 -- 15).
char ADDRMSB;
// $D702 ADDRBANK DMA list address bank (address bits 16 -- 22). Writing clears $D704.
/// $D702 ADDRBANK DMA list address bank (address bits 16 -- 22). Writing clears $D704.
char ADDRBANK;
// $D703 EN018B DMA enable F018B mode (adds sub-command byte )
// bit 0 enable F018B mode.
/// $D703 EN018B DMA enable F018B mode (adds sub-command byte )
/// bit 0 enable F018B mode.
char EN018B;
// $D704 ADDRMB DMA list address mega-byte
/// $D704 ADDRMB DMA list address mega-byte
char ADDRMB;
// $D705 ETRIG Set low-order byte of DMA list address, and trigger Enhanced DMA job
// Works like $D700, but enables DMA option lists.
/// $D705 ETRIG Set low-order byte of DMA list address, and trigger Enhanced DMA job
/// Works like $D700, but enables DMA option lists.
char ETRIG;
// $D706-$D70D Unused
/// $D706-$D70D Unused
char UNUSED1[8];
// $D70E ADDRLSB DMA list address low byte (address bits 0 -- 7) WITHOUT STARTING A DMA JOB
// (used by Hypervisor for unfreezing DMA-using tasks)
/// $D70E ADDRLSB DMA list address low byte (address bits 0 -- 7) WITHOUT STARTING A DMA JOB
/// (used by Hypervisor for unfreezing DMA-using tasks)
char ADDRLSB;
// $D70F Unused
/// $D70F Unused
char UNUSED2;
// $D710 MISC (non-DMA) options
// $D710.0 - MISC:BADLEN Enable badline emulation
// $D710.1 - MISC:SLIEN Enable 6502-style slow (7 cycle) interrupts
// $D710.2 - MISC:VDCSEN Enable VDC interface simulation
/// $D710 MISC (non-DMA) options
/// $D710.0 - MISC:BADLEN Enable badline emulation
/// $D710.1 - MISC:SLIEN Enable 6502-style slow (7 cycle) interrupts
/// $D710.2 - MISC:VDCSEN Enable VDC interface simulation
char MISC;
};
/// F018A DMA list entry
struct DMA_LIST_F018A {
// DMA command
// 0-1 command (00: copy, 01: mix (unsupported) 10: swap (unsupported) 11: fill )
// 2 chain
// 3 allow interrupt (unsupported)
/// DMA command
/// 0-1 command (00: copy, 01: mix (unsupported) 10: swap (unsupported) 11: fill )
/// 2 chain
/// 3 allow interrupt (unsupported)
char command;
// Count of bytes to copy/fill
/// Count of bytes to copy/fill
unsigned int count;
// Source address (low byte is used as data for command fill)
/// Source address (low byte is used as data for command fill)
char* src;
// Source address bank
// bits
// 7 src I/O
// 6 src direction
// 5 src modulo
// 4 src hold
// 0-3 address bank (which 64k bank is the address in)
/// Source address bank
/// bits
/// 7 src I/O
/// 6 src direction
/// 5 src modulo
/// 4 src hold
/// 0-3 address bank (which 64k bank is the address in)
char src_bank;
// Destination address
/// Destination address
char* dest;
// Destination address bank
// bits
// 7 dest I/O
// 6 dest direction
// 5 dest modulo
// 4 dest hold
// 0-3 address bank (which 64k bank is the address in)
/// Destination address bank
/// bits
/// 7 dest I/O
/// 6 dest direction
/// 5 dest modulo
/// 4 dest hold
/// 0-3 address bank (which 64k bank is the address in)
char dest_bank;
// Modulo value (unused)
/// Modulo value (unused)
unsigned int modulo;
};
/// F018B DMA list entry
struct DMA_LIST_F018B {
// DMA command (format F018B)
// bits
// 0-1 command (00: copy, 01: mix (unsupported) 10: swap (unsupported) 11: fill )
// 2 chain
// 3 allow interrupt (unsupported)
// 4 src direction
// 5 dest direction
/// DMA command (format F018B)
/// bits
/// 0-1 command (00: copy, 01: mix (unsupported) 10: swap (unsupported) 11: fill )
/// 2 chain
/// 3 allow interrupt (unsupported)
/// 4 src direction
/// 5 dest direction
char command;
// Count of bytes to copy/fill
/// Count of bytes to copy/fill
unsigned int count;
// Source address (low byte is used as data for command fill)
/// Source address (low byte is used as data for command fill)
char* src;
// Source address bank
// bits
// 7 src I/O
// 0-6 dest address bank (which 64k bank is the address in)
/// Source address bank
/// bits
/// 7 src I/O
/// 0-6 dest address bank (which 64k bank is the address in)
char src_bank;
// Destination address
/// Destination address
char* dest;
// Destination address bank
// bits
// 7 dest I/O
// 0-6 dest address bank (which 64k bank is the address in)
/// Destination address bank
/// bits
/// 7 dest I/O
/// 0-6 dest address bank (which 64k bank is the address in)
char dest_bank;
// Sub-command
// bits
// 0 src modulo (unsupported)
// 1 src hold
// 2 dest modulo (unsupported)
// 3 dest hold
/// Sub-command
/// bits
/// 0 src modulo (unsupported)
/// 1 src hold
/// 2 dest modulo (unsupported)
/// 3 dest hold
char sub_command;
// Modulo value (unused)
/// Modulo value (unused)
unsigned int modulo;
};

View File

@ -1,3 +1,4 @@
/// @file
/// MEGA65 CPU MATHS ACCELERATION REGISTERS
/// Every MEGA65 contains a combined 32-bit hardware multiplier and divider. This device
/// takes two 32-bit inputs, MULTINA and MULTINB, and simultaneously calculates:

View File

@ -1,3 +1,4 @@
/// @file
/// MEGA65 Memory Mapper allows the 6502 CPU to access up to 256MB of memory by remapping where the eight 8K blocks point in real memory.
/// The memory mapping is configured through the new MAP instruction of the MOS 4510.
/// https://mega65.org/

View File

@ -1,3 +1,4 @@
/// @file
/// MEGA65 Video Interface Chip (VIC IV)
/// https://mega65.org/
/// https://github.com/MEGA65/mega65-core/blob/master/src/vhdl/viciv.vhdl
@ -34,275 +35,275 @@ struct MEGA65_VICIV {
char SPRITES_EXPAND_X;
char SPRITES_COLLISION;
char SPRITES_BG_COLLISION;
// $D020 Border Color
/// $D020 Border Color
char BORDER_COLOR;
// $D021 Background Color 0
/// $D021 Background Color 0
char BG_COLOR;
// $D022 Background Color 1
/// $D022 Background Color 1
char BG_COLOR1;
// $D023 Background Color 2
/// $D023 Background Color 2
char BG_COLOR2;
// $D024 Background Color 3
/// $D024 Background Color 3
char BG_COLOR3;
// $D025 Sprite multicolor 0
/// $D025 Sprite multicolor 0
char SPRITES_MCOLOR1;
// $D026 Sprite multicolor 1
/// $D026 Sprite multicolor 1
char SPRITES_MCOLOR2;
// $D027 Color Sprite 0
/// $D027 Color Sprite 0
char SPRITE0_COLOR;
// $D028 Color Sprite 1
/// $D028 Color Sprite 1
char SPRITE1_COLOR;
// $D029 Color Sprite 2
/// $D029 Color Sprite 2
char SPRITE2_COLOR;
// $D02a Color Sprite 3
/// $D02a Color Sprite 3
char SPRITE3_COLOR;
// $D02b Color Sprite 4
/// $D02b Color Sprite 4
char SPRITE4_COLOR;
// $D02c Color Sprite 5
/// $D02c Color Sprite 5
char SPRITE5_COLOR;
// $D02d Color Sprite 6
/// $D02d Color Sprite 6
char SPRITE6_COLOR;
// $D02e Color Sprite 7
/// $D02e Color Sprite 7
char SPRITE7_COLOR;
// $D02f KEY register is used for choosing between the different I/O personalities.
// This disables/enables different registers in $D000-$DFFF
// $00: C64 personality
// $A5, $96: C65 personality
// $45, $54: MEGA65 ETHERNET personality
// $47, $53: MEGA65 personality
/// $D02f KEY register is used for choosing between the different I/O personalities.
/// This disables/enables different registers in $D000-$DFFF
/// $00: C64 personality
/// $A5, $96: C65 personality
/// $45, $54: MEGA65 ETHERNET personality
/// $47, $53: MEGA65 personality
char KEY;
// $D030 VIC-III Control Register A (ROM banks)
// Bit 20-bit Address 16-bit Address Read-Write
// 0 CRAM2K $1F800 $1FFFF, $D800 $DFFF Y
// $FF80000 $FF807FF
// 3 ROM8 $38000 $39FFF $8000 $9FFF N
// 4 ROMA $3A000 $3BFFF $A000 $BFFF N
// 5 ROMC $2C000 $2CFFF $C000 $CFFF N
// 6 CROM9 $29000 $29FFF $D000 $DFFF N
// 7 ROME $3E000 $3FFFF $E000 $FFFF N
/// $D030 VIC-III Control Register A (ROM banks)
/// Bit 20-bit Address 16-bit Address Read-Write
/// 0 CRAM2K $1F800 $1FFFF, $D800 $DFFF Y
/// $FF80000 $FF807FF
/// 3 ROM8 $38000 $39FFF $8000 $9FFF N
/// 4 ROMA $3A000 $3BFFF $A000 $BFFF N
/// 5 ROMC $2C000 $2CFFF $C000 $CFFF N
/// 6 CROM9 $29000 $29FFF $D000 $DFFF N
/// 7 ROME $3E000 $3FFFF $E000 $FFFF N
char CONTROLA;
// $D031 VIC-III Control Register B
// BIT
// 0 INT Enable VIC-III interlaced mode
// 1 MONO Enable VIC-III MONO video output (not implemented)
// 2 H1280 Enable 1280 horizontal pixels (not implemented)
// 3 V400 Enable 400 vertical pixels
// 4 BPM Bit-Plane Mode
// 5 ATTR Enable extended attributes and 8 bit colour entries
// 6 FAST Enable C65 FAST mode (3 .5MHz)
// 7 H640 Enable C64 640 horizontal pixels / 80 column mode
/// $D031 VIC-III Control Register B
/// BIT
/// 0 INT Enable VIC-III interlaced mode
/// 1 MONO Enable VIC-III MONO video output (not implemented)
/// 2 H1280 Enable 1280 horizontal pixels (not implemented)
/// 3 V400 Enable 400 vertical pixels
/// 4 BPM Bit-Plane Mode
/// 5 ATTR Enable extended attributes and 8 bit colour entries
/// 6 FAST Enable C65 FAST mode (3 .5MHz)
/// 7 H640 Enable C64 640 horizontal pixels / 80 column mode
char CONTROLB;
char UNUSED;
// $D033 Bitplane 0 Address
// 1-3 B0ADEVN Bitplane 0 address, even lines
// 5-7 B0ADODD Bitplane 0 address, odd lines
/// $D033 Bitplane 0 Address
/// 1-3 B0ADEVN Bitplane 0 address, even lines
/// 5-7 B0ADODD Bitplane 0 address, odd lines
char B0_ADDR;
// $D034 Bitplane 1 Address
/// $D034 Bitplane 1 Address
char B1_ADDR;
// $D035 Bitplane 2 Address
/// $D035 Bitplane 2 Address
char B2_ADDR;
// $D036 Bitplane 3 Address
/// $D036 Bitplane 3 Address
char B3_ADDR;
// $D037 Bitplane 4 Address
/// $D037 Bitplane 4 Address
char B4_ADDR;
// $D038 Bitplane 5 Address
/// $D038 Bitplane 5 Address
char B5_ADDR;
// $D039 Bitplane 6 Address
/// $D039 Bitplane 6 Address
char B6_ADDR;
// $D03A Bitplane 7 Address
/// $D03A Bitplane 7 Address
char B7_ADDR;
// $D03B Complement bitplane flags
/// $D03B Complement bitplane flags
char BPCOMP;
// $D03C Bitplane X
/// $D03C Bitplane X
char BPX;
// $D03D Bitplane Y
/// $D03D Bitplane Y
char BPY;
// $D03E Bitplane X Offset
/// $D03E Bitplane X Offset
char HPOS;
// $D03F Bitplane Y Offset
/// $D03F Bitplane Y Offset
char VPOS;
// $D040 Display Address Translater (DAT) Bitplane 0 port
/// $D040 Display Address Translater (DAT) Bitplane 0 port
char B0PIX;
// $D041 Display Address Translater (DAT) Bitplane 1 port
/// $D041 Display Address Translater (DAT) Bitplane 1 port
char B1PIX;
// $D042 Display Address Translater (DAT) Bitplane 2 port
/// $D042 Display Address Translater (DAT) Bitplane 2 port
char B2PIX;
// $D043 Display Address Translater (DAT) Bitplane 3 port
/// $D043 Display Address Translater (DAT) Bitplane 3 port
char B3PIX;
// $D044 Display Address Translater (DAT) Bitplane 4 port
/// $D044 Display Address Translater (DAT) Bitplane 4 port
char B4PIX;
// $D045 Display Address Translater (DAT) Bitplane 5 port
/// $D045 Display Address Translater (DAT) Bitplane 5 port
char B5PIX;
// $D046 Display Address Translater (DAT) Bitplane 6 port
/// $D046 Display Address Translater (DAT) Bitplane 6 port
char B6PIX;
// $D047 Display Address Translater (DAT) Bitplane 7 port
/// $D047 Display Address Translater (DAT) Bitplane 7 port
char B7PIX;
// $D048 top border position (low byte)
/// $D048 top border position (low byte)
char TBDRPOS_LO;
// $D049 top border position (high nibble) and sprite bitplane-modify-mode enables
// 0-3 Top border position (high nibble)
// 4-7 Sprite bitplane-modify-mode enables for sprite 0-3
/// $D049 top border position (high nibble) and sprite bitplane-modify-mode enables
/// 0-3 Top border position (high nibble)
/// 4-7 Sprite bitplane-modify-mode enables for sprite 0-3
char TBDRPOS_HI;
// $D04A bottom border position (low byte)
/// $D04A bottom border position (low byte)
char BBDRPOS_LO;
// $D04B bottom border position (high nibble) and sprite bitplane-modify-mode enables
// 0-3 Bottom border position (high nibble)
// 4-7 Sprite bitplane-modify-mode enables for sprite 4-7
/// $D04B bottom border position (high nibble) and sprite bitplane-modify-mode enables
/// 0-3 Bottom border position (high nibble)
/// 4-7 Sprite bitplane-modify-mode enables for sprite 4-7
char BBDRPOS_HI;
// $D04C character generator horizontal position (low byte)
/// $D04C character generator horizontal position (low byte)
char TEXTXPOS_LO;
// $D04D character generator horizontal position (high nibble) and sprite horizontal tile enables
// 0-3 Character generator horizontal position (high nibble)
// 4-7 Sprite horizontal tile enables for sprite 0-3
/// $D04D character generator horizontal position (high nibble) and sprite horizontal tile enables
/// 0-3 Character generator horizontal position (high nibble)
/// 4-7 Sprite horizontal tile enables for sprite 0-3
char TEXTXPOS_HI;
// $D04E character generator vertical position (low byte)
/// $D04E character generator vertical position (low byte)
char TEXTYPOS_LO;
// $D04F character generator vertical position (high nibble) and sprite horizontal tile enables
// 0-3 Character generator vertical position (high nibble)
// 4-7 Sprite horizontal tile enables for sprite 4-7
/// $D04F character generator vertical position (high nibble) and sprite horizontal tile enables
/// 0-3 Character generator vertical position (high nibble)
/// 4-7 Sprite horizontal tile enables for sprite 4-7
char TEXTYPOS_HI;
// $D050 Read horizontal raster scan position (lower byte)
/// $D050 Read horizontal raster scan position (lower byte)
char XPOS_LO;
// $D050 Read horizontal raster scan position (high byte)
// 0-5 Upper 6 bits of horizontal raster scan position
// 6-7 Always zero
/// $D050 Read horizontal raster scan position (high byte)
/// 0-5 Upper 6 bits of horizontal raster scan position
/// 6-7 Always zero
char XPOS_HI;
// $D052 Read physical raster position (low byte)
// -- Allow setting of fine raster for IRQ (low bits)
/// $D052 Read physical raster position (low byte)
/// -- Allow setting of fine raster for IRQ (low bits)
char FNRASTER_LO;
// $D053 Read physical raster position (high bits)
// -- Allow setting of fine raster for IRQ (high bits)
// 0-2 Read physical raster position (high bits)
// 7 FNRST Raster compare source (1=VIC-IV fine raster, 0=VIC-II raster)
/// $D053 Read physical raster position (high bits)
/// -- Allow setting of fine raster for IRQ (high bits)
/// 0-2 Read physical raster position (high bits)
/// 7 FNRST Raster compare source (1=VIC-IV fine raster, 0=VIC-II raster)
char FNRASTER_HI;
// $D054 VIC-IV Control register C
// 0 CHR16 enable 16-bit character numbers (two screen bytes per character)
// 1 FCLRLO enable full-colour mode for character numbers <=\$FF
// 2 FCLRHI enable full-colour mode for character numbers >\$FF
// 3 SMTH video output horizontal smoothing enable
// 4 VIC-IV:SPR640 Sprite H640 enable;
// 5 VIC-IV:PALEMU video output pal simulation
// 6 VIC-IV:VFAST C65GS FAST mode (48MHz)
// 7 VIC-IV:ALPHEN Alpha compositor enable
/// $D054 VIC-IV Control register C
/// 0 CHR16 enable 16-bit character numbers (two screen bytes per character)
/// 1 FCLRLO enable full-colour mode for character numbers <=\$FF
/// 2 FCLRHI enable full-colour mode for character numbers >\$FF
/// 3 SMTH video output horizontal smoothing enable
/// 4 VIC-IV:SPR640 Sprite H640 enable;
/// 5 VIC-IV:PALEMU video output pal simulation
/// 6 VIC-IV:VFAST C65GS FAST mode (48MHz)
/// 7 VIC-IV:ALPHEN Alpha compositor enable
char CONTROLC;
// $D055 SPRHGTEN sprite extended height enable (one bit per sprite)
/// $D055 SPRHGTEN sprite extended height enable (one bit per sprite)
char SPRHGTEN;
// $D056 Sprite extended height size (sprite pixels high)
/// $D056 Sprite extended height size (sprite pixels high)
char SPRHGHT;
// $D057 SPRX64EN Sprite extended width enables (8 bytes per sprite row = 64 pixels wide for normal sprites or 16 pixels wide for 16-colour sprite mode)
/// $D057 SPRX64EN Sprite extended width enables (8 bytes per sprite row = 64 pixels wide for normal sprites or 16 pixels wide for 16-colour sprite mode)
char SPRX64EN;
// $D058 CHARSTEP_LO characters per logical text row (LSB)
/// $D058 CHARSTEP_LO characters per logical text row (LSB)
char CHARSTEP_LO;
// $D059 CHARSTEP_HI characters per logical text row (MSB)
/// $D059 CHARSTEP_HI characters per logical text row (MSB)
char CHARSTEP_HI;
// $D05A CHRXSCL Horizontal hardware scale of text mode (pixel 120ths per pixel)
/// $D05A CHRXSCL Horizontal hardware scale of text mode (pixel 120ths per pixel)
char CHRXSCL;
// $D05B CHRYSCL Vertical scaling of text mode (number of physical rasters per char text row)
/// $D05B CHRYSCL Vertical scaling of text mode (number of physical rasters per char text row)
char CHRYSCL;
// $D05C SIDBDRWD Width of single side border (LSB)
/// $D05C SIDBDRWD Width of single side border (LSB)
char SIDBDRWD_LO;
// $D05D SIDBDRWD side border width (MSB)
// 0-5 side border width (upper bits)
// 6 RSTDELEN Enable raster delay (delays raster counter and interrupts by one line to match output pipeline latency)
// 7 HOTREG Enable VIC-II hot registers. When enabled, touching many VIC-II registers causes the VIC-IV to recalculate display parameters, such as border positions and sizes.
/// $D05D SIDBDRWD side border width (MSB)
/// 0-5 side border width (upper bits)
/// 6 RSTDELEN Enable raster delay (delays raster counter and interrupts by one line to match output pipeline latency)
/// 7 HOTREG Enable VIC-II hot registers. When enabled, touching many VIC-II registers causes the VIC-IV to recalculate display parameters, such as border positions and sizes.
char SIDBDRWD_HI;
// $D05E CHRCOUNT Number of characters to display per row
/// $D05E CHRCOUNT Number of characters to display per row
char CHRCOUNT;
// $D05F SPRXSMSBS Sprite H640 X Super-MSBs
/// $D05F SPRXSMSBS Sprite H640 X Super-MSBs
char SPRXSMSBS;
// $D060 SCRNPTR screen RAM precise base address (bits 0 - 7)
/// $D060 SCRNPTR screen RAM precise base address (bits 0 - 7)
char SCRNPTR_LOLO;
// $D061 SCRNPTR screen RAM precise base address (bits 15 - 8)
/// $D061 SCRNPTR screen RAM precise base address (bits 15 - 8)
char SCRNPTR_LOHI;
// $D062 SCRNPTR screen RAM precise base address (bits 23 - 16)
/// $D062 SCRNPTR screen RAM precise base address (bits 23 - 16)
char SCRNPTR_HILO;
// $D063 SCRNPTR screen RAM precise base address (bits 31 - 24)
/// $D063 SCRNPTR screen RAM precise base address (bits 31 - 24)
char SCRNPTR_HIHI;
// $D064 COLPTR colour RAM base address (bits 0 - 7)
/// $D064 COLPTR colour RAM base address (bits 0 - 7)
char COLPTR_LO;
// $D065 COLPTR colour RAM base address (bits 15 - 8)
/// $D065 COLPTR colour RAM base address (bits 15 - 8)
char COLPTR_HI;
// $D066 DEBUG1 (DEBUG WILL BE REMOVED)
// 0-4 VIC-IV xcounter pipeline delay (DEBUG WILL BE REMOVED)
// 6 VIC-IV render activity display enable (DEBUG WILL BE REMOVED)
// 7 VIC-IV test pattern display enable (DEBUG WILL BE REMOVED)
/// $D066 DEBUG1 (DEBUG WILL BE REMOVED)
/// 0-4 VIC-IV xcounter pipeline delay (DEBUG WILL BE REMOVED)
/// 6 VIC-IV render activity display enable (DEBUG WILL BE REMOVED)
/// 7 VIC-IV test pattern display enable (DEBUG WILL BE REMOVED)
char DEBUG1;
// $D067 SBPDEBUG Sprite/bitplane first X (DEBUG WILL BE REMOVED)
/// $D067 SBPDEBUG Sprite/bitplane first X (DEBUG WILL BE REMOVED)
char SBPDEBUG;
// $D068 CHARPTR Character set precise base address (bits 0 - 7)
/// $D068 CHARPTR Character set precise base address (bits 0 - 7)
char CHARPTR_LOLO;
// $D069 CHARPTR Character set precise base address (bits 15 - 8)
/// $D069 CHARPTR Character set precise base address (bits 15 - 8)
char CHARPTR_LOHI;
// $D06A CHARPTR Character set precise base address (bits 23 - 16)
/// $D06A CHARPTR Character set precise base address (bits 23 - 16)
char CHARPTR_HILO;
// $D06B SPR16EN sprite 16-colour mode enables
/// $D06B SPR16EN sprite 16-colour mode enables
char SPR16EN;
// $D06C SPRPTRADR sprite pointer address (bits 7 - 0)
/// $D06C SPRPTRADR sprite pointer address (bits 7 - 0)
char SPRPTRADR_LOLO;
// $D06D SPRPTRADR sprite pointer address (bits 15 - 8)
/// $D06D SPRPTRADR sprite pointer address (bits 15 - 8)
char SPRPTRADR_LOHI;
// $D06E.0-6 SPRPTRADR sprite pointer address (bits 22 - 16)
// 0-6 sprite pointer address (bits 22 - 16)
// 7 SPRPTR16 16-bit sprite pointer mode (allows sprites to be located on any 64 byte boundary in chip RAM)
/// $D06E.0-6 SPRPTRADR sprite pointer address (bits 22 - 16)
/// 0-6 sprite pointer address (bits 22 - 16)
/// 7 SPRPTR16 16-bit sprite pointer mode (allows sprites to be located on any 64 byte boundary in chip RAM)
char SPRPTRADR_HILO;
// $D06F First VIC-II raster line
// 0-5 RASLINE0 first VIC-II raster line
// 6 VGAHDTV Select more VGA-compatible mode if set, instead of HDMI/HDTV VIC-II cycle-exact frame timing. May help to produce a functional display on older VGA monitors.
// 7 PALNTSC NTSC emulation mode (max raster = 262)
// bit 7 6
// 0 0 => PAL, 720x576 @ 50Hz
// 0 1 => PAL, 720x576 50Hz, NTSC max raster
// 1 0 => NTSC, 720x480 @ 60Hz
// 1 1 => NTSC 720x480 60Hz
// ? ? => Default to NTSC 800x600 60Hz (see https://github.com/MEGA65/mega65-core/blob/master/src/vhdl/viciv.vhdl)
/// $D06F First VIC-II raster line
/// 0-5 RASLINE0 first VIC-II raster line
/// 6 VGAHDTV Select more VGA-compatible mode if set, instead of HDMI/HDTV VIC-II cycle-exact frame timing. May help to produce a functional display on older VGA monitors.
/// 7 PALNTSC NTSC emulation mode (max raster = 262)
/// bit 7 6
/// 0 0 => PAL, 720x576 @ 50Hz
/// 0 1 => PAL, 720x576 50Hz, NTSC max raster
/// 1 0 => NTSC, 720x480 @ 60Hz
/// 1 1 => NTSC 720x480 60Hz
/// ? ? => Default to NTSC 800x600 60Hz (see https://github.com/MEGA65/mega65-core/blob/master/src/vhdl/viciv.vhdl)
char RASLINE0;
// $D070 VIC-IV palette bank selection
// 1-0 ABTPALSEL VIC-IV bitmap/text palette bank (alternate palette)
// 3-2 SPRPALSEL sprite palette bank
// 5-4 BTPALSEL bitmap/text palette bank
// 7-6 MAPEDPAL palette bank mapped at \$D100-\$D3FF
/// $D070 VIC-IV palette bank selection
/// 1-0 ABTPALSEL VIC-IV bitmap/text palette bank (alternate palette)
/// 3-2 SPRPALSEL sprite palette bank
/// 5-4 BTPALSEL bitmap/text palette bank
/// 7-6 MAPEDPAL palette bank mapped at \$D100-\$D3FF
char PALSEL;
// $D071 BP16ENS VIC-IV 16-colour bitplane enable flags
/// $D071 BP16ENS VIC-IV 16-colour bitplane enable flags
char BP16ENS;
// $D072 VSYNDEL VIC-IV VSYNC delay
/// $D072 VSYNDEL VIC-IV VSYNC delay
char VSYNDEL;
// $D073 ALPHADELAY Alpha delay and raster height
// $D073.0-3 ALPHADELAY Alpha delay for compositor
// $D073.4-7 RASTERHEIGHT physical rasters per VIC-II raster (1 to 16)
/// $D073 ALPHADELAY Alpha delay and raster height
/// $D073.0-3 ALPHADELAY Alpha delay for compositor
/// $D073.4-7 RASTERHEIGHT physical rasters per VIC-II raster (1 to 16)
char ALPHADELAY;
// $D074 SPRENALPHA Sprite alpha-blend enable
/// $D074 SPRENALPHA Sprite alpha-blend enable
char SPRENALPHA;
// $D075 SPRALPHAVAL Sprite alpha-blend value
/// $D075 SPRALPHAVAL Sprite alpha-blend value
char SPRALPHAVAL;
// $D076 SPRENV400 Sprite V400 enables
/// $D076 SPRENV400 Sprite V400 enables
char SPRENV400;
// $D077 SRPYMSBS Sprite V400 Y position MSBs
/// $D077 SRPYMSBS Sprite V400 Y position MSBs
char SRPYMSBS;
// $D078 SPRYSMSBS Sprite V400 Y position super MSBs
/// $D078 SPRYSMSBS Sprite V400 Y position super MSBs
char SPRYSMSBSM;
// $D079 RSTCOMP Raster compare value
/// $D079 RSTCOMP Raster compare value
char RSTCOMP;
// $D07A RSTCMP Raster compare value MSB
// 0-2 RSTCMP Raster compare value MSB
// 3-6 RESERVED
// 7 FNRSTCMP Raster compare is in physical rasters if set, or VIC-II raster if clear
/// $D07A RSTCMP Raster compare value MSB
/// 0-2 RSTCMP Raster compare value MSB
/// 3-6 RESERVED
/// 7 FNRSTCMP Raster compare is in physical rasters if set, or VIC-II raster if clear
char RSTCMP;
// $D07B Number of text rows to display
/// $D07B Number of text rows to display
char ROWCOUNT;
// $D07C hsync/vsync polarity
// 0-3 RESERVED UNUSED BITS
// 4 HSYNCP hsync polarity
// 5 VSYNCP vsync polarity
// 6-7 RESERVED UNUSED BITS
/// $D07C hsync/vsync polarity
/// 0-3 RESERVED UNUSED BITS
/// 4 HSYNCP hsync polarity
/// 5 VSYNCP vsync polarity
/// 6-7 RESERVED UNUSED BITS
char SYNCPOL;
// $D07D DEBUGX VIC-IV debug X position (LSB)
/// $D07D DEBUGX VIC-IV debug X position (LSB)
char DEBUGX;
// $D07E DEBUGY VIC-IV debug Y position (LSB)
/// $D07E DEBUGY VIC-IV debug Y position (LSB)
char DEBUGY;
// $D07F DEBUGXY VIC-IV debug X/Y position (MSB)
// 0-5 DEBUGX VIC-IV debug X position (MSB)
// 7 DEBUGOOF VIC-IV debug out-of-frame signal enable
// 4-7 DEBUGY VIC-IV debug Y position (MSB)
/// $D07F DEBUGXY VIC-IV debug X/Y position (MSB)
/// 0-5 DEBUGX VIC-IV debug X position (MSB)
/// 7 DEBUGOOF VIC-IV debug out-of-frame signal enable
/// 4-7 DEBUGY VIC-IV debug Y position (MSB)
char DEBUGXY;
};

View File

@ -1,3 +1,4 @@
/// @file
/// MEGA65 Registers and Constants
#ifndef __MEGA65__
#error "Target platform must be MEGA65"

View File

@ -1,7 +1,6 @@
/// @file
/// @brief MOS 4567 / 4569 Video Interface Chip (VIC III)
/// MOS 4567 / 4569 Video Interface Chip (VIC III)
struct MOS4569_VICIII {
char SPRITE0_X;
@ -36,108 +35,108 @@ struct MOS4569_VICIII {
char SPRITES_EXPAND_X;
char SPRITES_COLLISION;
char SPRITES_BG_COLLISION;
// $D020 Border Color
/// $D020 Border Color
char BORDER_COLOR;
// $D021 Background Color 0
/// $D021 Background Color 0
char BG_COLOR;
// $D022 Background Color 1
/// $D022 Background Color 1
char BG_COLOR1;
// $D023 Background Color 2
/// $D023 Background Color 2
char BG_COLOR2;
// $D024 Background Color 3
/// $D024 Background Color 3
char BG_COLOR3;
// $D025 Sprite multicolor 0
/// $D025 Sprite multicolor 0
char SPRITES_MCOLOR1;
// $D026 Sprite multicolor 1
/// $D026 Sprite multicolor 1
char SPRITES_MCOLOR2;
// $D027 Color Sprite 0
/// $D027 Color Sprite 0
char SPRITE0_COLOR;
// $D028 Color Sprite 1
/// $D028 Color Sprite 1
char SPRITE1_COLOR;
// $D029 Color Sprite 2
/// $D029 Color Sprite 2
char SPRITE2_COLOR;
// $D02a Color Sprite 3
/// $D02a Color Sprite 3
char SPRITE3_COLOR;
// $D02b Color Sprite 4
/// $D02b Color Sprite 4
char SPRITE4_COLOR;
// $D02c Color Sprite 5
/// $D02c Color Sprite 5
char SPRITE5_COLOR;
// $D02d Color Sprite 6
/// $D02d Color Sprite 6
char SPRITE6_COLOR;
// $D02e Color Sprite 7
/// $D02e Color Sprite 7
char SPRITE7_COLOR;
// $D02f KEY register is used for choosing between the different I/O personalities.
// This disables/enables different registers in $D000-$DFFF
// $00: C64 personality
// $A5, $96: C65 personality
// $45, $54: MEGA65 ETHERNET personality
// $47, $53: MEGA65 personality
/// $D02f KEY register is used for choosing between the different I/O personalities.
/// This disables/enables different registers in $D000-$DFFF
/// $00: C64 personality
/// $A5, $96: C65 personality
/// $45, $54: MEGA65 ETHERNET personality
/// $47, $53: MEGA65 personality
char KEY;
// $D030 VIC-III Control Register A (ROM banks)
// Bit 20-bit Address 16-bit Address Read-Write
// 0 CRAM2K $1F800 $1FFFF, $D800 $DFFF Y
// $FF80000 $FF807FF
// 3 ROM8 $38000 $39FFF $8000 $9FFF N
// 4 ROMA $3A000 $3BFFF $A000 $BFFF N
// 5 ROMC $2C000 $2CFFF $C000 $CFFF N
// 6 CROM9 $29000 $29FFF $D000 $DFFF N
// 7 ROME $3E000 $3FFFF $E000 $FFFF N
/// $D030 VIC-III Control Register A (ROM banks)
/// Bit 20-bit Address 16-bit Address Read-Write
/// 0 CRAM2K $1F800 $1FFFF, $D800 $DFFF Y
/// $FF80000 $FF807FF
/// 3 ROM8 $38000 $39FFF $8000 $9FFF N
/// 4 ROMA $3A000 $3BFFF $A000 $BFFF N
/// 5 ROMC $2C000 $2CFFF $C000 $CFFF N
/// 6 CROM9 $29000 $29FFF $D000 $DFFF N
/// 7 ROME $3E000 $3FFFF $E000 $FFFF N
char CONTROLA;
// $D031 VIC-III Control Register B
// BIT
// 0 INT Enable VIC-III interlaced mode
// 1 MONO Enable VIC-III MONO video output (not implemented)
// 2 H1280 Enable 1280 horizontal pixels (not implemented)
// 3 V400 Enable 400 vertical pixels
// 4 BPM Bit-Plane Mode
// 5 ATTR Enable extended attributes and 8 bit colour entries
// 6 FAST Enable C65 FAST mode (3 .5MHz)
// 7 H640 Enable C64 640 horizontal pixels / 80 column mode
/// $D031 VIC-III Control Register B
/// BIT
/// 0 INT Enable VIC-III interlaced mode
/// 1 MONO Enable VIC-III MONO video output (not implemented)
/// 2 H1280 Enable 1280 horizontal pixels (not implemented)
/// 3 V400 Enable 400 vertical pixels
/// 4 BPM Bit-Plane Mode
/// 5 ATTR Enable extended attributes and 8 bit colour entries
/// 6 FAST Enable C65 FAST mode (3 .5MHz)
/// 7 H640 Enable C64 640 horizontal pixels / 80 column mode
char CONTROLB;
char UNUSED;
// $D033 Bitplane 0 Address
// 1-3 B0ADEVN Bitplane 0 address, even lines
// 5-7 B0ADODD Bitplane 0 address, odd lines
/// $D033 Bitplane 0 Address
/// 1-3 B0ADEVN Bitplane 0 address, even lines
/// 5-7 B0ADODD Bitplane 0 address, odd lines
char B0_ADDR;
// $D034 Bitplane 1 Address
/// $D034 Bitplane 1 Address
char B1_ADDR;
// $D035 Bitplane 2 Address
/// $D035 Bitplane 2 Address
char B2_ADDR;
// $D036 Bitplane 3 Address
/// $D036 Bitplane 3 Address
char B3_ADDR;
// $D037 Bitplane 4 Address
/// $D037 Bitplane 4 Address
char B4_ADDR;
// $D038 Bitplane 5 Address
/// $D038 Bitplane 5 Address
char B5_ADDR;
// $D039 Bitplane 6 Address
/// $D039 Bitplane 6 Address
char B6_ADDR;
// $D03A Bitplane 7 Address
/// $D03A Bitplane 7 Address
char B7_ADDR;
// $D03B Complement bitplane flags
/// $D03B Complement bitplane flags
char BPCOMP;
// $D03C Bitplane X
/// $D03C Bitplane X
char BPX;
// $D03D Bitplane Y
/// $D03D Bitplane Y
char BPY;
// $D03E Bitplane X Offset
/// $D03E Bitplane X Offset
char HPOS;
// $D03F Bitplane Y Offset
/// $D03F Bitplane Y Offset
char VPOS;
// $D040 Display Address Translater (DAT) Bitplane 0 port
/// $D040 Display Address Translater (DAT) Bitplane 0 port
char B0PIX;
// $D041 Display Address Translater (DAT) Bitplane 1 port
/// $D041 Display Address Translater (DAT) Bitplane 1 port
char B1PIX;
// $D042 Display Address Translater (DAT) Bitplane 2 port
/// $D042 Display Address Translater (DAT) Bitplane 2 port
char B2PIX;
// $D043 Display Address Translater (DAT) Bitplane 3 port
/// $D043 Display Address Translater (DAT) Bitplane 3 port
char B3PIX;
// $D044 Display Address Translater (DAT) Bitplane 4 port
/// $D044 Display Address Translater (DAT) Bitplane 4 port
char B4PIX;
// $D045 Display Address Translater (DAT) Bitplane 5 port
/// $D045 Display Address Translater (DAT) Bitplane 5 port
char B5PIX;
// $D046 Display Address Translater (DAT) Bitplane 6 port
/// $D046 Display Address Translater (DAT) Bitplane 6 port
char B6PIX;
// $D047 Display Address Translater (DAT) Bitplane 7 port
/// $D047 Display Address Translater (DAT) Bitplane 7 port
char B7PIX;
};

View File

@ -1,39 +1,40 @@
/// @file
/// MOS 6522 Versatile Interface Adapter (VIA)
/// Used in VIC 20 and 1541
/// https://en.wikipedia.org/wiki/MOS_Technology_6522
/// http://archive.6502.org/datasheets/mos_6522_preliminary_nov_1977.pdf
struct MOS6522_VIA {
// Port B
/// Port B
char PORT_B;
// Port A
/// Port A
char PORT_A;
// Port B data direction register.
/// Port B data direction register.
char PORT_B_DDR;
// Port A data direction register.
/// Port A data direction register.
char PORT_A_DDR;
// Timer 1 low byte
/// Timer 1 low byte
char TIMER1_LOW;
// Timer 1 high byte
/// Timer 1 high byte
char TIMER1_HIGH;
// Timer 1 latch low byte
/// Timer 1 latch low byte
char TIMER1_LATCH_LOW;
// Timer 1 latch high byte
/// Timer 1 latch high byte
char TIMER1_LATCH_HIGH;
// Timer 2 low byte
/// Timer 2 low byte
char TIMER2_LOW;
// Timer 2 high byte
/// Timer 2 high byte
char TIMER2_HIGH;
// Shift Register
/// Shift Register
char SHIFT;
// Auxiliary Control Register
/// Auxiliary Control Register
char AUX_CONTROL;
// Peripheral Control Register
/// Peripheral Control Register
char PERIPHERAL_CONTROL;
// Interrupt Flag Register
/// Interrupt Flag Register
char INTERRUPT_FLAG;
// Interrupt Enable Register
/// Interrupt Enable Register
char INTERRUPT_ENABLE;
// Port A Output (no handshake)
/// Port A Output (no handshake)
char PORT_A_OUTPUT;
};

View File

@ -1,19 +1,20 @@
/// @file
/// MOS 6523 TRI-PORT INTERFACE (TPI)
/// It has three dedicated 8-bit I/O ports which provide 24 individually programmable I/O lines
/// Used in the Commodore 1551 disk drive
/// http://archive.6502.org/datasheets/mos_6523_tpi_preliminary_nov_1980.pdf
struct MOS6523_TIA {
// Port A
/// Port A
char PORT_A;
// Port B
/// Port B
char PORT_B;
// Port C
/// Port C
char PORT_C;
// Port A data direction register.
/// Port A data direction register.
char PORT_A_DDR;
// Port B data direction register.
/// Port B data direction register.
char PORT_B_DDR;
// Port C data direction register.
/// Port C data direction register.
char PORT_C_DDR;
}

View File

@ -1,39 +1,37 @@
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
struct MOS6526_CIA {
// Port A
/// Port A
char PORT_A;
// Port B
/// Port B
char PORT_B;
// Port A data direction register.
/// Port A data direction register.
char PORT_A_DDR;
// Port B data direction register.
/// Port B data direction register.
char PORT_B_DDR;
// Timer A Value
/// Timer A Value
unsigned int TIMER_A;
// Timer B Value
/// Timer B Value
unsigned int TIMER_B;
// Time-of-day real-time-clock tenth seconds (BCD)
/// Time-of-day real-time-clock tenth seconds (BCD)
char TOD_10THS;
// Time-of-day real-time-clock seconds (BCD)
/// Time-of-day real-time-clock seconds (BCD)
char TOD_SEC;
// Time-of-day real-time-clock minutes (BCD)
/// Time-of-day real-time-clock minutes (BCD)
char TOD_MIN;
// Time-of-day real-time-clock hours (BCD)
/// Time-of-day real-time-clock hours (BCD)
char TOD_HOURS;
// Serial Shift Register
/// Serial Shift Register
char SERIAL_DATA;
// Interrupt Status & Control Register
/// Interrupt Status & Control Register
char INTERRUPT;
// Timer A Control Register
/// Timer A Control Register
char TIMER_A_CONTROL;
// Timer B Control Register
/// Timer B Control Register
char TIMER_B_CONTROL;
};

View File

@ -1,3 +1,4 @@
/// @file
/// MOS 6529 Single Port Interface (SPI aka PIO)
/// I/O controller providing a single 8-bit digital bidirectional parallel I/O port.
/// http://archive.6502.org/datasheets/mos_6529_spi.pdf

View File

@ -1,27 +1,28 @@
/// @file
/// MOS 6532 RAM-I/O-Timer (RIOT)
/// http://www.ionpool.net/arcade/gottlieb/technical/datasheets/R6532_datasheet.pdf
/// http://www.qotile.net/minidig/docs/stella.pdf
/// https://en.wikipedia.org/wiki/MOS_Technology_6532
struct MOS6532_RIOT {
// $280 Port A data register for joysticks: Bits 4-7 for player 1. Bits 0-3 for player 2.
/// $280 Port A data register for joysticks: Bits 4-7 for player 1. Bits 0-3 for player 2.
char SWCHA;
// $281 Port A data direction register (DDR)
/// $281 Port A data direction register (DDR)
char SWACNT;
// $282 Port B data (console switches)
/// $282 Port B data (console switches)
char SWCHB;
// $283 Port B DDR
/// $283 Port B DDR
char SWBCNT;
// $284 Timer output
/// $284 Timer output
char INTIM;
// Unused/undefined registers ($285-$294)
/// Unused/undefined registers ($285-$294)
char UNUSED[15];
// $294 set 1 clock interval
/// $294 set 1 clock interval
char TIM1T;
// $295 set 8 clock interval
/// $295 set 8 clock interval
char TIM8T;
// $296 set 64 clock interval
/// $296 set 64 clock interval
char TIM64T;
// $297 set 1024 clock interval
/// $297 set 1024 clock interval
char T1024T;
};

View File

@ -1,15 +1,16 @@
/// @file
/// MOS 6551 6551 ASYNCHRONOUS COMMUNICATION INTERFACE ADAPTER
/// used for RS232
/// http://archive.6502.org/datasheets/mos_6551_acia.pdf
/// https://en.wikipedia.org/wiki/MOS_Technology_6551
struct MOS6551_ACIA {
// DATA port
/// DATA port
char DATA;
// STATUS port
/// STATUS port
char STATUS;
// COMMAND port
/// COMMAND port
char COMMAND;
// CONTROL port
/// CONTROL port
char CONTROL;
};

View File

@ -1,65 +1,66 @@
/// @file
/// MOS 6560/6561 VIDEO INTERFACE CHIP
/// Used in VIC 20
/// http://archive.6502.org/datasheets/mos_6560_6561_vic.pdf
struct MOS6561_VIC {
// Screen Origin X-coordinate
// bits 0-6: horizontal centering
// bit 7: sets interlace scan
/// Screen Origin X-coordinate
/// bits 0-6: horizontal centering
/// bit 7: sets interlace scan
char ORIGIN_X;
// Screen Origin Y-coordinate
// bit 0-7: vertical centering
/// Screen Origin Y-coordinate
/// bit 0-7: vertical centering
char ORIGIN_Y;
// Number of Screen Columns
// bits 0-6: Number of columns
// bit 7: Upper bit of video matrix address (also controls address of COLOR RAM)
/// Number of Screen Columns
/// bits 0-6: Number of columns
/// bit 7: Upper bit of video matrix address (also controls address of COLOR RAM)
char MATRIX_COLUMNS;
// Number of Screen Rows
// bit 0: select 0) 8x8 chars or 1) 16x8 chars
// bits 1-6: Number of rows
// bit 7: Current TV raster mean line bit 0.
/// Number of Screen Rows
/// bit 0: select 0) 8x8 chars or 1) 16x8 chars
/// bits 1-6: Number of rows
/// bit 7: Current TV raster mean line bit 0.
char MATRIX_ROWS;
// The Raster Line
// bits 0-7: Current TV raster beam line (bit 8-1)
/// The Raster Line
/// bits 0-7: Current TV raster beam line (bit 8-1)
char RASTER;
// Character and Screen Address
// bits 0-3: start of character memory (default 0)
// ROM: 0000: 0x8000, 0001: 0x8400, 0010: 0x8800, 0011: 0x8c00
// RAM: 1000: 0x0000, 1001: unavail, 1010: unavail, 1011: unavail
// RAM: 1100: 0x1000, 1101: 0x1400, 1110: 0x1800, 1111: 0x1c00
// bits 4-7: is rest of video matrix address (default F)
/// Character and Screen Address
/// bits 0-3: start of character memory (default 0)
/// ROM: 0000: 0x8000, 0001: 0x8400, 0010: 0x8800, 0011: 0x8c00
/// RAM: 1000: 0x0000, 1001: unavail, 1010: unavail, 1011: unavail
/// RAM: 1100: 0x1000, 1101: 0x1400, 1110: 0x1800, 1111: 0x1c00
/// bits 4-7: is rest of video matrix address (default F)
char MEMORY;
// Lightpen X position
// bits 0-7: horizontal position of light pen
/// Lightpen X position
/// bits 0-7: horizontal position of light pen
char LIGHTPEN_X;
// Lightpen Y position
// bits 0-7: vertical position of light pen
/// Lightpen Y position
/// bits 0-7: vertical position of light pen
char LIGHTPEN_Y;
// Paddle X position
// bit 0-7: Digitized value of paddle X
/// Paddle X position
/// bit 0-7: Digitized value of paddle X
char PADDLE_X;
// Paddle Y position
// bit 0-7: Digitized value oi paddle Y
/// Paddle Y position
/// bit 0-7: Digitized value oi paddle Y
char PADDLE_Y;
// Sound Voice 1 (low) frequency
// Frequency for oscillator 1 (low) (on: 128-255)
/// Sound Voice 1 (low) frequency
/// Frequency for oscillator 1 (low) (on: 128-255)
char CH1_FREQ;
// Sound Voice 2 (medium) frequency
// Frequency for oscillator 1 (medium) (on: 128-255)
/// Sound Voice 2 (medium) frequency
/// Frequency for oscillator 1 (medium) (on: 128-255)
char CH2_FREQ;
// Sound Voice 3 (high) frequency
// Frequency for oscillator 1 (high) (on: 128-255)
/// Sound Voice 3 (high) frequency
/// Frequency for oscillator 1 (high) (on: 128-255)
char CH3_FREQ;
// Sound Voice 4 (noise) frequency
// Frequency of noise source
/// Sound Voice 4 (noise) frequency
/// Frequency of noise source
char CH4_FREQ;
// Sound Volume and auxiliary color information
// bit 0-3: sets volume of all sound
// bits 4-7: are auxiliary color information
/// Sound Volume and auxiliary color information
/// bit 0-3: sets volume of all sound
/// bits 4-7: are auxiliary color information
char VOLUME_COLOR;
// Screen and border color register
// bits 4-7: background color
// bit 3: inverted or normal mode
// bits 0-2: border color
/// Screen and border color register
/// bits 4-7: background color
/// bit 3: inverted or normal mode
/// bits 0-2: border color
char BORDER_BACKGROUND_COLOR;
};

View File

@ -1,145 +1,146 @@
/// @file
/// MOS 6567 / 6569 Video Interface Chip (VIC II)
/// http://archive.6502.org/datasheets/mos_6567_vic_ii_preliminary.pdf
/// https://dustlayer.com/vic-ii/2013/4/22/when-visibility-matters
/// http://www.zimmers.net/cbmpics/cbm/c64/vic-ii.txt
struct MOS6569_VICII {
// $D000 X-Coordinate Sprite#0
/// $D000 X-Coordinate Sprite#0
char SPRITE0_X;
// $D001 Y-Coordinate Sprite#0
/// $D001 Y-Coordinate Sprite#0
char SPRITE0_Y;
// $D002 X-Coordinate Sprite#1
/// $D002 X-Coordinate Sprite#1
char SPRITE1_X;
// $D003 Y-Coordinate Sprite#1
/// $D003 Y-Coordinate Sprite#1
char SPRITE1_Y;
// $D004 X-Coordinate Sprite#2
/// $D004 X-Coordinate Sprite#2
char SPRITE2_X;
// $D005 Y-Coordinate Sprite#2
/// $D005 Y-Coordinate Sprite#2
char SPRITE2_Y;
// $D006 X-Coordinate Sprite#3
/// $D006 X-Coordinate Sprite#3
char SPRITE3_X;
// $D007 Y-Coordinate Sprite#3
/// $D007 Y-Coordinate Sprite#3
char SPRITE3_Y;
// $D008 X-Coordinate Sprite#4
/// $D008 X-Coordinate Sprite#4
char SPRITE4_X;
// $D009 Y-Coordinate Sprite#4
/// $D009 Y-Coordinate Sprite#4
char SPRITE4_Y;
// $D00A X-Coordinate Sprite#5
/// $D00A X-Coordinate Sprite#5
char SPRITE5_X;
// $D00B Y-Coordinate Sprite#5
/// $D00B Y-Coordinate Sprite#5
char SPRITE5_Y;
// $D00C X-Coordinate Sprite#6
/// $D00C X-Coordinate Sprite#6
char SPRITE6_X;
// $D00D Y-Coordinate Sprite#6
/// $D00D Y-Coordinate Sprite#6
char SPRITE6_Y;
// $D00E X-Coordinate Sprite#7
/// $D00E X-Coordinate Sprite#7
char SPRITE7_X;
// $D00F Y-Coordinate Sprite#7
/// $D00F Y-Coordinate Sprite#7
char SPRITE7_Y;
// $D010 Bit#9 for Sprite X-Coordinates
/// $D010 Bit#9 for Sprite X-Coordinates
char SPRITES_XMSB;
// $D011 Control Register #1
// - Bit#0-#2: YSCROLL Screen Soft Scroll Vertical
// - Bit#3: RSEL Switch betweem 25 or 24 visible rows
// RSEL| Display window height | First line | Last line
// ----+--------------------------+-------------+----------
// 0 | 24 text lines/192 pixels | 55 ($37) | 246 ($f6)
// 1 | 25 text lines/200 pixels | 51 ($33) | 250 ($fa)
// - Bit#4: DEN Switch VIC-II output on/off
// - Bit#5: BMM Turn Bitmap Mode on/off
// - Bit#6: ECM Turn Extended Color Mode on/off
// - Bit#7: RST8 9th Bit for $D012 Rasterline counter
// Initial Value: %10011011
/// $D011 Control Register #1
/// - Bit#0-#2: YSCROLL Screen Soft Scroll Vertical
/// - Bit#3: RSEL Switch betweem 25 or 24 visible rows
/// RSEL| Display window height | First line | Last line
/// ----+--------------------------+-------------+----------
/// 0 | 24 text lines/192 pixels | 55 ($37) | 246 ($f6)
/// 1 | 25 text lines/200 pixels | 51 ($33) | 250 ($fa)
/// - Bit#4: DEN Switch VIC-II output on/off
/// - Bit#5: BMM Turn Bitmap Mode on/off
/// - Bit#6: ECM Turn Extended Color Mode on/off
/// - Bit#7: RST8 9th Bit for $D012 Rasterline counter
/// Initial Value: %10011011
char CONTROL1;
// $D012 RASTER Raster counter
/// $D012 RASTER Raster counter
char RASTER;
// $D013 LPX Light pen X
// When Reading:Return current Rasterline
// When Writing:Define Rasterline for Interrupt triggering
/// $D013 LPX Light pen X
/// When Reading:Return current Rasterline
/// When Writing:Define Rasterline for Interrupt triggering
char LIGHTPEN_X;
// $D014 LPY Light pen Y
/// $D014 LPY Light pen Y
char LIGHTPEN_Y;
// $D015 Sprite enabled
// If a bit is set high the corresponding Sprite is enabled on Screen
/// $D015 Sprite enabled
/// If a bit is set high the corresponding Sprite is enabled on Screen
char SPRITES_ENABLE;
// $D016 Control register 2
// - Bit#0-#2: XSCROLL Screen Soft Scroll Horizontal
// - Bit#3: CSEL Switch betweem 40 or 38 visible columns
// CSEL| Display window width | First X coo. | Last X coo.
// ----+--------------------------+--------------+------------
// 0 | 38 characters/304 pixels | 31 ($1f) | 334 ($14e)
// 1 | 40 characters/320 pixels | 24 ($18) | 343 ($157)
// - Bit#4: MCM Turn Multicolor Mode on/off
// - Bit#5-#7: not used
// Initial Value: %00001000
/// $D016 Control register 2
/// - Bit#0-#2: XSCROLL Screen Soft Scroll Horizontal
/// - Bit#3: CSEL Switch betweem 40 or 38 visible columns
/// CSEL| Display window width | First X coo. | Last X coo.
/// ----+--------------------------+--------------+------------
/// 0 | 38 characters/304 pixels | 31 ($1f) | 334 ($14e)
/// 1 | 40 characters/320 pixels | 24 ($18) | 343 ($157)
/// - Bit#4: MCM Turn Multicolor Mode on/off
/// - Bit#5-#7: not used
/// Initial Value: %00001000
char CONTROL2;
// $D017 Sprite Y expansion
// If a bit is set high, the corresponding Sprite will be stretched vertically x2
/// $D017 Sprite Y expansion
/// If a bit is set high, the corresponding Sprite will be stretched vertically x2
char SPRITES_EXPAND_Y;
// $D018 VIC-II base addresses
// - Bit#0: not used
// - Bit#1-#3: CB Address Bits 11-13 of the Character Set (*2048)
// - Bit#4-#7: VM Address Bits 10-13 of the Screen RAM (*1024)
// Initial Value: %00010100
/// $D018 VIC-II base addresses
/// - Bit#0: not used
/// - Bit#1-#3: CB Address Bits 11-13 of the Character Set (*2048)
/// - Bit#4-#7: VM Address Bits 10-13 of the Screen RAM (*1024)
/// Initial Value: %00010100
char MEMORY;
// $D019 Interrupt Status Register
// - Bit#0: IRST Interrupt by Rasterline triggered when high
// - Bit#1: IMBC Interrupt by Spite-Background collision triggered when high
// - Bit#2: IMMC Interrupt by Sprite-Sprite collision triggered when high
// - Bit#3: ILP Interrupt by Lightpen impulse triggered when high
// - Bit#4-#6: not used
// - Bit#7: IRQ If set high at least one of the Interrupts above were triggered
/// $D019 Interrupt Status Register
/// - Bit#0: IRST Interrupt by Rasterline triggered when high
/// - Bit#1: IMBC Interrupt by Spite-Background collision triggered when high
/// - Bit#2: IMMC Interrupt by Sprite-Sprite collision triggered when high
/// - Bit#3: ILP Interrupt by Lightpen impulse triggered when high
/// - Bit#4-#6: not used
/// - Bit#7: IRQ If set high at least one of the Interrupts above were triggered
char IRQ_STATUS;
// $D01A Interrupt Enable Register
// - Bit#0: ERST Request Interrupt by Rasterline by setting high
// - Bit#1: EMBC Request Interrupt by Spite-Background collision by setting high
// - Bit#2: EMMC Request Interrupt by Sprite-Sprite collision by setting high
// - Bit#3: ELP Request Interrupt by Lightpen impulse by setting high
// - Bit#4-#7: not used
/// $D01A Interrupt Enable Register
/// - Bit#0: ERST Request Interrupt by Rasterline by setting high
/// - Bit#1: EMBC Request Interrupt by Spite-Background collision by setting high
/// - Bit#2: EMMC Request Interrupt by Sprite-Sprite collision by setting high
/// - Bit#3: ELP Request Interrupt by Lightpen impulse by setting high
/// - Bit#4-#7: not used
char IRQ_ENABLE;
// $D01B Sprite data priority
// If a bit is set high, the Background overlays the corresponding Sprite, if set low, the Sprite overlays Background.
/// $D01B Sprite data priority
/// If a bit is set high, the Background overlays the corresponding Sprite, if set low, the Sprite overlays Background.
char SPRITES_PRIORITY;
// $D01C Sprite multicolor
// If a bit is set high, the the corresponding Sprite is a Multicolor-Sprite
/// $D01C Sprite multicolor
/// If a bit is set high, the the corresponding Sprite is a Multicolor-Sprite
char SPRITES_MC;
// $D01D Sprite X expansion
// If a bit is set high, the corresponding Sprite will be stretched horizontally x2
/// $D01D Sprite X expansion
/// If a bit is set high, the corresponding Sprite will be stretched horizontally x2
char SPRITES_EXPAND_X;
// $D01E Sprite-sprite collision
// If two sprites collide, then corresponding Bits involved in the collision are set to high.
/// $D01E Sprite-sprite collision
/// If two sprites collide, then corresponding Bits involved in the collision are set to high.
char SPRITES_COLLISION;
// $D01F Sprite-data collision
// If a sprite collides with the background, then its Bit is set to high.
/// $D01F Sprite-data collision
/// If a sprite collides with the background, then its Bit is set to high.
char SPRITES_BG_COLLISION;
// $D020 Border Color
/// $D020 Border Color
char BORDER_COLOR;
// $D021 Background Color 0
/// $D021 Background Color 0
char BG_COLOR;
// $D022 Background Color 1
/// $D022 Background Color 1
char BG_COLOR1;
// $D023 Background Color 2
/// $D023 Background Color 2
char BG_COLOR2;
// $D024 Background Color 3
/// $D024 Background Color 3
char BG_COLOR3;
// $D025 Sprite multicolor 0
/// $D025 Sprite multicolor 0
char SPRITES_MCOLOR1;
// $D026 Sprite multicolor 1
/// $D026 Sprite multicolor 1
char SPRITES_MCOLOR2;
// $D027 Color Sprite#0
/// $D027 Color Sprite#0
char SPRITE0_COLOR;
// $D028 Color Sprite#1
/// $D028 Color Sprite#1
char SPRITE1_COLOR;
// $D029 Color Sprite#2
/// $D029 Color Sprite#2
char SPRITE2_COLOR;
// $D02a Color Sprite#3
/// $D02a Color Sprite#3
char SPRITE3_COLOR;
// $D02b Color Sprite#4
/// $D02b Color Sprite#4
char SPRITE4_COLOR;
// $D02c Color Sprite#5
/// $D02c Color Sprite#5
char SPRITE5_COLOR;
// $D02d Color Sprite#6
/// $D02d Color Sprite#6
char SPRITE6_COLOR;
// $D02e Color Sprite#7
/// $D02e Color Sprite#7
char SPRITE7_COLOR;
};

View File

@ -1,51 +1,52 @@
/// @file
/// The MOS 6581/8580 SID (Sound Interface Device)
/// http://archive.6502.org/datasheets/mos_6581_sid.pdf
struct MOS6581_SID {
// Channel 1 Frequency
/// Channel 1 Frequency
unsigned int CH1_FREQ;
// Channel 1 Pulse Width (0-4095)
/// Channel 1 Pulse Width (0-4095)
unsigned int CH1_PULSE_WIDTH;
// Channel 1 Control
/// Channel 1 Control
char CH1_CONTROL;
// Channel 1 Attack/decay
/// Channel 1 Attack/decay
char CH1_ATTACK_DECAY;
// Channel 1 Sustain/Release
/// Channel 1 Sustain/Release
char CH1_SUSTAIN_RELEASE;
// Channel 2 Frequency
/// Channel 2 Frequency
unsigned int CH2_FREQ;
// Channel 2 Pulse Width (0-4095)
/// Channel 2 Pulse Width (0-4095)
unsigned int CH2_PULSE_WIDTH;
// Channel 2 Control
/// Channel 2 Control
char CH2_CONTROL;
// Channel 2 Attack/decay
/// Channel 2 Attack/decay
char CH2_ATTACK_DECAY;
// Channel 2 Sustain/Release
/// Channel 2 Sustain/Release
char CH2_SUSTAIN_RELEASE;
// Channel 3 Frequency
/// Channel 3 Frequency
unsigned int CH3_FREQ;
// Channel 3 Pulse Width (0-4095)
/// Channel 3 Pulse Width (0-4095)
unsigned int CH3_PULSE_WIDTH;
// Channel 3 Control
/// Channel 3 Control
char CH3_CONTROL;
// Channel 3 Attack/decay
/// Channel 3 Attack/decay
char CH3_ATTACK_DECAY;
// Channel 3 Sustain/Release
/// Channel 3 Sustain/Release
char CH3_SUSTAIN_RELEASE;
// Filter Cutoff Low
/// Filter Cutoff Low
char FILTER_CUTOFF_LOW;
// Filter Cutoff High
/// Filter Cutoff High
char FILTER_CUTOFF_HIGH;
// Resonance and Filter Setup
/// Resonance and Filter Setup
char FILTER_SETUP;
// Resonance and Filter Setup
/// Resonance and Filter Setup
char VOLUME_FILTER_MODE;
// Potentiometer X
/// Potentiometer X
char POT_X;
// Potentiometer Y
/// Potentiometer Y
char POT_Y;
// Channel 3 Oscillator Value
/// Channel 3 Oscillator Value
char CH3_OSC;
// Channel 3 Envelope Value
/// Channel 3 Envelope Value
char CH3_ENV;
};

View File

@ -1,138 +1,139 @@
/// @file
/// The MOS 7360/8360 TED chip used for graphics and sound in Plus/4 and Commodore 16
/// https://www.karlstechnology.com/commodore/TED7360-datasheet.pdf
/// http://mclauchlan.site.net.au/scott/C=Hacking/C-Hacking12/gfx.html
struct MOS7360_TED {
// Counter #01. It always starts to decrement from the last written value into it.
/// Counter #01. It always starts to decrement from the last written value into it.
unsigned int COUNTER1;
// Counter #02. It runs freely from $ffff.
/// Counter #02. It runs freely from $ffff.
unsigned int COUNTER2;
// Counter #03. Same as above.
/// Counter #03. Same as above.
unsigned int COUNTER3;
// Mostly the same as VIC's $d011.
// Bit 0,1,2 : Vertical smooth-scrolling
// Bit 3 : 24/25 rows screen
// Bit 4 : Blank screen
// Bit 5 : Bitplane mode
// Bit 6 : Enhanced color mode
// Bit 7 : TED's internal test, it should be 0.
/// Mostly the same as VIC's $d011.
/// Bit 0,1,2 : Vertical smooth-scrolling
/// Bit 3 : 24/25 rows screen
/// Bit 4 : Blank screen
/// Bit 5 : Bitplane mode
/// Bit 6 : Enhanced color mode
/// Bit 7 : TED's internal test, it should be 0.
unsigned char CONTROL1;
// Most similar VIC-reg is $d016.
// Bit 0,1,2 : Horizontal smooth-scrolling
// Bit 3 : 40/38 columns screen
// Bit 4 : Multicolor mode
// Bit 5 : TED stop. If set, the TED stops it's counters and screen-generating, only single clock and refresh
// cycles remain.
// Bit 6 : PAL/NTSC. 0:PAL, 1:NTSC
// Bit 7 : Disable reverse mode. If 0, we got 128 characters and higmost bit tells if the character should
// appear in inverse. If set, no inverse mode but 256 characters.
/// Most similar VIC-reg is $d016.
/// Bit 0,1,2 : Horizontal smooth-scrolling
/// Bit 3 : 40/38 columns screen
/// Bit 4 : Multicolor mode
/// Bit 5 : TED stop. If set, the TED stops it's counters and screen-generating, only single clock and refresh
/// cycles remain.
/// Bit 6 : PAL/NTSC. 0:PAL, 1:NTSC
/// Bit 7 : Disable reverse mode. If 0, we got 128 characters and higmost bit tells if the character should
/// appear in inverse. If set, no inverse mode but 256 characters.
unsigned char CONTROL2;
// Keyboard input latch. Giving a strobe - writing to the register, the latch stores the values of the input-lines.
// Then, we can read them from this register.
/// Keyboard input latch. Giving a strobe - writing to the register, the latch stores the values of the input-lines.
/// Then, we can read them from this register.
volatile unsigned char KEYBOARD_INPUT;
// Interrupt request register. When a counter sends want to send an IRQ, it's bit will appear as a 0; then, if the
// IRQ was caused then highmost bit is set.
// Bit 0 : Unused
// Bit 1 : Raster-counter
// Bit 2 : Lightpen. Not implemented.
// Bit 3 : Counter #1
// Bit 4 : Counter #2
// Bit 5 : Unused
// Bit 6 : Counter #3
// Bit 7 : Interrupt occured. This bit is set when an IRQ was enabled and therefore, the IRQ was sent to the
// processor. Physically, this is the negated level of the TED's IRQ output. The IRQ should be
// deleted with writing the register-value back after accepting an interrupt.
/// Interrupt request register. When a counter sends want to send an IRQ, it's bit will appear as a 0; then, if the
/// IRQ was caused then highmost bit is set.
/// Bit 0 : Unused
/// Bit 1 : Raster-counter
/// Bit 2 : Lightpen. Not implemented.
/// Bit 3 : Counter #1
/// Bit 4 : Counter #2
/// Bit 5 : Unused
/// Bit 6 : Counter #3
/// Bit 7 : Interrupt occured. This bit is set when an IRQ was enabled and therefore, the IRQ was sent to the
/// processor. Physically, this is the negated level of the TED's IRQ output. The IRQ should be
/// deleted with writing the register-value back after accepting an interrupt.
unsigned char IRQ_REQUEST;
// Interrupt mask register. These bits could be used to disable and enable interrupt-sources. When a place is set to
// 1, that will be able to cause an interrupt to the processor. If not, the sign of the interrupt request will only
// be appear in the above register.
// Bit 0 : 9th bit of RASTER_IRQ (see there)
// Bit 1 : Raster-counter
// Bit 2 : Lightpen. Not implemented.
// Bit 3 : Counter #1
// Bit 4 : Counter #2
// Bit 5 : Unused
// Bit 6 : Counter #3
// Bit 7 : Unused
/// Interrupt mask register. These bits could be used to disable and enable interrupt-sources. When a place is set to
/// 1, that will be able to cause an interrupt to the processor. If not, the sign of the interrupt request will only
/// be appear in the above register.
/// Bit 0 : 9th bit of RASTER_IRQ (see there)
/// Bit 1 : Raster-counter
/// Bit 2 : Lightpen. Not implemented.
/// Bit 3 : Counter #1
/// Bit 4 : Counter #2
/// Bit 5 : Unused
/// Bit 6 : Counter #3
/// Bit 7 : Unused
unsigned char IRQ_MASK;
// Raster interrupt register. Same as $d012 when writing; it stores the position of occuring raster interrupt.
// Higmost bit is in IRQ_REQUEST's 0. bit.
/// Raster interrupt register. Same as $d012 when writing; it stores the position of occuring raster interrupt.
/// Higmost bit is in IRQ_REQUEST's 0. bit.
unsigned char RASTER_IRQ;
// Hardware-cursor position (10 bits). Lower bits: CURSOR_LO, higher 2 bits in CURSOR_HI's 0. and 1. places.
// Beyond 1000 the cursor is not seeable.
/// Hardware-cursor position (10 bits). Lower bits: CURSOR_LO, higher 2 bits in CURSOR_HI's 0. and 1. places.
/// Beyond 1000 the cursor is not seeable.
unsigned char CURSOR_HI;
unsigned char CURSOR_LO;
// First sound-source's frq-value's lowmost 8 bit. More 2 bits are in $ff10's 0. and 1. places.
/// First sound-source's frq-value's lowmost 8 bit. More 2 bits are in $ff10's 0. and 1. places.
unsigned char CH1_FREQ_LO;
// Second sound-source, lowmost 8 bits. More 2 bits in $ff12, 0. and 1. places.
// The sound register-value can be calculated as
// reg=1024-(111860.781/frq[Hz]) (NTSC)
// reg=1024-(111840.45 /frq[Hz]) (PAL)
/// Second sound-source, lowmost 8 bits. More 2 bits in $ff12, 0. and 1. places.
/// The sound register-value can be calculated as
/// reg=1024-(111860.781/frq[Hz]) (NTSC)
/// reg=1024-(111840.45 /frq[Hz]) (PAL)
unsigned char CH2_FREQ_LO;
// First sound-source, higmost 2 bits. 2-7 bits are unused.
/// First sound-source, higmost 2 bits. 2-7 bits are unused.
unsigned char CH1_FREQ_HI;
// Sound control register.
// Bit 0-3 : Volume. Maximum value is 8.
// Bit 4 : Sound #1 on/off. (implicit squarewave)
// Bit 5 : Sound #2 squarewave on/off.
// Bit 6 : Sound #2 noise on/off. If You set both, the square will sound.
// Bit 7 : D/A mode. See above for more.
/// Sound control register.
/// Bit 0-3 : Volume. Maximum value is 8.
/// Bit 4 : Sound #1 on/off. (implicit squarewave)
/// Bit 5 : Sound #2 squarewave on/off.
/// Bit 6 : Sound #2 noise on/off. If You set both, the square will sound.
/// Bit 7 : D/A mode. See above for more.
unsigned char SOUND_CONTROL;
// Bitmap Address and Miscellaneous Control
// Bit 0,1 : 2nd sound-source, highmost bits.
// Bit 2 : Character generator in ROM or RAM. When set, TED will enable ROM when trying to get data from the
// charactergenerator to build screen. Else, it will give out control-signals to the DRAM's.
// Bit 3,4,5 : These bits tell, where to find bitplane in the memory when using bitplane-mode. TED assumes them
// as A15,A14 and A13 bits. So, the bitplanes can be switched as 8K pages, anywhere in the 64K.
// Bit 6-7 : Unused.
/// Bitmap Address and Miscellaneous Control
/// Bit 0,1 : 2nd sound-source, highmost bits.
/// Bit 2 : Character generator in ROM or RAM. When set, TED will enable ROM when trying to get data from the
/// charactergenerator to build screen. Else, it will give out control-signals to the DRAM's.
/// Bit 3,4,5 : These bits tell, where to find bitplane in the memory when using bitplane-mode. TED assumes them
/// as A15,A14 and A13 bits. So, the bitplanes can be switched as 8K pages, anywhere in the 64K.
/// Bit 6-7 : Unused.
unsigned char MEMORY1;
// Character Description Map Address and Miscellaneous Control
// Bit 0 : A sign to having control about memory paging. This bit always sets to 1 when ROM is active over
// $8000. Else, it will be 0. READ ONLY.
// Bit 1 : Force single clock mode. Then, TED will disable to generate twice clock.
// Bit 2-7 : Charactergenerator. Bit 7 corresponds to A15, 6 to A14 and so on. This value shows and sets the
// start of the charactergenerator. It can be paged as $400 bytes. Use with addition of CONTROL3-2.bit.
/// Character Description Map Address and Miscellaneous Control
/// Bit 0 : A sign to having control about memory paging. This bit always sets to 1 when ROM is active over
/// $8000. Else, it will be 0. READ ONLY.
/// Bit 1 : Force single clock mode. Then, TED will disable to generate twice clock.
/// Bit 2-7 : Charactergenerator. Bit 7 corresponds to A15, 6 to A14 and so on. This value shows and sets the
/// start of the charactergenerator. It can be paged as $400 bytes. Use with addition of CONTROL3-2.bit.
unsigned char MEMORY2;
// Screen Matrix address
// Bit 0-2 : Unused
// Bit 3-7 : Start of the video-ram. Bit 7 also corresponds to the A15 line as above. So, video-ram is mappable
// as $800 bytes - 2K. The above $ff12-2.bit doesn't affect this, but the actual RAM/ROM mapping
// (see at $ff3e/$ff3f and $ff13/0) does.
/// Screen Matrix address
/// Bit 0-2 : Unused
/// Bit 3-7 : Start of the video-ram. Bit 7 also corresponds to the A15 line as above. So, video-ram is mappable
/// as $800 bytes - 2K. The above $ff12-2.bit doesn't affect this, but the actual RAM/ROM mapping
/// (see at $ff3e/$ff3f and $ff13/0) does.
unsigned char MEMORY3;
// Background Color. Lower bits contain color-code, higher 3 luminance and highmost is ignored.
/// Background Color. Lower bits contain color-code, higher 3 luminance and highmost is ignored.
unsigned char BG_COLOR;
// Color register 1. Used in ECM and MCM modes.
/// Color register 1. Used in ECM and MCM modes.
unsigned char BG_COLOR1;
// Color register 2. Used in ECM and MCM modes.
/// Color register 2. Used in ECM and MCM modes.
unsigned char BG_COLOR2;
// Color register 3. Used in ECM and MCM modes.
/// Color register 3. Used in ECM and MCM modes.
unsigned char BG_COLOR3;
// Border Color. Lower bits contain color-code, higher 3 luminance and higmost is ignored.
/// Border Color. Lower bits contain color-code, higher 3 luminance and higmost is ignored.
unsigned char BORDER_COLOR;
// Actual character-position. TED counts the characters that it had fetched and put out to the screen.
// Lower bits: CHARPOS_LO, higher 2 bits in CHARPOS_HI's 0. and 1. places.
// The number is increasing by 40 after every characterline (8 rasterline).
/// Actual character-position. TED counts the characters that it had fetched and put out to the screen.
/// Lower bits: CHARPOS_LO, higher 2 bits in CHARPOS_HI's 0. and 1. places.
/// The number is increasing by 40 after every characterline (8 rasterline).
unsigned char CHARPOS_HI;
unsigned char CHARPOS_LO;
// Actual position of vertical scanning. Higmost bit is in $ff1c. Read/Writeable!
/// Actual position of vertical scanning. Higmost bit is in $ff1c. Read/Writeable!
unsigned char RASTER_HI;
unsigned char RASTER_LO;
// Actual position of horizontal scanning. R/W!. Lowmost bit is unused. It contains the TED's internal counter's
// highmost 8 bits. So, it increases 4 with every character. When writing, it seems to put the value to a
// functionally different register (writing back a reading value in right time affects the screen).
/// Actual position of horizontal scanning. R/W!. Lowmost bit is unused. It contains the TED's internal counter's
/// highmost 8 bits. So, it increases 4 with every character. When writing, it seems to put the value to a
/// functionally different register (writing back a reading value in right time affects the screen).
unsigned char HSCAN_POS;
// Bit 0,1,2 : Actual vertical scanning-line in a character-row. R/W!.
// Bit 3-6 : Flashing counter. It's value increases with every frame, and TED fits it's flashing feature to this
// register's reaching to 15.
// Bit 7 : Unused
/// Bit 0,1,2 : Actual vertical scanning-line in a character-row. R/W!.
/// Bit 3-6 : Flashing counter. It's value increases with every frame, and TED fits it's flashing feature to this
/// register's reaching to 15.
/// Bit 7 : Unused
unsigned char VSCAN_POS;
// Unused address space
/// Unused address space
unsigned char UNUSED[0x1d];
// Switching to ROM. A writing statement to this address will cause to turn on the ROM between $8000-$ffff. It's an
// other matter, which one; this time, only sure thing that it'll give CS signals instead of RAS', CAS' and MUX.
// See $ff13/0 and $ff14
/// Switching to ROM. A writing statement to this address will cause to turn on the ROM between $8000-$ffff. It's an
/// other matter, which one; this time, only sure thing that it'll give CS signals instead of RAS', CAS' and MUX.
/// See $ff13/0 and $ff14
unsigned char ROM_SWITCH;
// Switching to RAM. The opposite of ROM_SWITCH.
/// Switching to RAM. The opposite of ROM_SWITCH.
unsigned char RAM_SWITCH;
};

View File

@ -1,18 +1,19 @@
/// @file
/// MOS 7501/8501 MICROPROCESSOR
/// https://en.wikipedia.org/wiki/MOS_Technology_6510
/// The processor port of the MOS 7501 CPU
/// http://hackjunk.com/2017/06/23/commodore-16-plus-4-8501-to-6510-cpu-conversion/
struct MOS7501_PORT {
// The data direction of the port
/// The data direction of the port
char DDR;
// The on-chip processor port
// P0: SER DAT OUT
// P1: SER CLK OUT / CASS WRT
// P2: SER ATN OUT
// P3: CASS MOTOR
// P4: CASS READ
// P6: SER CLK IN
// P7: SER DAT IN
/// The on-chip processor port
/// P0: SER DAT OUT
/// P1: SER CLK OUT / CASS WRT
/// P2: SER ATN OUT
/// P3: CASS MOTOR
/// P4: CASS READ
/// P6: SER CLK IN
/// P7: SER DAT IN
char PORT;
};

View File

@ -1,3 +1,4 @@
/// @file
/// Simple binary multiplication implementation
/// Perform binary multiplication of two unsigned 8-bit chars into a 16-bit unsigned int

View File

@ -1,3 +1,4 @@
/// @file
/// Nintendo Entertainment System (NES
/// https://en.wikipedia.org/wiki/Nintendo_Entertainment_System_(Model_NES-101)
/// https://github.com/gregkrsak/first_nes

View File

@ -1,3 +1,4 @@
/// @file
/// PEEK and POKE macros for those who want to write BASIC code in C
/// Based on https://github.com/cc65/cc65/blob/master/include/peekpoke.h

View File

@ -1,3 +1,4 @@
/// @file
/// Plus/4 / Commodore 16 registers and memory layout
/// http://zimmers.net/anonftp/pub/cbm/schematics/computers/plus4/264_Hardware_Spec.pdf
/// http://www.zimmers.net/anonftp/pub/cbm/schematics/computers/plus4/Plus_4_Technical_Docs.pdf
@ -36,19 +37,19 @@ struct MOS6529_PIO * const KEYBOARD_PORT = (struct MOS6529_PIO *)0xfd30;
/// The ROM configuration is adjusted by writing to the registers (the value is irrelevant).
/// The upper portion of the kernal ROM at $FC00-$FCFF is always enabled no matter what the memory configuration, as are the I/O registers.
struct PLUS4_ROM_BANKING {
// $FDD0 enables or disables BASIC,
/// $FDD0 enables or disables BASIC,
char BASIC;
// $FDD1 the low function ROM,
/// $FDD1 the low function ROM,
char FUNCTION_LOW;
// $FDD2 the low cartridge ROM,
/// $FDD2 the low cartridge ROM,
char CARTRIDGE_LOW;
// $FDD3 is unused,
/// $FDD3 is unused,
char UNUSED;
// $FDD4 the kernal,
/// $FDD4 the kernal,
char KERNAL;
// $FDD5 the high function ROM
/// $FDD5 the high function ROM
char FUNCTION_HIGH;
// $FDD6 the high cartridge ROM.
/// $FDD6 the high cartridge ROM.
char CARTRIDGE_HIGH;
};

View File

@ -1,3 +1,4 @@
/// @file
/// Functions for printing formatted strings
#include <stdlib.h>
#include <conio.h>
@ -12,25 +13,25 @@ void printf_padding(char pad, char length);
/// Format specifying how to format a printed number
struct printf_format_number {
// The minimal number of chars to output (used for padding with spaces or 0)
/// The minimal number of chars to output (used for padding with spaces or 0)
char min_length;
// Justify left instead of right, which is the default.
/// Justify left instead of right, which is the default.
char justify_left;
// Always show a sign for a number, even if is is positive. (Default is to only show sign for negative numbers)
/// Always show a sign for a number, even if is is positive. (Default is to only show sign for negative numbers)
char sign_always;
// Pad the number with zeros to get the min width
/// Pad the number with zeros to get the min width
char zero_padding;
// Upper-case the letters in the number
/// Upper-case the letters in the number
char upper_case;
// The number radix to use for formatting
/// The number radix to use for formatting
enum RADIX radix;
};
/// Buffer used for stringified number being printed
struct printf_buffer_number {
// Sign used for printing numbers (0 if no sign, '-' if a minus-sign, '+' if a plus-sign)
/// Sign used for printing numbers (0 if no sign, '-' if a minus-sign, '+' if a plus-sign)
char sign;
// The buffer used for the digits. Size is chosen because it fits LONG_MAX in octal.
/// The buffer used for the digits. Size is chosen because it fits LONG_MAX in octal.
char digits[11];
};
@ -58,9 +59,9 @@ void printf_number_buffer(struct printf_buffer_number buffer, struct printf_form
/// Format specifying how to format a printed string
struct printf_format_string {
// The minimal number of chars to output (used for padding with spaces or 0).
/// The minimal number of chars to output (used for padding with spaces or 0).
char min_length;
// Justify left instead of right, which is the default.
/// Justify left instead of right, which is the default.
char justify_left;
};

View File

@ -1,3 +1,4 @@
/// @file
/// Ricoh 2A03 Nintendo Entertainment System CPU and audio processing unit (APU)
/// Ricoh 2A03 or RP2A03 (NTSC version) / Ricoh 2A07 or RP2A07 (PAL version)
/// https://en.wikipedia.org/wiki/Ricoh_2A03
@ -9,99 +10,99 @@
/// The APU (Audio Processing Unit) is the sound hardware the NES console which generates sound.
struct RICOH_2A03 {
// APU Square wave channels 1 and 2
// Reference: https://wiki.nesdev.com/w/index.php/APU_Pulse
// Duty and volume for square wave 1
// $4000 SQ1_VOL Duty and volume for square wave 1
/// APU Square wave channels 1 and 2
/// Reference: https://wiki.nesdev.com/w/index.php/APU_Pulse
/// Duty and volume for square wave 1
/// $4000 SQ1_VOL Duty and volume for square wave 1
char SQ1_VOL;
// $4001 SQ1_SWEEP Sweep control register for square wave 1
/// $4001 SQ1_SWEEP Sweep control register for square wave 1
char SQ1_SWEEP;
// $4002 SQ1_LO Low byte of period for square wave 1
/// $4002 SQ1_LO Low byte of period for square wave 1
char SQ1_LO;
// $4003 SQ1_HI High byte of period and length counter value for square wave 1
/// $4003 SQ1_HI High byte of period and length counter value for square wave 1
char SQ1_HI;
// $4004 SQ2_VOL Duty and volume for square wave 2
/// $4004 SQ2_VOL Duty and volume for square wave 2
char SQ2_VOL;
// $4005 SQ2_SWEEP Sweep control register for square wave 2
/// $4005 SQ2_SWEEP Sweep control register for square wave 2
char SQ2_SWEEP;
// $4006 SQ2_LO Low byte of period for square wave 2
/// $4006 SQ2_LO Low byte of period for square wave 2
char SQ2_LO;
// $4007 SQ2_HI High byte of period and length counter value for square wave 2
/// $4007 SQ2_HI High byte of period and length counter value for square wave 2
char SQ2_HI;
// APU Triangle wave channel
// Reference: https://wiki.nesdev.com/w/index.php/APU_Triangle
// $4008 TRI_LINEAR Triangle wave linear counter
/// APU Triangle wave channel
/// Reference: https://wiki.nesdev.com/w/index.php/APU_Triangle
/// $4008 TRI_LINEAR Triangle wave linear counter
char TRI_LINEAR;
// $4009 Unused, but is eventually accessed in memory-clearing loops
/// $4009 Unused, but is eventually accessed in memory-clearing loops
char UNUSED1;
// $400A TRI_LO Low byte of period for triangle wave
/// $400A TRI_LO Low byte of period for triangle wave
char TRI_LO;
// $400B TRI_HI High byte of period and length counter value for triangle wave
/// $400B TRI_HI High byte of period and length counter value for triangle wave
char TRI_HI;
// APU Noise generator
// Reference: https://wiki.nesdev.com/w/index.php/APU_Noise
// $400C NOISE_VOL Volume for noise generator
/// APU Noise generator
/// Reference: https://wiki.nesdev.com/w/index.php/APU_Noise
/// $400C NOISE_VOL Volume for noise generator
char NOISE_VOL;
// $400D Unused, but is eventually accessed in memory-clearing loops
/// $400D Unused, but is eventually accessed in memory-clearing loops
char UNUSED2;
// $400E NOISE_LO Period and waveform shape for noise generator
/// $400E NOISE_LO Period and waveform shape for noise generator
char NOISE_LO;
// $400F NOISE_HI Length counter value for noise generator
/// $400F NOISE_HI Length counter value for noise generator
char NOISE_HI;
// APU Delta Modulation Channel
// Reference: https://wiki.nesdev.com/w/index.php/APU_DMC
// ------+-----+---------------------------------------------------------------
// $4010 | W | DMC_FREQ Play mode FLAGS and frequency for DMC samples
// ------+-----+---------------------------------------------------------------
// | 7 | IRQ enabled flag. If clear, the interrupt flag is cleared.
// | 6 | Loop flag
// | 3-0 | Rate index
// ------+-----+---------------------------------------------------------------
// Rate $0 $1 $2 $3 $4 $5 $6 $7 $8 $9 $A $B $C $D $E $F
// ------------------------------------------------------------------------------
// NTSC 428, 380, 340, 320, 286, 254, 226, 214, 190, 160, 142, 128, 106, 84, 72, 54
// PAL 398, 354, 316, 298, 276, 236, 210, 198, 176, 148, 132, 118, 98, 78, 66, 50
/// APU Delta Modulation Channel
/// Reference: https://wiki.nesdev.com/w/index.php/APU_DMC
/// ------+-----+---------------------------------------------------------------
/// $4010 | W | DMC_FREQ Play mode FLAGS and frequency for DMC samples
/// ------+-----+---------------------------------------------------------------
/// | 7 | IRQ enabled flag. If clear, the interrupt flag is cleared.
/// | 6 | Loop flag
/// | 3-0 | Rate index
/// ------+-----+---------------------------------------------------------------
/// Rate $0 $1 $2 $3 $4 $5 $6 $7 $8 $9 $A $B $C $D $E $F
/// ------------------------------------------------------------------------------
/// NTSC 428, 380, 340, 320, 286, 254, 226, 214, 190, 160, 142, 128, 106, 84, 72, 54
/// PAL 398, 354, 316, 298, 276, 236, 210, 198, 176, 148, 132, 118, 98, 78, 66, 50
//
// The rate determines for how many CPU cycles happen between changes in the output level during automatic delta-encoded sample playback.
// For example, on NTSC (1.789773 MHz), a rate of 428 gives a frequency of 1789773/428 Hz = 4181.71 Hz.
// These periods are all even numbers because there are 2 CPU cycles in an APU cycle. A rate of 428 means the output level changes every 214 APU cycles.
/// The rate determines for how many CPU cycles happen between changes in the output level during automatic delta-encoded sample playback.
/// For example, on NTSC (1.789773 MHz), a rate of 428 gives a frequency of 1789773/428 Hz = 4181.71 Hz.
/// These periods are all even numbers because there are 2 CPU cycles in an APU cycle. A rate of 428 means the output level changes every 214 APU cycles.
char DMC_FREQ;
// $4011 DMC_RAW 7-bit DAC
/// $4011 DMC_RAW 7-bit DAC
char DMC_RAW;
// $4012 DMC_START Start of DMC waveform is at address $C000 + $40*$xx
/// $4012 DMC_START Start of DMC waveform is at address $C000 + $40*$xx
char DMC_START;
// $4013 DMC_LEN Length of DMC waveform is $10*$xx + 1 bytes (128*$xx + 8 samples)
/// $4013 DMC_LEN Length of DMC waveform is $10*$xx + 1 bytes (128*$xx + 8 samples)
char DMC_LEN;
// $4014 OAMDMA Writing $xx copies 256 bytes by reading from $xx00-$xxFF and writing to OAMDATA ($2004). The CPU is suspended while the transfer is taking place.
// Reference: https://wiki.nesdev.com/w/index.php/PPU_registers#OAMDMA
/// $4014 OAMDMA Writing $xx copies 256 bytes by reading from $xx00-$xxFF and writing to OAMDATA ($2004). The CPU is suspended while the transfer is taking place.
/// Reference: https://wiki.nesdev.com/w/index.php/PPU_registers#OAMDMA
char OAMDMA;
// ------+-----+---------------------------------------------------------------
// $4015 | W | Sound Channel Switch
// | 0 | Channel 1, 1 = enable sound.
// | 1 | Channel 2, 1 = enable sound.
// | 2 | Channel 3, 1 = enable sound.
// | 3 | Channel 4, 1 = enable sound.
// | 4 | Channel 5, 1 = enable sound.
// | 5-7 | Unused (???)
// ------+-----+---------------------------------------------------------------
// $4015 SND_CHN Sound channels enable and status
// Reference: https://wiki.nesdev.com/w/index.php/APU#Status_.28.244015.29
/// ------+-----+---------------------------------------------------------------
/// $4015 | W | Sound Channel Switch
/// | 0 | Channel 1, 1 = enable sound.
/// | 1 | Channel 2, 1 = enable sound.
/// | 2 | Channel 3, 1 = enable sound.
/// | 3 | Channel 4, 1 = enable sound.
/// | 4 | Channel 5, 1 = enable sound.
/// | 5-7 | Unused (???)
/// ------+-----+---------------------------------------------------------------
/// $4015 SND_CHN Sound channels enable and status
/// Reference: https://wiki.nesdev.com/w/index.php/APU#Status_.28.244015.29
char SND_CHN;
// ------+-----+---------------------------------------------------------------
// $4016 | W | JOY1 Joystick 1 data (R) and joystick strobe (W)
// | 0 | Controller port latch bit
// | 1-2 | Expansion port latch bits
// ------+-----+---------------------------------------------------------------
// $4016 | R | JOY1 Joystick 1 data (R) and joystick strobe (W)
// | 0-4 | Input data lines /D4 D3 D2 D1 D0) controller port 1
// ------+-----+---------------------------------------------------------------
// https://wiki.nesdev.com/w/index.php/Input_devices
// https://wiki.nesdev.com/w/index.php/Controller_reading
/// ------+-----+---------------------------------------------------------------
/// $4016 | W | JOY1 Joystick 1 data (R) and joystick strobe (W)
/// | 0 | Controller port latch bit
/// | 1-2 | Expansion port latch bits
/// ------+-----+---------------------------------------------------------------
/// $4016 | R | JOY1 Joystick 1 data (R) and joystick strobe (W)
/// | 0-4 | Input data lines /D4 D3 D2 D1 D0) controller port 1
/// ------+-----+---------------------------------------------------------------
/// https://wiki.nesdev.com/w/index.php/Input_devices
/// https://wiki.nesdev.com/w/index.php/Controller_reading
char JOY1;
// ------+-----+---------------------------------------------------------------
// $4017 | R | JOY2 Joystick 2 data (R) and frame counter control (W)
// | 0-4 | Input data lines /D4 D3 D2 D1 D0) controller port 2
// ------+-----+---------------------------------------------------------------
/// ------+-----+---------------------------------------------------------------
/// $4017 | R | JOY2 Joystick 2 data (R) and frame counter control (W)
/// | 0-4 | Input data lines /D4 D3 D2 D1 D0) controller port 2
/// ------+-----+---------------------------------------------------------------
char JOY2;
};

View File

@ -1,3 +1,4 @@
/// @file
/// Ricoh 2C02 - NES Picture Processing Unit (PPU)
/// Ricoh RP2C02 (NTSC version) / RP2C07 (PAL version),
/// https://en.wikipedia.org/wiki/Picture_Processing_Unit
@ -32,107 +33,107 @@ char * const PPU_PALETTE = (char*)0x3f00;
/// $3f20-$3fff $00e0 Mirrors of $3f00-$3f1f
struct RICOH_2C02 {
// ------+-----+---------------------------------------------------------------
// $2000 | RW | PPU Control Register 1
// | 0-1 | Name Table Address:
// | |
// | | +-----------+-----------+
// | | | 2 ($2800) | 3 ($2C00) |
// | | +-----------+-----------+
// | | | 0 ($2000) | 1 ($2400) |
// | | +-----------+-----------+
// | |
// | | Remember that because of the mirroring there are only 2
// | | real Name Tables, not 4. Also, PPU will automatically
// | | switch to another Name Table when running off the current
// | | Name Table during scroll (see picture above).
// | 2 | Vertical Write, 1 = PPU memory address increments by 32:
// | |
// | | Name Table, VW=0 Name Table, VW=1
// | | +----------------+ +----------------+
// | | |----> write | | | write |
// | | | | | V |
// | |
// | 3 | Sprite Pattern Table Address, 1 = $1000, 0 = $0000.
// | 4 | Screen Pattern Table Address, 1 = $1000, 0 = $0000.
// | 5 | Sprite Size, 1 = 8x16, 0 = 8x8.
// | 6 | PPU Master/Slave Mode, not used in NES.
// | 7 | VBlank Enable, 1 = generate interrupts on VBlank.
// ------+-----+---------------------------------------------------------------
char PPUCTRL; // Reference: https://wiki.nesdev.com/w/index.php/PPU_registers#PPUCTRL
// ------+-----+---------------------------------------------------------------
// $2001 | RW | PPU Control Register 2
// | 0 | Unknown (???)
// | 1 | Image Mask, 0 = don't show left 8 columns of the screen.
// | 2 | Sprite Mask, 0 = don't show sprites in left 8 columns.
// | 3 | Screen Enable, 1 = show picture, 0 = blank screen.
// | 4 | Sprites Enable, 1 = show sprites, 0 = hide sprites.
// | 5-7 | Background Color, 0 = black, 1 = blue, 2 = green, 4 = red.
// | | Do not use any other numbers as you may damage PPU hardware.
// ------+-----+---------------------------------------------------------------
char PPUMASK; // Reference: https://wiki.nesdev.com/w/index.php/PPU_registers#PPUMASK
// ------+-----+---------------------------------------------------------------
// $2002 | R | PPU Status Register
// | 0-5 | Unknown (???)
// | 6 | Hit Flag, 1 = Sprite refresh has hit sprite #0.
// | | This flag resets to 0 when screen refresh starts.
// | 7 | VBlank Flag, 1 = PPU is in VBlank state.
// | | This flag resets to 0 when VBlank ends or CPU reads $2002.
// ------+-----+---------------------------------------------------------------
volatile char PPUSTATUS; // Reference: https://wiki.nesdev.com/w/index.php/PPU_registers#PPUSTATUS
// The OAM (Object Attribute Memory) is internal memory inside the PPU that contains a lookup table
// of up to 64 sprites, where each table entry consists of 4 bytes.
// ------+-----+---------------------------------------------------------------
// $2003 | W | Sprite Memory Address
// | | Used to set the address of the 256-byte Sprite Memory to be
// | | accessed via $2004. This address will increment by 1 after
// | | each access to $2004. Sprite Memory contains coordinates,
// | | colors, and other sprite attributes.
// ------+-----+---------------------------------------------------------------
char OAMADDR; // Reference: https://wiki.nesdev.com/w/index.php/PPU_registers#OAMADDR
// ------+-----+---------------------------------------------------------------
// $2004 | RW | Sprite Memory Data
// | | Used to read/write the Sprite Memory. The address is set via
// | | $2003 and increments by 1 after each access. Sprite Memory
// | | contains coordinates, colors, and other sprite attributes
// | | sprites.
// ------+-----+---------------------------------------------------------------
char OAMDATA; // Reference: https://wiki.nesdev.com/w/index.php/PPU_registers#OAMDATA
// ------+-----+---------------------------------------------------------------
// $2005 | W | Screen Scroll Offsets
// | | There are two scroll registers, vertical and horizontal,
// | | which are both written via this port. The first value written
// | | will go into the Vertical Scroll Register (unless it is >239,
// | | then it will be ignored). The second value will appear in the
// | | Horizontal Scroll Register. Name Tables are assumed to be
// | | arranged in the following way:
// | |
// | | +-----------+-----------+
// | | | 2 ($2800) | 3 ($2C00) |
// | | +-----------+-----------+
// | | | 0 ($2000) | 1 ($2400) |
// | | +-----------+-----------+
// | |
// | | When scrolled, the picture may span over several Name Tables.
// | | Remember that because of the mirroring there are only 2 real
// | | Name Tables, not 4.
// ------+-----+---------------------------------------------------------------
char PPUSCROLL; // Reference: https://wiki.nesdev.com/w/index.php/PPU_registers#PPUSCROLL
// ------+-----+---------------------------------------------------------------
// $2006 | W | PPU Memory Address
// | | Used to set the address of PPU Memory to be accessed via
// | | $2007. The first write to this register will set 8 lower
// | | address bits. The second write will set 6 upper bits. The
// | | address will increment either by 1 or by 32 after each
// | | access to $2007.
// ------+-----+---------------------------------------------------------------
char PPUADDR; // Reference: https://wiki.nesdev.com/w/index.php/PPU_registers#PPUADDR
// ------+-----+---------------------------------------------------------------
// $2007 | RW | PPU Memory Data
// | | Used to read/write the PPU Memory. The address is set via
// | | $2006 and increments after each access, either by 1 or by 32.
// ------+-----+---------------------------------------------------------------
char PPUDATA; // Reference: https://wiki.nesdev.com/w/index.php/PPU_registers#PPUDATA
/// ------+-----+---------------------------------------------------------------
/// $2000 | RW | PPU Control Register 1
/// | 0-1 | Name Table Address:
/// | |
/// | | +-----------+-----------+
/// | | | 2 ($2800) | 3 ($2C00) |
/// | | +-----------+-----------+
/// | | | 0 ($2000) | 1 ($2400) |
/// | | +-----------+-----------+
/// | |
/// | | Remember that because of the mirroring there are only 2
/// | | real Name Tables, not 4. Also, PPU will automatically
/// | | switch to another Name Table when running off the current
/// | | Name Table during scroll (see picture above).
/// | 2 | Vertical Write, 1 = PPU memory address increments by 32:
/// | |
/// | | Name Table, VW=0 Name Table, VW=1
/// | | +----------------+ +----------------+
/// | | |----> write | | | write |
/// | | | | | V |
/// | |
/// | 3 | Sprite Pattern Table Address, 1 = $1000, 0 = $0000.
/// | 4 | Screen Pattern Table Address, 1 = $1000, 0 = $0000.
/// | 5 | Sprite Size, 1 = 8x16, 0 = 8x8.
/// | 6 | PPU Master/Slave Mode, not used in NES.
/// | 7 | VBlank Enable, 1 = generate interrupts on VBlank.
/// ------+-----+---------------------------------------------------------------
char PPUCTRL; /// Reference: https://wiki.nesdev.com/w/index.php/PPU_registers#PPUCTRL
/// ------+-----+---------------------------------------------------------------
/// $2001 | RW | PPU Control Register 2
/// | 0 | Unknown (???)
/// | 1 | Image Mask, 0 = don't show left 8 columns of the screen.
/// | 2 | Sprite Mask, 0 = don't show sprites in left 8 columns.
/// | 3 | Screen Enable, 1 = show picture, 0 = blank screen.
/// | 4 | Sprites Enable, 1 = show sprites, 0 = hide sprites.
/// | 5-7 | Background Color, 0 = black, 1 = blue, 2 = green, 4 = red.
/// | | Do not use any other numbers as you may damage PPU hardware.
/// ------+-----+---------------------------------------------------------------
char PPUMASK; /// Reference: https://wiki.nesdev.com/w/index.php/PPU_registers#PPUMASK
/// ------+-----+---------------------------------------------------------------
/// $2002 | R | PPU Status Register
/// | 0-5 | Unknown (???)
/// | 6 | Hit Flag, 1 = Sprite refresh has hit sprite #0.
/// | | This flag resets to 0 when screen refresh starts.
/// | 7 | VBlank Flag, 1 = PPU is in VBlank state.
/// | | This flag resets to 0 when VBlank ends or CPU reads $2002.
/// ------+-----+---------------------------------------------------------------
volatile char PPUSTATUS; /// Reference: https://wiki.nesdev.com/w/index.php/PPU_registers#PPUSTATUS
/// The OAM (Object Attribute Memory) is internal memory inside the PPU that contains a lookup table
/// of up to 64 sprites, where each table entry consists of 4 bytes.
/// ------+-----+---------------------------------------------------------------
/// $2003 | W | Sprite Memory Address
/// | | Used to set the address of the 256-byte Sprite Memory to be
/// | | accessed via $2004. This address will increment by 1 after
/// | | each access to $2004. Sprite Memory contains coordinates,
/// | | colors, and other sprite attributes.
/// ------+-----+---------------------------------------------------------------
char OAMADDR; /// Reference: https://wiki.nesdev.com/w/index.php/PPU_registers#OAMADDR
/// ------+-----+---------------------------------------------------------------
/// $2004 | RW | Sprite Memory Data
/// | | Used to read/write the Sprite Memory. The address is set via
/// | | $2003 and increments by 1 after each access. Sprite Memory
/// | | contains coordinates, colors, and other sprite attributes
/// | | sprites.
/// ------+-----+---------------------------------------------------------------
char OAMDATA; /// Reference: https://wiki.nesdev.com/w/index.php/PPU_registers#OAMDATA
/// ------+-----+---------------------------------------------------------------
/// $2005 | W | Screen Scroll Offsets
/// | | There are two scroll registers, vertical and horizontal,
/// | | which are both written via this port. The first value written
/// | | will go into the Vertical Scroll Register (unless it is >239,
/// | | then it will be ignored). The second value will appear in the
/// | | Horizontal Scroll Register. Name Tables are assumed to be
/// | | arranged in the following way:
/// | |
/// | | +-----------+-----------+
/// | | | 2 ($2800) | 3 ($2C00) |
/// | | +-----------+-----------+
/// | | | 0 ($2000) | 1 ($2400) |
/// | | +-----------+-----------+
/// | |
/// | | When scrolled, the picture may span over several Name Tables.
/// | | Remember that because of the mirroring there are only 2 real
/// | | Name Tables, not 4.
/// ------+-----+---------------------------------------------------------------
char PPUSCROLL; /// Reference: https://wiki.nesdev.com/w/index.php/PPU_registers#PPUSCROLL
/// ------+-----+---------------------------------------------------------------
/// $2006 | W | PPU Memory Address
/// | | Used to set the address of PPU Memory to be accessed via
/// | | $2007. The first write to this register will set 8 lower
/// | | address bits. The second write will set 6 upper bits. The
/// | | address will increment either by 1 or by 32 after each
/// | | access to $2007.
/// ------+-----+---------------------------------------------------------------
char PPUADDR; /// Reference: https://wiki.nesdev.com/w/index.php/PPU_registers#PPUADDR
/// ------+-----+---------------------------------------------------------------
/// $2007 | RW | PPU Memory Data
/// | | Used to read/write the PPU Memory. The address is set via
/// | | $2006 and increments after each access, either by 1 or by 32.
/// ------+-----+---------------------------------------------------------------
char PPUDATA; /// Reference: https://wiki.nesdev.com/w/index.php/PPU_registers#PPUDATA
};
/// PPU Status Register for reading in ASM

View File

@ -1,3 +1,4 @@
/// @file
/// Sine Generator functions using only multiplication, addition and bit shifting
/// Uses a single division for converting the wavelength to a reciprocal.
/// Generates sine using the series sin(x) = x - x^/3! + x^-5! - x^7/7! ...

View File

@ -1,3 +1,4 @@
/// @file
/// Table-based implementation of integer square sqr() and square root sqrt()
/// Initialize squares table

View File

@ -1,3 +1,4 @@
/// @file
/// C standard library stdint.h
/// Defines a set of integral type aliases with specific width requirements, along with macros specifying their limits and macro functions to create values of these types.

View File

@ -1,3 +1,4 @@
/// @file
/// Functions for performing input and output.
#include <printf.h>

View File

@ -1,3 +1,4 @@
/// @file
/// C standard library stdlib.h
/// Implementation of functions found int C stdlib.h / stdlib.c
#include <string.h>

View File

@ -1,3 +1,4 @@
/// @file
/// C standard library string.h
/// Functions to manipulate C strings and arrays.

View File

@ -1,3 +1,4 @@
/// @file
/// Commodore VIC 20 registers and memory layout
/// http://sleepingelephant.com/denial/wiki/index.php?title=Memory_Map
/// http://www.zimmers.net/anonftp/pub/cbm/vic20/manuals/VIC-20_Programmers_Reference_Guide_1st_Edition_6th_Printing.pdf

View File

@ -1,8 +1,7 @@
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Commodore 64 PRG executable file
.file [name="bitmap-circle-2.prg", type="prg", segments="Program"]

View File

@ -1271,10 +1271,9 @@ Allocated (was zp[2]:43) zp[2]:16 [ plot::$15 plot::$16 plot::$12 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file
@ -2013,11 +2012,11 @@ Removing instruction __b3:
Removing instruction __b2:
Removing instruction __b1:
Succesful ASM optimization Pass5UnusedLabelElimination
Fixing long branch [155] bmi __b3 to bpl
Fixing long branch [352] bmi __breturn to bpl
Fixing long branch [362] bmi __breturn to bpl
Fixing long branch [366] bmi __breturn to bpl
Fixing long branch [376] bpl __breturn to bmi
Fixing long branch [154] bmi __b3 to bpl
Fixing long branch [351] bmi __breturn to bpl
Fixing long branch [361] bmi __breturn to bpl
Fixing long branch [365] bmi __breturn to bpl
Fixing long branch [375] bpl __breturn to bmi
FINAL SYMBOL TABLE
constant byte* const BITMAP = (byte*) 8192
@ -2127,10 +2126,9 @@ Score: 51752
// File Comments
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file

View File

@ -1,10 +1,9 @@
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
// Plots simple plots
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Commodore 64 PRG executable file
.file [name="bitmap-plot-0.prg", type="prg", segments="Program"]

View File

@ -1638,10 +1638,9 @@ ASSEMBLER BEFORE OPTIMIZATION
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
// Plots simple plots
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file
@ -2441,10 +2440,9 @@ Score: 3200
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
// Plots simple plots
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file

View File

@ -1,10 +1,9 @@
// Tests the simple bitmap plotter
// Plots a few lines using the bresenham line algorithm
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Commodore 64 PRG executable file
.file [name="bitmap-plot-3.prg", type="prg", segments="Program"]

View File

@ -2499,10 +2499,9 @@ ASSEMBLER BEFORE OPTIMIZATION
// Tests the simple bitmap plotter
// Plots a few lines using the bresenham line algorithm
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file
@ -3461,7 +3460,7 @@ Removing instruction __b2:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Fixing long branch [201] beq __b4 to bne
Fixing long branch [200] beq __b4 to bne
FINAL SYMBOL TABLE
constant byte* BITMAP = (byte*) 8192
@ -3658,10 +3657,9 @@ Score: 26875
// Tests the simple bitmap plotter
// Plots a few lines using the bresenham line algorithm
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file

View File

@ -1,4 +1,5 @@
// C64DTV 8bpp charmode stretcher
/// @file
/// C64 DTV version 2 Registers and Constants
//
/// Sources

View File

@ -1254,6 +1254,7 @@ Allocated (was zp[1]:23) zp[1]:9 [ gfx_init_screen0::$1 gfx_init_plane_charset8:
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// C64DTV 8bpp charmode stretcher
/// @file
/// C64 DTV version 2 Registers and Constants
//
/// Sources
@ -2051,6 +2052,7 @@ Score: 75355
// File Comments
// C64DTV 8bpp charmode stretcher
/// @file
/// C64 DTV version 2 Registers and Constants
//
/// Sources

View File

@ -1,4 +1,5 @@
// C64DTV 8bpp charmode stretcher
/// @file
/// C64 DTV version 2 Registers and Constants
//
/// Sources

View File

@ -797,6 +797,7 @@ Allocated (was zp[2]:14) zp[2]:7 [ gfx_init_chunky::$5 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// C64DTV 8bpp charmode stretcher
/// @file
/// C64 DTV version 2 Registers and Constants
//
/// Sources
@ -1369,6 +1370,7 @@ Score: 19882
// File Comments
// C64DTV 8bpp charmode stretcher
/// @file
/// C64 DTV version 2 Registers and Constants
//
/// Sources

View File

@ -1,3 +1,4 @@
/// @file
/// C64 DTV version 2 Registers and Constants
//
/// Sources

View File

@ -414,6 +414,7 @@ Uplifting [] best 2503 combination
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
/// @file
/// C64 DTV version 2 Registers and Constants
//
/// Sources
@ -734,6 +735,7 @@ FINAL ASSEMBLER
Score: 1553
// File Comments
/// @file
/// C64 DTV version 2 Registers and Constants
//
/// Sources

View File

@ -1,3 +1,4 @@
/// @file
/// A lightweight library for printing on the C64.
/// Printing with this library is done by calling print_ function for each element
// Commodore 64 PRG executable file

View File

@ -1636,6 +1636,7 @@ Allocated (was zp[2]:16) zp[2]:7 [ print_line_cursor#25 print_line_cursor#49 pri
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
/// @file
/// A lightweight library for printing on the C64.
/// Printing with this library is done by calling print_ function for each element
// Upstart
@ -2423,6 +2424,7 @@ FINAL ASSEMBLER
Score: 1783
// File Comments
/// @file
/// A lightweight library for printing on the C64.
/// Printing with this library is done by calling print_ function for each element
// Upstart

View File

@ -1,8 +1,7 @@
// Minimal Atari 2600 VCS Program
// Source: https://atariage.com/forums/blogs/entry/11109-step-1-generate-a-stable-display/
/// @file
///
/// @brief Atari 2600 Registers and Constants
/// Atari 2600 Registers and Constants
/// https://web.archive.org/web/20170215054248/http://www.atariguide.com/pdfs/Atari_2600_VCS_Domestic_Field_Service_Manual.pdf
// Atari 2600 VCS 2K ROM in A26 executable file
.file [name="atari2600-demo.a26", type="bin", segments="Code, Data, Vectors"]

View File

@ -465,8 +465,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Minimal Atari 2600 VCS Program
// Source: https://atariage.com/forums/blogs/entry/11109-step-1-generate-a-stable-display/
/// @file
///
/// @brief Atari 2600 Registers and Constants
/// Atari 2600 Registers and Constants
/// https://web.archive.org/web/20170215054248/http://www.atariguide.com/pdfs/Atari_2600_VCS_Domestic_Field_Service_Manual.pdf
// Upstart
// Atari 2600 VCS 2K ROM in A26 executable file
@ -723,8 +722,7 @@ Score: 8279
// Minimal Atari 2600 VCS Program
// Source: https://atariage.com/forums/blogs/entry/11109-step-1-generate-a-stable-display/
/// @file
///
/// @brief Atari 2600 Registers and Constants
/// Atari 2600 Registers and Constants
/// https://web.archive.org/web/20170215054248/http://www.atariguide.com/pdfs/Atari_2600_VCS_Domestic_Field_Service_Manual.pdf
// Upstart
// Atari 2600 VCS 2K ROM in A26 executable file

View File

@ -1,8 +1,7 @@
// Minimal Atari 2600 VCS Program using Sprites
// Source: https://atariage.com/forums/blogs/entry/11109-step-1-generate-a-stable-display/
/// @file
///
/// @brief Atari 2600 Registers and Constants
/// Atari 2600 Registers and Constants
/// https://web.archive.org/web/20170215054248/http://www.atariguide.com/pdfs/Atari_2600_VCS_Domestic_Field_Service_Manual.pdf
// Atari 2600 VCS 2K ROM in A26 executable file
.file [name="atari2600-sprites.a26", type="bin", segments="Code, Data, Vectors"]

View File

@ -811,8 +811,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// Minimal Atari 2600 VCS Program using Sprites
// Source: https://atariage.com/forums/blogs/entry/11109-step-1-generate-a-stable-display/
/// @file
///
/// @brief Atari 2600 Registers and Constants
/// Atari 2600 Registers and Constants
/// https://web.archive.org/web/20170215054248/http://www.atariguide.com/pdfs/Atari_2600_VCS_Domestic_Field_Service_Manual.pdf
// Upstart
// Atari 2600 VCS 2K ROM in A26 executable file
@ -1227,8 +1226,7 @@ Score: 10892
// Minimal Atari 2600 VCS Program using Sprites
// Source: https://atariage.com/forums/blogs/entry/11109-step-1-generate-a-stable-display/
/// @file
///
/// @brief Atari 2600 Registers and Constants
/// Atari 2600 Registers and Constants
/// https://web.archive.org/web/20170215054248/http://www.atariguide.com/pdfs/Atari_2600_VCS_Domestic_Field_Service_Manual.pdf
// Upstart
// Atari 2600 VCS 2K ROM in A26 executable file

View File

@ -3,10 +3,9 @@
// - C= Hacking Magazine Issue 8. http://www.ffd2.com/fridge/chacking/c=hacking8.txt
// - Codebase64 Article http://codebase64.org/doku.php?id=base:3d_rotation
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Commodore 64 PRG executable file
.file [name="perspective.prg", type="prg", segments="Program"]

View File

@ -1730,10 +1730,9 @@ ASSEMBLER BEFORE OPTIMIZATION
// - C= Hacking Magazine Issue 8. http://www.ffd2.com/fridge/chacking/c=hacking8.txt
// - Codebase64 Article http://codebase64.org/doku.php?id=base:3d_rotation
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file
@ -2724,10 +2723,9 @@ Score: 3117
// - C= Hacking Magazine Issue 8. http://www.ffd2.com/fridge/chacking/c=hacking8.txt
// - Codebase64 Article http://codebase64.org/doku.php?id=base:3d_rotation
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file

View File

@ -1,8 +1,7 @@
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Commodore 64 PRG executable file
.file [name="bitmap-bresenham.prg", type="prg", segments="Program"]

View File

@ -2342,10 +2342,9 @@ Allocated (was zp[2]:66) zp[2]:25 [ bitmap_plot::$0 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file
@ -3347,7 +3346,7 @@ Removing instruction __b2:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Fixing long branch [248] beq __b4 to bne
Fixing long branch [247] beq __b4 to bne
FINAL SYMBOL TABLE
constant byte* const BITMAP = (byte*) 8192
@ -3536,10 +3535,9 @@ Score: 246362
// File Comments
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file

View File

@ -1,9 +1,8 @@
// A raster IRQ that opens the top/bottom border.
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Commodore 64 PRG executable file
.file [name="irq-hyperscreen.prg", type="prg", segments="Program"]

View File

@ -232,10 +232,9 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// A raster IRQ that opens the top/bottom border.
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file
@ -444,10 +443,9 @@ Score: 424
// File Comments
// A raster IRQ that opens the top/bottom border.
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file

View File

@ -1,9 +1,8 @@
// A simple usage of the flexible sprite multiplexer routine
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Commodore 64 PRG executable file
.file [name="simple-multiplexer.prg", type="prg", segments="Program"]

View File

@ -1595,10 +1595,9 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// A simple usage of the flexible sprite multiplexer routine
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file
@ -2491,10 +2490,9 @@ Score: 58107
// File Comments
// A simple usage of the flexible sprite multiplexer routine
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file

View File

@ -1,9 +1,8 @@
// A simple SID music player playing music in the main loop.
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Commodore 64 PRG executable file
.file [name="music.prg", type="prg", segments="Program"]

View File

@ -121,10 +121,9 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// A simple SID music player playing music in the main loop.
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file
@ -206,10 +205,9 @@ Score: 1066
// File Comments
// A simple SID music player playing music in the main loop.
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file

View File

@ -1,9 +1,8 @@
// A simple SID music player using RASTER IRQ
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Commodore 64 PRG executable file
.file [name="music_irq.prg", type="prg", segments="Program"]

View File

@ -160,10 +160,9 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// A simple SID music player using RASTER IRQ
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file
@ -300,10 +299,9 @@ Score: 110
// File Comments
// A simple SID music player using RASTER IRQ
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file

View File

@ -1,8 +1,7 @@
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Commodore 64 PRG executable file
.file [name="raster-bars.prg", type="prg", segments="Program"]

View File

@ -204,10 +204,9 @@ Uplifting [] best 9573 combination
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file
@ -376,10 +375,9 @@ Score: 8340
// File Comments
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file

View File

@ -1,8 +1,7 @@
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Commodore 64 PRG executable file
.file [name="scroll.prg", type="prg", segments="Program"]

View File

@ -490,10 +490,9 @@ Allocated (was zp[2]:7) zp[2]:4 [ fillscreen::cursor#2 fillscreen::cursor#1 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file
@ -773,10 +772,9 @@ Score: 6262
// File Comments
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file

View File

@ -1,9 +1,8 @@
// An 8x8 char letter scroller
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Commodore 64 PRG executable file
.file [name="scrollbig.prg", type="prg", segments="Program"]

View File

@ -1437,10 +1437,9 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// An 8x8 char letter scroller
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file
@ -2013,10 +2012,9 @@ Score: 20884
// File Comments
// An 8x8 char letter scroller
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file

View File

@ -1,8 +1,7 @@
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Commodore 64 PRG executable file
.file [name="showlogo.prg", type="prg", segments="Program"]

View File

@ -566,10 +566,9 @@ Allocated (was zp[2]:8) zp[2]:4 [ memset::end#0 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file
@ -831,10 +830,9 @@ Score: 3324
// File Comments
/// @file
/// @brief Commodore 64 Registers and Constants
/// Commodore 64 Registers and Constants
/// @file
/// @brief The MOS 6526 Complex Interface Adapter (CIA)
///
/// The MOS 6526 Complex Interface Adapter (CIA)
/// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
// Commodore 64 PRG executable file

View File

@ -1,3 +1,4 @@
/// @file
/// Functions for performing input and output.
// Commodore 64 PRG executable file
.file [name="helloworld.prg", type="prg", segments="Program"]

Some files were not shown because too many files have changed in this diff Show More