Renamed the old geos target to geos-cbm.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5343 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
21
libsrc/geos-cbm/disk/Makefile
Normal file
21
libsrc/geos-cbm/disk/Makefile
Normal file
@@ -0,0 +1,21 @@
|
||||
#
|
||||
# Makefile for GEOS lib
|
||||
# for cc65
|
||||
#
|
||||
|
||||
%.o: %.s
|
||||
@$(AS) -o $@ $(AFLAGS) $<
|
||||
|
||||
|
||||
S_OBJS = blkalloc.o calcblksfree.o changediskdevice.o chkdkgeos.o enterturbo.o exitturbo.o\
|
||||
findbambit.o freeblock.o getblock.o getdirhead.o getptrcurdknm.o newdisk.o\
|
||||
nxtblkalloc.o opendisk.o purgeturbo.o putblock.o putdirhead.o readblock.o\
|
||||
readbuff.o setnextfree.o setgeosdisk.o writeblock.o writebuff.o verwriteblock.o\
|
||||
gettrse.o setoserror.o\
|
||||
dio_openclose.o dio_cts.o dio_stc.o dio_read.o dio_write.o dio_writev.o\
|
||||
dio_params.o
|
||||
|
||||
all: $(S_OBJS)
|
||||
|
||||
clean:
|
||||
@$(RM) *.~ $(S_OBJS) core
|
||||
22
libsrc/geos-cbm/disk/blkalloc.s
Normal file
22
libsrc/geos-cbm/disk/blkalloc.s
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 21.12.1999, 2.1.2003
|
||||
|
||||
; char BlkAlloc (struct tr_se output[], int length);
|
||||
|
||||
.import popax, setoserror
|
||||
.export _BlkAlloc
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
.include "../inc/geossym.inc"
|
||||
|
||||
_BlkAlloc:
|
||||
sta r2L
|
||||
stx r2H
|
||||
jsr popax
|
||||
sta r4L
|
||||
stx r4H
|
||||
jsr BlkAlloc
|
||||
jmp setoserror
|
||||
20
libsrc/geos-cbm/disk/calcblksfree.s
Normal file
20
libsrc/geos-cbm/disk/calcblksfree.s
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Alliance' Witkowiak
|
||||
;
|
||||
; 21.12.99
|
||||
|
||||
; int CalcBlksFree (void);
|
||||
|
||||
.import __oserror
|
||||
.export _CalcBlksFree
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
.include "../inc/geossym.inc"
|
||||
|
||||
_CalcBlksFree:
|
||||
jsr CalcBlksFree
|
||||
stx __oserror
|
||||
lda r4L
|
||||
ldx r4H
|
||||
rts
|
||||
16
libsrc/geos-cbm/disk/changediskdevice.s
Normal file
16
libsrc/geos-cbm/disk/changediskdevice.s
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 21.12.1999, 2.1.2003
|
||||
|
||||
; char ChangeDiskDevice (char newDriveNumber);
|
||||
|
||||
.import setoserror
|
||||
.export _ChangeDiskDevice
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
|
||||
_ChangeDiskDevice:
|
||||
jsr ChangeDiskDevice
|
||||
jmp setoserror
|
||||
19
libsrc/geos-cbm/disk/chkdkgeos.s
Normal file
19
libsrc/geos-cbm/disk/chkdkgeos.s
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 21.12.1999, 2.1.2003
|
||||
|
||||
; char ChkDkGEOS (void);
|
||||
|
||||
.import setoserror
|
||||
.export _ChkDkGEOS
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
.include "../inc/geossym.inc"
|
||||
|
||||
_ChkDkGEOS:
|
||||
jsr ChkDkGEOS
|
||||
jsr setoserror
|
||||
lda isGEOS
|
||||
rts
|
||||
191
libsrc/geos-cbm/disk/dio_cts.s
Normal file
191
libsrc/geos-cbm/disk/dio_cts.s
Normal file
@@ -0,0 +1,191 @@
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
; 2.7.2001
|
||||
;
|
||||
;
|
||||
; unsigned char __fastcall__ dio_phys_to_log(dhandle_t handle,
|
||||
; dio_phys_pos *physpos, /* input */
|
||||
; sectnum_t *sectnum); /* output */
|
||||
;
|
||||
; dhandle_t - 16bit (ptr)
|
||||
; sectnum_t - 16bit
|
||||
;
|
||||
|
||||
.export _dio_phys_to_log
|
||||
.export sectab_1541_l, sectab_1541_h ; for log_to_phys
|
||||
.import popax,__oserror
|
||||
.importzp ptr1,ptr2,ptr3,tmp1,tmp2,tmp3,tmp4
|
||||
.include "../inc/dio.inc"
|
||||
.include "../inc/geossym.inc"
|
||||
.include "../inc/const.inc"
|
||||
|
||||
.proc _dio_phys_to_log
|
||||
sta ptr1
|
||||
stx ptr1+1 ; pointer to result
|
||||
|
||||
jsr popax
|
||||
sta ptr2
|
||||
stx ptr2+1 ; pointer to input structure
|
||||
|
||||
jsr popax
|
||||
sta ptr3
|
||||
stx ptr3+1 ; pointer to handle
|
||||
|
||||
ldy #sst_flag
|
||||
lda (ptr3),y
|
||||
and #128
|
||||
beq _inv_hand ; handle not open or invalid
|
||||
|
||||
|
||||
ldy #diopp_head
|
||||
lda (ptr2),y
|
||||
bne _inv_data ; there is only head 0
|
||||
ldy #diopp_track
|
||||
lda (ptr2),y
|
||||
beq _inv_data ; there is no track 0
|
||||
sta tmp1
|
||||
iny
|
||||
lda (ptr2),y
|
||||
bne _inv_data ; there are no more than 256 tracks
|
||||
dec tmp1 ; normalize track to start from 0
|
||||
ldy #diopp_sector
|
||||
lda (ptr2),y
|
||||
sta tmp2
|
||||
iny
|
||||
lda (ptr2),y
|
||||
bne _inv_data ; there are no more than 256 sectors
|
||||
|
||||
; tmp1 (int) holds track+sector, translate it using device info
|
||||
|
||||
ldy #sst_driveno
|
||||
lda (ptr3),y
|
||||
tay
|
||||
lda driveType,y
|
||||
and #%00000011 ; this is for RamDrive compatibility
|
||||
cmp #DRV_1541
|
||||
beq dio_cts1541
|
||||
cmp #DRV_1571
|
||||
beq dio_cts1571
|
||||
cmp #DRV_1581
|
||||
beq dio_cts1581
|
||||
|
||||
lda #DEV_NOT_FOUND ; unknown device
|
||||
ldx #0
|
||||
beq ret
|
||||
|
||||
dio_ctsend:
|
||||
ldy #1
|
||||
lda tmp2
|
||||
sta (ptr1),y
|
||||
dey
|
||||
lda tmp1
|
||||
sta (ptr1),y
|
||||
|
||||
ldx #0
|
||||
txa
|
||||
ret:
|
||||
sta __oserror
|
||||
rts ; return success
|
||||
|
||||
; errors
|
||||
|
||||
_inv_data:
|
||||
lda #INV_TRACK
|
||||
.byte $2c
|
||||
_inv_hand:
|
||||
lda #INCOMPATIBLE
|
||||
ldx #0
|
||||
beq ret
|
||||
|
||||
; device-depended stuff, tmp1=track-1, tmp2=sector
|
||||
|
||||
dio_cts1541:
|
||||
ldy tmp1
|
||||
cpy #35
|
||||
bcs _inv_data
|
||||
lda sectab_1541_l,y
|
||||
clc
|
||||
adc tmp2
|
||||
sta tmp1
|
||||
lda sectab_1541_h,y
|
||||
adc #0
|
||||
sta tmp2
|
||||
jmp dio_ctsend
|
||||
|
||||
dio_cts1571:
|
||||
lda tmp1
|
||||
cmp #70
|
||||
bcs _inv_data
|
||||
cmp #35 ; last track of one side
|
||||
bcs _sub35
|
||||
jmp dio_cts1541 ; track <=35 - same as 1541
|
||||
|
||||
_sub35:
|
||||
sec
|
||||
sbc #35
|
||||
sta tmp1
|
||||
jsr dio_cts1541 ; get offset on second side of disk
|
||||
lda tmp1 ; add second side base
|
||||
clc
|
||||
adc #<683
|
||||
sta tmp1
|
||||
lda tmp2
|
||||
adc #>683
|
||||
sta tmp2
|
||||
jmp dio_ctsend
|
||||
|
||||
dio_cts1581:
|
||||
; 1581 has 80 tracks, 40 sectors each secnum=track*40+sector
|
||||
ldx #0
|
||||
stx tmp3
|
||||
stx tmp4
|
||||
lda tmp1
|
||||
beq _nomult
|
||||
cmp #80
|
||||
bcs _inv_data
|
||||
|
||||
; mul40 by Christian Groessler
|
||||
sta tmp4
|
||||
asl a
|
||||
rol tmp3
|
||||
asl a
|
||||
rol tmp3 ; val * 4
|
||||
adc tmp4
|
||||
bcc L1
|
||||
inc tmp3 ; val * 5
|
||||
L1: asl a
|
||||
rol tmp3 ; val * 10
|
||||
asl a
|
||||
rol tmp3
|
||||
asl a
|
||||
rol tmp3 ; val * 40 = AX
|
||||
ldx tmp3
|
||||
sta tmp3
|
||||
stx tmp4
|
||||
|
||||
_nomult:
|
||||
lda tmp2
|
||||
clc
|
||||
adc tmp3
|
||||
sta tmp1
|
||||
lda tmp4
|
||||
adc #0
|
||||
sta tmp2
|
||||
jmp dio_ctsend
|
||||
|
||||
.endproc
|
||||
|
||||
.rodata
|
||||
|
||||
sectab_1541_l:
|
||||
.byte $00, $15, $2a, $3f, $54, $69, $7e, $93
|
||||
.byte $a8, $bd, $d2, $e7, $fc, $11, $26, $3b
|
||||
.byte $50, $65, $78, $8b, $9e, $b1, $c4, $d7
|
||||
.byte $ea, $fc, $0e, $20, $32, $44, $56, $67
|
||||
.byte $78, $89, $9a, $ab
|
||||
sectab_1541_h:
|
||||
.byte $00, $00, $00, $00, $00, $00, $00, $00
|
||||
.byte $00, $00, $00, $00, $00, $01, $01, $01
|
||||
.byte $01, $01, $01, $01, $01, $01, $01, $01
|
||||
.byte $01, $01, $02, $02, $02, $02, $02, $02
|
||||
.byte $02, $02, $02, $02
|
||||
85
libsrc/geos-cbm/disk/dio_openclose.s
Normal file
85
libsrc/geos-cbm/disk/dio_openclose.s
Normal file
@@ -0,0 +1,85 @@
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; based on Atari version by Christian Groessler
|
||||
; 2.7.2001
|
||||
;
|
||||
; dhandle_t __fastcall__ dio_open (driveid_t drive_id);
|
||||
; unsigned char __fastcall__ dio_close (dhandle_t handle);
|
||||
;
|
||||
; dio_open sets given device as current and initializes disk
|
||||
; dio_close does nothing special
|
||||
|
||||
.export _dio_open, _dio_close
|
||||
.import __oserror, _OpenDisk
|
||||
.importzp ptr1, tmp1
|
||||
.include "../inc/dio.inc"
|
||||
.include "../inc/jumptab.inc"
|
||||
.include "../inc/geossym.inc"
|
||||
.include "../inc/const.inc"
|
||||
|
||||
.bss
|
||||
|
||||
sectsizetab:
|
||||
.res 4 * sst_size ; this is hardcoded
|
||||
|
||||
.code
|
||||
|
||||
.proc _dio_open
|
||||
pha
|
||||
tax
|
||||
lda driveType,x ; check if there's a device
|
||||
beq _inv_drive
|
||||
txa
|
||||
clc
|
||||
adc #8 ; normalize devnum
|
||||
sta curDevice
|
||||
jsr SetDevice
|
||||
jsr _OpenDisk ; take care for errors there
|
||||
|
||||
pla
|
||||
tay ; drive #
|
||||
asl a ; make index from drive id
|
||||
asl a
|
||||
tax
|
||||
|
||||
lda #0
|
||||
sta sectsizetab+sst_sectsize,x
|
||||
lda #128
|
||||
sta sectsizetab+sst_flag,x ; set flag that drive is "open"
|
||||
lda #1
|
||||
sta sectsizetab+sst_sectsize+1,x
|
||||
tya
|
||||
sta sectsizetab+sst_driveno,x
|
||||
|
||||
stx tmp1
|
||||
lda #<sectsizetab
|
||||
clc
|
||||
adc tmp1
|
||||
sta tmp1
|
||||
lda #>sectsizetab
|
||||
adc #0
|
||||
tax
|
||||
lda tmp1
|
||||
|
||||
rts
|
||||
|
||||
_inv_drive:
|
||||
lda #DEV_NOT_FOUND
|
||||
sta __oserror
|
||||
lda #0
|
||||
tax
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _dio_close
|
||||
sta ptr1
|
||||
stx ptr1+1
|
||||
lda #0
|
||||
ldy #sst_flag
|
||||
sta (ptr1),y
|
||||
sta __oserror ; success
|
||||
tax
|
||||
rts ; return no error
|
||||
.endproc
|
||||
51
libsrc/geos-cbm/disk/dio_params.s
Normal file
51
libsrc/geos-cbm/disk/dio_params.s
Normal file
@@ -0,0 +1,51 @@
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
; 2.7.2001
|
||||
;
|
||||
; this function is used by dio_read and dio_write to fix parameters (secnum)
|
||||
; this function calls SetDevice so that more than one drive can be used at once
|
||||
|
||||
.import popax,pushax,_dio_log_to_phys
|
||||
.importzp ptr1
|
||||
.export dio_params,dio_secnum
|
||||
.include "../inc/geossym.inc"
|
||||
.include "../inc/jumptab.inc"
|
||||
.include "../inc/dio.inc"
|
||||
|
||||
.bss
|
||||
dio_secnum: .res 2
|
||||
|
||||
.code
|
||||
.proc dio_params
|
||||
|
||||
sta r4L
|
||||
stx r4H
|
||||
|
||||
jsr popax
|
||||
sta dio_secnum
|
||||
stx dio_secnum
|
||||
|
||||
jsr popax ; get 3rd parameter
|
||||
pha ; save it
|
||||
txa
|
||||
pha
|
||||
jsr pushax ; put it back
|
||||
pla ; restore it
|
||||
sta ptr1+1
|
||||
pla
|
||||
sta ptr1
|
||||
ldy #sst_driveno
|
||||
lda (ptr1),y
|
||||
clc
|
||||
adc #8
|
||||
jsr SetDevice ; setup device, load driver
|
||||
|
||||
lda #<dio_secnum
|
||||
ldx #>dio_secnum
|
||||
jsr pushax
|
||||
|
||||
lda #<r1L
|
||||
ldx #>r1H
|
||||
jmp _dio_log_to_phys
|
||||
|
||||
.endproc
|
||||
25
libsrc/geos-cbm/disk/dio_read.s
Normal file
25
libsrc/geos-cbm/disk/dio_read.s
Normal file
@@ -0,0 +1,25 @@
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
; 2.7.2001
|
||||
;
|
||||
; this file provides the _dio_read function
|
||||
;
|
||||
; unsigned char __fastcall__ dio_read(dhandle_t handle,sectnum_t sect_num,void *buffer);
|
||||
; dhandle_t - 16bit (ptr)
|
||||
; sectnum_t - 16bit
|
||||
;
|
||||
|
||||
.import dio_params, __oserror
|
||||
.export _dio_read
|
||||
.include "../inc/geossym.inc"
|
||||
.include "../inc/jumptab.inc"
|
||||
|
||||
.proc _dio_read
|
||||
|
||||
jsr dio_params
|
||||
jsr ReadBlock
|
||||
stx __oserror
|
||||
txa
|
||||
rts
|
||||
|
||||
.endproc
|
||||
182
libsrc/geos-cbm/disk/dio_stc.s
Normal file
182
libsrc/geos-cbm/disk/dio_stc.s
Normal file
@@ -0,0 +1,182 @@
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
; 2.7.2001
|
||||
;
|
||||
; unsigned char __fastcall__ dio_log_to_phys(dhandle_t handle,
|
||||
; sectnum_t *sectnum, /* input */
|
||||
; dio_phys_pos *physpos); /* output */
|
||||
;
|
||||
; dhandle_t - 16bit (ptr)
|
||||
; sectnum_t - 16bit
|
||||
;
|
||||
|
||||
.export _dio_log_to_phys
|
||||
.importzp ptr1,ptr2,ptr3,tmp1,tmp2
|
||||
.import popax,__oserror
|
||||
.import sectab_1541_l, sectab_1541_h
|
||||
.include "../inc/dio.inc"
|
||||
.include "../inc/geossym.inc"
|
||||
.include "../inc/const.inc"
|
||||
|
||||
.proc _dio_log_to_phys
|
||||
|
||||
; check device type
|
||||
sta ptr1
|
||||
stx ptr1+1 ; pointer to result (struct dio_phys_pos)
|
||||
|
||||
jsr popax
|
||||
sta ptr2
|
||||
stx ptr2+1 ; pointer to input structure (pointer to int)
|
||||
|
||||
jsr popax
|
||||
sta ptr3
|
||||
stx ptr3+1 ; pointer to handle
|
||||
|
||||
ldy #sst_flag
|
||||
lda (ptr3),y
|
||||
and #128
|
||||
beq _inv_hand ; handle not open or invalid
|
||||
|
||||
; fill in all we have
|
||||
ldy #diopp_head
|
||||
lda #0 ; head 0
|
||||
sta (ptr1),y
|
||||
ldy #diopp_track+1
|
||||
sta (ptr1),y ; track <256
|
||||
ldy #diopp_sector+1
|
||||
sta (ptr1),y ; sector <256
|
||||
|
||||
ldy #0
|
||||
lda (ptr2),y
|
||||
sta tmp1
|
||||
iny
|
||||
lda (ptr2),y
|
||||
sta tmp2
|
||||
|
||||
; get drive info
|
||||
ldy #sst_driveno
|
||||
lda (ptr3),y
|
||||
tay
|
||||
lda driveType,y
|
||||
and #%00000011 ; this is for RamDrive compatibility
|
||||
cmp #DRV_1541
|
||||
beq dio_stc1541
|
||||
cmp #DRV_1571
|
||||
beq dio_stc1571
|
||||
cmp #DRV_1581
|
||||
beq dio_stc1581
|
||||
|
||||
lda #DEV_NOT_FOUND ; unknown device
|
||||
ldx #0
|
||||
beq _ret
|
||||
|
||||
dio_stcend:
|
||||
ldy #diopp_track
|
||||
lda tmp1
|
||||
sta (ptr1),y
|
||||
ldy #diopp_sector
|
||||
lda tmp2
|
||||
sta (ptr1),y
|
||||
|
||||
ldx #0
|
||||
txa
|
||||
_ret:
|
||||
sta __oserror
|
||||
rts ; return success
|
||||
|
||||
; errors
|
||||
_inv_data:
|
||||
lda #INV_TRACK
|
||||
.byte $2c
|
||||
_inv_hand:
|
||||
lda #INCOMPATIBLE
|
||||
ldx #0
|
||||
beq _ret
|
||||
|
||||
dio_stc1541:
|
||||
; if 1541:
|
||||
; - compare with table to find track
|
||||
; - subtract and find sector
|
||||
|
||||
ldx #0 ; index=(track-1)
|
||||
_loop41:
|
||||
lda tmp2
|
||||
cmp sectab_1541_h+1,x
|
||||
bne _nxt
|
||||
lda tmp1
|
||||
cmp sectab_1541_l+1,x
|
||||
bcc _found
|
||||
_nxt: inx
|
||||
cpx #35
|
||||
bne _loop41
|
||||
beq _inv_data
|
||||
|
||||
_found:
|
||||
lda tmp1
|
||||
sec
|
||||
sbc sectab_1541_l,x
|
||||
sta tmp2
|
||||
_fndend:
|
||||
inx
|
||||
stx tmp1
|
||||
jmp dio_stcend
|
||||
|
||||
dio_stc1571:
|
||||
; if 1571:
|
||||
; - check size, if too big - subtract and add 35 to track
|
||||
; - fall down to 1541
|
||||
lda tmp2
|
||||
cmp #>683
|
||||
bne _cnt71
|
||||
lda tmp1
|
||||
cmp #<683
|
||||
bcc dio_stc1541
|
||||
|
||||
_cnt71:
|
||||
lda tmp1
|
||||
sec
|
||||
sbc #<683
|
||||
sta tmp1
|
||||
lda tmp2
|
||||
sbc #>683
|
||||
sta tmp2
|
||||
jsr dio_stc1541 ; will fall through here
|
||||
|
||||
ldy #diopp_track
|
||||
lda (ptr1),y
|
||||
clc
|
||||
adc #35
|
||||
sta (ptr1),y
|
||||
lda #0
|
||||
beq _ret
|
||||
|
||||
; if 1581:
|
||||
; - subtract 40 in loop (at most 80 times) to find track
|
||||
; - the remainder is sector
|
||||
dio_stc1581:
|
||||
ldx #0 ; index=(track-1)
|
||||
_loop81:
|
||||
lda tmp2
|
||||
bne _sub81
|
||||
lda tmp1
|
||||
cmp #40
|
||||
bcc _got81
|
||||
_sub81: lda tmp1
|
||||
sec
|
||||
sbc #40
|
||||
sta tmp1
|
||||
lda tmp2
|
||||
sbc #0
|
||||
sta tmp2
|
||||
inx
|
||||
cpx #81
|
||||
bne _loop81
|
||||
beq _inv_data
|
||||
|
||||
_got81: lda tmp1
|
||||
sta tmp2
|
||||
inx
|
||||
stx tmp1
|
||||
jmp dio_stcend
|
||||
|
||||
.endproc
|
||||
23
libsrc/geos-cbm/disk/dio_write.s
Normal file
23
libsrc/geos-cbm/disk/dio_write.s
Normal file
@@ -0,0 +1,23 @@
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
; 2.7.2001
|
||||
;
|
||||
; this file provides the _dio_write function
|
||||
;
|
||||
; unsigned char __fastcall__ dio_write(dhandle_t handle,sectnum_t sect_num,const void *buffer);
|
||||
; dhandle_t - 16bit (ptr)
|
||||
; sectnum_t - 16bit
|
||||
;
|
||||
|
||||
.import dio_params, setoserror
|
||||
.export _dio_write
|
||||
.include "../inc/geossym.inc"
|
||||
.include "../inc/jumptab.inc"
|
||||
|
||||
.proc _dio_write
|
||||
|
||||
jsr dio_params
|
||||
jsr WriteBlock
|
||||
jmp setoserror
|
||||
|
||||
.endproc
|
||||
25
libsrc/geos-cbm/disk/dio_writev.s
Normal file
25
libsrc/geos-cbm/disk/dio_writev.s
Normal file
@@ -0,0 +1,25 @@
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
; 2.7.2001
|
||||
;
|
||||
; this file provides the _dio_write function
|
||||
;
|
||||
; unsigned char __fastcall__ dio_write_verify(dhandle_t handle,sectnum_t sect_num,const void *buffer);
|
||||
; dhandle_t - 16bit (ptr)
|
||||
; sectnum_t - 16bit
|
||||
;
|
||||
|
||||
.import dio_params, __oserror
|
||||
.export _dio_write_verify
|
||||
.include "../inc/geossym.inc"
|
||||
.include "../inc/jumptab.inc"
|
||||
|
||||
.proc _dio_write_verify
|
||||
|
||||
jsr dio_params
|
||||
jsr VerWriteBlock
|
||||
stx __oserror
|
||||
txa
|
||||
rts
|
||||
|
||||
.endproc
|
||||
13
libsrc/geos-cbm/disk/enterturbo.s
Normal file
13
libsrc/geos-cbm/disk/enterturbo.s
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Alliance' Witkowiak
|
||||
;
|
||||
; 21.12.99
|
||||
|
||||
; void EnterTurbo (void);
|
||||
|
||||
.export _EnterTurbo
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
|
||||
_EnterTurbo = EnterTurbo
|
||||
13
libsrc/geos-cbm/disk/exitturbo.s
Normal file
13
libsrc/geos-cbm/disk/exitturbo.s
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Alliance' Witkowiak
|
||||
;
|
||||
; 21.12.99
|
||||
|
||||
; void ExitTurbo (void);
|
||||
|
||||
.export _ExitTurbo
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
|
||||
_ExitTurbo = ExitTurbo
|
||||
24
libsrc/geos-cbm/disk/findbambit.s
Normal file
24
libsrc/geos-cbm/disk/findbambit.s
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 21.12.1999, 2.1.2003
|
||||
|
||||
; char FindBAMBit (struct tr_se *TS);
|
||||
; (might be called inUSE (if (!inUSE(block))))
|
||||
|
||||
.import gettrse
|
||||
.import return0, return1
|
||||
.export _FindBAMBit
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
.include "../inc/geossym.inc"
|
||||
|
||||
_FindBAMBit:
|
||||
jsr gettrse
|
||||
sta r6L
|
||||
stx r6H
|
||||
jsr FindBAMBit
|
||||
bne inUse
|
||||
jmp return0
|
||||
inUse: jmp return1
|
||||
20
libsrc/geos-cbm/disk/freeblock.s
Normal file
20
libsrc/geos-cbm/disk/freeblock.s
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 21.12.1999, 2.1.2003
|
||||
|
||||
; char FreeBlock (struct tr_se *TS);
|
||||
|
||||
.import gettrse, setoserror
|
||||
.export _FreeBlock
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
.include "../inc/geossym.inc"
|
||||
|
||||
_FreeBlock:
|
||||
jsr gettrse
|
||||
sta r6L
|
||||
stx r6H
|
||||
jsr FreeBlock
|
||||
jmp setoserror
|
||||
24
libsrc/geos-cbm/disk/getblock.s
Normal file
24
libsrc/geos-cbm/disk/getblock.s
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 21.12.1999, 2.1.2003
|
||||
|
||||
; char GetBlock (struct tr_se *myTS, char *buffer);
|
||||
|
||||
.import popax, setoserror
|
||||
.import gettrse
|
||||
.export _GetBlock
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
.include "../inc/geossym.inc"
|
||||
|
||||
_GetBlock:
|
||||
sta r4L
|
||||
stx r4H
|
||||
jsr popax
|
||||
jsr gettrse
|
||||
sta r1L
|
||||
stx r1H
|
||||
jsr GetBlock
|
||||
jmp setoserror
|
||||
16
libsrc/geos-cbm/disk/getdirhead.s
Normal file
16
libsrc/geos-cbm/disk/getdirhead.s
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 21.12.1999, 2.1.2003
|
||||
|
||||
; char GetDirHead (void);
|
||||
|
||||
.import setoserror
|
||||
.export _GetDirHead
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
|
||||
_GetDirHead:
|
||||
jsr GetDirHead
|
||||
jmp setoserror
|
||||
35
libsrc/geos-cbm/disk/getptrcurdknm.s
Normal file
35
libsrc/geos-cbm/disk/getptrcurdknm.s
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Alliance' Witkowiak
|
||||
;
|
||||
; 21.12.99
|
||||
|
||||
; void GetPtrCurDkNm (char *curName);
|
||||
; (fills curName[17] with current disk's name)
|
||||
|
||||
.importzp ptr4, ptr3
|
||||
.import __oserror
|
||||
.export _GetPtrCurDkNm
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
.include "../inc/geossym.inc"
|
||||
|
||||
_GetPtrCurDkNm:
|
||||
sta ptr3
|
||||
stx ptr3+1
|
||||
ldx #ptr4
|
||||
jsr GetPtrCurDkNm
|
||||
ldy #0
|
||||
txa
|
||||
bne fin
|
||||
namelp: lda (ptr4),y
|
||||
cmp #$a0
|
||||
beq fin
|
||||
sta (ptr3),y
|
||||
iny
|
||||
cpy #16
|
||||
bne namelp
|
||||
fin: lda #0
|
||||
sta (ptr3),y
|
||||
stx __oserror
|
||||
rts
|
||||
17
libsrc/geos-cbm/disk/gettrse.s
Normal file
17
libsrc/geos-cbm/disk/gettrse.s
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Alliance' Witkowiak
|
||||
;
|
||||
; 29.1.00
|
||||
|
||||
.export gettrse
|
||||
.importzp ptr4
|
||||
gettrse:
|
||||
sta ptr4
|
||||
stx ptr4+1
|
||||
ldy #1
|
||||
lda (ptr4),y
|
||||
tax
|
||||
dey
|
||||
lda (ptr4),y
|
||||
rts
|
||||
16
libsrc/geos-cbm/disk/newdisk.s
Normal file
16
libsrc/geos-cbm/disk/newdisk.s
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 21.12.1999, 2.1.2003
|
||||
|
||||
; char NewDisk (void);
|
||||
|
||||
.import setoserror
|
||||
.export _NewDisk
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
|
||||
_NewDisk:
|
||||
jsr NewDisk
|
||||
jmp setoserror
|
||||
28
libsrc/geos-cbm/disk/nxtblkalloc.s
Normal file
28
libsrc/geos-cbm/disk/nxtblkalloc.s
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 21.12.1999, 2.1.2003
|
||||
|
||||
; char NxtBlkAlloc (struct tr_se *startTS, struct tr_se output[], int length );
|
||||
|
||||
.import popax, setoserror
|
||||
.import gettrse
|
||||
.importzp ptr4
|
||||
.export _NxtBlkAlloc
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
.include "../inc/geossym.inc"
|
||||
|
||||
_NxtBlkAlloc:
|
||||
sta r2L
|
||||
stx r2H
|
||||
jsr popax
|
||||
sta r4L
|
||||
stx r4H
|
||||
jsr popax
|
||||
jsr gettrse
|
||||
sta r3L
|
||||
stx r3H
|
||||
jsr NxtBlkAlloc
|
||||
jmp setoserror
|
||||
16
libsrc/geos-cbm/disk/opendisk.s
Normal file
16
libsrc/geos-cbm/disk/opendisk.s
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 21.12.1999, 2.1.2003
|
||||
|
||||
; char OpenDisk (void);
|
||||
|
||||
.import setoserror
|
||||
.export _OpenDisk
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
|
||||
_OpenDisk:
|
||||
jsr OpenDisk
|
||||
jmp setoserror
|
||||
13
libsrc/geos-cbm/disk/purgeturbo.s
Normal file
13
libsrc/geos-cbm/disk/purgeturbo.s
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Alliance' Witkowiak
|
||||
;
|
||||
; 21.12.99
|
||||
|
||||
; void PurgeTurbo (void);
|
||||
|
||||
.export _PurgeTurbo
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
|
||||
_PurgeTurbo = PurgeTurbo
|
||||
24
libsrc/geos-cbm/disk/putblock.s
Normal file
24
libsrc/geos-cbm/disk/putblock.s
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 21.12.1999, 2.1.2003
|
||||
|
||||
; char PutBlock (struct tr_se *myTS, char *buffer);
|
||||
|
||||
.import popax, setoserror
|
||||
.import gettrse
|
||||
.export _PutBlock
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
.include "../inc/geossym.inc"
|
||||
|
||||
_PutBlock:
|
||||
sta r4L
|
||||
stx r4H
|
||||
jsr popax
|
||||
jsr gettrse
|
||||
sta r1L
|
||||
stx r1H
|
||||
jsr PutBlock
|
||||
jmp setoserror
|
||||
16
libsrc/geos-cbm/disk/putdirhead.s
Normal file
16
libsrc/geos-cbm/disk/putdirhead.s
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 21.12.99, 2.1.2003
|
||||
|
||||
; char PutDirHead (void);
|
||||
|
||||
.import setoserror
|
||||
.export _PutDirHead
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
|
||||
_PutDirHead:
|
||||
jsr PutDirHead
|
||||
jmp setoserror
|
||||
24
libsrc/geos-cbm/disk/readblock.s
Normal file
24
libsrc/geos-cbm/disk/readblock.s
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 21.12.1999, 2.1.2003
|
||||
|
||||
; char ReadBlock (struct tr_se myTS, char *buffer);
|
||||
|
||||
.import popax, setoserror
|
||||
.import gettrse
|
||||
.export _ReadBlock
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
.include "../inc/geossym.inc"
|
||||
|
||||
_ReadBlock:
|
||||
sta r4L
|
||||
stx r4H
|
||||
jsr popax
|
||||
jsr gettrse
|
||||
sta r1L
|
||||
stx r1H
|
||||
jsr ReadBlock
|
||||
jmp setoserror
|
||||
21
libsrc/geos-cbm/disk/readbuff.s
Normal file
21
libsrc/geos-cbm/disk/readbuff.s
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 26.10.1999, 2.1.2003
|
||||
|
||||
; char ReadBuff (struct tr_se);
|
||||
|
||||
.import setoserror
|
||||
.import gettrse
|
||||
.export _ReadBuff
|
||||
|
||||
.include "../inc/diskdrv.inc"
|
||||
.include "../inc/geossym.inc"
|
||||
|
||||
_ReadBuff:
|
||||
jsr gettrse
|
||||
sta r1L
|
||||
stx r1H
|
||||
jsr ReadBuff
|
||||
jmp setoserror
|
||||
16
libsrc/geos-cbm/disk/setgeosdisk.s
Normal file
16
libsrc/geos-cbm/disk/setgeosdisk.s
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 21.12.1999, 2.1.2003
|
||||
|
||||
; char SetGEOSDisk (void);
|
||||
|
||||
.import setoserror
|
||||
.export _SetGEOSDisk
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
|
||||
_SetGEOSDisk:
|
||||
jsr SetGEOSDisk
|
||||
jmp setoserror
|
||||
24
libsrc/geos-cbm/disk/setnextfree.s
Normal file
24
libsrc/geos-cbm/disk/setnextfree.s
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Alliance' Witkowiak
|
||||
;
|
||||
; 21.12.99
|
||||
|
||||
; struct tr_se SetNextFree (struct tr_se *startTS);
|
||||
|
||||
.import __oserror
|
||||
.import gettrse
|
||||
.export _SetNextFree
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
.include "../inc/geossym.inc"
|
||||
|
||||
_SetNextFree:
|
||||
jsr gettrse
|
||||
sta r3L
|
||||
stx r3H
|
||||
jsr SetNextFree
|
||||
stx __oserror
|
||||
lda r3L
|
||||
ldx r3H
|
||||
rts
|
||||
16
libsrc/geos-cbm/disk/setoserror.s
Normal file
16
libsrc/geos-cbm/disk/setoserror.s
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 2.1.2003
|
||||
;
|
||||
|
||||
.export setoserror
|
||||
.import __oserror
|
||||
|
||||
setoserror:
|
||||
stx __oserror
|
||||
txa
|
||||
ldx #0 ; X is cleared (high byte for promoting char to int)
|
||||
tay ; Y register is used just to save flags state
|
||||
rts
|
||||
24
libsrc/geos-cbm/disk/verwriteblock.s
Normal file
24
libsrc/geos-cbm/disk/verwriteblock.s
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 21.12.1999, 2.1.2003
|
||||
|
||||
; char VerWriteBlock (struct tr_se *myTS, char *buffer);
|
||||
|
||||
.import popax, setoserror
|
||||
.import gettrse
|
||||
.export _VerWriteBlock
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
.include "../inc/geossym.inc"
|
||||
|
||||
_VerWriteBlock:
|
||||
sta r4L
|
||||
stx r4H
|
||||
jsr popax
|
||||
jsr gettrse
|
||||
sta r1L
|
||||
stx r1H
|
||||
jsr VerWriteBlock
|
||||
jmp setoserror
|
||||
24
libsrc/geos-cbm/disk/writeblock.s
Normal file
24
libsrc/geos-cbm/disk/writeblock.s
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 21.12.1999, 2.1.2003
|
||||
|
||||
; char WriteBlock (struct tr_se *myTS, char *buffer);
|
||||
|
||||
.import popax, setoserror
|
||||
.import gettrse
|
||||
.export _WriteBlock
|
||||
|
||||
.include "../inc/jumptab.inc"
|
||||
.include "../inc/geossym.inc"
|
||||
|
||||
_WriteBlock:
|
||||
sta r4L
|
||||
stx r4H
|
||||
jsr popax
|
||||
jsr gettrse
|
||||
sta r1L
|
||||
stx r1H
|
||||
jsr WriteBlock
|
||||
jmp setoserror
|
||||
21
libsrc/geos-cbm/disk/writebuff.s
Normal file
21
libsrc/geos-cbm/disk/writebuff.s
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
;
|
||||
; Maciej 'YTM/Elysium' Witkowiak
|
||||
;
|
||||
; 26.10.1999, 2.1.2003
|
||||
|
||||
; char WriteBuff (struct tr_se*);
|
||||
|
||||
.import setoserror
|
||||
.import gettrse
|
||||
.export _WriteBuff
|
||||
|
||||
.include "../inc/diskdrv.inc"
|
||||
.include "../inc/geossym.inc"
|
||||
|
||||
_WriteBuff:
|
||||
jsr gettrse
|
||||
sta r1L
|
||||
stx r1H
|
||||
jsr WriteBuff
|
||||
jmp setoserror
|
||||
Reference in New Issue
Block a user