Brudnopis Delyry
From Atariki
Revision as of 09:42, 20 paź 2012; view current revision
←Older revision | Newer revision→
←Older revision | Newer revision→
Zapis Hiscore.dat z wykorzystaniem dowolnego DOS.
buflen = $4f org hiscores run_number dta 0,0,0 org hiscores+$10 tokens dta 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 hiscore dta 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 org hiscores+$40 player_name dta d'123456789a' org hiscores+$4e checksum dta 0 org code save_hiscore jsr find_free_IOCB jsr open_file jsr write_binary jsr close_file rts find_free_IOCB ldx #$00 ldy #$01 ?loop lda icchid,x cmp #$ff beq found txa clc adc #$10 tax bpl ?loop ldy #-95 found rts open_file lda #$03 sta iccmd,x lda #<fname sta icbufa,x lda #>fname sta icbufa+1,x lda #$08 sta icax1,x lda #$00 sta icax2,x jsr ciov rts close_file lda #$0c sta iccmd,x jsr ciov rts write_binary lda #$0b sta iccmd,x lda #<hiscores sta icbufa,x lda #>hiscores sta icbufa+1,x lda #<buflen sta icbufl,x lda #>buflen sta icbufl+1,x jsr ciov rts fname dta c'D:HISCORE.DAT',$9B