; this file needs to be assembled with: ; cl65 -o newtitle.xex -t none newtitle.s ; It contains only an init routine, no run address. .include "atari.inc" ; where our screen was loaded (see newtitle.pl) screendata = $9000 ; homebrew atari xex header .word $ffff .word version .word end-1 ; needs to be above the BSS (see taipan.map). we'll place it right at ; the end of screendata. .org $a800 version: .incbin "ver.dat" colorchoices: .byte $c0,$10,$00 colorcount = (*-colorchoices)-1 ; executable code here start: ; setup color registers lda #$c0 ; dark green sta COLOR2 ; text bg lda #$0c ; white sta COLOR1 ; turn off screen, in case vblank happens while we work lda #0 sta SDMCTL ; build our display list ; wait for the next frame, to avoid graphics glitching jsr wait1jiffy ; setup our display list lda SDLSTL sta FR0 lda SDLSTH sta FR0+1 lda #dlist sta SDLSTH ; switch to narrow playfield, enable screen lda #$21 sta SDMCTL ; clear any keypress that happened during loading lda #$ff sta CH ldx #0 ; X = index into color choices ; wait for user to press a key wait4key: lda colorchoices,x sta COLOR2 lda CH cmp #$ff beq wait4key cmp #39 ; atari logo key bne keyok dex bpl x_ok ldx #colorcount x_ok: lda #$ff sta CH bne wait4key keyok: ; eat the keypress lda #$ff sta CH rts ; return to DOS (which loads the rest of the game) wait1jiffy: lda RTCLOK+2 wait: cmp RTCLOK+2 beq wait rts ; display list here dlist: .byte $70 ; 24 scanlines of blanks .byte $70 .byte $70 ; .byte $30 ; 4 more since image is only 184 lines tall .byte $0f | $40 ; LMS, BASIC mode 8 .word screendata .repeat 127 .byte $0f ; 127 more scanlines of mode 8 .endrepeat .byte $0f | $40 ; Hit 4K boundary, LMS again .word screendata+$1000 .repeat 55 .byte $0f ; 55 more scanlines of mode 8 .endrepeat ; .byte $30 ; blank 4 lines to match GR.8 (does it even matter?) .byte $02 | $40 ; LMS, 1 line of GR.0 for the version .word version .byte $41 ; JVB, jump & wait for vblank .word dlist end: .word INITAD .word INITAD+1 .word start