Wenn du es aus dem DOS starten und ggf. wieder dorthin zurückkehren willst, ist das immer noc hviel zu niedrig.
Du solltest dann nicht unter $2000 beginnen.
Moderator: Rockford
Wenn du es aus dem DOS starten und ggf. wieder dorthin zurückkehren willst, ist das immer noc hviel zu niedrig.
Das ist im Prinzip korrekt.
Code: Alles auswählen
/*
16 bars boot disc based on 510b+ from nyd2022
*/
; @com.wudsn.ide.asm.hardware=ATARI8BIT
; @com.wudsn.ide.asm.outputfileextension=.atr
opt l-
;---- ATARI addresses
hposp0 = $D000
hposp1 = $D001
hposp2 = $D002
hposp3 = $D003
sizep0 = $D008
sizep1 = $D009
sizep2 = $D00A
sizep3 = $D00B
trig0 = $D010
trig1 = $D011
colpm0 = $D012
colpm1 = $D013
colpm2 = $D014
colpm3 = $D015
colbak = $D01A
color2 = $D018
gtictl = $D01B
pmcntl = $D01D
consol = $D01F
skctl = $D20F
dmactl = $D400
pmbase = $D407
wsync = $D40A
nmien = $D40E
;---
opt l+
compileto equ $2000
sectors equ ((fin-compileto)/128)+1
opt f+ ;Activate fill mode
opt h- ;no headers
;;; ATR disk header
.word $0296, $8, $80
:10 .he 00
org compileto
;--------------------------- boot init
.proc boot
.he 00 ;always 0
dta b(sectors) ;how many sctors to load
.wo boot ;load address
.wo init ;init address (seems not to be used)
jmp start
; mva #$24 710
.endp
;--------------------------- boot init end
.proc init
;you can start an intro here
rts
.endp
;---------------------------
.zpvar .byte ct,wt,mx,shape,rega,regx,posp1,posp0
ri equ $a0 ;needs 16 bytes
pos equ $b0 ;needs 16 bytes
col equ $c0 ;needs 16 bytes
pmg equ $2000
p0 equ $2000+$400
p1 equ $2000+$500
p2 equ $2000+$600
p3 equ $2000+$700
;---------------------
.local DL
.he 70 80
:12 .he 70 ;have to use it on boot disc again
; .ds 96 ;mega cheat :) 12 times $70 or just 96 times 0 if area is clear
.he 42
.wo txt
.he 41
.wo DL
txt dta d'NYD 2022',d' 16bars_510b+ '*,d' by PPs '
.endl
;---------------------
.local dli
sta rega
stx regx
mva posp0 hposp0
mva posp1 hposp1
dec posp0
inc posp1
mva #%00111001 dmactl ;set screen width (32b,dma,players)
sta wsync
mva #$21 gtictl
;--- additional pm
rol ;$42 red
sta colpm2
rol ;$84 blue
sta colpm3
;--- additional pm
;stripes
ldx #0
@ lda start.area,x
sta colbak
and #$7f
sta colpm0
sta colpm1
lda shape
ror
ror
ror
sta color2
sta wsync
inx
cpx #210
bne @-
lda #0
sta colpm0
sta colpm1
ldx regx
lda rega
rti
.endl
;---------------------
.proc start
.proc main
jsr clear_area
mwa #DL 560
sta pmbase ;-> high byte is $20 ;)
sta 513 ;-> high of DLI is $20, too ;)
mva <dli 512
;--- set colors ;.he 00 10 20 30 40 50 60 70 80 90 a0 b0 c0 d0 e0 f0
.local setcol
ldx #15
lx lda #$f0
sta col,x
sub #$10
sta lx+1
dex
bpl lx
.endl
;---
stx shape ;$ff
stx wt
stx ct
;---------------------
.local set_pm
txa ;x and a @$ff
@ sta p0,x
sta p1,x
dex
bne @-
;--- additional pm
ldx #7
; lda #$f0
@ sta p2+113,x
sta p3+113,x
dex
bpl @-
mva #$70 posp0
sta posp1
mva #$40 hposp2
mva #$a0 hposp3
;--- additional pm
.endl
;---------------------
mva #3 sizep0
sta sizep1
;--- additional pm
sta sizep2
sta sizep3
;--- additional pm
sta pmcntl ;enable players and missiles
mva #$c0 nmien ;DLI + VBI on
lp
;Test ob Ende
/* lda trig0
beq @+
lda trig1
beq @+
lda skctl
and #$04
beq @+
lda consol
and #1
bne noend
@ jmp $e477 ;cold reset
noend
*/ dec wt
lda wt
bpl out
mva #2 wt
sta 77
dec ct
out
;---------------------
.local stripes
;run thru the 16 stripes
ldx #15
stx mx
lp_str
lda ri,x
beq hoch
runter
lda pos,x
cmp #196
beq change_up
;runter geht noch
inc pos,x
lda pos,x
tay
jsr copyshape
jmp next
change_up ;up again
ldx mx
dec ri,x
hoch
lda pos,x
beq change_down
;hoch geht noch
dec pos,x
lda pos,x
tay
jsr copyshape
jmp next
change_down ;down again
ldx mx
inc ri,x
jmp runter
next
dec mx
ldx mx
bpl lp_str
.endl
;---------------------
lda ct
bne lp
dec ct ;set back 2 $ff
jsr chg_shape
jmp lp
.endp
;---------------------
.local copyshape
;first
lda #0
sta area,y
;1
lda col,x
sta area+1,y
sta area+12,y
;2
lda col,x
ora #2
sta area+2,y
sta area+11,y
;3
lda col,x
ora #4
sta area+3,y
sta area+10,y
;4
lda col,x
ora #6
sta area+4,y
sta area+9,y
;5
lda col,x
ora #8
sta area+5,y
sta area+8,y
;6
lda col,x
ora #10
sta area+6,y
sta area+7,y
;last
lda #0
sta area+13,y
rts
.endl
;---------------------
.local clear_area
ldx #15
@ lda posi,x
sta pos,x
lda #1
sta ri,x
dex
bpl @-
inx
txa ;0
@ sta area,x
dex
bne @-
rts
;----------
posi .he 00 0c 18 24 30 3c 48 54 60 6c 78 84 90 9c a8 b4
.endl
;---------------------
.local chg_shape
jsr clear_area
inc shape
lda shape
cmp #4
beq sixteenth
cmp #3
beq eighth
cmp #2
beq quarter
cmp #1
beq half
;all ;was set during clear_area
rts
half
ldx #7
lda #0
@ sta ri+8,x
dex
bpl @-
rts
quarter
ldx #4
lda #0
@ sta ri+4,x
sta ri+12,x
dex
bpl @-
rts
eighth
ldx #1
lda #0
@ sta ri+2,x
sta ri+6,x
sta ri+10,x
sta ri+14,x
dex
bpl @-
rts
sixteenth
ldx #15
lda #0
@ sta ri+1,x
dex
dex
bpl @-
stx shape ;reset shape color value to initial $ff
rts
.endl
;---------------------
area ;area of stripes
; .ds 210 ;not needed on disc boot
;---------------------
.endp
;---------------------------
fin
.if <fin < 128
;---
.rept 128-<fin ;Sektor noch auffüllen
.he 00
.endr
;----
.else
;----
.rept 256-<fin
.he 00
.endr
;----
.endif
;---------------------------
.rept 359-sectors ;SD disc will be our goal
:128 .he 00
.endr
;---------------------------
;sector 360 := VTOC
;---------------------------
.he 02 ;DOS 2 DIR
; .he d0 02 ;720 Sectors disc
.he c5 02
.he 00 00 ;0 free sectors
.he 00 00 00 00 00 ;unused space in VTOC
;10-99 -> mark all as used
:90 .he 00
;100-127 -> unused
:28 .he 00
;---------------------------
;Sector 361-368 := DIR
;---------------------------
.he 22 ;file locked + inuse
.he 00 00 ;file size in sectors
.he 00 00 ;start sector number
dta '-----------'
.he 22 ;file locked + inuse
.wo sectors ;file size in sectors
.he 01 00 ;start sector number
dta '16 bars PPs'
.he 22 ;file locked + inuse
.he 00 00 ;file size in sectors
.he 00 00 ;start sector number
dta '-----------'
.rept 5
:16 .he 00 ;no file
.endr
.rept 7
:128 .he 00
.endr
;---------------------------
.rept 352
:128 .he 00
.endr
Code: Alles auswählen
fin
;---------------------------
.if <fin < 128
;---
.rept 128-<fin ;Sektor noch auffüllen
.he 00
.endr
;----
.else
;----
.rept 256-<fin
.he 00
.endr
;----
.endif
;---------------------------
; .rept 1040-sectors ;noch weitere 1039 Sektoren (MD)
.rept 720-sectors ;SD
:128 .he 00
.endr
Code: Alles auswählen
/*
16 bars boot disc based on 510b+ from nyd2022
*/
; @com.wudsn.ide.asm.hardware=ATARI8BIT
; @com.wudsn.ide.asm.outputfileextension=.atr
compileto equ $1000
sectors equ ((fin-compileto)/128)+1
opt f+ ;Activate fill mode
opt h- ;no headers
;;; ATR disk header
.word $0296, $8, $80
:10 .he 00
org compileto
;--------------------------- boot init
.proc boot
.he 00 ;always 0
dta b(sectors) ;how many sctors to load
.wo boot ;load address
.wo init ;init address (seems not to be used)
jmp start
; mva #$24 710
.endp
;--------------------------- boot init end
.proc init
;you can start an intro here
jmp *
rts
.endp
;---------------------------
;---------------------
org $2000 ;4096
icl '../hardware.txt'
icl 'header.txt'
icl 'character.asm'
icl 'pmg_vars.asm'
icl 'VBI.asm'
icl 'Sfx-Engine.asm'
.proc start
main1 mwa #40960 bilds1
mwa #41000 bilds11
mwa #42460 bilds2
mwa #42500 bilds21
mva #11 wsync
mwa #dlist 560
mva #151 fuelzaehleritem
mva #0 fuelzaehler
mva #10 store1
mva #170 store3
mva #16 sound12
jsr text
Start1
;50Hz oder 60 Hz
mva #0 vcount
@ lda vcount
beq @+
sta grafmod
jmp @-
@ lda grafmod
cmp #155
bmi @+
;PAL
mva #50 grafmod
jmp @+1
@ ;NTSC
mva #9 grafmod
@
jsr variablensetzen
jsr pmvorbereiten
ldy #0
ldx #0
ldx #>vbinter ;VB-Interrupt VektorHi
ldy #<vbinter ;VB-Interrupt VektorLo
lda #7 ;Deferred Mode mit lda #7 festlegen
jsr setvbv ;Vektor für die eigene Routine über setvbv eintragen
lda #5
ldx #2 ; Kanal 1 wählen
sec ; force
jsr xSFX.START
hauptprogramm
.........
........
......
.......
@ lda #32
sta scorez2
sta 42060
sta 43560
inc scorez3
lda scorez3
sta 42059
sta 43559
rts
.end
icl 'lands.asm'
fin
;---------------------------
.if <fin < 128
;---
.rept 128-<fin ;Sektor noch auffüllen
.he 00
.endr
;----
.else
;----
.rept 256-<fin
.he 00
.endr
;----
.endif
;---------------------------
; .rept 1040-sectors ;noch weitere 1039 Sektoren (MD)
.rept 720-sectors ;SD
:128 .he 00
.endr
;run start
vielleicht ist es schon aufgefallen, aber falls nicht: wenn man ROR benutzt, kommen die Bits, die man rechts rausschiebt, über und mit Carry wieder links rein:
Code: Alles auswählen
lda #$08
sta CONSOL
jsr TitleVBI.An ; Titel-MUSIK einschalten
Loop lda #$00 ; Farbwechsel verhindern
sta ATRACT
lda CH ; Prüfen ob ESC gedrückt wurde
cmp #$1c
beq Exit
lda CONSOL ; Prüfen ob START gedrück wurde
cmp #$06
bne Loop
Exit jsr TitleVBI.Aus ; Titel-MUSIK abschalten
Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast