init dl addresses

This commit is contained in:
2018-06-20 00:33:55 +02:00
parent 796e5c53a8
commit 3fb32a966e
8 changed files with 1062 additions and 986 deletions
+1 -1
View File
@@ -9,4 +9,4 @@ The Atari 8-bit game created for Wapniak'2018 party. Not released in time for re
[] game over msg [] game over msg
[] bird [] bird
[] clouds [] clouds
[] fix ground gfx [] fix ground gfx
+7
View File
@@ -1,5 +1,12 @@
; @com.wudsn.ide.asm.mainsourcefile=ni.asm ; @com.wudsn.ide.asm.mainsourcefile=ni.asm
;------------------------------------------------------------- ;-------------------------------------------------------------
;screen layout
;0 0 0 1
;0 4 7 2
;0 7 9 7
;| initial window--> | when drawing here, copy to zero
; |------------------------------------------------------------|
;24x24 pix = 3x3 chars (3x24 bytes) ;24x24 pix = 3x3 chars (3x24 bytes)
.rept 3, # .rept 3, #
dino:1 dino:1
+18 -17
View File
@@ -1,7 +1,7 @@
;------------------------------------- ;-------------------------------------
.MACRO ROLW .MACRO ROLW
ROL :1 ROL :1
ROL :1+1 ROL :1+1
.ENDM .ENDM
;------------------------------------- ;-------------------------------------
.MACRO ASLW .MACRO ASLW
@@ -20,26 +20,26 @@
.ENDM .ENDM
;------------------------------------- ;-------------------------------------
.MACRO VMAIN .MACRO VMAIN ; Initialises Vertical Blank Interrupts
; VMAIN #WORD,interrupt.vector ; (works only with system interrupts ON)
; interrupt.vector:
; 0 - VIMIRQ ; VMAIN #WORD interrupt.vector
; 1 - TIMCNT1 ; interrupt.vector:
; 2 - TIMCNT2 ; 0 - VIMIRQ
; 3 - TIMCNT3 ; 1 - TIMCNT1
; 4 - TIMCNT4 ; 2 - TIMCNT2
; 5 - TIMCNT5 ; 3 - TIMCNT3
; 6 - VVBLKI ; 4 - TIMCNT4
; 7 - VVBLKD ; 5 - TIMCNT5
; 8 - TIMVEC1 ; 6 - VVBLKI
; 9 - TIMVEC2 ; 7 - VVBLKD
; Initialises Vertical Blank Interrupts ; 8 - TIMVEC1
; (works only with system interrupts ON) ; 9 - TIMVEC2
LDY # <:1 LDY # <:1
LDX # >:1 LDX # >:1
LDA #:2 LDA #:2
JSR SETVBV JSR SETVBV
.ENDM .ENDM
;------------------------------------- ;-------------------------------------
.MACRO VDLI .MACRO VDLI
; VDLI #WORD ; VDLI #WORD
@@ -65,6 +65,7 @@
.MACRO KEY .MACRO KEY
; KEY ; KEY
; waits for releasing and pressing "any key" ; waits for releasing and pressing "any key"
; with OS on autorepeat works
PHA PHA
?CK1 LDA SKSTAT ?CK1 LDA SKSTAT
AND #$04 AND #$04
+2 -2
View File
@@ -4,7 +4,7 @@
.zpvar tmp, tmp0, tmp1, tmp2, tmp3 .word .zpvar tmp, tmp0, tmp1, tmp2, tmp3 .word
sw = $80 ;physical screen width in bytes (distance between beginnings of consecutive lines) sw = $80 ;physical screen width in bytes (distance between beginnings of consecutive lines)
sw_log = 48 ;logical screen width sw_log = $40 ;logical screen width
sh = 128 ;screen height in lines sh = 128 ;screen height in lines
screen = $4000 screen = $4000
pmgraph = $9000 pmgraph = $9000
@@ -28,7 +28,7 @@ start
mva #$0F COLBAKS mva #$0F COLBAKS
mva #$0f COLPF2S mva #$0f COLPF2S
jsr dl_addr_init
jsr sprites_init jsr sprites_init
pause 1 pause 1
jsr ground_init jsr ground_init
+72 -65
View File
@@ -119,6 +119,7 @@ Label table:
00 0286 TRIG2S 00 0286 TRIG2S
00 0287 TRIG3S 00 0287 TRIG3S
00 0080 SW 00 0080 SW
00 0040 SW_LOG
00 0080 SH 00 0080 SH
00 4000 SCREEN 00 4000 SCREEN
00 9000 PMGRAPH 00 9000 PMGRAPH
@@ -130,83 +131,89 @@ Label table:
00 2000 DL 00 2000 DL
00 2003 DL_ADDRS 00 2003 DL_ADDRS
00 2186 START 00 2186 START
00 21B1 PAUSE0.LOOP 00 21B4 PAUSE0.LOOP
00 21BD PAUSE0.WAIT0.0@ 00 21C0 PAUSE0.WAIT0.0@
00 21DD XX 00 21E0 XX
00 21DF YY 00 21E2 YY
00 2209 LLP 00 220C LLP
00 220E LP 00 2211 LP
00 2251 NTMP 00 2254 NTMP
00 2252 DINO 00 2255 DL_ADDR_INIT
00 0082 DL_ADDR_INIT._DL
00 0084 DL_ADDR_INIT._SCR
00 2267 DL_ADDR_INIT.1@
00 228C DINO
00 0080 DINO._DINO 00 0080 DINO._DINO
00 0084 DINO._MASK 00 0084 DINO._MASK
00 0086 DINO._SCR 00 0086 DINO._SCR
00 0088 DINO._BACK 00 0088 DINO._BACK
00 2290 DINO.LOOP1 00 22CA DINO.LOOP1
00 2292 DINO.DN1 00 22CC DINO.DN1
00 22D5 DINO_CLEAR 00 230F DINO_CLEAR
00 0086 DINO_CLEAR._SCR 00 0086 DINO_CLEAR._SCR
00 0088 DINO_CLEAR._BACK 00 0088 DINO_CLEAR._BACK
00 22F7 DINO_CLEAR.LOOP1 00 2331 DINO_CLEAR.LOOP1
00 22F9 DINO_CLEAR.DN1 00 2333 DINO_CLEAR.DN1
00 231C GROUND 00 2356 GROUND
00 0084 GROUND._GND 00 0084 GROUND._GND
00 0086 GROUND._SCR 00 0086 GROUND._SCR
00 233B GROUND.LOOP1 00 2375 GROUND.LOOP1
00 233D GROUND.1@ 00 2377 GROUND.2@
00 2361 GROUND.LOOP2 00 239B GROUND.LOOP2
00 2363 GROUND.2@ 00 239D GROUND.3@
00 2389 GROUND_INIT 00 23C3 GROUND_INIT
00 238D GROUND_INIT.GROUND_LOOP 00 23C7 GROUND_INIT.GROUND_LOOP
00 23AA CACTUS 00 23E4 CACTUS
00 0084 CACTUS._CACT 00 0084 CACTUS._CACT
00 0086 CACTUS._SCR 00 0086 CACTUS._SCR
00 23C6 CACTUS.NO_INC 00 2400 CACTUS.NO_INC
00 23D0 CACTUS.LOOP 00 240A CACTUS.LOOP
00 23D2 CACTUS.3@ 00 240C CACTUS.4@
00 23F9 CACTUS.CACT_W 00 2433 CACTUS.CACT_W
00 23FA SPRITES_INIT 00 2434 SPRITES_INIT
00 002A SPRITES_INIT.DX 00 002A SPRITES_INIT.DX
00 2432 DINO_PM 00 246C DINO_PM
00 0084 DINO_PM._DINO 00 0084 DINO_PM._DINO
00 0086 DINO_PM._DINO_SAV 00 0086 DINO_PM._DINO_SAV
00 0088 DINO_PM._SPR 00 0088 DINO_PM._SPR
00 244A DINO_PM.LOOP0 00 2484 DINO_PM.LOOP0
00 245D DINO_PM.4@ 00 2497 DINO_PM.5@
00 248D DINO_PM.5@ 00 24C7 DINO_PM.6@
00 24B5 DINO_PM.6@ 00 24EF DINO_PM.7@
00 24E0 DINO_PM.COUNTER 00 251A DINO_PM.COUNTER
00 24E1 DINO_PM.DINO_SAVE_PM_Y 00 251B DINO_PM.DINO_SAVE_PM_Y
00 24E2 DINO_PM.DINO_SAVE_PM_Y_PREV 00 251C DINO_PM.DINO_SAVE_PM_Y_PREV
00 24E3 MOVE_DL 00 251D MOVE_DL
00 24EF MOVE_DL.INCR 00 252F MOVE_DL.8@
00 2504 MOVE_SCR 00 253B MOVE_DL.INCR
00 251F MOVE_SCR.7@ 00 2550 X_SCR_OFFSET
00 2520 MOVE_SCR.HSCR_STATE 00 2551 MOVE_SCR
00 2521 DINO0 00 256C MOVE_SCR.9@
00 2569 DINO1 00 256D MOVE_SCR.HSCR_STATE
00 25B1 DINO2 00 256E DINO0
00 25F9 DINO_MASK0 00 25B6 DINO1
00 2641 DINO_MASK1 00 25FE DINO2
00 2689 DINO_MASK2 00 2646 DINO_MASK0
00 26D1 DINO_TAB_L 00 268E DINO_MASK1
00 26D4 DINO_TAB_H 00 26D6 DINO_MASK2
00 26D7 DINO_MASK_TAB_L 00 271E DINO_TAB_L
00 26DA DINO_MASK_TAB_H 00 2721 DINO_TAB_H
00 26DD DINO_BACK 00 2724 DINO_MASK_TAB_L
00 2725 DINO_SAVE_Y 00 2727 DINO_MASK_TAB_H
00 2726 GND_0 00 272A DINO_BACK
00 2736 GND_1 00 2772 DINO_SAVE_Y
00 2746 GND_2 00 2773 GND_0
00 2756 GND_TAB_L 00 2783 GND_1
00 2759 GND_TAB_H 00 2793 GND_2
00 275C SCR_ADDRS_L 00 27A3 GND_TAB_L
00 27DC SCR_ADDRS_H 00 27A6 GND_TAB_H
00 27A9 SCR_ADDRS_L
00 2829 SCR_ADDRS_H
00 0003 CACTI 00 0003 CACTI
00 285C CACT0 00 28A9 CACT0
00 28E8 CACT1 00 2935 CACT1
00 29A8 CACT2 00 29F5 CACT2
00 2AC0 CACT_WIDTHS 00 2B0D CACT_WIDTHS
00 2AC3 CACT_HEIGHTS 00 2B10 CACT_HEIGHTS
00 2AC6 CACT_TAB_L 00 2B13 CACT_TAB_L
00 2AC9 CACT_TAB_H 00 2B16 CACT_TAB_H
+933 -900
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+29 -1
View File
@@ -1,5 +1,27 @@
; @com.wudsn.ide.asm.mainsourcefile=ni.asm ; @com.wudsn.ide.asm.mainsourcefile=ni.asm
.proc dl_addr_init ;sets initial values for DL addressess
;uses AXY, tmp0, tmp1
_dl = tmp0
_scr = tmp1
mwa #dl_addrs+1 _dl
mwa #screen _scr
ldx #sh
@ ldy #0
lda _scr
sta (_dl),y
lda _scr+1
iny
sta (_dl),y
adw _dl #3
adw _scr #sw
dex
bne @-
rts
.endp
.proc dino ; dino to the screen .proc dino ; dino to the screen
; uses: AXY tmp0 tmp1 tmp2 tmp3 ; uses: AXY tmp0 tmp1 tmp2 tmp3
; Y - ypos in lines ; Y - ypos in lines
@@ -343,7 +365,12 @@ dino_save_pm_y_prev .by 0
;uses: AXY ;uses: AXY
inc:lda x_scr_offset inc:lda x_scr_offset
cmp #sw_l cmp #sw_log+1 ; is it end of the logical 2 screens?
bne @+
;start anew
mva #0 x_scr_offset
jsr dl_addr_init
@
mwa #dl_addrs+1 incr+1 ;self mod mwa #dl_addrs+1 incr+1 ;self mod
ldx #sh ldx #sh
incr inc $ffff incr inc $ffff
@@ -355,6 +382,7 @@ incr inc $ffff
x_scr_offset .by 0 ;where is the beginning of the screen x_scr_offset .by 0 ;where is the beginning of the screen
.proc move_scr ;screen window one step (1/4 th of byte) right .proc move_scr ;screen window one step (1/4 th of byte) right
;uses: AXY
dec:lda hscr_state dec:lda hscr_state
sta HSCROL sta HSCROL
cmp #4 cmp #4