This page (revision-8) was last changed on 03-Feb-2023 15:21 by Stefan Haubenthal 

This page was created on 13-Mar-2010 18:13 by Carsten Strotmann

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
8 03-Feb-2023 15:21 93 KB Stefan Haubenthal to previous
7 14-Dec-2020 13:02 93 KB Carsten Strotmann to previous | to last
6 14-Dec-2020 12:48 87 KB Carsten Strotmann to previous | to last
5 13-Mar-2010 18:35 66 KB Carsten Strotmann to previous | to last
4 13-Mar-2010 18:35 66 KB Carsten Strotmann to previous | to last
3 13-Mar-2010 18:33 66 KB Carsten Strotmann to previous | to last
2 13-Mar-2010 18:33 66 KB Carsten Strotmann to previous | to last
1 13-Mar-2010 18:13 66 KB Carsten Strotmann to last

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 1,479 changed 2 lines
/* -*- C
-*- ****************************************************************
/* -*- C -*- ****************************************************************
At line 2,701 added 451 lines
!! Assembler Code (ca65)
!!! Display List Interrupts
{{{
.include "/Users/cas/develop/cc65/asminc/atari.inc"
.export _dli01
.export _dli02
.export _dli03
.export _dli04
.export _dli05
.export _menuflg
.export _fnt7
.export _fnt14
_fnt7: .incbin "seven.fnt"
_fnt14: .incbin "fourteen.fnt"
_menuflg: .byte 0
.proc _dli01
pha
txa
pha
nop
nop
ldx DLI02cnt2
L1:
lda DLI02fade2-1,x
sta WSYNC
sta COLBK
sta COLPF2
nop
dex
bne L1
lda #<_dli02
ldx #>_dli02
sta VDSLST
stx VDSLST+1
pla
tax
pla
rti
.endproc
DLI02fade: .byte $9E, $9C, $9A, $98, $96, $94, $92, $90
DLI02fadem: .byte $0E, $0C, $0A, $08, $06, $04, $02, $00
DLI02cnt: .byte 8
DLI02fade2: .byte $00, $02, $04, $06, $0E
DLI02fade2m: .byte $90, $92, $94, $96, $9E
DLI02fadepm: .byte $98, $98, $9A, $9C, $9E
DLI02cnt2: .byte 5
.proc _dli02
pha
txa
pha
ldx DLI02cnt
dex
L1:
lda _menuflg
beq X1
lda DLI02fadem-1,x
bne X2
X1:
lda DLI02fade-1,x
X2:
sta WSYNC
sta COLBK
sta COLPF2
dex
bne L1
sta WSYNC
sta COLPM0
sta COLPM1
lda #$2C
sta HPOSP0
lda #$CC
sta HPOSP1
lda #$FF
sta GRAFP0
sta GRAFP1
lda %00000010
sta GRACTL
ldx DLI02cnt2
L2:
lda DLI02fade2-1,x
sta WSYNC
sta COLPF2
lda DLI02fadepm-1,x
sta COLPM0
sta COLPM1
dex
bne L2
lda #<_dli03
ldx #>_dli03
sta VDSLST
stx VDSLST+1
pla
tax
pla
rti
.endproc
DLI03fade: .byte $90, $92, $94, $96, $98, $9A, $9C, $9E
DLI03fadem: .byte $00, $02, $04, $06, $08, $0A, $0C, $0E
DLI03cnt: .byte 8
DLI03fade2m: .byte $9E, $96, $94, $92, $90
DLI03fadepm: .byte $9E, $9C, $9A, $98, $98
DLI03fade2: .byte $0E, $06, $04, $02, $01
DLI03cnt2: .byte 5
.proc _dli03
pha
txa
pha
ldx DLI03cnt2
L1:
lda DLI03fade2-1,x
sta WSYNC
sta COLPF2
lda DLI03fadepm-1,x
sta COLPM0
sta COLPM1
dex
bne L1
sta WSYNC
lda #0
sta HPOSP0
sta HPOSP0
lda #$0
sta GRAFP0
sta GRAFP1
ldx DLI03cnt
dex
L2:
lda _menuflg
beq X1
lda DLI03fadem-1,x
bne X2
X1:
lda DLI03fade-1,x
X2:
sta WSYNC
sta COLBK
sta COLPF2
dex
bne L2
sta WSYNC
stx COLBK
stx COLPF2
lda #<_dli04
sta VDSLST
lda #>_dli04
sta VDSLST+1
pla
tax
pla
rti
.endproc
.proc _dli04
pha
txa
pha
ldx DLI02cnt2
L4:
lda _menuflg
beq X1
lda DLI02fade2m-1,x
bne X2
X1:
lda DLI02fade2-1,x
X2:
sta WSYNC
sta COLBK
sta COLPF2
dex
bne L4
stx WSYNC
stx COLBK
stx COLPF2
lda #<_dli05
sta VDSLST
lda #>_dli05
sta VDSLST+1
pla
tax
pla
rti
.endproc
.proc _dli05
pha
txa
pha
ldx DLI03cnt2
L4:
lda _menuflg
bne X1
lda DLI03fade2-1,x
bne X2
X1:
nop
nop
lda DLI03fade2m-1,x
X2:
sta WSYNC
sta COLBK
sta COLPF2
dex
bne L4
sta WSYNC
stx COLBK
stx COLPF2
lda #<_dli01
sta VDSLST
lda #>_dli01
sta VDSLST+1
pla
tax
pla
rti
.endproc
}}}
!! Access RAM under OS
{{{
; RAMXL
; routines to access RAM under OS-ROM
.word $FFFF
.word $2a00
.word end-1
.org $2a00
intv = $FFF0
nmiv = $FFFA
resv = $FFFC
irqv = $FFFE
portb = $D301
nmien = $D40E
on: jmp os_on
x_save: .byte $00
off: jmp os_off
;
doirq: stx x_save
tax ; a - irq #
jsr os_on
lda intv,x
sta jmpvec+1
lda intv+1,x
sta jmpvec+2
lda #>return
pha
lda #<return
pha
cli
php
;
jmpvec: jmp $FFFF ; -- will be overwritten
;
return: jsr os_off
ldx x_save
pla
rti
;
nmi_han: pha
lda #$0A
jmp doirq
;
irq_han: pha
lda #$0E
jmp doirq
;
os_on: lda portb
ora #$01 ; toggle OS bit on
sta portb
rts
;
os_off: lda portb
and #$FE ; toggle OS bit off
sta portb
rts
;
install: lda #0
sta nmien
sei
jsr os_off
lda #<nmi_han
sta nmiv
lda #>nmi_han
sta nmiv+1
lda #<irq_han
sta irqv
lda #>irq_han
sta irqv+1
jsr os_on
cli
lda #$40
sta nmien
rts
memcpy:
src = $f0
dst = $f2
cnt = $f4
; src = $F0-$F1
; dst = $F2-$F3
; cnt = $F4-$F5
ldy #0
L1:
lda (src),y
sta (dst),y
inc src
bne L2
inc src+1
L2:
inc dst
bne L3
inc dst+1
L3:
dec cnt
bne L1
dec cnt+1
bpl L1
rts
movetitle:
lda #<titlestart
sta src
lda #>titlestart
sta src+1
lda #<$D800 ; $D800
sta dst
lda #>$D800
sta dst+1
lda #<5472
sta cnt
lda #>5472
sta cnt+1
jsr install
jsr os_off
jsr memcpy
jsr os_on
rts
end:
;---------------------------
.word $FFFF
.word $3000
.word end2-1
.org $3000
titlestart:
.incbin "titelbild.raw"
end2:
.word $FFFF
.word $02e2
.word end3-1
.org $02e2
.word movetitle
}}}
!! Level Files
!!! Level 1 (Example)
{{{
; level 0 for ATARI Greed
; Version 1.0
; total length 130 bytes
; Magic Code, 'AG'
magic: .byte "AG"
; percent needed to complete level
percent: .byte 65
; Level Title 32 Chars
title: .byte "aller anfang ist einfach..."
.res $20 - (* - title)
; Possible values (bitfield), 10 bits
; FEDCBA9876543210
values: .word %0000001111111111 ; 0-9
; Possible goodies (bitfield), 16 Bits
; FEDCBA9876543210
goodies: .word %0000000000000000 ; no goodies
; Time in minutes
time: .byte 8 ; 8 Minutes time
; levelmask 5 x 18 bytes (bitfield)
levelmask: .incbin "level00.raw"
}}}