I/O added

This commit is contained in:
Pecusx
2024-12-04 10:14:04 +01:00
parent f706f7f8fc
commit ce327c37a8
2 changed files with 58 additions and 1 deletions
+7 -1
View File
@@ -68,6 +68,11 @@ statusBuffer
score=statusBuffer+33
HiScore=statusBuffer+17
Lives=statusBuffer+8
;--------------------------------------------------
icl 'fileio.asm'
;--------------------------------------------------
;--------------------------------------------------
.proc vint
;--------------------------------------------------
@@ -1291,7 +1296,8 @@ Level000_data
:14 .byte ' ##################################',155
.byte 0
LevelFileBuff
.ds (screenWidth*maxLines)+20 ; Buffer for data from the level file
LevelFileBuffLen=(screenWidth*maxLines)+20
.ds LevelFileBuffLen ; Buffer for data from the level file
;--------------------------------------------------
BigBrickFlag
.byte 0
+51
View File
@@ -0,0 +1,51 @@
.IF *>0 ;this is a trick that prevents compiling this file alone
;--------------------------------------------------
.proc open
;--------------------------------------------------
; OPEN #1,4,0,"D:LEVEL000.DAT"
ldx #$10 ;IOCB #1
lda #$03 ;komenda: OPEN
sta iccmd,x
lda #<fname ;adres nazwy pliku
sta icbufa,x
lda #>fname
sta icbufa+1,x
lda #04 ;kod dostępu: $04 odczyt, $08 zapis, $09 dopisywanie, $0c odczyt/zapis
sta icax1,x
lda #$00 ;dodatkowy parametr, $00 jest zawsze dobre
sta icax2,x
jmp ciov
fname .byte "D:LEVEL000.DAT",$9b
.endp
;--------------------------------------------------
.proc bget
;--------------------------------------------------
; BGET #1,LevelFileBuff,LevelFileBuffLen-2
ldx #$10 ;IOCB #1
lda #$07 ;komenda: GET BYTES / BINARY READ
sta iccmd,x
lda #<LevelFileBuff ;adres w pamieci, gdzie maja trafic dane
sta icbufa,x
lda #>LevelFileBuff
sta icbufa+1,x
lda #<(LevelFileBuffLen-2) ;wielkosc bloku danych w bajtach
sta icbufl,x
lda #>(LevelFileBuffLen-2)
sta icbufl+1,x
jmp ciov
.endp
;--------------------------------------------------
.proc close
;--------------------------------------------------
; CLOSE #1
ldx #$10 ;IOCB #1
lda #$0c ;komenda: CLOSE
sta iccmd,x
jmp ciov
.endp
.ENDIF