1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-12-27 09:31:18 +00:00

Extended display list sample code.

This commit is contained in:
jespergravgaard 2020-08-08 11:07:53 +02:00
parent f794626be6
commit 17441047cd
6 changed files with 24 additions and 21 deletions

View File

@ -2,10 +2,10 @@
"extension": "a26",
"link": "atari2600.ld",
"cpu": "MOS6502X",
"emulator": "stella",
"zp_reserve": [ "0x00..0x7f" ],
"encoding": "screencode_atari",
"defines": {
"__ATARI2600__": 1
}
},
"emulator": "stella"
}

View File

@ -2,9 +2,9 @@
"extension": "xex",
"link": "atarixl.ld",
"cpu": "MOS6502X",
"emulator": "atari800 -xl",
"encoding": "screencode_atari",
"defines": {
"__ATARIXL__": 1
}
},
"emulator": "atari800 -xl"
}

View File

@ -17,13 +17,16 @@ void main() {
}
// Message to show
char TEXT[] = "hello XT world! ";
char TEXT[] = "HELLO atari 8BIT"
"Demonstrates ANTIC display list"
;
// ANTIC Display List Program
// https://en.wikipedia.org/wiki/ANTIC
char DISPLAY_LIST[] = {
0x70, 0x70, 0x70, // 3* BLK 8 (0x70) 8 blank lines
0x47, <TEXT, >TEXT, // LMS 7, TEXT (0x47) Load memory address and set to charmode 7 (16/20/24 chars wide, 16 lines per char)
0x47, <TEXT, >TEXT, // LMS 7, TEXT (0x47) Load memory address and set to charmode 7 (16/20/24 chars wide, 16 lines per char)
0x70, // BLK 8 (0x70) 8 blank lines
0x02, // 2, TEXT (0x02) Charmode 2 (32/40/48 chars wide, 8 lines per char)
0x41, <DISPLAY_LIST, >DISPLAY_LIST // JVB DISPLAY_LIST (0x41) jump and wait for VBLANK
};

View File

@ -48,8 +48,8 @@ main: {
.segment Data
// Message to show
.encoding "ascii"
TEXT: .text @"hello\$00\$38\$34\$00world\$01\$00"
TEXT: .text @"\$28\$25\$2c\$2c\$2f\$00atari\$00\$18\$22\$29\$34\$24emonstrates\$00\$21\$2e\$34\$29\$23\$00display\$00list"
.byte 0
// ANTIC Display List Program
// https://en.wikipedia.org/wiki/ANTIC
DISPLAY_LIST: .byte $70, $70, $70, $47, <TEXT, >TEXT, $41, <DISPLAY_LIST, >DISPLAY_LIST
DISPLAY_LIST: .byte $70, $70, $70, $47, <TEXT, >TEXT, $70, 2, $41, <DISPLAY_LIST, >DISPLAY_LIST

View File

@ -138,10 +138,10 @@ SYMBOL TABLE SSA
(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 byte*) DISPLAY_LIST[] = { (byte) $70, (byte) $70, (byte) $70, (byte) $47, <(const byte*) TEXT, >(const byte*) TEXT, (byte) $70, (byte) 2, (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*) "hello XT world! "sa
(const byte*) TEXT[] = (byte*) "HELLO atari 8BITDemonstrates ANTIC display list"sa
(void()) __start()
(label) __start::@1
(label) __start::@2
@ -361,11 +361,11 @@ main: {
.segment Data
// Message to show
.encoding "ascii"
TEXT: .text @"hello\$00\$38\$34\$00world\$01\$00"
TEXT: .text @"\$28\$25\$2c\$2c\$2f\$00atari\$00\$18\$22\$29\$34\$24emonstrates\$00\$21\$2e\$34\$29\$23\$00display\$00list"
.byte 0
// ANTIC Display List Program
// https://en.wikipedia.org/wiki/ANTIC
DISPLAY_LIST: .byte $70, $70, $70, $47, <TEXT, >TEXT, $41, <DISPLAY_LIST, >DISPLAY_LIST
DISPLAY_LIST: .byte $70, $70, $70, $47, <TEXT, >TEXT, $70, 2, $41, <DISPLAY_LIST, >DISPLAY_LIST
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] *((const nomodify byte*) SDMCTL) ← (byte) $21 [ ] ( [ ] { } ) always clobbers reg byte a
@ -449,11 +449,11 @@ main: {
.segment Data
// Message to show
.encoding "ascii"
TEXT: .text @"hello\$00\$38\$34\$00world\$01\$00"
TEXT: .text @"\$28\$25\$2c\$2c\$2f\$00atari\$00\$18\$22\$29\$34\$24emonstrates\$00\$21\$2e\$34\$29\$23\$00display\$00list"
.byte 0
// ANTIC Display List Program
// https://en.wikipedia.org/wiki/ANTIC
DISPLAY_LIST: .byte $70, $70, $70, $47, <TEXT, >TEXT, $41, <DISPLAY_LIST, >DISPLAY_LIST
DISPLAY_LIST: .byte $70, $70, $70, $47, <TEXT, >TEXT, $70, 2, $41, <DISPLAY_LIST, >DISPLAY_LIST
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
@ -567,10 +567,10 @@ FINAL SYMBOL TABLE
(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 byte*) DISPLAY_LIST[] = { (byte) $70, (byte) $70, (byte) $70, (byte) $47, <(const byte*) TEXT, >(const byte*) TEXT, (byte) $70, (byte) 2, (byte) $41, <(const byte*) DISPLAY_LIST, >(const byte*) DISPLAY_LIST }
(const nomodify byte**) SDLST = (byte**) 560
(const nomodify byte*) SDMCTL = (byte*) 559
(const byte*) TEXT[] = (byte*) "hello XT world! "sa
(const byte*) TEXT[] = (byte*) "HELLO atari 8BITDemonstrates ANTIC display list"sa
(void()) main()
(label) main::@1
@ -638,9 +638,9 @@ main: {
.segment Data
// Message to show
.encoding "ascii"
TEXT: .text @"hello\$00\$38\$34\$00world\$01\$00"
TEXT: .text @"\$28\$25\$2c\$2c\$2f\$00atari\$00\$18\$22\$29\$34\$24emonstrates\$00\$21\$2e\$34\$29\$23\$00display\$00list"
.byte 0
// ANTIC Display List Program
// https://en.wikipedia.org/wiki/ANTIC
DISPLAY_LIST: .byte $70, $70, $70, $47, <TEXT, >TEXT, $41, <DISPLAY_LIST, >DISPLAY_LIST
DISPLAY_LIST: .byte $70, $70, $70, $47, <TEXT, >TEXT, $70, 2, $41, <DISPLAY_LIST, >DISPLAY_LIST

View File

@ -99,10 +99,10 @@
(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 byte*) DISPLAY_LIST[] = { (byte) $70, (byte) $70, (byte) $70, (byte) $47, <(const byte*) TEXT, >(const byte*) TEXT, (byte) $70, (byte) 2, (byte) $41, <(const byte*) DISPLAY_LIST, >(const byte*) DISPLAY_LIST }
(const nomodify byte**) SDLST = (byte**) 560
(const nomodify byte*) SDMCTL = (byte*) 559
(const byte*) TEXT[] = (byte*) "hello XT world! "sa
(const byte*) TEXT[] = (byte*) "HELLO atari 8BITDemonstrates ANTIC display list"sa
(void()) main()
(label) main::@1