mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-11-29 18:49:42 +00:00
Added Atari 8-bit chipset ANTIC/GTIA/POKEY. Closes #501
This commit is contained in:
parent
601a88dc82
commit
9dfe9d6634
113
src/main/kc/include/atari-antic.h
Normal file
113
src/main/kc/include/atari-antic.h
Normal file
@ -0,0 +1,113 @@
|
||||
// ATARI Alphanumeric Television Interface Controller (ANTIC)
|
||||
// Used in Atari 5200 and the 8-bit series (400, 800, XL, XE)
|
||||
// https://en.wikipedia.org/wiki/ANTIC
|
||||
// https://playermissile.com/dli_tutorial/
|
||||
|
||||
struct ATARI_ANTIC {
|
||||
|
||||
// Direct Memory Access Control
|
||||
// 7 6 5 4 3 2 1 0
|
||||
// - - - - - - 0 0 No playfield
|
||||
// - - - - - - 0 1 Narrow playfield (128 color clocks 32 characters)
|
||||
// - - - - - - 1 0 Standard playfield (160 color clocks 40 characters) (default)
|
||||
// - - - - - - 1 1 Wide playfield (192 color clocks 48 characters)
|
||||
// - - - - - 1 - - Enable missle DMA
|
||||
// - - - - 1 - - - Enable player DMA
|
||||
// - - - 1 - - - - One line player resolution
|
||||
// - - - 0 - - - - Two-line player resolution (default)
|
||||
// - - 1 - - - - - Enable DMA for fetching the display list instructions (default)
|
||||
// SHADOW: SDMCTL $022F
|
||||
char DMACTL;
|
||||
|
||||
// Character Control
|
||||
// 7 6 5 4 3 2 1 0
|
||||
// - - - - - - - 1 Video Blank. Inverse video characters display as blanks spaces.
|
||||
// - - - - - - 1 - Video Inverse. Inverse video characters appear as inverse video. (default)
|
||||
// - - - - - 1 - - Video Reflect. All characters are displayed vertically mirrored.
|
||||
// SHADOW: CHART $02F3
|
||||
char CHACTL;
|
||||
|
||||
// Display List Pointer
|
||||
// ANTIC begins executing the Display List pointed to by the 16-bit address in registers DLISTL/DLISTH
|
||||
// SHADOW: SDLSTL/SDLSTH $0230/$0231
|
||||
char *DLIST;
|
||||
|
||||
// Horizontal Fine Scroll
|
||||
// Only the lowest 4 bits are significant.
|
||||
// The value range of 16 color clocks allows ANTIC to shift Mode 2 Text four characters, and Mode 6 text two characters before a coarse scroll is needed.
|
||||
char HSCROL;
|
||||
|
||||
// Vertical Fine Scroll
|
||||
// The lowest 4 bits are significant, however the Vertical scroll value should range from 0 to the ANTIC Mode line's scan line height - 1.
|
||||
// Scrolling farther than the ANTIC Mode's number of scan lines results in lines of repeated data upsetting the fine scrolling continuity (though, this can also be used as an exploitable behavior).
|
||||
char VSCROL;
|
||||
|
||||
// Unused
|
||||
char UNUSED1;
|
||||
|
||||
// Player Missile Base Address
|
||||
// This specifies the page of the base address for Player/Missile graphics.
|
||||
// When double line resolution P/M graphics are operating the PMBASE value must begin on a 1K boundary.
|
||||
// When single line resolution P/M graphics are operating the PMBASE value must begin on a 2K boundary.
|
||||
char PMBASE;
|
||||
|
||||
// Unused
|
||||
char UNUSED2;
|
||||
|
||||
// Character Base Address
|
||||
// This specifies the page of the base address for the character set.
|
||||
// ANTIC Modes 2, 3, 4, and 5 use 128 characters in the character set and require the CHBASE value begin on a 1K boundary.
|
||||
// ANTIC Modes 6 and 7 use 64 characters, so the CHBASE value must begin on a 512 byte boundary.
|
||||
// The usual default value is $E0hex/224dec for the character set in ROM at $E000hex/57344dec.
|
||||
// SHADOW: CHBAS $02F4
|
||||
char CHBASE;
|
||||
|
||||
// Wait For Horizontal Sync
|
||||
// This register allows programs to synchronize to the display. A write to this register halts the 6502 program through the end of the current scanline.
|
||||
// The value written is unimportant.
|
||||
char WSYNC;
|
||||
|
||||
// Vertical Line Counter
|
||||
// This register tracks the scan line currently being generated. The value returned is the actual scan line divided by 2.
|
||||
// Blank lines generated at the start of the display are included.
|
||||
// The value for NTSC will range from 0 to 130 for NTSC, and 0 to 155 for PAL.
|
||||
char VCOUNT;
|
||||
|
||||
// Light Pen Horizontal Position
|
||||
// This contains the horizontal color clock position when the light pen/light gun trigger is pressed.
|
||||
// The shadow register is the recommended source for reading this information, since it will be updated during the vertical blank guaranteeing consistent and reliable results.
|
||||
// Programs should avoid reading the hardware register directly unless the program is certain the register is read at a time insuring the value is valid.
|
||||
// SHADOW: LPENH $0234
|
||||
char PENH;
|
||||
|
||||
// Light Pen Vertical Position
|
||||
// This contains the VCOUNT value captured when the light pen/light gun trigger is pressed.
|
||||
// The shadow register is the recommended source for reading this information, since it will be updated during the vertical blank guaranteeing consistent and reliable results.
|
||||
// Programs should avoid reading the hardware register directly unless the program is certain the register is read at a time insuring the value is valid.
|
||||
// SHADOW: LPENV $0235
|
||||
char PENV;
|
||||
|
||||
// Non-Maskable Interrupt (NMI) Enable
|
||||
// Enables Non-Maskable Interrupts.
|
||||
// 7 6 5 4 3 2 1 0
|
||||
// 1 - - - - - - - RESET: Enable Reset key interrupt
|
||||
// - 1 - - - - - - VBI: Enable Vertical Blank Interrupt
|
||||
// - - 1 - - - - - DLI: Enable Display List Interrupt
|
||||
// The Operation System sets NMIEN to the default $40hex/64dec during the power up routines.
|
||||
// The NMI service routines first vector through $FFFAhex/65530dec which determines the cause and then transfers control to the interrupt service routine.
|
||||
// If NMIEN's DLI bit is set when ANTIC encounters a Display List instruction with the DLI modifier bit set, then ANTIC triggers the DLI on the last scan line of that Display List instruction mode line.
|
||||
// When NMIEN's VBI bit is set, ANTIC will signals a Vertical Blank Interrupt at the end of processing the JVB (Jump vertical blank) at the end of the Display List.
|
||||
// The OS jumps through VVBLKI ($0222hex/546dec) to begin the OS VBI Service Routine, and the OS VBI Routine exits with a jump through VVBLKD ($0224hex/548dec).
|
||||
// By default VVBLKI points to the OS jump vector SYSVBV ($E45Fhex/58463dec) to begin the Vertical Blank Interrupt, and VVBLKD points to the OS jump vector XITVBV ($E462hex/58466dec).
|
||||
char NMIEN;
|
||||
|
||||
// Non-Maskable Interrupt (NMI) Status / Reset
|
||||
// Contains information about which NMI occured.
|
||||
// Any value written to NMIRES resets the bits in NMIST which indicate the reason for the most recent Non-Maskable Interrupt.
|
||||
// 7 6 5 4 3 2 1 0
|
||||
// 1 - - - - - - - RESET: Reset key interrupt
|
||||
// - 1 - - - - - - VBI: Vertical Blank Interrupt
|
||||
// - - 1 - - - - - DLI: Display List Interrupt
|
||||
char NMIST;
|
||||
|
||||
};
|
119
src/main/kc/include/atari-gtia.h
Normal file
119
src/main/kc/include/atari-gtia.h
Normal file
@ -0,0 +1,119 @@
|
||||
// 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
|
||||
|
||||
struct ATARI_GTIA_READ {
|
||||
// Missile 0 to Playfield collisions Read $D000
|
||||
char M0PF;
|
||||
// Missile 1 to Playfield collisions Read $D001
|
||||
char M1PF;
|
||||
// Missile 2 to Playfield collisions Read $D002
|
||||
char M2PF;
|
||||
// Missile 3 to Playfield collisions Read $D003
|
||||
char M3PF;
|
||||
// Player 0 to Playfield collisions Read $D004
|
||||
char P0PF;
|
||||
// Player 1 to Playfield collisions Read $D005
|
||||
char P1PF;
|
||||
// Player 2 to Playfield collisions Read $D006
|
||||
char P2PF;
|
||||
// Player 3 to Playfield collisions Read $D007
|
||||
char P3PF;
|
||||
// Missile 0 to Player collisions Read $D008
|
||||
char M0PL;
|
||||
// Missile 1 to Player collisions Read $D009
|
||||
char M1PL;
|
||||
// Missile 2 to Player collisions Read $D00A
|
||||
char M2PL;
|
||||
// Missile 3 to Player collisions Read $D00B
|
||||
char M3PL;
|
||||
// Player 0 to Player collisions Read $D00C
|
||||
char P0PL;
|
||||
// Player 1 to Player collisions Read $D00D
|
||||
char P1PL;
|
||||
// Player 2 to Player collisions Read $D00E
|
||||
char P2PL;
|
||||
// Player 3 to Player collisions Read $D00F
|
||||
char P3PL;
|
||||
// Joystick 0 trigger. Read $D010
|
||||
char TRIG0;
|
||||
// Joystick 1 trigger. Read $D011
|
||||
char TRIG1;
|
||||
// Joystick 2 trigger. Read $D012
|
||||
char TRIG2;
|
||||
// Joystick 3 trigger. Read $D013
|
||||
char TRIG3;
|
||||
// flags. Read $D014
|
||||
char PAL;
|
||||
// Unused READ registers
|
||||
char UNUSED[10];
|
||||
// Console Keys Read $D01F
|
||||
char CONSOL;
|
||||
};
|
||||
|
||||
struct ATARI_GTIA_WRITE {
|
||||
// Horizontal Position of Player 0 Write $D000
|
||||
char HPOSP0;
|
||||
// Horizontal Position of Player 1 Write $D001
|
||||
char HPOSP1;
|
||||
// Horizontal Position of Player 2 Write $D002
|
||||
char HPOSP2;
|
||||
// Horizontal Position of Player 3 Write $D003
|
||||
char HPOSP3;
|
||||
// Horizontal Position of Missile 0 Write $D004
|
||||
char HPOSM0;
|
||||
// Horizontal Position of Missile 1 Write $D005
|
||||
char HPOSM1;
|
||||
// Horizontal Position of Missile 2 Write $D006
|
||||
char HPOSM2;
|
||||
// Horizontal Position of Missile 3 Write $D007
|
||||
char HPOSM3;
|
||||
// Size of Player 0 Write $D008
|
||||
char SIZEP0;
|
||||
// Size of Player 1 Write $D009
|
||||
char SIZEP1;
|
||||
// Size of Player 2 Write $D00A
|
||||
char SIZEP2;
|
||||
// Size of Player 3 Write $D00B
|
||||
char SIZEP3;
|
||||
// Size of all Missiles Write $D00C
|
||||
char SIZEM;
|
||||
// Graphics pattern for Player 0 Write $D00D
|
||||
char GRAFP0;
|
||||
// Graphics pattern for Player 1 Write $D00E
|
||||
char GRAFP1;
|
||||
// Graphics pattern for Player 2 Write $D00F
|
||||
char GRAFP2;
|
||||
// Graphics pattern for Player 3 Write $D010
|
||||
char GRAFP3;
|
||||
// Graphics pattern for all Missiles Write $D011
|
||||
char GRAFM;
|
||||
// Color/luminance of Player and Missile 0. Write $D012
|
||||
char COLPM0;
|
||||
// Color/luminance of Player and Missile 1. Write $D013
|
||||
char COLPM1;
|
||||
// Color/luminance of Player and Missile 2. Write $D014
|
||||
char COLPM2;
|
||||
// Color/luminance of Player and Missile 3. Write $D015
|
||||
char COLPM3;
|
||||
// Color/luminance of Playfield 0. Write $D016 53270
|
||||
char COLPF0;
|
||||
// Color/luminance of Playfield 1. Write $D017 53271
|
||||
char COLPF1;
|
||||
// Color/luminance of Playfield 2. Write $D018 53272
|
||||
char COLPF2;
|
||||
// Color/luminance of Playfield 3. Write $D019 53273
|
||||
char COLPF3;
|
||||
// Color/luminance of Playfield background. Write $D01A
|
||||
char COLBK;
|
||||
// Priority selection, fifth player, and GTIA modes Write
|
||||
char PRIOR;
|
||||
// Vertical Delay P/M Graphics Write $D01C
|
||||
char VDELAY;
|
||||
// Graphics Control. Write $D01D
|
||||
char GRACTL;
|
||||
// Clear Collisions Write $D01E
|
||||
char HITCLR;
|
||||
// Console Speaker Write $D01F
|
||||
char CONSPK;
|
||||
};
|
71
src/main/kc/include/atari-pokey.h
Normal file
71
src/main/kc/include/atari-pokey.h
Normal file
@ -0,0 +1,71 @@
|
||||
// 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
|
||||
|
||||
struct ATARI_POKEY_READ {
|
||||
// Potentiometer (Paddle) 0 Read $D200 53760 PADDL0 $0270 624
|
||||
char POT0;
|
||||
// Potentiometer (Paddle) 1 Read $D201 53761 PADDL1 $0271 625
|
||||
char POT1;
|
||||
// Potentiometer (Paddle) 2 Read $D202 53762 PADDL2 $0272 626
|
||||
char POT2;
|
||||
// Potentiometer (Paddle) 3 Read $D203 53763 PADDL3 $0273 627
|
||||
char POT3;
|
||||
// Potentiometer (Paddle) 4 Read $D204 53764 PADDL4 $0274 628
|
||||
char POT4;
|
||||
// Potentiometer (Paddle) 5 Read $D205 53765 PADDL5 $0275 629
|
||||
char POT5;
|
||||
// Potentiometer (Paddle) 6 Read $D206 53766 PADDL6 $0276 630
|
||||
char POT6;
|
||||
// Potentiometer (Paddle) 7 Read $D207 53767 PADDL7 $0277 631
|
||||
char POT7;
|
||||
// Read 8 Line POT Port State Read $D208 53768
|
||||
char ALLPOT;
|
||||
// Keyboard Code Read $D209 53769 CH $02FC 764
|
||||
char KBCODE;
|
||||
// Random Number Generator Read $D20A 53770
|
||||
char RANDOM;
|
||||
// Unused read registers $D20B-C
|
||||
char UNUSED[2];
|
||||
// Serial Port Data Input Read $D20D 53773
|
||||
char SERIN;
|
||||
// IRQ Status Read $D20E 53774
|
||||
char IRQST;
|
||||
// Serial Port Status Read $D20F 53775
|
||||
char SKSTAT;
|
||||
};
|
||||
|
||||
struct ATARI_POKEY_WRITE {
|
||||
// Audio Channel 1 Frequency Write $D200 53760
|
||||
char AUDF1;
|
||||
// Audio Channel 1 Control Write $D201 53761
|
||||
char AUDC1;
|
||||
// Audio Channel 2 Frequency Write $D202 53762
|
||||
char AUDF2;
|
||||
// Audio Channel 2 Control Write $D203 53763
|
||||
char AUDC2;
|
||||
// Audio Channel 3 Frequency Write $D204 53764
|
||||
char AUDF3;
|
||||
// Audio Channel 3 Control Write $D205 53765
|
||||
char AUDC3;
|
||||
// Audio Channel 4 Frequency Write $D206 53766
|
||||
char AUDF4;
|
||||
// Audio Channel 4 Control Write $D207 53767
|
||||
char AUDC4;
|
||||
// Audio Control Write $D208 53768
|
||||
char AUDCTL;
|
||||
// Start Timers Write $D209 53769
|
||||
char STIMER;
|
||||
// Reset Serial Status (SKSTAT) Write $D20A 53770
|
||||
char SKREST;
|
||||
// Start POT Scan Sequence Write $D20B 53771
|
||||
char POTGO;
|
||||
// Unused write register $D20C
|
||||
char UNUSED;
|
||||
// Serial Port Data Output Write $D20D 53773
|
||||
char SEROUT;
|
||||
// Interrupt Request Enable Write $D20E 53774 POKMSK $10 16
|
||||
char IRQEN;
|
||||
// Serial Port Control Write $D20F 53775 SSKCTL $0232 562
|
||||
char SKCTL;
|
||||
};
|
42
src/main/kc/include/atari-xl.h
Normal file
42
src/main/kc/include/atari-xl.h
Normal file
@ -0,0 +1,42 @@
|
||||
// Atari 8-bit 400/800/XL/XE Registers and Constants
|
||||
// https://en.wikipedia.org/wiki/Atari_8-bit_family
|
||||
|
||||
#include <atari-antic.h>
|
||||
#include <atari-gtia.h>
|
||||
#include <atari-pokey.h>
|
||||
|
||||
// Atari GTIA write registers
|
||||
struct ATARI_GTIA_WRITE * const TIA = 0xd000;
|
||||
|
||||
// Atari GTIA read registers
|
||||
struct ATARI_GTIA_READ * const TIA_READ = 0xd000;
|
||||
|
||||
// Atari POKEY write registers
|
||||
struct ATARI_POKEY_WRITE * const POKEY = 0xd200;
|
||||
|
||||
// Atari POKEY read registers
|
||||
struct ATARI_POKEY_READ * const POKEY_READ = 0xd200;
|
||||
|
||||
// Atari ANTIC registers
|
||||
struct ATARI_ANTIC * const ANTIC = 0xd400;
|
||||
|
||||
// Atari OS Shadow registers
|
||||
|
||||
// OS Shadow ANTIC Direct Memory Access Control ($D400)
|
||||
char * const SDMCTL = 0x022f;
|
||||
|
||||
// OS Shadow ANTIC Character Control ($D401)
|
||||
char * const CHART = 0x02f3;
|
||||
|
||||
// OS Shadow ANTIC Display List Pointer ($D402)
|
||||
char ** const SDLST = 0x0230;
|
||||
|
||||
// OS Shadow ANTIC Character Set Base Address (D409)
|
||||
char * CHBAS = 0x02f4;
|
||||
|
||||
// OS Shadow ANTIC Light Pen Horizontal Position ($D40C)
|
||||
char * LPENH = 0x234;
|
||||
|
||||
// OS Shadow ANTIC Light Pen Vertical Position ($D40D)
|
||||
char * LPENV = 0x235;
|
||||
|
@ -1,15 +1,6 @@
|
||||
// Atari XL/XE XEX file minimal file
|
||||
// https://www.atarimax.com/jindroush.atari.org/afmtexe.html
|
||||
.file [name="%O", type="bin", segments="XexFile"]
|
||||
.segmentdef Program [segments="ProgramStart, Code, Data, ProgramEnd"]
|
||||
.segmentdef ProgramStart [start=$2000]
|
||||
.segmentdef Code [startAfter="ProgramStart"]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segmentdef ProgramEnd [startAfter="Data"]
|
||||
.segment ProgramStart
|
||||
ProgramStart:
|
||||
.segment ProgramEnd
|
||||
ProgramEnd:
|
||||
.segmentdef XexFile
|
||||
.segment XexFile
|
||||
// Binary File Header
|
||||
@ -19,4 +10,13 @@ ProgramEnd:
|
||||
.segmentout [ segments="Program" ]
|
||||
// RunAd - Run Address Segment [start address, end address, data]
|
||||
.word $02e0, $02e1
|
||||
.word %E
|
||||
.word %E
|
||||
.segmentdef Program [segments="ProgramStart, Code, Data, ProgramEnd"]
|
||||
.segmentdef ProgramStart [start=$2000]
|
||||
.segment ProgramStart
|
||||
ProgramStart:
|
||||
.segmentdef Code [startAfter="ProgramStart"]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segmentdef ProgramEnd [startAfter="Data"]
|
||||
.segment ProgramEnd
|
||||
ProgramEnd:
|
||||
|
@ -4,42 +4,7 @@
|
||||
// Display Lists atariarchives.org/mapping/appendix8.php
|
||||
|
||||
#pragma target(atarixl)
|
||||
|
||||
// Direct Memory Access Control
|
||||
// 7 6 5 4 3 2 1 0
|
||||
// - - - - - - 0 0 No playfield
|
||||
// - - - - - - 0 1 Narrow playfield (128 color clocks 32 characters)
|
||||
// - - - - - - 1 0 Standard playfield (160 color clocks 40 characters) (default)
|
||||
// - - - - - - 1 1 Wide playfield (192 color clocks 48 characters)
|
||||
// - - - - - 1 - - Enable missle DMA
|
||||
// - - - - 1 - - - Enable player DMA
|
||||
// - - - 1 - - - - One line player resolution
|
||||
// - - - 0 - - - - Two-line player resolution (default)
|
||||
// - - 1 - - - - - Enable DMA for fetching the display list instructions (default)
|
||||
// SHADOW: SDMCTL $022F
|
||||
char * const ANTIC_DMACTL = 0xd400;
|
||||
|
||||
// OS Shadow ANTIC Direct Memory Access Control
|
||||
char * const SDMCTL = 0x022f;
|
||||
|
||||
// Character Control
|
||||
// 7 6 5 4 3 2 1 0
|
||||
// - - - - - - - 1 Video Blank. Inverse video characters display as blanks spaces.
|
||||
// - - - - - - 1 - Video Inverse. Inverse video characters appear as inverse video. (default)
|
||||
// - - - - - 1 - - Video Reflect. All characters are displayed vertically mirrored.
|
||||
// SHADOW: CHART $02F3
|
||||
char * const ANTIC_CHACTL = 0xd401;
|
||||
|
||||
// OS Shadow ANTIC Character Control
|
||||
char * const CHART = 0x02f3;
|
||||
|
||||
// Display List Pointer
|
||||
// ANTIC begins executing the Display List pointed to by the 16-bit address in registers DLISTL/DLISTH
|
||||
// SHADOW: SDLSTL/SDLSTH $0230/$0231
|
||||
char ** const ANTIC_DLIST = 0xd402;
|
||||
|
||||
// OS Shadow ANTIC Display List Pointer
|
||||
char ** const SDLST = 0x0230;
|
||||
#include <atari-xl.h>
|
||||
|
||||
void main() {
|
||||
// Enable DMA, Narrow Playfield into Shadow ANTIC Direct Memory Access Control
|
||||
@ -51,7 +16,7 @@ void main() {
|
||||
}
|
||||
|
||||
// Message to show
|
||||
// Encoding: atari_internal
|
||||
// Encoding: atari_screencode
|
||||
char TEXT[] = {'h'|0x20,'e'|0x20,'l'|0x20,'l'|0x20,'o'|0x20,0x0,'x'|0x60,'t'|0x60,0x0,'w'|0x20,'o'|0x20,'r'|0x20,'l'|0x20,'d'|0x20,0x41,0x0,0x0,0x0,0x0};
|
||||
|
||||
// ANTIC Display List Program
|
||||
|
@ -5,15 +5,6 @@
|
||||
// Atari XL/XE XEX file minimal file
|
||||
// https://www.atarimax.com/jindroush.atari.org/afmtexe.html
|
||||
.file [name="helloxl.xex", type="bin", segments="XexFile"]
|
||||
.segmentdef Program [segments="ProgramStart, Code, Data, ProgramEnd"]
|
||||
.segmentdef ProgramStart [start=$2000]
|
||||
.segmentdef Code [startAfter="ProgramStart"]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segmentdef ProgramEnd [startAfter="Data"]
|
||||
.segment ProgramStart
|
||||
ProgramStart:
|
||||
.segment ProgramEnd
|
||||
ProgramEnd:
|
||||
.segmentdef XexFile
|
||||
.segment XexFile
|
||||
// Binary File Header
|
||||
@ -23,10 +14,20 @@ ProgramEnd:
|
||||
.segmentout [ segments="Program" ]
|
||||
// RunAd - Run Address Segment [start address, end address, data]
|
||||
.word $02e0, $02e1
|
||||
.word main
|
||||
// OS Shadow ANTIC Direct Memory Access Control
|
||||
.word main
|
||||
.segmentdef Program [segments="ProgramStart, Code, Data, ProgramEnd"]
|
||||
.segmentdef ProgramStart [start=$2000]
|
||||
.segment ProgramStart
|
||||
ProgramStart:
|
||||
.segmentdef Code [startAfter="ProgramStart"]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segmentdef ProgramEnd [startAfter="Data"]
|
||||
.segment ProgramEnd
|
||||
ProgramEnd:
|
||||
|
||||
// OS Shadow ANTIC Direct Memory Access Control ($D400)
|
||||
.label SDMCTL = $22f
|
||||
// OS Shadow ANTIC Display List Pointer
|
||||
// OS Shadow ANTIC Display List Pointer ($D402)
|
||||
.label SDLST = $230
|
||||
.segment Code
|
||||
main: {
|
||||
@ -46,7 +47,7 @@ main: {
|
||||
}
|
||||
.segment Data
|
||||
// Message to show
|
||||
// Encoding: atari_internal
|
||||
// Encoding: atari_screencode
|
||||
TEXT: .byte 'h'|$20, 'e'|$20, 'l'|$20, 'l'|$20, 'o'|$20, 0, 'x'|$60, 't'|$60, 0, 'w'|$20, 'o'|$20, 'r'|$20, 'l'|$20, 'd'|$20, $41, 0, 0, 0, 0
|
||||
// ANTIC Display List Program
|
||||
// https://en.wikipedia.org/wiki/ANTIC
|
||||
|
@ -1,9 +1,16 @@
|
||||
Resolved forward reference DISPLAY_LIST to (const byte*) DISPLAY_LIST
|
||||
Fixing struct type size struct ATARI_GTIA_READ to 32
|
||||
Fixing struct type size struct ATARI_POKEY_READ to 16
|
||||
Fixing struct type SIZE_OF struct ATARI_GTIA_READ to 32
|
||||
Fixing struct type SIZE_OF struct ATARI_POKEY_READ to 16
|
||||
Fixing struct type SIZE_OF struct ATARI_GTIA_READ to 32
|
||||
Fixing struct type SIZE_OF struct ATARI_POKEY_READ to 16
|
||||
Inlined call call __init
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from __start
|
||||
main: scope:[main] from __start::@1
|
||||
*((const nomodify byte*) SDMCTL) ← (number) $21
|
||||
*((const nomodify byte**) SDLST) ← (const byte*) DISPLAY_LIST
|
||||
to:main::@1
|
||||
@ -17,22 +24,129 @@ main::@return: scope:[main] from main::@1
|
||||
|
||||
(void()) __start()
|
||||
__start: scope:[__start] from
|
||||
call main
|
||||
to:__start::__init1
|
||||
__start::__init1: scope:[__start] from __start
|
||||
to:__start::@1
|
||||
__start::@1: scope:[__start] from __start
|
||||
__start::@1: scope:[__start] from __start::__init1
|
||||
call main
|
||||
to:__start::@2
|
||||
__start::@2: scope:[__start] from __start::@1
|
||||
to:__start::@return
|
||||
__start::@return: scope:[__start] from __start::@1
|
||||
__start::@return: scope:[__start] from __start::@2
|
||||
return
|
||||
to:@return
|
||||
|
||||
SYMBOL TABLE SSA
|
||||
(byte) ATARI_ANTIC::CHACTL
|
||||
(byte) ATARI_ANTIC::CHBASE
|
||||
(byte*) ATARI_ANTIC::DLIST
|
||||
(byte) ATARI_ANTIC::DMACTL
|
||||
(byte) ATARI_ANTIC::HSCROL
|
||||
(byte) ATARI_ANTIC::NMIEN
|
||||
(byte) ATARI_ANTIC::NMIST
|
||||
(byte) ATARI_ANTIC::PENH
|
||||
(byte) ATARI_ANTIC::PENV
|
||||
(byte) ATARI_ANTIC::PMBASE
|
||||
(byte) ATARI_ANTIC::UNUSED1
|
||||
(byte) ATARI_ANTIC::UNUSED2
|
||||
(byte) ATARI_ANTIC::VCOUNT
|
||||
(byte) ATARI_ANTIC::VSCROL
|
||||
(byte) ATARI_ANTIC::WSYNC
|
||||
(byte) ATARI_GTIA_READ::CONSOL
|
||||
(byte) ATARI_GTIA_READ::M0PF
|
||||
(byte) ATARI_GTIA_READ::M0PL
|
||||
(byte) ATARI_GTIA_READ::M1PF
|
||||
(byte) ATARI_GTIA_READ::M1PL
|
||||
(byte) ATARI_GTIA_READ::M2PF
|
||||
(byte) ATARI_GTIA_READ::M2PL
|
||||
(byte) ATARI_GTIA_READ::M3PF
|
||||
(byte) ATARI_GTIA_READ::M3PL
|
||||
(byte) ATARI_GTIA_READ::P0PF
|
||||
(byte) ATARI_GTIA_READ::P0PL
|
||||
(byte) ATARI_GTIA_READ::P1PF
|
||||
(byte) ATARI_GTIA_READ::P1PL
|
||||
(byte) ATARI_GTIA_READ::P2PF
|
||||
(byte) ATARI_GTIA_READ::P2PL
|
||||
(byte) ATARI_GTIA_READ::P3PF
|
||||
(byte) ATARI_GTIA_READ::P3PL
|
||||
(byte) ATARI_GTIA_READ::PAL
|
||||
(byte) ATARI_GTIA_READ::TRIG0
|
||||
(byte) ATARI_GTIA_READ::TRIG1
|
||||
(byte) ATARI_GTIA_READ::TRIG2
|
||||
(byte) ATARI_GTIA_READ::TRIG3
|
||||
(const byte*) ATARI_GTIA_READ::UNUSED[(number) $a] = { fill( $a, 0) }
|
||||
(byte) ATARI_GTIA_WRITE::COLBK
|
||||
(byte) ATARI_GTIA_WRITE::COLPF0
|
||||
(byte) ATARI_GTIA_WRITE::COLPF1
|
||||
(byte) ATARI_GTIA_WRITE::COLPF2
|
||||
(byte) ATARI_GTIA_WRITE::COLPF3
|
||||
(byte) ATARI_GTIA_WRITE::COLPM0
|
||||
(byte) ATARI_GTIA_WRITE::COLPM1
|
||||
(byte) ATARI_GTIA_WRITE::COLPM2
|
||||
(byte) ATARI_GTIA_WRITE::COLPM3
|
||||
(byte) ATARI_GTIA_WRITE::CONSPK
|
||||
(byte) ATARI_GTIA_WRITE::GRACTL
|
||||
(byte) ATARI_GTIA_WRITE::GRAFM
|
||||
(byte) ATARI_GTIA_WRITE::GRAFP0
|
||||
(byte) ATARI_GTIA_WRITE::GRAFP1
|
||||
(byte) ATARI_GTIA_WRITE::GRAFP2
|
||||
(byte) ATARI_GTIA_WRITE::GRAFP3
|
||||
(byte) ATARI_GTIA_WRITE::HITCLR
|
||||
(byte) ATARI_GTIA_WRITE::HPOSM0
|
||||
(byte) ATARI_GTIA_WRITE::HPOSM1
|
||||
(byte) ATARI_GTIA_WRITE::HPOSM2
|
||||
(byte) ATARI_GTIA_WRITE::HPOSM3
|
||||
(byte) ATARI_GTIA_WRITE::HPOSP0
|
||||
(byte) ATARI_GTIA_WRITE::HPOSP1
|
||||
(byte) ATARI_GTIA_WRITE::HPOSP2
|
||||
(byte) ATARI_GTIA_WRITE::HPOSP3
|
||||
(byte) ATARI_GTIA_WRITE::PRIOR
|
||||
(byte) ATARI_GTIA_WRITE::SIZEM
|
||||
(byte) ATARI_GTIA_WRITE::SIZEP0
|
||||
(byte) ATARI_GTIA_WRITE::SIZEP1
|
||||
(byte) ATARI_GTIA_WRITE::SIZEP2
|
||||
(byte) ATARI_GTIA_WRITE::SIZEP3
|
||||
(byte) ATARI_GTIA_WRITE::VDELAY
|
||||
(byte) ATARI_POKEY_READ::ALLPOT
|
||||
(byte) ATARI_POKEY_READ::IRQST
|
||||
(byte) ATARI_POKEY_READ::KBCODE
|
||||
(byte) ATARI_POKEY_READ::POT0
|
||||
(byte) ATARI_POKEY_READ::POT1
|
||||
(byte) ATARI_POKEY_READ::POT2
|
||||
(byte) ATARI_POKEY_READ::POT3
|
||||
(byte) ATARI_POKEY_READ::POT4
|
||||
(byte) ATARI_POKEY_READ::POT5
|
||||
(byte) ATARI_POKEY_READ::POT6
|
||||
(byte) ATARI_POKEY_READ::POT7
|
||||
(byte) ATARI_POKEY_READ::RANDOM
|
||||
(byte) ATARI_POKEY_READ::SERIN
|
||||
(byte) ATARI_POKEY_READ::SKSTAT
|
||||
(const byte*) ATARI_POKEY_READ::UNUSED[(number) 2] = { fill( 2, 0) }
|
||||
(byte) ATARI_POKEY_WRITE::AUDC1
|
||||
(byte) ATARI_POKEY_WRITE::AUDC2
|
||||
(byte) ATARI_POKEY_WRITE::AUDC3
|
||||
(byte) ATARI_POKEY_WRITE::AUDC4
|
||||
(byte) ATARI_POKEY_WRITE::AUDCTL
|
||||
(byte) ATARI_POKEY_WRITE::AUDF1
|
||||
(byte) ATARI_POKEY_WRITE::AUDF2
|
||||
(byte) ATARI_POKEY_WRITE::AUDF3
|
||||
(byte) ATARI_POKEY_WRITE::AUDF4
|
||||
(byte) ATARI_POKEY_WRITE::IRQEN
|
||||
(byte) ATARI_POKEY_WRITE::POTGO
|
||||
(byte) ATARI_POKEY_WRITE::SEROUT
|
||||
(byte) ATARI_POKEY_WRITE::SKCTL
|
||||
(byte) ATARI_POKEY_WRITE::SKREST
|
||||
(byte) ATARI_POKEY_WRITE::STIMER
|
||||
(byte) ATARI_POKEY_WRITE::UNUSED
|
||||
(const byte*) DISPLAY_LIST[] = { (byte) $70, (byte) $70, (byte) $70, (byte) $47, <(const byte*) TEXT, >(const byte*) TEXT, (byte) $41, <(const byte*) DISPLAY_LIST, >(const byte*) DISPLAY_LIST }
|
||||
(const nomodify byte**) SDLST = (byte**)(number) $230
|
||||
(const nomodify byte*) SDMCTL = (byte*)(number) $22f
|
||||
(const byte*) TEXT[] = { (byte)(byte) 'h'|(number) $20, (byte)(byte) 'e'|(number) $20, (byte)(byte) 'l'|(number) $20, (byte)(byte) 'l'|(number) $20, (byte)(byte) 'o'|(number) $20, (byte) 0, (byte)(byte) 'x'|(number) $60, (byte)(byte) 't'|(number) $60, (byte) 0, (byte)(byte) 'w'|(number) $20, (byte)(byte) 'o'|(number) $20, (byte)(byte) 'r'|(number) $20, (byte)(byte) 'l'|(number) $20, (byte)(byte) 'd'|(number) $20, (byte) $41, (byte) 0, (byte) 0, (byte) 0, (byte) 0 }
|
||||
(void()) __start()
|
||||
(label) __start::@1
|
||||
(label) __start::@2
|
||||
(label) __start::@return
|
||||
(label) __start::__init1
|
||||
(void()) main()
|
||||
(bool~) main::$0
|
||||
(label) main::@1
|
||||
@ -92,7 +206,9 @@ Removing unused block main::@return
|
||||
Successful SSA optimization Pass2EliminateUnusedBlocks
|
||||
Removing unused procedure __start
|
||||
Removing unused procedure block __start
|
||||
Removing unused procedure block __start::__init1
|
||||
Removing unused procedure block __start::@1
|
||||
Removing unused procedure block __start::@2
|
||||
Removing unused procedure block __start::@return
|
||||
Successful SSA optimization PassNEliminateEmptyStart
|
||||
Simplifying constant integer cast (byte) 'h'|(byte) $20
|
||||
@ -128,6 +244,105 @@ main::@1: scope:[main] from main main::@1
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
(byte) ATARI_ANTIC::CHACTL
|
||||
(byte) ATARI_ANTIC::CHBASE
|
||||
(byte*) ATARI_ANTIC::DLIST
|
||||
(byte) ATARI_ANTIC::DMACTL
|
||||
(byte) ATARI_ANTIC::HSCROL
|
||||
(byte) ATARI_ANTIC::NMIEN
|
||||
(byte) ATARI_ANTIC::NMIST
|
||||
(byte) ATARI_ANTIC::PENH
|
||||
(byte) ATARI_ANTIC::PENV
|
||||
(byte) ATARI_ANTIC::PMBASE
|
||||
(byte) ATARI_ANTIC::UNUSED1
|
||||
(byte) ATARI_ANTIC::UNUSED2
|
||||
(byte) ATARI_ANTIC::VCOUNT
|
||||
(byte) ATARI_ANTIC::VSCROL
|
||||
(byte) ATARI_ANTIC::WSYNC
|
||||
(byte) ATARI_GTIA_READ::CONSOL
|
||||
(byte) ATARI_GTIA_READ::M0PF
|
||||
(byte) ATARI_GTIA_READ::M0PL
|
||||
(byte) ATARI_GTIA_READ::M1PF
|
||||
(byte) ATARI_GTIA_READ::M1PL
|
||||
(byte) ATARI_GTIA_READ::M2PF
|
||||
(byte) ATARI_GTIA_READ::M2PL
|
||||
(byte) ATARI_GTIA_READ::M3PF
|
||||
(byte) ATARI_GTIA_READ::M3PL
|
||||
(byte) ATARI_GTIA_READ::P0PF
|
||||
(byte) ATARI_GTIA_READ::P0PL
|
||||
(byte) ATARI_GTIA_READ::P1PF
|
||||
(byte) ATARI_GTIA_READ::P1PL
|
||||
(byte) ATARI_GTIA_READ::P2PF
|
||||
(byte) ATARI_GTIA_READ::P2PL
|
||||
(byte) ATARI_GTIA_READ::P3PF
|
||||
(byte) ATARI_GTIA_READ::P3PL
|
||||
(byte) ATARI_GTIA_READ::PAL
|
||||
(byte) ATARI_GTIA_READ::TRIG0
|
||||
(byte) ATARI_GTIA_READ::TRIG1
|
||||
(byte) ATARI_GTIA_READ::TRIG2
|
||||
(byte) ATARI_GTIA_READ::TRIG3
|
||||
(byte) ATARI_GTIA_WRITE::COLBK
|
||||
(byte) ATARI_GTIA_WRITE::COLPF0
|
||||
(byte) ATARI_GTIA_WRITE::COLPF1
|
||||
(byte) ATARI_GTIA_WRITE::COLPF2
|
||||
(byte) ATARI_GTIA_WRITE::COLPF3
|
||||
(byte) ATARI_GTIA_WRITE::COLPM0
|
||||
(byte) ATARI_GTIA_WRITE::COLPM1
|
||||
(byte) ATARI_GTIA_WRITE::COLPM2
|
||||
(byte) ATARI_GTIA_WRITE::COLPM3
|
||||
(byte) ATARI_GTIA_WRITE::CONSPK
|
||||
(byte) ATARI_GTIA_WRITE::GRACTL
|
||||
(byte) ATARI_GTIA_WRITE::GRAFM
|
||||
(byte) ATARI_GTIA_WRITE::GRAFP0
|
||||
(byte) ATARI_GTIA_WRITE::GRAFP1
|
||||
(byte) ATARI_GTIA_WRITE::GRAFP2
|
||||
(byte) ATARI_GTIA_WRITE::GRAFP3
|
||||
(byte) ATARI_GTIA_WRITE::HITCLR
|
||||
(byte) ATARI_GTIA_WRITE::HPOSM0
|
||||
(byte) ATARI_GTIA_WRITE::HPOSM1
|
||||
(byte) ATARI_GTIA_WRITE::HPOSM2
|
||||
(byte) ATARI_GTIA_WRITE::HPOSM3
|
||||
(byte) ATARI_GTIA_WRITE::HPOSP0
|
||||
(byte) ATARI_GTIA_WRITE::HPOSP1
|
||||
(byte) ATARI_GTIA_WRITE::HPOSP2
|
||||
(byte) ATARI_GTIA_WRITE::HPOSP3
|
||||
(byte) ATARI_GTIA_WRITE::PRIOR
|
||||
(byte) ATARI_GTIA_WRITE::SIZEM
|
||||
(byte) ATARI_GTIA_WRITE::SIZEP0
|
||||
(byte) ATARI_GTIA_WRITE::SIZEP1
|
||||
(byte) ATARI_GTIA_WRITE::SIZEP2
|
||||
(byte) ATARI_GTIA_WRITE::SIZEP3
|
||||
(byte) ATARI_GTIA_WRITE::VDELAY
|
||||
(byte) ATARI_POKEY_READ::ALLPOT
|
||||
(byte) ATARI_POKEY_READ::IRQST
|
||||
(byte) ATARI_POKEY_READ::KBCODE
|
||||
(byte) ATARI_POKEY_READ::POT0
|
||||
(byte) ATARI_POKEY_READ::POT1
|
||||
(byte) ATARI_POKEY_READ::POT2
|
||||
(byte) ATARI_POKEY_READ::POT3
|
||||
(byte) ATARI_POKEY_READ::POT4
|
||||
(byte) ATARI_POKEY_READ::POT5
|
||||
(byte) ATARI_POKEY_READ::POT6
|
||||
(byte) ATARI_POKEY_READ::POT7
|
||||
(byte) ATARI_POKEY_READ::RANDOM
|
||||
(byte) ATARI_POKEY_READ::SERIN
|
||||
(byte) ATARI_POKEY_READ::SKSTAT
|
||||
(byte) ATARI_POKEY_WRITE::AUDC1
|
||||
(byte) ATARI_POKEY_WRITE::AUDC2
|
||||
(byte) ATARI_POKEY_WRITE::AUDC3
|
||||
(byte) ATARI_POKEY_WRITE::AUDC4
|
||||
(byte) ATARI_POKEY_WRITE::AUDCTL
|
||||
(byte) ATARI_POKEY_WRITE::AUDF1
|
||||
(byte) ATARI_POKEY_WRITE::AUDF2
|
||||
(byte) ATARI_POKEY_WRITE::AUDF3
|
||||
(byte) ATARI_POKEY_WRITE::AUDF4
|
||||
(byte) ATARI_POKEY_WRITE::IRQEN
|
||||
(byte) ATARI_POKEY_WRITE::POTGO
|
||||
(byte) ATARI_POKEY_WRITE::SEROUT
|
||||
(byte) ATARI_POKEY_WRITE::SKCTL
|
||||
(byte) ATARI_POKEY_WRITE::SKREST
|
||||
(byte) ATARI_POKEY_WRITE::STIMER
|
||||
(byte) ATARI_POKEY_WRITE::UNUSED
|
||||
(void()) main()
|
||||
|
||||
Initial phi equivalence classes
|
||||
@ -144,15 +359,6 @@ Target platform is atarixl / MOS6502X
|
||||
// Atari XL/XE XEX file minimal file
|
||||
// https://www.atarimax.com/jindroush.atari.org/afmtexe.html
|
||||
.file [name="helloxl.xex", type="bin", segments="XexFile"]
|
||||
.segmentdef Program [segments="ProgramStart, Code, Data, ProgramEnd"]
|
||||
.segmentdef ProgramStart [start=$2000]
|
||||
.segmentdef Code [startAfter="ProgramStart"]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segmentdef ProgramEnd [startAfter="Data"]
|
||||
.segment ProgramStart
|
||||
ProgramStart:
|
||||
.segment ProgramEnd
|
||||
ProgramEnd:
|
||||
.segmentdef XexFile
|
||||
.segment XexFile
|
||||
// Binary File Header
|
||||
@ -162,11 +368,21 @@ ProgramEnd:
|
||||
.segmentout [ segments="Program" ]
|
||||
// RunAd - Run Address Segment [start address, end address, data]
|
||||
.word $02e0, $02e1
|
||||
.word main
|
||||
.word main
|
||||
.segmentdef Program [segments="ProgramStart, Code, Data, ProgramEnd"]
|
||||
.segmentdef ProgramStart [start=$2000]
|
||||
.segment ProgramStart
|
||||
ProgramStart:
|
||||
.segmentdef Code [startAfter="ProgramStart"]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segmentdef ProgramEnd [startAfter="Data"]
|
||||
.segment ProgramEnd
|
||||
ProgramEnd:
|
||||
|
||||
// Global Constants & labels
|
||||
// OS Shadow ANTIC Direct Memory Access Control
|
||||
// OS Shadow ANTIC Direct Memory Access Control ($D400)
|
||||
.label SDMCTL = $22f
|
||||
// OS Shadow ANTIC Display List Pointer
|
||||
// OS Shadow ANTIC Display List Pointer ($D402)
|
||||
.label SDLST = $230
|
||||
.segment Code
|
||||
// main
|
||||
@ -193,7 +409,7 @@ main: {
|
||||
// File Data
|
||||
.segment Data
|
||||
// Message to show
|
||||
// Encoding: atari_internal
|
||||
// Encoding: atari_screencode
|
||||
TEXT: .byte 'h'|$20, 'e'|$20, 'l'|$20, 'l'|$20, 'o'|$20, 0, 'x'|$60, 't'|$60, 0, 'w'|$20, 'o'|$20, 'r'|$20, 'l'|$20, 'd'|$20, $41, 0, 0, 0, 0
|
||||
// ANTIC Display List Program
|
||||
// https://en.wikipedia.org/wiki/ANTIC
|
||||
@ -204,9 +420,19 @@ Statement [0] *((const nomodify byte*) SDMCTL) ← (byte) $21 [ ] ( [ ] { } )
|
||||
Statement [1] *((const nomodify byte**) SDLST) ← (const byte*) DISPLAY_LIST [ ] ( [ ] { } ) always clobbers reg byte a
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [ATARI_ANTIC]
|
||||
Uplift Scope [ATARI_GTIA_READ]
|
||||
Uplift Scope [ATARI_GTIA_WRITE]
|
||||
Uplift Scope [ATARI_POKEY_READ]
|
||||
Uplift Scope [ATARI_POKEY_WRITE]
|
||||
Uplift Scope [main]
|
||||
Uplift Scope []
|
||||
|
||||
Uplifting [ATARI_ANTIC] best 78 combination
|
||||
Uplifting [ATARI_GTIA_READ] best 78 combination
|
||||
Uplifting [ATARI_GTIA_WRITE] best 78 combination
|
||||
Uplifting [ATARI_POKEY_READ] best 78 combination
|
||||
Uplifting [ATARI_POKEY_WRITE] best 78 combination
|
||||
Uplifting [main] best 78 combination
|
||||
Uplifting [] best 78 combination
|
||||
|
||||
@ -220,15 +446,6 @@ ASSEMBLER BEFORE OPTIMIZATION
|
||||
// Atari XL/XE XEX file minimal file
|
||||
// https://www.atarimax.com/jindroush.atari.org/afmtexe.html
|
||||
.file [name="helloxl.xex", type="bin", segments="XexFile"]
|
||||
.segmentdef Program [segments="ProgramStart, Code, Data, ProgramEnd"]
|
||||
.segmentdef ProgramStart [start=$2000]
|
||||
.segmentdef Code [startAfter="ProgramStart"]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segmentdef ProgramEnd [startAfter="Data"]
|
||||
.segment ProgramStart
|
||||
ProgramStart:
|
||||
.segment ProgramEnd
|
||||
ProgramEnd:
|
||||
.segmentdef XexFile
|
||||
.segment XexFile
|
||||
// Binary File Header
|
||||
@ -238,11 +455,21 @@ ProgramEnd:
|
||||
.segmentout [ segments="Program" ]
|
||||
// RunAd - Run Address Segment [start address, end address, data]
|
||||
.word $02e0, $02e1
|
||||
.word main
|
||||
.word main
|
||||
.segmentdef Program [segments="ProgramStart, Code, Data, ProgramEnd"]
|
||||
.segmentdef ProgramStart [start=$2000]
|
||||
.segment ProgramStart
|
||||
ProgramStart:
|
||||
.segmentdef Code [startAfter="ProgramStart"]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segmentdef ProgramEnd [startAfter="Data"]
|
||||
.segment ProgramEnd
|
||||
ProgramEnd:
|
||||
|
||||
// Global Constants & labels
|
||||
// OS Shadow ANTIC Direct Memory Access Control
|
||||
// OS Shadow ANTIC Direct Memory Access Control ($D400)
|
||||
.label SDMCTL = $22f
|
||||
// OS Shadow ANTIC Display List Pointer
|
||||
// OS Shadow ANTIC Display List Pointer ($D402)
|
||||
.label SDLST = $230
|
||||
.segment Code
|
||||
// main
|
||||
@ -269,7 +496,7 @@ main: {
|
||||
// File Data
|
||||
.segment Data
|
||||
// Message to show
|
||||
// Encoding: atari_internal
|
||||
// Encoding: atari_screencode
|
||||
TEXT: .byte 'h'|$20, 'e'|$20, 'l'|$20, 'l'|$20, 'o'|$20, 0, 'x'|$60, 't'|$60, 0, 'w'|$20, 'o'|$20, 'r'|$20, 'l'|$20, 'd'|$20, $41, 0, 0, 0, 0
|
||||
// ANTIC Display List Program
|
||||
// https://en.wikipedia.org/wiki/ANTIC
|
||||
@ -286,6 +513,107 @@ Relabelling long label __b1_from___b1 to __b1
|
||||
Succesful ASM optimization Pass5RelabelLongLabels
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
(byte) ATARI_ANTIC::CHACTL
|
||||
(byte) ATARI_ANTIC::CHBASE
|
||||
(byte*) ATARI_ANTIC::DLIST
|
||||
(byte) ATARI_ANTIC::DMACTL
|
||||
(byte) ATARI_ANTIC::HSCROL
|
||||
(byte) ATARI_ANTIC::NMIEN
|
||||
(byte) ATARI_ANTIC::NMIST
|
||||
(byte) ATARI_ANTIC::PENH
|
||||
(byte) ATARI_ANTIC::PENV
|
||||
(byte) ATARI_ANTIC::PMBASE
|
||||
(byte) ATARI_ANTIC::UNUSED1
|
||||
(byte) ATARI_ANTIC::UNUSED2
|
||||
(byte) ATARI_ANTIC::VCOUNT
|
||||
(byte) ATARI_ANTIC::VSCROL
|
||||
(byte) ATARI_ANTIC::WSYNC
|
||||
(byte) ATARI_GTIA_READ::CONSOL
|
||||
(byte) ATARI_GTIA_READ::M0PF
|
||||
(byte) ATARI_GTIA_READ::M0PL
|
||||
(byte) ATARI_GTIA_READ::M1PF
|
||||
(byte) ATARI_GTIA_READ::M1PL
|
||||
(byte) ATARI_GTIA_READ::M2PF
|
||||
(byte) ATARI_GTIA_READ::M2PL
|
||||
(byte) ATARI_GTIA_READ::M3PF
|
||||
(byte) ATARI_GTIA_READ::M3PL
|
||||
(byte) ATARI_GTIA_READ::P0PF
|
||||
(byte) ATARI_GTIA_READ::P0PL
|
||||
(byte) ATARI_GTIA_READ::P1PF
|
||||
(byte) ATARI_GTIA_READ::P1PL
|
||||
(byte) ATARI_GTIA_READ::P2PF
|
||||
(byte) ATARI_GTIA_READ::P2PL
|
||||
(byte) ATARI_GTIA_READ::P3PF
|
||||
(byte) ATARI_GTIA_READ::P3PL
|
||||
(byte) ATARI_GTIA_READ::PAL
|
||||
(byte) ATARI_GTIA_READ::TRIG0
|
||||
(byte) ATARI_GTIA_READ::TRIG1
|
||||
(byte) ATARI_GTIA_READ::TRIG2
|
||||
(byte) ATARI_GTIA_READ::TRIG3
|
||||
(const byte*) ATARI_GTIA_READ::UNUSED[(number) $a] = { fill( $a, 0) }
|
||||
(byte) ATARI_GTIA_WRITE::COLBK
|
||||
(byte) ATARI_GTIA_WRITE::COLPF0
|
||||
(byte) ATARI_GTIA_WRITE::COLPF1
|
||||
(byte) ATARI_GTIA_WRITE::COLPF2
|
||||
(byte) ATARI_GTIA_WRITE::COLPF3
|
||||
(byte) ATARI_GTIA_WRITE::COLPM0
|
||||
(byte) ATARI_GTIA_WRITE::COLPM1
|
||||
(byte) ATARI_GTIA_WRITE::COLPM2
|
||||
(byte) ATARI_GTIA_WRITE::COLPM3
|
||||
(byte) ATARI_GTIA_WRITE::CONSPK
|
||||
(byte) ATARI_GTIA_WRITE::GRACTL
|
||||
(byte) ATARI_GTIA_WRITE::GRAFM
|
||||
(byte) ATARI_GTIA_WRITE::GRAFP0
|
||||
(byte) ATARI_GTIA_WRITE::GRAFP1
|
||||
(byte) ATARI_GTIA_WRITE::GRAFP2
|
||||
(byte) ATARI_GTIA_WRITE::GRAFP3
|
||||
(byte) ATARI_GTIA_WRITE::HITCLR
|
||||
(byte) ATARI_GTIA_WRITE::HPOSM0
|
||||
(byte) ATARI_GTIA_WRITE::HPOSM1
|
||||
(byte) ATARI_GTIA_WRITE::HPOSM2
|
||||
(byte) ATARI_GTIA_WRITE::HPOSM3
|
||||
(byte) ATARI_GTIA_WRITE::HPOSP0
|
||||
(byte) ATARI_GTIA_WRITE::HPOSP1
|
||||
(byte) ATARI_GTIA_WRITE::HPOSP2
|
||||
(byte) ATARI_GTIA_WRITE::HPOSP3
|
||||
(byte) ATARI_GTIA_WRITE::PRIOR
|
||||
(byte) ATARI_GTIA_WRITE::SIZEM
|
||||
(byte) ATARI_GTIA_WRITE::SIZEP0
|
||||
(byte) ATARI_GTIA_WRITE::SIZEP1
|
||||
(byte) ATARI_GTIA_WRITE::SIZEP2
|
||||
(byte) ATARI_GTIA_WRITE::SIZEP3
|
||||
(byte) ATARI_GTIA_WRITE::VDELAY
|
||||
(byte) ATARI_POKEY_READ::ALLPOT
|
||||
(byte) ATARI_POKEY_READ::IRQST
|
||||
(byte) ATARI_POKEY_READ::KBCODE
|
||||
(byte) ATARI_POKEY_READ::POT0
|
||||
(byte) ATARI_POKEY_READ::POT1
|
||||
(byte) ATARI_POKEY_READ::POT2
|
||||
(byte) ATARI_POKEY_READ::POT3
|
||||
(byte) ATARI_POKEY_READ::POT4
|
||||
(byte) ATARI_POKEY_READ::POT5
|
||||
(byte) ATARI_POKEY_READ::POT6
|
||||
(byte) ATARI_POKEY_READ::POT7
|
||||
(byte) ATARI_POKEY_READ::RANDOM
|
||||
(byte) ATARI_POKEY_READ::SERIN
|
||||
(byte) ATARI_POKEY_READ::SKSTAT
|
||||
(const byte*) ATARI_POKEY_READ::UNUSED[(number) 2] = { fill( 2, 0) }
|
||||
(byte) ATARI_POKEY_WRITE::AUDC1
|
||||
(byte) ATARI_POKEY_WRITE::AUDC2
|
||||
(byte) ATARI_POKEY_WRITE::AUDC3
|
||||
(byte) ATARI_POKEY_WRITE::AUDC4
|
||||
(byte) ATARI_POKEY_WRITE::AUDCTL
|
||||
(byte) ATARI_POKEY_WRITE::AUDF1
|
||||
(byte) ATARI_POKEY_WRITE::AUDF2
|
||||
(byte) ATARI_POKEY_WRITE::AUDF3
|
||||
(byte) ATARI_POKEY_WRITE::AUDF4
|
||||
(byte) ATARI_POKEY_WRITE::IRQEN
|
||||
(byte) ATARI_POKEY_WRITE::POTGO
|
||||
(byte) ATARI_POKEY_WRITE::SEROUT
|
||||
(byte) ATARI_POKEY_WRITE::SKCTL
|
||||
(byte) ATARI_POKEY_WRITE::SKREST
|
||||
(byte) ATARI_POKEY_WRITE::STIMER
|
||||
(byte) ATARI_POKEY_WRITE::UNUSED
|
||||
(const byte*) DISPLAY_LIST[] = { (byte) $70, (byte) $70, (byte) $70, (byte) $47, <(const byte*) TEXT, >(const byte*) TEXT, (byte) $41, <(const byte*) DISPLAY_LIST, >(const byte*) DISPLAY_LIST }
|
||||
(const nomodify byte**) SDLST = (byte**) 560
|
||||
(const nomodify byte*) SDMCTL = (byte*) 559
|
||||
@ -307,15 +635,6 @@ Score: 48
|
||||
// Atari XL/XE XEX file minimal file
|
||||
// https://www.atarimax.com/jindroush.atari.org/afmtexe.html
|
||||
.file [name="helloxl.xex", type="bin", segments="XexFile"]
|
||||
.segmentdef Program [segments="ProgramStart, Code, Data, ProgramEnd"]
|
||||
.segmentdef ProgramStart [start=$2000]
|
||||
.segmentdef Code [startAfter="ProgramStart"]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segmentdef ProgramEnd [startAfter="Data"]
|
||||
.segment ProgramStart
|
||||
ProgramStart:
|
||||
.segment ProgramEnd
|
||||
ProgramEnd:
|
||||
.segmentdef XexFile
|
||||
.segment XexFile
|
||||
// Binary File Header
|
||||
@ -325,11 +644,21 @@ ProgramEnd:
|
||||
.segmentout [ segments="Program" ]
|
||||
// RunAd - Run Address Segment [start address, end address, data]
|
||||
.word $02e0, $02e1
|
||||
.word main
|
||||
.word main
|
||||
.segmentdef Program [segments="ProgramStart, Code, Data, ProgramEnd"]
|
||||
.segmentdef ProgramStart [start=$2000]
|
||||
.segment ProgramStart
|
||||
ProgramStart:
|
||||
.segmentdef Code [startAfter="ProgramStart"]
|
||||
.segmentdef Data [startAfter="Code"]
|
||||
.segmentdef ProgramEnd [startAfter="Data"]
|
||||
.segment ProgramEnd
|
||||
ProgramEnd:
|
||||
|
||||
// Global Constants & labels
|
||||
// OS Shadow ANTIC Direct Memory Access Control
|
||||
// OS Shadow ANTIC Direct Memory Access Control ($D400)
|
||||
.label SDMCTL = $22f
|
||||
// OS Shadow ANTIC Display List Pointer
|
||||
// OS Shadow ANTIC Display List Pointer ($D402)
|
||||
.label SDLST = $230
|
||||
.segment Code
|
||||
// main
|
||||
@ -355,7 +684,7 @@ main: {
|
||||
// File Data
|
||||
.segment Data
|
||||
// Message to show
|
||||
// Encoding: atari_internal
|
||||
// Encoding: atari_screencode
|
||||
TEXT: .byte 'h'|$20, 'e'|$20, 'l'|$20, 'l'|$20, 'o'|$20, 0, 'x'|$60, 't'|$60, 0, 'w'|$20, 'o'|$20, 'r'|$20, 'l'|$20, 'd'|$20, $41, 0, 0, 0, 0
|
||||
// ANTIC Display List Program
|
||||
// https://en.wikipedia.org/wiki/ANTIC
|
||||
|
@ -1,3 +1,104 @@
|
||||
(byte) ATARI_ANTIC::CHACTL
|
||||
(byte) ATARI_ANTIC::CHBASE
|
||||
(byte*) ATARI_ANTIC::DLIST
|
||||
(byte) ATARI_ANTIC::DMACTL
|
||||
(byte) ATARI_ANTIC::HSCROL
|
||||
(byte) ATARI_ANTIC::NMIEN
|
||||
(byte) ATARI_ANTIC::NMIST
|
||||
(byte) ATARI_ANTIC::PENH
|
||||
(byte) ATARI_ANTIC::PENV
|
||||
(byte) ATARI_ANTIC::PMBASE
|
||||
(byte) ATARI_ANTIC::UNUSED1
|
||||
(byte) ATARI_ANTIC::UNUSED2
|
||||
(byte) ATARI_ANTIC::VCOUNT
|
||||
(byte) ATARI_ANTIC::VSCROL
|
||||
(byte) ATARI_ANTIC::WSYNC
|
||||
(byte) ATARI_GTIA_READ::CONSOL
|
||||
(byte) ATARI_GTIA_READ::M0PF
|
||||
(byte) ATARI_GTIA_READ::M0PL
|
||||
(byte) ATARI_GTIA_READ::M1PF
|
||||
(byte) ATARI_GTIA_READ::M1PL
|
||||
(byte) ATARI_GTIA_READ::M2PF
|
||||
(byte) ATARI_GTIA_READ::M2PL
|
||||
(byte) ATARI_GTIA_READ::M3PF
|
||||
(byte) ATARI_GTIA_READ::M3PL
|
||||
(byte) ATARI_GTIA_READ::P0PF
|
||||
(byte) ATARI_GTIA_READ::P0PL
|
||||
(byte) ATARI_GTIA_READ::P1PF
|
||||
(byte) ATARI_GTIA_READ::P1PL
|
||||
(byte) ATARI_GTIA_READ::P2PF
|
||||
(byte) ATARI_GTIA_READ::P2PL
|
||||
(byte) ATARI_GTIA_READ::P3PF
|
||||
(byte) ATARI_GTIA_READ::P3PL
|
||||
(byte) ATARI_GTIA_READ::PAL
|
||||
(byte) ATARI_GTIA_READ::TRIG0
|
||||
(byte) ATARI_GTIA_READ::TRIG1
|
||||
(byte) ATARI_GTIA_READ::TRIG2
|
||||
(byte) ATARI_GTIA_READ::TRIG3
|
||||
(const byte*) ATARI_GTIA_READ::UNUSED[(number) $a] = { fill( $a, 0) }
|
||||
(byte) ATARI_GTIA_WRITE::COLBK
|
||||
(byte) ATARI_GTIA_WRITE::COLPF0
|
||||
(byte) ATARI_GTIA_WRITE::COLPF1
|
||||
(byte) ATARI_GTIA_WRITE::COLPF2
|
||||
(byte) ATARI_GTIA_WRITE::COLPF3
|
||||
(byte) ATARI_GTIA_WRITE::COLPM0
|
||||
(byte) ATARI_GTIA_WRITE::COLPM1
|
||||
(byte) ATARI_GTIA_WRITE::COLPM2
|
||||
(byte) ATARI_GTIA_WRITE::COLPM3
|
||||
(byte) ATARI_GTIA_WRITE::CONSPK
|
||||
(byte) ATARI_GTIA_WRITE::GRACTL
|
||||
(byte) ATARI_GTIA_WRITE::GRAFM
|
||||
(byte) ATARI_GTIA_WRITE::GRAFP0
|
||||
(byte) ATARI_GTIA_WRITE::GRAFP1
|
||||
(byte) ATARI_GTIA_WRITE::GRAFP2
|
||||
(byte) ATARI_GTIA_WRITE::GRAFP3
|
||||
(byte) ATARI_GTIA_WRITE::HITCLR
|
||||
(byte) ATARI_GTIA_WRITE::HPOSM0
|
||||
(byte) ATARI_GTIA_WRITE::HPOSM1
|
||||
(byte) ATARI_GTIA_WRITE::HPOSM2
|
||||
(byte) ATARI_GTIA_WRITE::HPOSM3
|
||||
(byte) ATARI_GTIA_WRITE::HPOSP0
|
||||
(byte) ATARI_GTIA_WRITE::HPOSP1
|
||||
(byte) ATARI_GTIA_WRITE::HPOSP2
|
||||
(byte) ATARI_GTIA_WRITE::HPOSP3
|
||||
(byte) ATARI_GTIA_WRITE::PRIOR
|
||||
(byte) ATARI_GTIA_WRITE::SIZEM
|
||||
(byte) ATARI_GTIA_WRITE::SIZEP0
|
||||
(byte) ATARI_GTIA_WRITE::SIZEP1
|
||||
(byte) ATARI_GTIA_WRITE::SIZEP2
|
||||
(byte) ATARI_GTIA_WRITE::SIZEP3
|
||||
(byte) ATARI_GTIA_WRITE::VDELAY
|
||||
(byte) ATARI_POKEY_READ::ALLPOT
|
||||
(byte) ATARI_POKEY_READ::IRQST
|
||||
(byte) ATARI_POKEY_READ::KBCODE
|
||||
(byte) ATARI_POKEY_READ::POT0
|
||||
(byte) ATARI_POKEY_READ::POT1
|
||||
(byte) ATARI_POKEY_READ::POT2
|
||||
(byte) ATARI_POKEY_READ::POT3
|
||||
(byte) ATARI_POKEY_READ::POT4
|
||||
(byte) ATARI_POKEY_READ::POT5
|
||||
(byte) ATARI_POKEY_READ::POT6
|
||||
(byte) ATARI_POKEY_READ::POT7
|
||||
(byte) ATARI_POKEY_READ::RANDOM
|
||||
(byte) ATARI_POKEY_READ::SERIN
|
||||
(byte) ATARI_POKEY_READ::SKSTAT
|
||||
(const byte*) ATARI_POKEY_READ::UNUSED[(number) 2] = { fill( 2, 0) }
|
||||
(byte) ATARI_POKEY_WRITE::AUDC1
|
||||
(byte) ATARI_POKEY_WRITE::AUDC2
|
||||
(byte) ATARI_POKEY_WRITE::AUDC3
|
||||
(byte) ATARI_POKEY_WRITE::AUDC4
|
||||
(byte) ATARI_POKEY_WRITE::AUDCTL
|
||||
(byte) ATARI_POKEY_WRITE::AUDF1
|
||||
(byte) ATARI_POKEY_WRITE::AUDF2
|
||||
(byte) ATARI_POKEY_WRITE::AUDF3
|
||||
(byte) ATARI_POKEY_WRITE::AUDF4
|
||||
(byte) ATARI_POKEY_WRITE::IRQEN
|
||||
(byte) ATARI_POKEY_WRITE::POTGO
|
||||
(byte) ATARI_POKEY_WRITE::SEROUT
|
||||
(byte) ATARI_POKEY_WRITE::SKCTL
|
||||
(byte) ATARI_POKEY_WRITE::SKREST
|
||||
(byte) ATARI_POKEY_WRITE::STIMER
|
||||
(byte) ATARI_POKEY_WRITE::UNUSED
|
||||
(const byte*) DISPLAY_LIST[] = { (byte) $70, (byte) $70, (byte) $70, (byte) $47, <(const byte*) TEXT, >(const byte*) TEXT, (byte) $41, <(const byte*) DISPLAY_LIST, >(const byte*) DISPLAY_LIST }
|
||||
(const nomodify byte**) SDLST = (byte**) 560
|
||||
(const nomodify byte*) SDMCTL = (byte*) 559
|
||||
|
Loading…
Reference in New Issue
Block a user