mirror of
https://github.com/Pecusx/dino-game.git
synced 2026-05-20 22:33:23 +02:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a6478ae361 | |||
| fe0e9640af | |||
| 8a789527b1 | |||
| 5d39d86ea1 | |||
| 5f2bd3130d | |||
| 6ff92bb0da | |||
| cc878e35a6 | |||
| fd95eab62f | |||
| 49ba83f111 | |||
| 57248e8675 |
@@ -7,7 +7,7 @@ Code: [Pecus](https://github.com/Pecusx) and [pirx](https://github.com/pkali)
|
||||
|
||||
Msx: Alex and Jochen Hippel
|
||||
|
||||
Used portions of LZSS player by [DMSC](https://github.com/dmsc/lzss-sap)
|
||||
Used portions of LZSS player by [dmsc](https://github.com/dmsc/lzss-sap)
|
||||
|
||||
Assembly:
|
||||
```
|
||||
@@ -18,4 +18,5 @@ cat intro/tech_diff.xex dino_.xex > tdc.xex; rm dino_.xex
|
||||
|
||||
Stand-alone game (no intro):
|
||||
```
|
||||
mads dino.asm -o:dino.xex -d:ALONE=1```
|
||||
mads dino.asm -o:dino.xex -d:ALONE=1
|
||||
```
|
||||
|
||||
Binary file not shown.
+4
-3
@@ -142,10 +142,11 @@ ShapesTableH
|
||||
.by >ground_1
|
||||
.by >ground_2
|
||||
diff_object_gap ; min distance between obstacles by difficulty level
|
||||
.by 18,17,15,13,11,9,8,7,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5
|
||||
.by 24,22,20,18,16,14,12,11,10,9,8,8,8,8,8,8,8,8,8,8,8,8,8
|
||||
;.by 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
|
||||
;----------vars----------
|
||||
CloudHpos .by 0,0,0,0
|
||||
diff_level .ds 1
|
||||
DinoJumpTr .by 1,2,3,4,4,3,2,1
|
||||
JumpLen = 7
|
||||
DinoJumpTr .by 1,2,3,4,4,4,3,2,1
|
||||
JumpLen = 8
|
||||
.endif ; .IF *>0
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
SCR_HEIGHT = 8
|
||||
WORLD_LENGTH = 64
|
||||
WORLD_LENGTH = 44
|
||||
DIFF_LEVELS = 20
|
||||
.IFNDEF ALONE
|
||||
.def ALONE = 1 ; standalone version
|
||||
@@ -24,7 +24,9 @@ swap_table=$0600 ; table for swap bytes in left characters :)
|
||||
.zpvar JumpPhase .byte
|
||||
.zpvar Hit .byte
|
||||
.zpvar Level .byte
|
||||
.zpvar PaddleState .byte
|
||||
.zpvar play_flag .byte
|
||||
.zpvar NTSCounter .byte
|
||||
;---------------------------------------------------
|
||||
icl 'lib/ATARISYS.ASM'
|
||||
icl 'lib/MACRO.ASM'
|
||||
@@ -72,12 +74,12 @@ status_line_addr
|
||||
:4 .byte SKIP8
|
||||
.byte MODE2
|
||||
|
||||
.byte SKIP8,SKIP8 ; empty lines
|
||||
.byte SKIP8,SKIP8,SKIP8 ; empty lines
|
||||
|
||||
.rept SCR_HEIGHT, #
|
||||
.rept SCR_HEIGHT-1, #
|
||||
.byte MODE2+LMS+SCH ; gr.0+LMS+HSCRL
|
||||
line:1_addr
|
||||
.word screen+$100*#
|
||||
.word screen+$100*(#+1)
|
||||
.endr
|
||||
.byte JVB
|
||||
.word GameDL
|
||||
@@ -127,6 +129,12 @@ WorldTable
|
||||
:WORLD_LENGTH+1 .byte 0 ; ground
|
||||
;---------------------------------------------------
|
||||
FirstSTART
|
||||
mva #0 dmactls ; dark screen
|
||||
mva #$ff portb
|
||||
; and wait one frame :)
|
||||
waitRTC ; or waitRTC ?
|
||||
jsr Check2button ; reset JoyB2+ state
|
||||
sta PaddleState
|
||||
jsr ClearScreen
|
||||
jsr GenerateCharsets
|
||||
jsr GenerateClouds
|
||||
@@ -400,18 +408,19 @@ SwapLoop
|
||||
bpl @-
|
||||
rts
|
||||
.endp
|
||||
;-----------------------------------------------
|
||||
.proc ClearScreen
|
||||
ldy #44 ; visible screen len
|
||||
ldy #WORLD_LENGTH ; visible screen len
|
||||
lda #0
|
||||
ClearLoop
|
||||
sta screen+$0700,y
|
||||
;sta screen+$0700,y
|
||||
sta screen+$0600,y
|
||||
sta screen+$0500,y
|
||||
sta screen+$0400,y
|
||||
sta screen+$0300,y
|
||||
sta screen+$0200,y
|
||||
sta screen+$0100,y
|
||||
sta screen+$0000,y
|
||||
;sta screen+$0000,y
|
||||
dey
|
||||
bne ClearLoop
|
||||
rts
|
||||
@@ -437,7 +446,7 @@ NothingToDraw
|
||||
jsr ClearScreen
|
||||
ldx #0 ; start position (world)
|
||||
stx temp_b
|
||||
lda #42 ; start position (screen)
|
||||
lda #WORLD_LENGTH-1 ; start position (screen)
|
||||
sta temp_b2
|
||||
ToScreenLoop
|
||||
lda WorldTable,x
|
||||
@@ -446,10 +455,9 @@ ToScreenLoop
|
||||
ldx temp_b2
|
||||
jsr ShowObjectL
|
||||
NothingToDraw
|
||||
dec temp_b2
|
||||
inc:ldx temp_b
|
||||
cpx #WORLD_LENGTH
|
||||
bne ToScreenLoop
|
||||
dec temp_b2
|
||||
bpl ToScreenLoop
|
||||
rts
|
||||
.endp
|
||||
;-----------------------------------------------
|
||||
@@ -1074,6 +1082,8 @@ DinoLoop4
|
||||
beq Up
|
||||
lda TRIG0 ; Fire = Up
|
||||
beq Up
|
||||
jsr Check2button ; 2nd button = down
|
||||
bcc Down
|
||||
; check keyboard
|
||||
lda SKSTAT
|
||||
cmp #$f7 ; SHIFT
|
||||
@@ -1321,9 +1331,17 @@ pressed
|
||||
rts
|
||||
.endp
|
||||
;--------------------------------------------------
|
||||
Check2button
|
||||
lda PADDL0
|
||||
and #$c0
|
||||
eor #$C0
|
||||
cmp PaddleState
|
||||
rts
|
||||
;--------------------------------------------------
|
||||
.proc PrepareMusicPlayer
|
||||
jsr StopMusic
|
||||
VMAIN VBLinterrupt,7 ; jsr SetVBL
|
||||
mva #0 NTSCounter
|
||||
rts
|
||||
.endp
|
||||
.proc PlayInGameMusic
|
||||
@@ -1348,9 +1366,23 @@ pressed
|
||||
.endp
|
||||
.proc VBLinterrupt
|
||||
lda play_flag
|
||||
beq @+
|
||||
beq NoMusic
|
||||
; music - PAL/NTSC check
|
||||
lda PAL
|
||||
and #%00001110
|
||||
beq IsPAL
|
||||
; NTSC ...
|
||||
inc NTSCounter
|
||||
lda NTSCounter
|
||||
cmp #5
|
||||
bne PlayMusic
|
||||
mva #0 NTSCounter
|
||||
beq NoMusic
|
||||
PlayMusic
|
||||
IsPAL
|
||||
jsr PLAYER
|
||||
@ pla
|
||||
NoMusic
|
||||
pla
|
||||
tay
|
||||
pla
|
||||
tax
|
||||
@@ -1392,9 +1424,11 @@ screen
|
||||
.align $100
|
||||
MUSIC1_DATA
|
||||
ins 'music/InGame.lzss' ; ingame music
|
||||
.ds 1
|
||||
MUSIC1_DATA_END
|
||||
.align $100
|
||||
MUSIC2_DATA
|
||||
ins 'music/GameOver.lzss' ; game over music
|
||||
.ds 1
|
||||
MUSIC2_DATA_END
|
||||
run FirstSTART
|
||||
|
||||
+38
-10
@@ -8,6 +8,7 @@
|
||||
.zpvar temp_b .byte
|
||||
.zpvar temp_w2 .word
|
||||
.zpvar temp_w3 .word
|
||||
.zpvar NTSCounter .byte
|
||||
;---------------------------------------------------
|
||||
icl '../lib/ATARISYS.ASM'
|
||||
icl '../lib/MACRO.ASM'
|
||||
@@ -22,8 +23,11 @@
|
||||
ini $3000
|
||||
org $2000
|
||||
PLAYER
|
||||
icl '../music/playlzs16.asm' ; Music Player
|
||||
icl '../music/playlzs16.asm' ; Music Player, dmsc lzss
|
||||
;---------------------------------------------------
|
||||
leet_screen = $a000 ; further than samples
|
||||
leet_screen_end = leet_screen + 32*9
|
||||
|
||||
ORG $2c00
|
||||
start1
|
||||
mva #$ff portb
|
||||
@@ -84,6 +88,18 @@ next_letter
|
||||
jmp @-
|
||||
|
||||
leet_end
|
||||
; normal (not leeted) text back
|
||||
mwa #pre_screen temp_w
|
||||
mwa #leet_screen temp_w3
|
||||
ldy #0
|
||||
@
|
||||
lda (temp_w),y
|
||||
sta (temp_w3),y
|
||||
inw temp_w
|
||||
inw temp_w3
|
||||
cpw temp_w #pre_screen_end
|
||||
bne @-
|
||||
|
||||
jsr StopMusic
|
||||
jsr wait_for_releasing_keyz
|
||||
rts
|
||||
@@ -152,6 +168,7 @@ leet_speeks_h
|
||||
mwa #MUSIC_DATA_END song_end_ptr
|
||||
jsr init_song
|
||||
VMAIN VBLinterrupt,7 ; jsr SetVBL
|
||||
mva #0 NTSCounter
|
||||
rts
|
||||
.endp
|
||||
.proc StopMusic
|
||||
@@ -166,12 +183,23 @@ leet_speeks_h
|
||||
rts
|
||||
.endp
|
||||
.proc VBLinterrupt
|
||||
; music - PAL/NTSC check
|
||||
lda PAL
|
||||
and #%00001110
|
||||
beq IsPAL
|
||||
; NTSC ...
|
||||
inc NTSCounter
|
||||
lda NTSCounter
|
||||
cmp #5
|
||||
bne PlayMusic
|
||||
mva #0 NTSCounter
|
||||
beq NoMusic
|
||||
PlayMusic
|
||||
IsPAL
|
||||
jsr PLAYER
|
||||
NoMusic
|
||||
jmp XITVBV
|
||||
.endp
|
||||
leet_screen
|
||||
.ds 32*9
|
||||
leet_screen_end
|
||||
.endp
|
||||
.align $100
|
||||
MUSIC_DATA
|
||||
ins '../music/title.lzss' ; title music
|
||||
@@ -181,8 +209,6 @@ MUSIC_DATA_END
|
||||
;---------------------------------------------------
|
||||
|
||||
org $3000
|
||||
screen
|
||||
ins 'difficulties.bmp',+62
|
||||
DL
|
||||
:13 .by SKIP8
|
||||
.by MODEF+LMS
|
||||
@@ -289,9 +315,8 @@ exit_tech_diff
|
||||
lda #$40
|
||||
sta $d40e ; NMI On
|
||||
cli ; IRQ on
|
||||
mva #0 DMACTLS
|
||||
sta dmactl
|
||||
;jmp quiet ; rts
|
||||
|
||||
;jmp quiet ; rts ; POZOR PREMATURE OTTIMIZZAZIONE
|
||||
|
||||
.proc quiet
|
||||
ldx #8
|
||||
@@ -367,4 +392,7 @@ samples_end_h
|
||||
.by >sample_end2
|
||||
.by >sample_end4
|
||||
finito
|
||||
org $b000 ; empty space I hope
|
||||
screen
|
||||
ins 'difficulties.bmp',+62
|
||||
ini start
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user