mirror of
https://github.com/Pecusx/Young-lumberjack.git
synced 2026-05-20 22:33:54 +02:00
Something works
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
!"#$%&6789;<= !"#$%&
|
||||||
BIN
Binary file not shown.
+44
-532
@@ -31,101 +31,30 @@ RMT_zpvars = AutoPlay+1 ; POZOR!!! RMT vars go here
|
|||||||
;---------------------------------------------------
|
;---------------------------------------------------
|
||||||
org $2000
|
org $2000
|
||||||
MODUL
|
MODUL
|
||||||
ins 'art/muzyka_stripped.rmt',+5 ; my RMT 1.28 on WINE is apparently broken. I lost some hair here (5, not 6)
|
;ins 'art/muzyka_stripped.rmt',+5 ; my RMT 1.28 on WINE is apparently broken. I lost some hair here (5, not 6)
|
||||||
.align $100
|
;.align $100
|
||||||
icl 'art/rmtplayr.a65'
|
;icl 'art/rmtplayr.a65'
|
||||||
;---------------------------------------------------
|
;---------------------------------------------------
|
||||||
.align $400
|
.align $400
|
||||||
font
|
font_game1
|
||||||
ins 'art/Mild West.fnt' ; https://damieng.com/typography/zx-origins/mild-west/
|
ins 'art/t1.fnt' ;
|
||||||
dl
|
dl_level
|
||||||
.by SKIP3
|
.by $90
|
||||||
dta MODE2+LMS,a(statusBuffer)
|
.by $44
|
||||||
;.by $80+$50 # fancy shmancy vscroll square pixels
|
.wo gamescreen
|
||||||
;dta $4f+$20,a(display) ;VSCROLL
|
:27 .by $04
|
||||||
;:((maxlines-1)/2) dta a($2f8f)
|
.by $41
|
||||||
.by SKIP1+DLII
|
.wo dl_level
|
||||||
.rept (maxlines-1), #
|
|
||||||
:3 dta MODEF+LMS, a(display+screenBytes*:1)
|
|
||||||
dta MODEF+LMS+DLII, a(display+screenBytes*:1)
|
|
||||||
.endr
|
|
||||||
;----
|
|
||||||
.by MODE2+LMS+SCH ;Hscroll
|
|
||||||
DLracquetAddr0
|
|
||||||
.wo racquetDisp
|
|
||||||
.by JVB
|
|
||||||
.wo dl
|
|
||||||
;---------------------------------------------------
|
;---------------------------------------------------
|
||||||
|
gamescreen
|
||||||
|
ins 'art/screen.bin' ;
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
icl 'lib/fileio.asm'
|
;icl 'lib/fileio.asm'
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
|
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc vint
|
.proc vint
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
;------------JOY-------------
|
|
||||||
;happy happy joy joy
|
|
||||||
;check for joystick now
|
|
||||||
|
|
||||||
ldy PORTA
|
|
||||||
tya
|
|
||||||
and #$04 ;left
|
|
||||||
bne jNotLeft
|
|
||||||
ldx racquetPos
|
|
||||||
cpx #racquetPosMin+1
|
|
||||||
bcc jNotLeft
|
|
||||||
dex
|
|
||||||
stx racquetPos
|
|
||||||
|
|
||||||
jNotLeft
|
|
||||||
tya
|
|
||||||
and #$08 ;right
|
|
||||||
bne jNotRight
|
|
||||||
ldx racquetPos
|
|
||||||
cpx #racquetPosMax
|
|
||||||
bcs jNotRight
|
|
||||||
inx
|
|
||||||
stx racquetPos
|
|
||||||
jNotRight
|
|
||||||
/*
|
|
||||||
;fire
|
|
||||||
lda TRIG0
|
|
||||||
bne JNotFire
|
|
||||||
...
|
|
||||||
JNotFire
|
|
||||||
*/
|
|
||||||
|
|
||||||
;lda racquetPos
|
|
||||||
|
|
||||||
sec
|
|
||||||
lda #screenWidth-1
|
|
||||||
sbc racquetPos
|
|
||||||
lsr
|
|
||||||
clc
|
|
||||||
adc #<racquetDisp
|
|
||||||
sta dlracquetAddr0
|
|
||||||
lda #>racquetDisp
|
|
||||||
adc #0
|
|
||||||
sta dlracquetAddr0+1
|
|
||||||
|
|
||||||
lda racquetPos
|
|
||||||
lsr
|
|
||||||
and #$01
|
|
||||||
;sta HSCROL
|
|
||||||
|
|
||||||
/* ;pos print
|
|
||||||
lda racquetPos
|
|
||||||
:4 lsr
|
|
||||||
clc
|
|
||||||
adc #'0'
|
|
||||||
sta hexDump
|
|
||||||
|
|
||||||
lda racquetPos
|
|
||||||
and #$0F
|
|
||||||
clc
|
|
||||||
adc #'0'
|
|
||||||
sta hexDump+1
|
|
||||||
*/
|
|
||||||
|
|
||||||
mva #0 dliCount
|
mva #0 dliCount
|
||||||
; mva #13 VSCROL ; FOX gfx mode only
|
; mva #13 VSCROL ; FOX gfx mode only
|
||||||
@@ -151,7 +80,7 @@ lab2
|
|||||||
SkipRMTVBL
|
SkipRMTVBL
|
||||||
|
|
||||||
*/
|
*/
|
||||||
;sfx
|
/* ;sfx
|
||||||
lda sfx_effect
|
lda sfx_effect
|
||||||
bmi lab2
|
bmi lab2
|
||||||
asl ; * 2
|
asl ; * 2
|
||||||
@@ -165,7 +94,7 @@ SkipRMTVBL
|
|||||||
;
|
;
|
||||||
lab2
|
lab2
|
||||||
jsr RASTERMUSICTRACKER+3
|
jsr RASTERMUSICTRACKER+3
|
||||||
skipSoundFrame
|
skipSoundFrame */
|
||||||
|
|
||||||
jmp XITVBV
|
jmp XITVBV
|
||||||
.endp
|
.endp
|
||||||
@@ -182,46 +111,29 @@ main
|
|||||||
jsr initialize
|
jsr initialize
|
||||||
RMTsong song_main_menu
|
RMTsong song_main_menu
|
||||||
jsr StartScreen
|
jsr StartScreen
|
||||||
jsr MakeDarkScreen
|
|
||||||
|
|
||||||
mva #$0 AutoPlay
|
|
||||||
jsr ScoreClear
|
|
||||||
mva #"5" Lives
|
|
||||||
jsr clearscreen
|
|
||||||
mva #$0 LevelType
|
|
||||||
jsr LoadLevelData.level000 ; set visible number to 000
|
|
||||||
jsr BuildLevelFromBuffer
|
|
||||||
jsr LevelScreen
|
|
||||||
RMTSong song_ingame
|
RMTSong song_ingame
|
||||||
gameloop
|
gameloop
|
||||||
jsr initialize.ClearTables
|
|
||||||
jsr MainScreen
|
|
||||||
jsr PlayLevel
|
|
||||||
bit EndLevelFlag ; reason for end level
|
|
||||||
bmi EndOfLife ; end of life :)
|
|
||||||
; end of level (level up)
|
|
||||||
jsr MakeDarkScreen
|
jsr MakeDarkScreen
|
||||||
jsr NextLevel
|
|
||||||
jsr LevelScreen
|
jsr LevelScreen
|
||||||
|
jsr PlayLevel
|
||||||
|
jsr MakeDarkScreen
|
||||||
|
;jsr NextLevel
|
||||||
; RMTSong song_ingame
|
; RMTSong song_ingame
|
||||||
jsr AudioInit ; after I/O
|
jsr AudioInit ; after I/O
|
||||||
jmp gameloop
|
jmp gameloop
|
||||||
EndOfLife
|
EndOfLife
|
||||||
dec Lives ; decrease Lives
|
;dec Lives ; decrease Lives
|
||||||
lda Lives
|
;lda Lives
|
||||||
cmp #"0"
|
;cmp #"0"
|
||||||
beq gameOver ; if no lives - game over
|
;beq gameOver ; if no lives - game over
|
||||||
jsr NextLife
|
;jsr NextLife
|
||||||
jmp gameloop
|
jmp gameloop
|
||||||
gameOver
|
gameOver
|
||||||
;game over
|
;game over
|
||||||
RMTSong song_game_over
|
;RMTSong song_game_over
|
||||||
jsr HiScoreCheckWrite
|
;jsr HiScoreCheckWrite
|
||||||
jsr GameOverScreen
|
jsr GameOverScreen
|
||||||
@ lda RANDOM
|
@ lda CONSOL
|
||||||
and #%00001110
|
|
||||||
sta COLPF0
|
|
||||||
lda CONSOL
|
|
||||||
and #@consol(start) ; START
|
and #@consol(start) ; START
|
||||||
beq main
|
beq main
|
||||||
lda TRIG0 ; fire
|
lda TRIG0 ; fire
|
||||||
@@ -231,12 +143,7 @@ gameOver
|
|||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc StartScreen
|
.proc StartScreen
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
jsr MakeDarkScreen
|
/* jsr MakeDarkScreen
|
||||||
mva #$ff AutoPlay
|
|
||||||
sta LevelType ; Title
|
|
||||||
mva #"9" Lives
|
|
||||||
jsr clearscreen
|
|
||||||
jsr BuildLevelFromBuffer
|
|
||||||
mwa #dl_start dlptrs
|
mwa #dl_start dlptrs
|
||||||
lda #$0 ;+GTIACTLBITS
|
lda #$0 ;+GTIACTLBITS
|
||||||
sta GPRIOR
|
sta GPRIOR
|
||||||
@@ -245,102 +152,35 @@ gameOver
|
|||||||
sta dmactls
|
sta dmactls
|
||||||
pause 1
|
pause 1
|
||||||
StartLoop
|
StartLoop
|
||||||
jsr PlayLevel
|
;jmp StartLoop
|
||||||
bit EndLevelFlag ; reason for end level
|
EndOfStartScreen */
|
||||||
bmi EndOfStartScreen
|
|
||||||
; end of level (level up)
|
|
||||||
jsr NextLevel
|
|
||||||
jmp StartLoop
|
|
||||||
EndOfStartScreen
|
|
||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
;--------------------------------------------------
|
|
||||||
.proc NextLife
|
|
||||||
;--------------------------------------------------
|
|
||||||
ldy #maxBalls
|
|
||||||
sty eXistenZstackPtr
|
|
||||||
;OK, one ball starts!
|
|
||||||
lda eXistenZstack,Y
|
|
||||||
dey
|
|
||||||
sty eXistenZstackPtr
|
|
||||||
tax
|
|
||||||
jsr randomStart ;just one random pixxxel
|
|
||||||
;previously the whole band of ballz
|
|
||||||
rts
|
|
||||||
.endp
|
|
||||||
;--------------------------------------------------
|
|
||||||
.proc NextLevel
|
|
||||||
;--------------------------------------------------
|
|
||||||
lda LevelType
|
|
||||||
beq level000
|
|
||||||
bmi levelTitle
|
|
||||||
; load level from disk
|
|
||||||
loadNext
|
|
||||||
jsr FileUp
|
|
||||||
jsr LoadLevelData
|
|
||||||
levelTitle
|
|
||||||
jsr clearscreen
|
|
||||||
jsr BuildLevelFromBuffer
|
|
||||||
jsr initialize.ClearTables
|
|
||||||
rts ; start level
|
|
||||||
level000
|
|
||||||
mva #1 LevelType ; switch to files
|
|
||||||
; reset file number to 000
|
|
||||||
ldx #2
|
|
||||||
@ lda StartLevelNumber,x
|
|
||||||
sta LevelNumber,x
|
|
||||||
dex
|
|
||||||
bpl @-
|
|
||||||
jmp loadNext
|
|
||||||
.endp
|
|
||||||
|
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc LevelScreen
|
.proc LevelScreen
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
jsr MakeDarkScreen
|
jsr MakeDarkScreen
|
||||||
ldx #2
|
ldx #2
|
||||||
@ lda LevelNumber,x
|
|
||||||
sec
|
|
||||||
sbc #$20
|
|
||||||
sta LevelText+16,x
|
|
||||||
dex
|
|
||||||
bpl @-
|
|
||||||
mwa #dl_level dlptrs
|
mwa #dl_level dlptrs
|
||||||
lda #@dmactl(standard|dma) ; normal screen width, DL on, P/M off
|
lda #@dmactl(narrow|dma) ; narrow screen width, DL on, P/M off
|
||||||
sta dmactls
|
sta dmactls
|
||||||
|
mva #>font_game1 CHBAS
|
||||||
pause 100
|
pause 100
|
||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc GameOverScreen
|
.proc GameOverScreen
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
jsr MakeDarkScreen
|
/* jsr MakeDarkScreen
|
||||||
ldx #5
|
ldx #5
|
||||||
@ lda score,x
|
|
||||||
sta OverText+33,x
|
|
||||||
dex
|
|
||||||
bpl @-
|
|
||||||
mwa #dl_over dlptrs
|
mwa #dl_over dlptrs
|
||||||
lda #%00110010 ; normal screen width, DL on, P/M off
|
lda #%00110010 ; normal screen width, DL on, P/M off
|
||||||
sta dmactls
|
sta dmactls
|
||||||
pause 20
|
pause 20 */
|
||||||
|
|
||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc MainScreen
|
|
||||||
;--------------------------------------------------
|
|
||||||
jsr MakeDarkScreen
|
|
||||||
mwa #dl dlptrs
|
|
||||||
lda #$0 ;+GTIACTLBITS
|
|
||||||
sta GPRIOR
|
|
||||||
sta COLBAKS
|
|
||||||
lda #@dmactl(standard|dma) ; normal screen width, DL on, P/M off
|
|
||||||
sta dmactls
|
|
||||||
pause 1
|
|
||||||
rts
|
|
||||||
.endp
|
|
||||||
;--------------------------------------------------
|
|
||||||
.proc MakeDarkScreen
|
.proc MakeDarkScreen
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
mva #0 dmactls ; dark screen
|
mva #0 dmactls ; dark screen
|
||||||
@@ -355,150 +195,16 @@ loop
|
|||||||
|
|
||||||
; PUT GAME HERE
|
; PUT GAME HERE
|
||||||
|
|
||||||
dec currBall
|
|
||||||
jpl flight
|
|
||||||
|
|
||||||
|
|
||||||
pause 1 ;all balls
|
|
||||||
bit AutoPlay
|
|
||||||
bpl NoAuto
|
|
||||||
pause 1 ;additional pause if auto play mode (slower)
|
|
||||||
lda CONSOL
|
|
||||||
and #@consol(start) ; START
|
|
||||||
beq LevelOver ; Start pressed in Auto Play - exit
|
|
||||||
lda TRIG0
|
|
||||||
beq LevelOver
|
|
||||||
|
|
||||||
NoAuto
|
NoAuto
|
||||||
lda eXistenZstackPtr
|
|
||||||
cmp #maxBalls
|
|
||||||
jne loop
|
jne loop
|
||||||
LevelOver
|
LevelOver
|
||||||
; level over
|
; level over
|
||||||
mva #$ff EndLevelFlag
|
|
||||||
jsr wait_for_depress
|
jsr wait_for_depress
|
||||||
rts
|
rts
|
||||||
|
.endp
|
||||||
|
|
||||||
;--------------------------------------------------
|
|
||||||
.proc ScoreUp
|
|
||||||
;--------------------------------------------------
|
|
||||||
inc score+5
|
|
||||||
lda score+5
|
|
||||||
cmp #"9"+1 ; 9+1 character code
|
|
||||||
bne ScoreReady
|
|
||||||
lda #"0" ; 0 character code
|
|
||||||
sta score+5
|
|
||||||
inc score+4
|
|
||||||
lda score+4
|
|
||||||
cmp #"9"+1 ; 9+1 character code
|
|
||||||
bne ScoreReady
|
|
||||||
lda #"0" ; 0 character code
|
|
||||||
sta score+4
|
|
||||||
inc score+3
|
|
||||||
lda score+3
|
|
||||||
cmp #"9"+1 ; 9+1 character code
|
|
||||||
bne ScoreReady
|
|
||||||
lda #"0" ; 0 character code
|
|
||||||
sta score+3
|
|
||||||
inc score+2
|
|
||||||
; bonus !!! :)
|
|
||||||
lda Lives
|
|
||||||
cmp #"9"
|
|
||||||
beq noLivesUP
|
|
||||||
inc Lives
|
|
||||||
mva #05 sfx_effect
|
|
||||||
mva #$ff COLBAKS
|
|
||||||
pause 2 ; sorry
|
|
||||||
inc COLBAKS
|
|
||||||
noLivesUP
|
|
||||||
;----------
|
|
||||||
lda score+2
|
|
||||||
cmp #"9"+1 ; 9+1 character code
|
|
||||||
bne ScoreReady
|
|
||||||
lda #"0" ; 0 character code
|
|
||||||
sta score+2
|
|
||||||
inc score+1
|
|
||||||
lda score+1
|
|
||||||
cmp #"9"+1 ; 9+1 character code
|
|
||||||
bne ScoreReady
|
|
||||||
lda #"0" ; 0 character code
|
|
||||||
sta score+1
|
|
||||||
inc score
|
|
||||||
ScoreReady
|
|
||||||
rts
|
|
||||||
.endp
|
|
||||||
;--------------------------------------------------
|
|
||||||
.proc ScoreClear
|
|
||||||
;--------------------------------------------------
|
|
||||||
lda #"0"
|
|
||||||
ldx #4
|
|
||||||
@ sta score,x
|
|
||||||
dex
|
|
||||||
bpl @-
|
|
||||||
rts
|
|
||||||
.endp
|
|
||||||
;--------------------------------------------------
|
|
||||||
.proc HiScoreCheckWrite
|
|
||||||
; It checks if the score is greater than hiscore.
|
|
||||||
; If yes - rewrites the score to hiscore.
|
|
||||||
;--------------------------------------------------
|
|
||||||
lda HiScore
|
|
||||||
cmp score
|
|
||||||
bcc higher1
|
|
||||||
bne lower
|
|
||||||
lda HiScore+1
|
|
||||||
cmp score+1
|
|
||||||
bcc higher2
|
|
||||||
bne lower
|
|
||||||
lda HiScore+2
|
|
||||||
cmp score+2
|
|
||||||
bcc higher3
|
|
||||||
bne lower
|
|
||||||
lda HiScore+3
|
|
||||||
cmp score+3
|
|
||||||
bcc higher4
|
|
||||||
bne lower
|
|
||||||
lda HiScore+4
|
|
||||||
cmp score+4
|
|
||||||
bcc higher5
|
|
||||||
bne lower
|
|
||||||
lda HiScore+5
|
|
||||||
cmp score+5
|
|
||||||
bcc higher6
|
|
||||||
lower
|
|
||||||
rts
|
|
||||||
higher1
|
|
||||||
lda score
|
|
||||||
sta HiScore
|
|
||||||
higher2
|
|
||||||
lda score+1
|
|
||||||
sta HiScore+1
|
|
||||||
higher3
|
|
||||||
lda score+2
|
|
||||||
sta HiScore+2
|
|
||||||
higher4
|
|
||||||
lda score+3
|
|
||||||
sta HiScore+3
|
|
||||||
higher5
|
|
||||||
lda score+4
|
|
||||||
sta HiScore+4
|
|
||||||
higher6
|
|
||||||
lda score+5
|
|
||||||
sta HiScore+5
|
|
||||||
rts
|
|
||||||
.endp
|
|
||||||
;--------------------------------------------------
|
|
||||||
.proc clearScreen
|
|
||||||
;--------------------------------------------------
|
|
||||||
lda #0
|
|
||||||
tax
|
|
||||||
@
|
|
||||||
:(maxLines*40/256+1) sta display+$100*#,x
|
|
||||||
inx
|
|
||||||
bne @-
|
|
||||||
rts
|
|
||||||
.endp
|
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc AudioInit
|
.proc AudioInit
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
@@ -519,12 +225,11 @@ higher6
|
|||||||
.proc initialize
|
.proc initialize
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
|
|
||||||
mva #>font CHBAS
|
mva #>font_game1 CHBAS
|
||||||
mva #$00 PCOLR0 ; = $02C0 ;- - rejestr-cień COLPM0
|
mva #$00 PCOLR0 ; = $02C0 ;- - rejestr-cień COLPM0
|
||||||
|
|
||||||
mva #$7C COLBAKS
|
mva #$7C COLBAKS
|
||||||
|
|
||||||
mva #screenWidth/2-racquetSize/4 racquetPos
|
|
||||||
|
|
||||||
mva #0 dliCount
|
mva #0 dliCount
|
||||||
sta RMT_blocked
|
sta RMT_blocked
|
||||||
@@ -534,157 +239,26 @@ higher6
|
|||||||
|
|
||||||
JSR AudioInit
|
JSR AudioInit
|
||||||
|
|
||||||
;RMT INIT
|
/* ;RMT INIT
|
||||||
ldx #<MODUL ;low byte of RMT module to X reg
|
ldx #<MODUL ;low byte of RMT module to X reg
|
||||||
ldy #>MODUL ;hi byte of RMT module to Y reg
|
ldy #>MODUL ;hi byte of RMT module to Y reg
|
||||||
lda #0 ;starting song line 0-255 to A reg
|
lda #0 ;starting song line 0-255 to A reg
|
||||||
jsr RASTERMUSICTRACKER ;Init
|
jsr RASTERMUSICTRACKER ;Init
|
||||||
|
*/
|
||||||
|
|
||||||
lda #@dmactl(standard|dma)
|
lda #@dmactl(standard|dma)
|
||||||
sta dmactls
|
sta dmactls
|
||||||
mwa #dl dlptrs
|
mwa #dl_level dlptrs
|
||||||
vdli DLI
|
;vdli DLI
|
||||||
|
|
||||||
ClearTables
|
|
||||||
jsr cyclecolorsReset
|
|
||||||
mwa #clear_vars_start temp
|
|
||||||
ldy #0
|
|
||||||
@
|
|
||||||
tya
|
|
||||||
sta (temp),y
|
|
||||||
inw temp
|
|
||||||
cpw temp #clear_vars_end
|
|
||||||
bne @-
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;VBI
|
;VBI
|
||||||
|
|
||||||
vmain vint,7
|
;vmain vint,7
|
||||||
|
|
||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc FileUp
|
|
||||||
;--------------------------------------------------
|
|
||||||
inc LevelNumber+2
|
|
||||||
lda LevelNumber+2
|
|
||||||
cmp #'9'+1 ; 9+1 character code
|
|
||||||
bne NumberReady
|
|
||||||
lda #'0' ; 0 character code
|
|
||||||
sta LevelNumber+2
|
|
||||||
inc LevelNumber+1
|
|
||||||
lda LevelNumber+1
|
|
||||||
cmp #'9'+1 ; 9+1 character code
|
|
||||||
bne NumberReady
|
|
||||||
lda #'0' ; 0 character code
|
|
||||||
sta LevelNumber+1
|
|
||||||
inc LevelNumber
|
|
||||||
NumberReady
|
|
||||||
rts
|
|
||||||
.endp
|
|
||||||
;--------------------------------------------------
|
|
||||||
.proc LoadLevelData
|
|
||||||
;--------------------------------------------------
|
|
||||||
lda LevelType
|
|
||||||
beq level000
|
|
||||||
bmi levelTitle
|
|
||||||
; load level from disk
|
|
||||||
; prepare number in filename
|
|
||||||
ldx #2
|
|
||||||
@ lda LevelNumber,x
|
|
||||||
sta fname+7,x
|
|
||||||
dex
|
|
||||||
bpl @-
|
|
||||||
; clear buffer
|
|
||||||
mwa #LevelFileBuff temp
|
|
||||||
ldy #0
|
|
||||||
@ tya
|
|
||||||
sta (temp),y
|
|
||||||
inw temp
|
|
||||||
cpw temp #LevelFileBuffEnd
|
|
||||||
bne @-
|
|
||||||
; try to load file
|
|
||||||
jsr close
|
|
||||||
jsr open
|
|
||||||
bmi open_error
|
|
||||||
jsr bget
|
|
||||||
bmi bget_error
|
|
||||||
go_close jsr close
|
|
||||||
rts
|
|
||||||
bget_error
|
|
||||||
cpy #136 ; EOF
|
|
||||||
beq go_close
|
|
||||||
open_error
|
|
||||||
mva #0 LevelType ; set level to internal 000
|
|
||||||
level000
|
|
||||||
; reset file number to 000
|
|
||||||
ldx #2
|
|
||||||
@ lda StartLevelNumber,x
|
|
||||||
sta LevelNumber,x
|
|
||||||
dex
|
|
||||||
bpl @-
|
|
||||||
levelTitle
|
|
||||||
rts
|
|
||||||
.endp
|
|
||||||
;--------------------------------------------------
|
|
||||||
.proc displaydec5 ;decimal (word), displayposition (word)
|
|
||||||
;--------------------------------------------------
|
|
||||||
; displays decimal number as in parameters (in text mode)
|
|
||||||
; leading zeroes are removed
|
|
||||||
; the range is (00000..65565 - two bytes)
|
|
||||||
|
|
||||||
ldy #4 ; there will be 5 digits
|
|
||||||
NextDigit
|
|
||||||
ldx #16 ; 16-bit dividee so Rotate 16 times
|
|
||||||
lda #$00
|
|
||||||
Rotate000
|
|
||||||
aslw decimal
|
|
||||||
rol ; scroll dividee
|
|
||||||
; (as highest byte - additional - byte is A)
|
|
||||||
cmp #10 ; divider
|
|
||||||
bcc TooLittle000 ; if A is smaller than divider
|
|
||||||
; there is nothing to substract
|
|
||||||
sbc #10 ; divider
|
|
||||||
inc decimal ; lowest bit set to 1
|
|
||||||
; because it is 0 and this is the fastest way
|
|
||||||
TooLittle000 dex
|
|
||||||
bne Rotate000 ; and Rotate 16 times, Result will be in decimal
|
|
||||||
tax ; and the rest in A
|
|
||||||
; (and it goes to X because
|
|
||||||
; it is our decimal digit)
|
|
||||||
lda digits,x
|
|
||||||
sta decimalresult,y
|
|
||||||
dey
|
|
||||||
bpl NextDigit ; Result again /10 and we have next digit
|
|
||||||
|
|
||||||
;rightnumber
|
|
||||||
; displaying without leading zeroes (if zeroes exist then display space at this position)
|
|
||||||
ldy #0
|
|
||||||
ldx #0 ; digit flag (cut leading zeroes)
|
|
||||||
displayloop
|
|
||||||
lda decimalresult,y
|
|
||||||
cpx #0
|
|
||||||
bne noleading0
|
|
||||||
cpy #4
|
|
||||||
beq noleading0 ; if 00000 - last 0 must stay
|
|
||||||
cmp zero
|
|
||||||
bne noleading0
|
|
||||||
lda #space
|
|
||||||
beq displaychar ; space = 0 !
|
|
||||||
noleading0
|
|
||||||
inx ; set flag (no leading zeroes to cut)
|
|
||||||
displaychar
|
|
||||||
sta (displayposition),y
|
|
||||||
nexdigit
|
|
||||||
iny
|
|
||||||
cpy #5
|
|
||||||
bne displayloop
|
|
||||||
|
|
||||||
rts
|
|
||||||
.endp
|
|
||||||
;--------------------------------------------------
|
|
||||||
.proc RmtSongSelect
|
.proc RmtSongSelect
|
||||||
; starting song line 0-255 to A reg
|
; starting song line 0-255 to A reg
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
@@ -695,12 +269,12 @@ nexdigit
|
|||||||
spl:lda #song_silencio
|
spl:lda #song_silencio
|
||||||
noingame
|
noingame
|
||||||
*/
|
*/
|
||||||
mvx #$ff RMT_blocked
|
/* mvx #$ff RMT_blocked
|
||||||
ldx #<MODUL ; low byte of RMT module to X reg
|
ldx #<MODUL ; low byte of RMT module to X reg
|
||||||
ldy #>MODUL ; hi byte of RMT module to Y reg
|
ldy #>MODUL ; hi byte of RMT module to Y reg
|
||||||
jsr RASTERMUSICTRACKER ; Init
|
jsr RASTERMUSICTRACKER ; Init
|
||||||
mva #0 RMT_blocked
|
mva #0 RMT_blocked
|
||||||
rts
|
*/ rts
|
||||||
.endp
|
.endp
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc wait_for_depress ; ion
|
.proc wait_for_depress ; ion
|
||||||
@@ -712,68 +286,6 @@ noingame
|
|||||||
beq wait_for_depress
|
beq wait_for_depress
|
||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
LevelType
|
|
||||||
.byte 0 ; level type $00 - first level, $01 - level from buffer, $ff - title screen
|
|
||||||
Numbers
|
|
||||||
.byte '0123456789'
|
|
||||||
digits
|
|
||||||
zero
|
|
||||||
.byte "0123456789"
|
|
||||||
space = 0
|
|
||||||
.byte " "
|
|
||||||
decimal
|
|
||||||
.word 0
|
|
||||||
decimalresult
|
|
||||||
.byte " "
|
|
||||||
lineAdrL
|
|
||||||
:margin .byte <marginLine ;8 lines of margin space
|
|
||||||
:maxLines .byte <(display+screenBytes*#)
|
|
||||||
:256-maxLines-1*margin .by <marginLine ; (display+40*#) ;just to let the plot smear on full .byte ypos
|
|
||||||
lineAdrH
|
|
||||||
:margin .byte >marginLine
|
|
||||||
:maxLines .byte >(display+screenBytes*#)
|
|
||||||
:256-maxLines-1*margin .by >marginLine ; (display+40*#) ;just to let the plot smear on full .byte ypos
|
|
||||||
bittable
|
|
||||||
.byte %11110000
|
|
||||||
debittable
|
|
||||||
.byte %00001111
|
|
||||||
.byte %11110000
|
|
||||||
RNColtable ; Right Nibble color Table
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00000001
|
|
||||||
.byte %00000010
|
|
||||||
.byte %00000011
|
|
||||||
.byte %00000100
|
|
||||||
.byte %00000101
|
|
||||||
.byte %00000110
|
|
||||||
.byte %00000111
|
|
||||||
.byte %00001000
|
|
||||||
LNColtable ; Left Nibble color Table
|
|
||||||
.byte %00000000
|
|
||||||
.byte %00010000
|
|
||||||
.byte %00100000
|
|
||||||
.byte %00110000
|
|
||||||
.byte %01000000
|
|
||||||
.byte %01010000
|
|
||||||
.byte %01100000
|
|
||||||
.byte %01110000
|
|
||||||
.byte %10000000
|
|
||||||
;--------------------------------
|
|
||||||
clear_vars_start
|
|
||||||
; PUT VARS HERE
|
|
||||||
clear_vars_end
|
|
||||||
;--------------------------------
|
|
||||||
statusBar
|
|
||||||
dta d"rc$"
|
|
||||||
hexDump
|
|
||||||
dta d" dx$"
|
|
||||||
dxDisp
|
|
||||||
dta d" dy$"
|
|
||||||
dyDisp
|
|
||||||
dta d" balls$"
|
|
||||||
ballDisp
|
|
||||||
dta d" "
|
|
||||||
marginLine .ds screenBytes
|
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
; names of RMT instruments (sfx)
|
; names of RMT instruments (sfx)
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
|
|||||||
BIN
Binary file not shown.
Reference in New Issue
Block a user