Removed (pretty inconsistently used) tab chars from source code base.
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
; offsets into sectsizetab (DIO functions)
|
||||
sst_flag = 0 ; length 1
|
||||
sst_sectsize = 1 ; 2
|
||||
sst_driveno = 3 ; 1 (drive #)
|
||||
sst_size = 4 ; size of one entry
|
||||
; if changed, adapt diopncls.s
|
||||
sst_flag = 0 ; length 1
|
||||
sst_sectsize = 1 ; 2
|
||||
sst_driveno = 3 ; 1 (drive #)
|
||||
sst_size = 4 ; size of one entry
|
||||
; if changed, adapt diopncls.s
|
||||
|
||||
; offsets into dio_phys_pos
|
||||
diopp_head = 0 ; head
|
||||
diopp_track = 1 ; track / cylinder
|
||||
diopp_sector = 3 ; sector
|
||||
diopp_size = 5 ; size of structure
|
||||
diopp_head = 0 ; head
|
||||
diopp_track = 1 ; track / cylinder
|
||||
diopp_sector = 3 ; sector
|
||||
diopp_size = 5 ; size of structure
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
|
||||
; char ChangeDiskDevice (char newDriveNumber);
|
||||
|
||||
.export _ChangeDiskDevice
|
||||
.import setoserror
|
||||
.export _ChangeDiskDevice
|
||||
.import setoserror
|
||||
|
||||
.include "jumptab.inc"
|
||||
|
||||
.include "jumptab.inc"
|
||||
|
||||
_ChangeDiskDevice:
|
||||
jsr ChangeDiskDevice
|
||||
jmp setoserror
|
||||
jsr ChangeDiskDevice
|
||||
jmp setoserror
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
|
||||
; char ChkDkGEOS (void);
|
||||
|
||||
.export _ChkDkGEOS
|
||||
.import setoserror
|
||||
.export _ChkDkGEOS
|
||||
.import setoserror
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_ChkDkGEOS:
|
||||
jsr ChkDkGEOS
|
||||
jsr setoserror
|
||||
lda isGEOS
|
||||
rts
|
||||
jsr ChkDkGEOS
|
||||
jsr setoserror
|
||||
lda isGEOS
|
||||
rts
|
||||
|
||||
@@ -4,184 +4,184 @@
|
||||
;
|
||||
;
|
||||
; unsigned char __fastcall__ dio_phys_to_log (dhandle_t handle,
|
||||
; dio_phys_pos *physpos, /* input */
|
||||
; unsigned *sectnum); /* output */
|
||||
; dio_phys_pos *physpos, /* input */
|
||||
; unsigned *sectnum); /* output */
|
||||
;
|
||||
|
||||
.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
|
||||
.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 "dio.inc"
|
||||
.include "geossym.inc"
|
||||
.include "const.inc"
|
||||
.include "dio.inc"
|
||||
.include "geossym.inc"
|
||||
.include "const.inc"
|
||||
|
||||
_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
|
||||
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
|
||||
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
|
||||
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
|
||||
lda #INV_TRACK
|
||||
.byte $2c
|
||||
_inv_hand:
|
||||
lda #INCOMPATIBLE
|
||||
ldx #0
|
||||
beq ret
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
lda tmp2
|
||||
clc
|
||||
adc tmp3
|
||||
sta tmp1
|
||||
lda tmp4
|
||||
adc #0
|
||||
sta tmp2
|
||||
jmp dio_ctsend
|
||||
|
||||
.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
|
||||
.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
|
||||
.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
|
||||
|
||||
@@ -10,74 +10,74 @@
|
||||
; 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
|
||||
.export _dio_open, _dio_close
|
||||
.import __oserror, _OpenDisk
|
||||
.importzp ptr1, tmp1
|
||||
|
||||
.include "dio.inc"
|
||||
.include "dio.inc"
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
.include "const.inc"
|
||||
.include "const.inc"
|
||||
|
||||
.bss
|
||||
|
||||
sectsizetab:
|
||||
.res 4 * sst_size ; this is hardcoded
|
||||
.res 4 * sst_size ; this is hardcoded
|
||||
|
||||
.code
|
||||
|
||||
_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
|
||||
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
|
||||
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
|
||||
rts
|
||||
|
||||
_inv_drive:
|
||||
lda #DEV_NOT_FOUND
|
||||
sta __oserror
|
||||
lda #0
|
||||
tax
|
||||
rts
|
||||
lda #DEV_NOT_FOUND
|
||||
sta __oserror
|
||||
lda #0
|
||||
tax
|
||||
rts
|
||||
|
||||
_dio_close:
|
||||
sta ptr1
|
||||
stx ptr1+1
|
||||
lda #0
|
||||
ldy #sst_flag
|
||||
sta (ptr1),y
|
||||
sta __oserror ; success
|
||||
tax
|
||||
rts ; return no error
|
||||
sta ptr1
|
||||
stx ptr1+1
|
||||
lda #0
|
||||
ldy #sst_flag
|
||||
sta (ptr1),y
|
||||
sta __oserror ; success
|
||||
tax
|
||||
rts ; return no error
|
||||
|
||||
@@ -5,48 +5,48 @@
|
||||
; 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
|
||||
|
||||
.export dio_params,dio_secnum
|
||||
.import popax,pushax,_dio_log_to_phys
|
||||
.importzp ptr1
|
||||
.export dio_params,dio_secnum
|
||||
.import popax,pushax,_dio_log_to_phys
|
||||
.importzp ptr1
|
||||
|
||||
.include "geossym.inc"
|
||||
.include "jumptab.inc"
|
||||
.include "dio.inc"
|
||||
.include "geossym.inc"
|
||||
.include "jumptab.inc"
|
||||
.include "dio.inc"
|
||||
|
||||
.bss
|
||||
|
||||
dio_secnum:
|
||||
.res 2
|
||||
.res 2
|
||||
|
||||
.code
|
||||
|
||||
dio_params:
|
||||
sta r4L
|
||||
stx r4H
|
||||
sta r4L
|
||||
stx r4H
|
||||
|
||||
jsr popax
|
||||
sta dio_secnum
|
||||
stx dio_secnum+1
|
||||
jsr popax
|
||||
sta dio_secnum
|
||||
stx dio_secnum+1
|
||||
|
||||
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
|
||||
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 #<dio_secnum
|
||||
ldx #>dio_secnum
|
||||
jsr pushax
|
||||
|
||||
lda #<r1L
|
||||
ldx #>r1H
|
||||
jmp _dio_log_to_phys
|
||||
lda #<r1L
|
||||
ldx #>r1H
|
||||
jmp _dio_log_to_phys
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
; unsigned __fastcall__ dio_query_sectcount (dhandle_t handle);
|
||||
;
|
||||
|
||||
.export _dio_query_sectcount
|
||||
.import __oserror
|
||||
.export _dio_query_sectcount
|
||||
.import __oserror
|
||||
|
||||
_dio_query_sectcount:
|
||||
lda #0
|
||||
sta __oserror
|
||||
lda #<683
|
||||
ldx #>683
|
||||
rts
|
||||
lda #0
|
||||
sta __oserror
|
||||
lda #<683
|
||||
ldx #>683
|
||||
rts
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
; unsigned __fastcall__ dio_query_sectsize (dhandle_t handle);
|
||||
;
|
||||
|
||||
.export _dio_query_sectsize
|
||||
.import __oserror
|
||||
.export _dio_query_sectsize
|
||||
.import __oserror
|
||||
|
||||
_dio_query_sectsize:
|
||||
lda #<256
|
||||
ldx #>256
|
||||
sta __oserror
|
||||
rts
|
||||
lda #<256
|
||||
ldx #>256
|
||||
sta __oserror
|
||||
rts
|
||||
|
||||
@@ -7,15 +7,15 @@
|
||||
; unsigned char __fastcall__ dio_read (dhandle_t handle, unsigned sect_num, void *buffer);
|
||||
;
|
||||
|
||||
.export _dio_read
|
||||
.import dio_params, __oserror
|
||||
.export _dio_read
|
||||
.import dio_params, __oserror
|
||||
|
||||
.include "geossym.inc"
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
.include "jumptab.inc"
|
||||
|
||||
_dio_read:
|
||||
jsr dio_params
|
||||
jsr ReadBlock
|
||||
stx __oserror
|
||||
txa
|
||||
rts
|
||||
jsr dio_params
|
||||
jsr ReadBlock
|
||||
stx __oserror
|
||||
txa
|
||||
rts
|
||||
|
||||
@@ -3,175 +3,175 @@
|
||||
; 2.7.2001
|
||||
;
|
||||
; unsigned char __fastcall__ dio_log_to_phys (dhandle_t handle,
|
||||
; unsigned *sectnum, /* input */
|
||||
; dio_phys_pos *physpos); /* output */
|
||||
; unsigned *sectnum, /* input */
|
||||
; dio_phys_pos *physpos); /* output */
|
||||
;
|
||||
|
||||
.export _dio_log_to_phys
|
||||
.importzp ptr1,ptr2,ptr3,tmp1,tmp2
|
||||
.import popax,__oserror
|
||||
.import sectab_1541_l, sectab_1541_h
|
||||
.export _dio_log_to_phys
|
||||
.importzp ptr1,ptr2,ptr3,tmp1,tmp2
|
||||
.import popax,__oserror
|
||||
.import sectab_1541_l, sectab_1541_h
|
||||
|
||||
.include "dio.inc"
|
||||
.include "geossym.inc"
|
||||
.include "const.inc"
|
||||
.include "dio.inc"
|
||||
.include "geossym.inc"
|
||||
.include "const.inc"
|
||||
|
||||
_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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
lda #INV_TRACK
|
||||
.byte $2c
|
||||
_inv_hand:
|
||||
lda #INCOMPATIBLE
|
||||
ldx #0
|
||||
beq _ret
|
||||
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)
|
||||
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
|
||||
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
|
||||
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
|
||||
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)
|
||||
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
|
||||
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
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
; unsigned char __fastcall__ dio_write (dhandle_t handle, unsigned sect_num, const void *buffer);
|
||||
;
|
||||
|
||||
.export _dio_write
|
||||
.import dio_params, setoserror
|
||||
.export _dio_write
|
||||
.import dio_params, setoserror
|
||||
|
||||
.include "geossym.inc"
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
.include "jumptab.inc"
|
||||
|
||||
_dio_write:
|
||||
jsr dio_params
|
||||
jsr WriteBlock
|
||||
jmp setoserror
|
||||
jsr dio_params
|
||||
jsr WriteBlock
|
||||
jmp setoserror
|
||||
|
||||
@@ -7,15 +7,15 @@
|
||||
; unsigned char __fastcall__ dio_write_verify (dhandle_t handle, unsigned sect_num, const void *buffer);
|
||||
;
|
||||
|
||||
.export _dio_write_verify
|
||||
.import dio_params, __oserror
|
||||
.export _dio_write_verify
|
||||
.import dio_params, __oserror
|
||||
|
||||
.include "geossym.inc"
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
.include "jumptab.inc"
|
||||
|
||||
_dio_write_verify:
|
||||
jsr dio_params
|
||||
jsr VerWriteBlock
|
||||
stx __oserror
|
||||
txa
|
||||
rts
|
||||
jsr dio_params
|
||||
jsr VerWriteBlock
|
||||
stx __oserror
|
||||
txa
|
||||
rts
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
; void EnterTurbo (void);
|
||||
|
||||
.export _EnterTurbo
|
||||
.export _EnterTurbo
|
||||
|
||||
.include "jumptab.inc"
|
||||
|
||||
_EnterTurbo = EnterTurbo
|
||||
.include "jumptab.inc"
|
||||
|
||||
_EnterTurbo = EnterTurbo
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
; void ExitTurbo (void);
|
||||
|
||||
.export _ExitTurbo
|
||||
.export _ExitTurbo
|
||||
|
||||
.include "jumptab.inc"
|
||||
|
||||
_ExitTurbo = ExitTurbo
|
||||
.include "jumptab.inc"
|
||||
|
||||
_ExitTurbo = ExitTurbo
|
||||
|
||||
@@ -6,18 +6,18 @@
|
||||
; char FindBAMBit (struct tr_se *TS);
|
||||
; (might be called inUSE (if (!inUSE(block))))
|
||||
|
||||
.export _FindBAMBit
|
||||
.import gettrse
|
||||
.import return0, return1
|
||||
.export _FindBAMBit
|
||||
.import gettrse
|
||||
.import return0, return1
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_FindBAMBit:
|
||||
jsr gettrse
|
||||
sta r6L
|
||||
stx r6H
|
||||
jsr FindBAMBit
|
||||
bne inUse
|
||||
jmp return0
|
||||
inUse: jmp return1
|
||||
jsr gettrse
|
||||
sta r6L
|
||||
stx r6H
|
||||
jsr FindBAMBit
|
||||
bne inUse
|
||||
jmp return0
|
||||
inUse: jmp return1
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
|
||||
; char NewDisk (void);
|
||||
|
||||
.export _NewDisk
|
||||
.import setoserror
|
||||
.export _NewDisk
|
||||
.import setoserror
|
||||
|
||||
.include "jumptab.inc"
|
||||
|
||||
.include "jumptab.inc"
|
||||
|
||||
_NewDisk:
|
||||
jsr NewDisk
|
||||
jmp setoserror
|
||||
jsr NewDisk
|
||||
jmp setoserror
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
; void PurgeTurbo (void);
|
||||
|
||||
.export _PurgeTurbo
|
||||
.export _PurgeTurbo
|
||||
|
||||
.include "jumptab.inc"
|
||||
|
||||
_PurgeTurbo = PurgeTurbo
|
||||
.include "jumptab.inc"
|
||||
|
||||
_PurgeTurbo = PurgeTurbo
|
||||
|
||||
@@ -5,19 +5,19 @@
|
||||
|
||||
; char ReadBlock (struct tr_se myTS, char *buffer);
|
||||
|
||||
.export _ReadBlock
|
||||
.import popax, setoserror
|
||||
.import gettrse
|
||||
.export _ReadBlock
|
||||
.import popax, setoserror
|
||||
.import gettrse
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_ReadBlock:
|
||||
sta r4L
|
||||
stx r4H
|
||||
jsr popax
|
||||
jsr gettrse
|
||||
sta r1L
|
||||
stx r1H
|
||||
jsr ReadBlock
|
||||
jmp setoserror
|
||||
sta r4L
|
||||
stx r4H
|
||||
jsr popax
|
||||
jsr gettrse
|
||||
sta r1L
|
||||
stx r1H
|
||||
jsr ReadBlock
|
||||
jmp setoserror
|
||||
|
||||
@@ -5,16 +5,16 @@
|
||||
|
||||
; char ReadBuff (struct tr_se);
|
||||
|
||||
.export _ReadBuff
|
||||
.import setoserror
|
||||
.import gettrse
|
||||
.export _ReadBuff
|
||||
.import setoserror
|
||||
.import gettrse
|
||||
|
||||
.include "diskdrv.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
.include "diskdrv.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_ReadBuff:
|
||||
jsr gettrse
|
||||
sta r1L
|
||||
stx r1H
|
||||
jsr ReadBuff
|
||||
jmp setoserror
|
||||
jsr gettrse
|
||||
sta r1L
|
||||
stx r1H
|
||||
jsr ReadBuff
|
||||
jmp setoserror
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
|
||||
; char SetGEOSDisk (void);
|
||||
|
||||
.export _SetGEOSDisk
|
||||
.import setoserror
|
||||
.export _SetGEOSDisk
|
||||
.import setoserror
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "jumptab.inc"
|
||||
|
||||
_SetGEOSDisk:
|
||||
jsr SetGEOSDisk
|
||||
jmp setoserror
|
||||
jsr SetGEOSDisk
|
||||
jmp setoserror
|
||||
|
||||
@@ -5,19 +5,19 @@
|
||||
|
||||
; char VerWriteBlock (struct tr_se *myTS, char *buffer);
|
||||
|
||||
.export _VerWriteBlock
|
||||
.import popax, setoserror
|
||||
.import gettrse
|
||||
.export _VerWriteBlock
|
||||
.import popax, setoserror
|
||||
.import gettrse
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_VerWriteBlock:
|
||||
sta r4L
|
||||
stx r4H
|
||||
jsr popax
|
||||
jsr gettrse
|
||||
sta r1L
|
||||
stx r1H
|
||||
jsr VerWriteBlock
|
||||
jmp setoserror
|
||||
sta r4L
|
||||
stx r4H
|
||||
jsr popax
|
||||
jsr gettrse
|
||||
sta r1L
|
||||
stx r1H
|
||||
jsr VerWriteBlock
|
||||
jmp setoserror
|
||||
|
||||
@@ -5,19 +5,19 @@
|
||||
|
||||
; char WriteBlock (struct tr_se *myTS, char *buffer);
|
||||
|
||||
.export _WriteBlock
|
||||
.import popax, setoserror
|
||||
.import gettrse
|
||||
.export _WriteBlock
|
||||
.import popax, setoserror
|
||||
.import gettrse
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_WriteBlock:
|
||||
sta r4L
|
||||
stx r4H
|
||||
jsr popax
|
||||
jsr gettrse
|
||||
sta r1L
|
||||
stx r1H
|
||||
jsr WriteBlock
|
||||
jmp setoserror
|
||||
sta r4L
|
||||
stx r4H
|
||||
jsr popax
|
||||
jsr gettrse
|
||||
sta r1L
|
||||
stx r1H
|
||||
jsr WriteBlock
|
||||
jmp setoserror
|
||||
|
||||
@@ -5,16 +5,16 @@
|
||||
|
||||
; char WriteBuff (struct tr_se*);
|
||||
|
||||
.export _WriteBuff
|
||||
.import setoserror
|
||||
.import gettrse
|
||||
.export _WriteBuff
|
||||
.import setoserror
|
||||
.import gettrse
|
||||
|
||||
.include "diskdrv.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
.include "diskdrv.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_WriteBuff:
|
||||
jsr gettrse
|
||||
sta r1L
|
||||
stx r1H
|
||||
jsr WriteBuff
|
||||
jmp setoserror
|
||||
jsr gettrse
|
||||
sta r1L
|
||||
stx r1H
|
||||
jsr WriteBuff
|
||||
jmp setoserror
|
||||
|
||||
@@ -4,39 +4,39 @@
|
||||
;4-2-99
|
||||
|
||||
;pointers
|
||||
InitForIO_ = $9000
|
||||
DoneWithIO_ = $9002
|
||||
ExitTurbo_ = $9004
|
||||
PurgeTurbo_ = $9006
|
||||
EnterTurbo_ = $9008
|
||||
ChangeDiskDevice_ = $900a
|
||||
NewDisk_ = $900c
|
||||
ReadBlock_ = $900e
|
||||
WriteBlock_ = $9010
|
||||
VerWriteBlock_ = $9012
|
||||
OpenDisk_ = $9014
|
||||
GetBlock_ = $9016
|
||||
PutBlock_ = $9018
|
||||
GetDirHead_ = $901a
|
||||
PutDirHead_ = $901c
|
||||
GetFreeDirBlk_ = $901e
|
||||
CalcBlksFree_ = $9020
|
||||
FreeBlock_ = $9022
|
||||
SetNextFree_ = $9024
|
||||
FindBAMBit_ = $9026
|
||||
NxtBlkAlloc_ = $9028
|
||||
BlkAlloc_ = $902a
|
||||
ChkDkGEOS_ = $902c
|
||||
SetGEOSDisk_ = $902e
|
||||
InitForIO_ = $9000
|
||||
DoneWithIO_ = $9002
|
||||
ExitTurbo_ = $9004
|
||||
PurgeTurbo_ = $9006
|
||||
EnterTurbo_ = $9008
|
||||
ChangeDiskDevice_ = $900a
|
||||
NewDisk_ = $900c
|
||||
ReadBlock_ = $900e
|
||||
WriteBlock_ = $9010
|
||||
VerWriteBlock_ = $9012
|
||||
OpenDisk_ = $9014
|
||||
GetBlock_ = $9016
|
||||
PutBlock_ = $9018
|
||||
GetDirHead_ = $901a
|
||||
PutDirHead_ = $901c
|
||||
GetFreeDirBlk_ = $901e
|
||||
CalcBlksFree_ = $9020
|
||||
FreeBlock_ = $9022
|
||||
SetNextFree_ = $9024
|
||||
FindBAMBit_ = $9026
|
||||
NxtBlkAlloc_ = $9028
|
||||
BlkAlloc_ = $902a
|
||||
ChkDkGEOS_ = $902c
|
||||
SetGEOSDisk_ = $902e
|
||||
|
||||
;jump table
|
||||
Get1stDirEntry = $9030
|
||||
GetNxtDirEntry = $9033
|
||||
GetBorder = $9036
|
||||
AddDirBlock = $9039
|
||||
ReadBuff = $903c
|
||||
WriteBuff = $903f
|
||||
Get1stDirEntry = $9030
|
||||
GetNxtDirEntry = $9033
|
||||
GetBorder = $9036
|
||||
AddDirBlock = $9039
|
||||
ReadBuff = $903c
|
||||
WriteBuff = $903f
|
||||
;??? = $9042
|
||||
;??? = $9045
|
||||
AllocateBlock = $9048
|
||||
ReadLink = $904b
|
||||
AllocateBlock = $9048
|
||||
ReadLink = $904b
|
||||
|
||||
@@ -5,43 +5,43 @@
|
||||
; Maciej 'YTM/Elysium' Witkowiak <ytm@elysium.pl>
|
||||
; 06,20,25.12.2002
|
||||
|
||||
.include "zeropage.inc"
|
||||
.include "em-kernel.inc"
|
||||
.include "zeropage.inc"
|
||||
.include "em-kernel.inc"
|
||||
.include "em-error.inc"
|
||||
|
||||
.macpack generic
|
||||
.macpack generic
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Header. Includes jump table
|
||||
|
||||
.segment "JUMPTABLE"
|
||||
.segment "JUMPTABLE"
|
||||
|
||||
; Driver signature
|
||||
|
||||
.byte $65, $6d, $64 ; "emd"
|
||||
.byte EMD_API_VERSION ; EM API version number
|
||||
.byte $65, $6d, $64 ; "emd"
|
||||
.byte EMD_API_VERSION ; EM API version number
|
||||
|
||||
; Jump table.
|
||||
|
||||
.word INSTALL
|
||||
.word UNINSTALL
|
||||
.word PAGECOUNT
|
||||
.word MAP
|
||||
.word USE
|
||||
.word COMMIT
|
||||
.word COPYFROM
|
||||
.word COPYTO
|
||||
.word INSTALL
|
||||
.word UNINSTALL
|
||||
.word PAGECOUNT
|
||||
.word MAP
|
||||
.word USE
|
||||
.word COMMIT
|
||||
.word COPYFROM
|
||||
.word COPYTO
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
||||
VDC_ADDR_REG = $D600 ; VDC address
|
||||
VDC_DATA_REG = $D601 ; VDC data
|
||||
VDC_ADDR_REG = $D600 ; VDC address
|
||||
VDC_DATA_REG = $D601 ; VDC data
|
||||
|
||||
VDC_DATA_HI = 18 ; used registers
|
||||
VDC_DATA_LO = 19
|
||||
VDC_CSET = 28
|
||||
VDC_DATA = 31
|
||||
VDC_DATA_HI = 18 ; used registers
|
||||
VDC_DATA_LO = 19
|
||||
VDC_CSET = 28
|
||||
VDC_DATA = 31
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Data.
|
||||
@@ -49,14 +49,14 @@ VDC_DATA = 31
|
||||
.data
|
||||
|
||||
pagecount:
|
||||
.word 64 ; $0000-$3fff as 16k default
|
||||
.word 64 ; $0000-$3fff as 16k default
|
||||
curpage:
|
||||
.word $ffff ; currently mapped-in page (invalid)
|
||||
.word $ffff ; currently mapped-in page (invalid)
|
||||
|
||||
.bss
|
||||
|
||||
window:
|
||||
.res 256 ; memory window
|
||||
.res 256 ; memory window
|
||||
|
||||
.code
|
||||
|
||||
@@ -68,88 +68,88 @@ window:
|
||||
;
|
||||
|
||||
INSTALL:
|
||||
; do test for VDC presence here???
|
||||
; do test for VDC presence here???
|
||||
|
||||
php
|
||||
sei
|
||||
lda $01
|
||||
pha
|
||||
lda #$35
|
||||
sta $01
|
||||
|
||||
ldx #VDC_CSET ; determine size of RAM...
|
||||
jsr vdcgetreg
|
||||
sta tmp1
|
||||
ora #%00010000
|
||||
jsr vdcputreg ; turn on 64k
|
||||
|
||||
jsr settestadr1 ; save original value of test byte
|
||||
jsr vdcgetbyte
|
||||
sta tmp2
|
||||
|
||||
lda #$55 ; write $55 here
|
||||
ldy #ptr1
|
||||
jsr test64k ; read it here and there
|
||||
lda #$aa ; write $aa here
|
||||
ldy #ptr2
|
||||
jsr test64k ; read it here and there
|
||||
|
||||
jsr settestadr1
|
||||
lda tmp2
|
||||
jsr vdcputbyte ; restore original value of test byte
|
||||
|
||||
lda ptr1 ; do bytes match?
|
||||
cmp ptr1+1
|
||||
bne @have64k
|
||||
lda ptr2
|
||||
cmp ptr2+1
|
||||
bne @have64k
|
||||
|
||||
ldx #VDC_CSET
|
||||
lda tmp1
|
||||
jsr vdcputreg ; restore 16/64k flag
|
||||
jmp @endok ; and leave default values for 16k
|
||||
|
||||
php
|
||||
sei
|
||||
lda $01
|
||||
pha
|
||||
lda #$35
|
||||
sta $01
|
||||
|
||||
ldx #VDC_CSET ; determine size of RAM...
|
||||
jsr vdcgetreg
|
||||
sta tmp1
|
||||
ora #%00010000
|
||||
jsr vdcputreg ; turn on 64k
|
||||
|
||||
jsr settestadr1 ; save original value of test byte
|
||||
jsr vdcgetbyte
|
||||
sta tmp2
|
||||
|
||||
lda #$55 ; write $55 here
|
||||
ldy #ptr1
|
||||
jsr test64k ; read it here and there
|
||||
lda #$aa ; write $aa here
|
||||
ldy #ptr2
|
||||
jsr test64k ; read it here and there
|
||||
|
||||
jsr settestadr1
|
||||
lda tmp2
|
||||
jsr vdcputbyte ; restore original value of test byte
|
||||
|
||||
lda ptr1 ; do bytes match?
|
||||
cmp ptr1+1
|
||||
bne @have64k
|
||||
lda ptr2
|
||||
cmp ptr2+1
|
||||
bne @have64k
|
||||
|
||||
ldx #VDC_CSET
|
||||
lda tmp1
|
||||
jsr vdcputreg ; restore 16/64k flag
|
||||
jmp @endok ; and leave default values for 16k
|
||||
|
||||
@have64k:
|
||||
lda #<256
|
||||
ldx #>256
|
||||
sta pagecount
|
||||
stx pagecount+1
|
||||
@endok:
|
||||
pla
|
||||
sta $01
|
||||
plp
|
||||
lda #<EM_ERR_OK
|
||||
ldx #>EM_ERR_OK
|
||||
rts
|
||||
|
||||
lda #<256
|
||||
ldx #>256
|
||||
sta pagecount
|
||||
stx pagecount+1
|
||||
@endok:
|
||||
pla
|
||||
sta $01
|
||||
plp
|
||||
lda #<EM_ERR_OK
|
||||
ldx #>EM_ERR_OK
|
||||
rts
|
||||
|
||||
test64k:
|
||||
sta tmp1
|
||||
sty ptr3
|
||||
lda #0
|
||||
sta ptr3+1
|
||||
jsr settestadr1
|
||||
lda tmp1
|
||||
jsr vdcputbyte ; write $55
|
||||
jsr settestadr1
|
||||
jsr vdcgetbyte ; read here
|
||||
pha
|
||||
jsr settestadr2
|
||||
jsr vdcgetbyte ; and there
|
||||
ldy #1
|
||||
sta (ptr3),y
|
||||
pla
|
||||
dey
|
||||
sta (ptr3),y
|
||||
rts
|
||||
sta tmp1
|
||||
sty ptr3
|
||||
lda #0
|
||||
sta ptr3+1
|
||||
jsr settestadr1
|
||||
lda tmp1
|
||||
jsr vdcputbyte ; write $55
|
||||
jsr settestadr1
|
||||
jsr vdcgetbyte ; read here
|
||||
pha
|
||||
jsr settestadr2
|
||||
jsr vdcgetbyte ; and there
|
||||
ldy #1
|
||||
sta (ptr3),y
|
||||
pla
|
||||
dey
|
||||
sta (ptr3),y
|
||||
rts
|
||||
|
||||
settestadr1:
|
||||
ldy #$02 ; test page 2 (here)
|
||||
.byte $2c
|
||||
ldy #$02 ; test page 2 (here)
|
||||
.byte $2c
|
||||
settestadr2:
|
||||
ldy #$42 ; or page 64+2 (there)
|
||||
lda #0
|
||||
jmp vdcsetsrcaddr
|
||||
ldy #$42 ; or page 64+2 (there)
|
||||
lda #0
|
||||
jmp vdcsetsrcaddr
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; UNINSTALL routine. Is called before the driver is removed from memory.
|
||||
@@ -157,17 +157,17 @@ settestadr2:
|
||||
;
|
||||
|
||||
UNINSTALL:
|
||||
;on C128 restore font and clear the screen?
|
||||
rts
|
||||
;on C128 restore font and clear the screen?
|
||||
rts
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; PAGECOUNT: Return the total number of available pages in a/x.
|
||||
;
|
||||
|
||||
PAGECOUNT:
|
||||
lda pagecount
|
||||
ldx pagecount+1
|
||||
rts
|
||||
lda pagecount
|
||||
ldx pagecount+1
|
||||
rts
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; MAP: Map the page in a/x into memory and return a pointer to the page in
|
||||
@@ -175,104 +175,104 @@ PAGECOUNT:
|
||||
; by the driver.
|
||||
;
|
||||
|
||||
MAP: sta curpage
|
||||
stx curpage+1
|
||||
sta ptr1+1
|
||||
ldy #0
|
||||
sty ptr1
|
||||
|
||||
lda #<window
|
||||
sta ptr2
|
||||
lda #>window
|
||||
sta ptr2+1
|
||||
|
||||
jsr transferin
|
||||
|
||||
lda #<window
|
||||
ldx #>window
|
||||
rts
|
||||
MAP: sta curpage
|
||||
stx curpage+1
|
||||
sta ptr1+1
|
||||
ldy #0
|
||||
sty ptr1
|
||||
|
||||
lda #<window
|
||||
sta ptr2
|
||||
lda #>window
|
||||
sta ptr2+1
|
||||
|
||||
jsr transferin
|
||||
|
||||
lda #<window
|
||||
ldx #>window
|
||||
rts
|
||||
|
||||
; copy a single page from (ptr1):VDCRAM to (ptr2):RAM
|
||||
|
||||
transferin:
|
||||
php
|
||||
sei
|
||||
lda $01
|
||||
pha
|
||||
lda #$35
|
||||
sta $01
|
||||
lda ptr1
|
||||
ldy ptr1+1
|
||||
jsr vdcsetsrcaddr ; set source address in VDC
|
||||
ldy #0
|
||||
ldx #VDC_DATA
|
||||
stx VDC_ADDR_REG
|
||||
@L0: bit VDC_ADDR_REG
|
||||
bpl @L0
|
||||
lda VDC_DATA_REG ; get 2 bytes at a time to speed-up
|
||||
sta (ptr2),y ; (in fact up to 8 bytes could be fetched with special VDC config)
|
||||
iny
|
||||
lda VDC_DATA_REG
|
||||
sta (ptr2),y
|
||||
iny
|
||||
bne @L0
|
||||
pla
|
||||
sta $01
|
||||
plp
|
||||
rts
|
||||
php
|
||||
sei
|
||||
lda $01
|
||||
pha
|
||||
lda #$35
|
||||
sta $01
|
||||
lda ptr1
|
||||
ldy ptr1+1
|
||||
jsr vdcsetsrcaddr ; set source address in VDC
|
||||
ldy #0
|
||||
ldx #VDC_DATA
|
||||
stx VDC_ADDR_REG
|
||||
@L0: bit VDC_ADDR_REG
|
||||
bpl @L0
|
||||
lda VDC_DATA_REG ; get 2 bytes at a time to speed-up
|
||||
sta (ptr2),y ; (in fact up to 8 bytes could be fetched with special VDC config)
|
||||
iny
|
||||
lda VDC_DATA_REG
|
||||
sta (ptr2),y
|
||||
iny
|
||||
bne @L0
|
||||
pla
|
||||
sta $01
|
||||
plp
|
||||
rts
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; USE: Tell the driver that the window is now associated with a given page.
|
||||
|
||||
USE: sta curpage
|
||||
stx curpage+1 ; Remember the page
|
||||
lda #<window
|
||||
ldx #>window ; Return the window
|
||||
stx curpage+1 ; Remember the page
|
||||
lda #<window
|
||||
ldx #>window ; Return the window
|
||||
done: rts
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; COMMIT: Commit changes in the memory window to extended storage.
|
||||
|
||||
COMMIT:
|
||||
lda curpage ; jump if no page mapped
|
||||
ldx curpage+1
|
||||
bmi done
|
||||
sta ptr1+1
|
||||
ldy #0
|
||||
sty ptr1
|
||||
lda curpage ; jump if no page mapped
|
||||
ldx curpage+1
|
||||
bmi done
|
||||
sta ptr1+1
|
||||
ldy #0
|
||||
sty ptr1
|
||||
|
||||
lda #<window
|
||||
sta ptr2
|
||||
lda #>window
|
||||
sta ptr2+1
|
||||
lda #<window
|
||||
sta ptr2
|
||||
lda #>window
|
||||
sta ptr2+1
|
||||
|
||||
; fall through to transferout
|
||||
|
||||
; copy a single page from (ptr2):RAM to (ptr1):VDCRAM
|
||||
|
||||
transferout:
|
||||
php
|
||||
sei
|
||||
lda $01
|
||||
pha
|
||||
lda #$35
|
||||
sta $01
|
||||
lda ptr1
|
||||
ldy ptr1+1
|
||||
jsr vdcsetsrcaddr ; set source address in VDC
|
||||
ldy #0
|
||||
ldx #VDC_DATA
|
||||
stx VDC_ADDR_REG
|
||||
@L0: bit VDC_ADDR_REG
|
||||
bpl @L0
|
||||
lda (ptr2),y ; speedup does not work for writing
|
||||
sta VDC_DATA_REG
|
||||
iny
|
||||
bne @L0
|
||||
pla
|
||||
sta $01
|
||||
plp
|
||||
rts
|
||||
php
|
||||
sei
|
||||
lda $01
|
||||
pha
|
||||
lda #$35
|
||||
sta $01
|
||||
lda ptr1
|
||||
ldy ptr1+1
|
||||
jsr vdcsetsrcaddr ; set source address in VDC
|
||||
ldy #0
|
||||
ldx #VDC_DATA
|
||||
stx VDC_ADDR_REG
|
||||
@L0: bit VDC_ADDR_REG
|
||||
bpl @L0
|
||||
lda (ptr2),y ; speedup does not work for writing
|
||||
sta VDC_DATA_REG
|
||||
iny
|
||||
bne @L0
|
||||
pla
|
||||
sta $01
|
||||
plp
|
||||
rts
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; COPYFROM: Copy from extended into linear memory. A pointer to a structure
|
||||
@@ -281,42 +281,42 @@ transferout:
|
||||
;
|
||||
|
||||
COPYFROM:
|
||||
jsr setup
|
||||
beq @L2 ; Skip if no full pages
|
||||
jsr setup
|
||||
beq @L2 ; Skip if no full pages
|
||||
|
||||
; Copy full pages
|
||||
|
||||
@L1: jsr transferin
|
||||
inc ptr1+1
|
||||
inc ptr2+1
|
||||
dec tmp1
|
||||
bne @L1
|
||||
inc ptr1+1
|
||||
inc ptr2+1
|
||||
dec tmp1
|
||||
bne @L1
|
||||
|
||||
; Copy the remainder of the page
|
||||
|
||||
|
||||
@L2: ldy #EM_COPY::COUNT
|
||||
lda (ptr3),y ; Get bytes in last page
|
||||
beq @L4
|
||||
sta tmp1
|
||||
lda (ptr3),y ; Get bytes in last page
|
||||
beq @L4
|
||||
sta tmp1
|
||||
|
||||
; Transfer the bytes in the last page
|
||||
php
|
||||
sei
|
||||
lda $01
|
||||
pha
|
||||
lda #$35
|
||||
sta $01
|
||||
ldy #0
|
||||
@L3: jsr vdcgetbyte
|
||||
sta (ptr2),y
|
||||
iny
|
||||
dec tmp1
|
||||
lda tmp1
|
||||
bne @L3
|
||||
pla
|
||||
sta $01
|
||||
plp
|
||||
@L4: rts
|
||||
php
|
||||
sei
|
||||
lda $01
|
||||
pha
|
||||
lda #$35
|
||||
sta $01
|
||||
ldy #0
|
||||
@L3: jsr vdcgetbyte
|
||||
sta (ptr2),y
|
||||
iny
|
||||
dec tmp1
|
||||
lda tmp1
|
||||
bne @L3
|
||||
pla
|
||||
sta $01
|
||||
plp
|
||||
@L4: rts
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; COPYTO: Copy from linear into extended memory. A pointer to a structure
|
||||
@@ -325,76 +325,76 @@ COPYFROM:
|
||||
;
|
||||
|
||||
COPYTO:
|
||||
jsr setup
|
||||
beq @L2 ; Skip if no full pages
|
||||
jsr setup
|
||||
beq @L2 ; Skip if no full pages
|
||||
|
||||
; Copy full pages
|
||||
|
||||
@L1: jsr transferout
|
||||
inc ptr1+1
|
||||
inc ptr2+1
|
||||
dec tmp1
|
||||
bne @L1
|
||||
inc ptr1+1
|
||||
inc ptr2+1
|
||||
dec tmp1
|
||||
bne @L1
|
||||
|
||||
; Copy the remainder of the page
|
||||
|
||||
@L2: ldy #EM_COPY::COUNT
|
||||
lda (ptr3),y ; Get bytes in last page
|
||||
beq @L4
|
||||
sta tmp1
|
||||
lda (ptr3),y ; Get bytes in last page
|
||||
beq @L4
|
||||
sta tmp1
|
||||
|
||||
; Transfer the bytes in the last page
|
||||
php
|
||||
sei
|
||||
lda $01
|
||||
pha
|
||||
lda #$35
|
||||
sta $01
|
||||
ldy #0
|
||||
@L3: lda (ptr2),y
|
||||
jsr vdcputbyte
|
||||
iny
|
||||
dec tmp1
|
||||
lda tmp1
|
||||
bne @L3
|
||||
pla
|
||||
sta $01
|
||||
plp
|
||||
@L4: rts
|
||||
php
|
||||
sei
|
||||
lda $01
|
||||
pha
|
||||
lda #$35
|
||||
sta $01
|
||||
ldy #0
|
||||
@L3: lda (ptr2),y
|
||||
jsr vdcputbyte
|
||||
iny
|
||||
dec tmp1
|
||||
lda tmp1
|
||||
bne @L3
|
||||
pla
|
||||
sta $01
|
||||
plp
|
||||
@L4: rts
|
||||
|
||||
;-------------------------------------------------------------------------
|
||||
; Helper functions to handle VDC ram
|
||||
;
|
||||
|
||||
vdcsetsrcaddr:
|
||||
ldx #VDC_DATA_LO
|
||||
stx VDC_ADDR_REG
|
||||
@L0: bit VDC_ADDR_REG
|
||||
bpl @L0
|
||||
sta VDC_DATA_REG
|
||||
dex
|
||||
tya
|
||||
stx VDC_ADDR_REG
|
||||
sta VDC_DATA_REG
|
||||
rts
|
||||
ldx #VDC_DATA_LO
|
||||
stx VDC_ADDR_REG
|
||||
@L0: bit VDC_ADDR_REG
|
||||
bpl @L0
|
||||
sta VDC_DATA_REG
|
||||
dex
|
||||
tya
|
||||
stx VDC_ADDR_REG
|
||||
sta VDC_DATA_REG
|
||||
rts
|
||||
|
||||
vdcgetbyte:
|
||||
ldx #VDC_DATA
|
||||
ldx #VDC_DATA
|
||||
vdcgetreg:
|
||||
stx VDC_ADDR_REG
|
||||
@L0: bit VDC_ADDR_REG
|
||||
bpl @L0
|
||||
lda VDC_DATA_REG
|
||||
rts
|
||||
stx VDC_ADDR_REG
|
||||
@L0: bit VDC_ADDR_REG
|
||||
bpl @L0
|
||||
lda VDC_DATA_REG
|
||||
rts
|
||||
|
||||
vdcputbyte:
|
||||
ldx #VDC_DATA
|
||||
ldx #VDC_DATA
|
||||
vdcputreg:
|
||||
stx VDC_ADDR_REG
|
||||
@L0: bit VDC_ADDR_REG
|
||||
bpl @L0
|
||||
sta VDC_DATA_REG
|
||||
rts
|
||||
stx VDC_ADDR_REG
|
||||
@L0: bit VDC_ADDR_REG
|
||||
bpl @L0
|
||||
sta VDC_DATA_REG
|
||||
rts
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Helper function for COPYFROM and COPYTO: Store the pointer to the request
|
||||
@@ -402,24 +402,24 @@ vdcputreg:
|
||||
;
|
||||
|
||||
setup:
|
||||
sta ptr3
|
||||
stx ptr3+1 ; Save the passed em_copy pointer
|
||||
sta ptr3
|
||||
stx ptr3+1 ; Save the passed em_copy pointer
|
||||
|
||||
ldy #EM_COPY::OFFS
|
||||
lda (ptr3),y
|
||||
sta ptr1
|
||||
ldy #EM_COPY::PAGE
|
||||
lda (ptr3),y
|
||||
sta ptr1+1 ; From
|
||||
ldy #EM_COPY::OFFS
|
||||
lda (ptr3),y
|
||||
sta ptr1
|
||||
ldy #EM_COPY::PAGE
|
||||
lda (ptr3),y
|
||||
sta ptr1+1 ; From
|
||||
|
||||
ldy #EM_COPY::BUF
|
||||
lda (ptr3),y
|
||||
sta ptr2
|
||||
iny
|
||||
lda (ptr3),y
|
||||
sta ptr2+1 ; To
|
||||
ldy #EM_COPY::BUF
|
||||
lda (ptr3),y
|
||||
sta ptr2
|
||||
iny
|
||||
lda (ptr3),y
|
||||
sta ptr2+1 ; To
|
||||
|
||||
ldy #EM_COPY::COUNT+1
|
||||
lda (ptr3),y ; Get number of pages
|
||||
sta tmp1
|
||||
rts
|
||||
ldy #EM_COPY::COUNT+1
|
||||
lda (ptr3),y ; Get number of pages
|
||||
sta tmp1
|
||||
rts
|
||||
|
||||
@@ -5,19 +5,19 @@
|
||||
|
||||
; char FollowChain (struct tr_se *myTrSe, char *buffer);
|
||||
|
||||
.export _FollowChain
|
||||
.import popax, setoserror
|
||||
.import gettrse
|
||||
.export _FollowChain
|
||||
.import popax, setoserror
|
||||
.import gettrse
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_FollowChain:
|
||||
sta r3L
|
||||
stx r3H
|
||||
jsr popax
|
||||
jsr gettrse
|
||||
sta r1L
|
||||
stx r1H
|
||||
jsr FollowChain
|
||||
jmp setoserror
|
||||
sta r3L
|
||||
stx r3H
|
||||
jsr popax
|
||||
jsr gettrse
|
||||
sta r1L
|
||||
stx r1H
|
||||
jsr FollowChain
|
||||
jmp setoserror
|
||||
|
||||
@@ -3,312 +3,312 @@
|
||||
;reassembled by Maciej 'YTM/Elysium' Witkowiak
|
||||
;4-2-99
|
||||
|
||||
zpage = $0000
|
||||
zpage = $0000
|
||||
;
|
||||
|
||||
CPU_DDR = $00
|
||||
CPU_DATA = $01
|
||||
CPU_DDR = $00
|
||||
CPU_DATA = $01
|
||||
;
|
||||
r0 = $02
|
||||
r0L = $02
|
||||
r0H = $03
|
||||
r1 = $04
|
||||
r1L = $04
|
||||
r1H = $05
|
||||
r2 = $06
|
||||
r2L = $06
|
||||
r2H = $07
|
||||
r3 = $08
|
||||
r3L = $08
|
||||
r3H = $09
|
||||
r4 = $0a
|
||||
r4L = $0a
|
||||
r4H = $0b
|
||||
r5 = $0c
|
||||
r5L = $0c
|
||||
r5H = $0d
|
||||
r6 = $0e
|
||||
r6L = $0e
|
||||
r6H = $0f
|
||||
r7 = $10
|
||||
r7L = $10
|
||||
r7H = $11
|
||||
r8 = $12
|
||||
r8L = $12
|
||||
r8H = $13
|
||||
r9 = $14
|
||||
r9L = $14
|
||||
r9H = $15
|
||||
r10 = $16
|
||||
r10L = $16
|
||||
r10H = $17
|
||||
r11 = $18
|
||||
r11L = $18
|
||||
r11H = $19
|
||||
r12 = $1a
|
||||
r12L = $1a
|
||||
r12H = $1b
|
||||
r13 = $1c
|
||||
r13L = $1c
|
||||
r13H = $1d
|
||||
r14 = $1e
|
||||
r14L = $1e
|
||||
r14H = $1f
|
||||
r15 = $20
|
||||
r15L = $20
|
||||
r15H = $21
|
||||
r0 = $02
|
||||
r0L = $02
|
||||
r0H = $03
|
||||
r1 = $04
|
||||
r1L = $04
|
||||
r1H = $05
|
||||
r2 = $06
|
||||
r2L = $06
|
||||
r2H = $07
|
||||
r3 = $08
|
||||
r3L = $08
|
||||
r3H = $09
|
||||
r4 = $0a
|
||||
r4L = $0a
|
||||
r4H = $0b
|
||||
r5 = $0c
|
||||
r5L = $0c
|
||||
r5H = $0d
|
||||
r6 = $0e
|
||||
r6L = $0e
|
||||
r6H = $0f
|
||||
r7 = $10
|
||||
r7L = $10
|
||||
r7H = $11
|
||||
r8 = $12
|
||||
r8L = $12
|
||||
r8H = $13
|
||||
r9 = $14
|
||||
r9L = $14
|
||||
r9H = $15
|
||||
r10 = $16
|
||||
r10L = $16
|
||||
r10H = $17
|
||||
r11 = $18
|
||||
r11L = $18
|
||||
r11H = $19
|
||||
r12 = $1a
|
||||
r12L = $1a
|
||||
r12H = $1b
|
||||
r13 = $1c
|
||||
r13L = $1c
|
||||
r13H = $1d
|
||||
r14 = $1e
|
||||
r14L = $1e
|
||||
r14H = $1f
|
||||
r15 = $20
|
||||
r15L = $20
|
||||
r15H = $21
|
||||
;
|
||||
a0 = $fb
|
||||
a0L = $fb
|
||||
a0H = $fc
|
||||
a1 = $fd
|
||||
a1L = $fd
|
||||
a1H = $fe
|
||||
a2 = $70
|
||||
a2L = $70
|
||||
a2H = $71
|
||||
a3 = $72
|
||||
a3L = $72
|
||||
a3H = $73
|
||||
a4 = $74
|
||||
a4L = $74
|
||||
a4H = $75
|
||||
a5 = $76
|
||||
a5L = $76
|
||||
a5H = $77
|
||||
a6 = $78
|
||||
a6L = $78
|
||||
a6H = $79
|
||||
a7 = $7a
|
||||
a7L = $7a
|
||||
a7H = $7b
|
||||
a8 = $7c
|
||||
a8L = $7c
|
||||
a8H = $7d
|
||||
a9 = $7e
|
||||
a9L = $7e
|
||||
a9H = $7f
|
||||
a0 = $fb
|
||||
a0L = $fb
|
||||
a0H = $fc
|
||||
a1 = $fd
|
||||
a1L = $fd
|
||||
a1H = $fe
|
||||
a2 = $70
|
||||
a2L = $70
|
||||
a2H = $71
|
||||
a3 = $72
|
||||
a3L = $72
|
||||
a3H = $73
|
||||
a4 = $74
|
||||
a4L = $74
|
||||
a4H = $75
|
||||
a5 = $76
|
||||
a5L = $76
|
||||
a5H = $77
|
||||
a6 = $78
|
||||
a6L = $78
|
||||
a6H = $79
|
||||
a7 = $7a
|
||||
a7L = $7a
|
||||
a7H = $7b
|
||||
a8 = $7c
|
||||
a8L = $7c
|
||||
a8H = $7d
|
||||
a9 = $7e
|
||||
a9L = $7e
|
||||
a9H = $7f
|
||||
|
||||
;
|
||||
|
||||
curPattern = $22
|
||||
string = $24
|
||||
baselineOffset = $26
|
||||
curSetWidth = $27
|
||||
curHeight = $29
|
||||
curIndexTable = $2a
|
||||
cardDataPntr = $2c
|
||||
currentMode = $2e
|
||||
dispBufferOn = $2f
|
||||
mouseOn = $30
|
||||
msePicPtr = $31
|
||||
windowTop = $33
|
||||
windowBottom = $34
|
||||
leftMargin = $35
|
||||
rightMargin = $37
|
||||
pressFlag = $39
|
||||
mouseXPos = $3a
|
||||
mouseYPos = $3c
|
||||
returnAddress = $3d
|
||||
graphMode = $3f
|
||||
TURBO_DD00 = $8e ; from 1541 turbo
|
||||
TURBO_DD00_CPY = $8f ; from 1541 turbo
|
||||
STATUS = $90
|
||||
curDevice = $ba
|
||||
curPattern = $22
|
||||
string = $24
|
||||
baselineOffset = $26
|
||||
curSetWidth = $27
|
||||
curHeight = $29
|
||||
curIndexTable = $2a
|
||||
cardDataPntr = $2c
|
||||
currentMode = $2e
|
||||
dispBufferOn = $2f
|
||||
mouseOn = $30
|
||||
msePicPtr = $31
|
||||
windowTop = $33
|
||||
windowBottom = $34
|
||||
leftMargin = $35
|
||||
rightMargin = $37
|
||||
pressFlag = $39
|
||||
mouseXPos = $3a
|
||||
mouseYPos = $3c
|
||||
returnAddress = $3d
|
||||
graphMode = $3f
|
||||
TURBO_DD00 = $8e ; from 1541 turbo
|
||||
TURBO_DD00_CPY = $8f ; from 1541 turbo
|
||||
STATUS = $90
|
||||
curDevice = $ba
|
||||
;
|
||||
irqvec = $0314
|
||||
bkvec = $0316
|
||||
nmivec = $0318
|
||||
irqvec = $0314
|
||||
bkvec = $0316
|
||||
nmivec = $0318
|
||||
;
|
||||
APP_RAM = $0400
|
||||
BACK_SCR_BASE = $6000
|
||||
PRINTBASE = $7900
|
||||
OS_VARS = $8000
|
||||
APP_RAM = $0400
|
||||
BACK_SCR_BASE = $6000
|
||||
PRINTBASE = $7900
|
||||
OS_VARS = $8000
|
||||
;
|
||||
diskBlkBuf = $8000
|
||||
fileHeader = $8100
|
||||
curDirHead = $8200
|
||||
fileTrScTab = $8300
|
||||
dirEntryBuf = $8400
|
||||
DrACurDkNm = $841e
|
||||
DrBCurDkNm = $8430
|
||||
dataFileName = $8442
|
||||
dataDiskName = $8453
|
||||
PrntFilename = $8465
|
||||
PrntDiskName = $8476
|
||||
curDrive = $8489
|
||||
diskOpenFlg = $848a
|
||||
isGEOS = $848b
|
||||
interleave = $848c
|
||||
NUMDRV = $848d
|
||||
driveType = $848e
|
||||
_driveType = driveType-8
|
||||
turboFlags = $8492
|
||||
_turboFlags = turboFlags-8
|
||||
curRecord = $8496
|
||||
usedRecords = $8497
|
||||
fileWritten = $8498
|
||||
fileSize = $8499
|
||||
appMain = $849b
|
||||
intTopVector = $849d
|
||||
intBotVector = $849f
|
||||
mouseVector = $84a1
|
||||
keyVector = $84a3
|
||||
inputVector = $84a5
|
||||
mouseFaultVec = $84a7
|
||||
otherPressVec = $84a9
|
||||
StringFaultVec = $84ab
|
||||
alarmTmtVector = $84ad
|
||||
BRKVector = $84af
|
||||
RecoverVector = $84b1
|
||||
selectionFlash = $84b3
|
||||
alphaFlag = $84b4
|
||||
iconSelFlg = $84b5
|
||||
faultData = $84b6
|
||||
menuNumber = $84b7
|
||||
mouseTop = $84b8
|
||||
mouseBottom = $84b9
|
||||
mouseLeft = $84ba
|
||||
mouseRight = $84bc
|
||||
stringX = $84be
|
||||
stringY = $84c0
|
||||
mousePicData = $84c1
|
||||
maxMouseSpeed = $8501
|
||||
minMouseSpeed = $8502
|
||||
mouseAccel = $8503
|
||||
keyData = $8504
|
||||
mouseData = $8505
|
||||
inputData = $8506
|
||||
mouseSpeed = $8507
|
||||
random = $850a
|
||||
saveFontTab = $850c
|
||||
dblClickCount = $8515
|
||||
year = $8516
|
||||
month = $8517
|
||||
day = $8518
|
||||
hour = $8519
|
||||
minutes = $851a
|
||||
seconds = $851b
|
||||
alarmSetFlag = $851c
|
||||
sysDBData = $851d
|
||||
screencolors = $851e
|
||||
dlgBoxRamBuf = $851f ; to $8697
|
||||
diskBlkBuf = $8000
|
||||
fileHeader = $8100
|
||||
curDirHead = $8200
|
||||
fileTrScTab = $8300
|
||||
dirEntryBuf = $8400
|
||||
DrACurDkNm = $841e
|
||||
DrBCurDkNm = $8430
|
||||
dataFileName = $8442
|
||||
dataDiskName = $8453
|
||||
PrntFilename = $8465
|
||||
PrntDiskName = $8476
|
||||
curDrive = $8489
|
||||
diskOpenFlg = $848a
|
||||
isGEOS = $848b
|
||||
interleave = $848c
|
||||
NUMDRV = $848d
|
||||
driveType = $848e
|
||||
_driveType = driveType-8
|
||||
turboFlags = $8492
|
||||
_turboFlags = turboFlags-8
|
||||
curRecord = $8496
|
||||
usedRecords = $8497
|
||||
fileWritten = $8498
|
||||
fileSize = $8499
|
||||
appMain = $849b
|
||||
intTopVector = $849d
|
||||
intBotVector = $849f
|
||||
mouseVector = $84a1
|
||||
keyVector = $84a3
|
||||
inputVector = $84a5
|
||||
mouseFaultVec = $84a7
|
||||
otherPressVec = $84a9
|
||||
StringFaultVec = $84ab
|
||||
alarmTmtVector = $84ad
|
||||
BRKVector = $84af
|
||||
RecoverVector = $84b1
|
||||
selectionFlash = $84b3
|
||||
alphaFlag = $84b4
|
||||
iconSelFlg = $84b5
|
||||
faultData = $84b6
|
||||
menuNumber = $84b7
|
||||
mouseTop = $84b8
|
||||
mouseBottom = $84b9
|
||||
mouseLeft = $84ba
|
||||
mouseRight = $84bc
|
||||
stringX = $84be
|
||||
stringY = $84c0
|
||||
mousePicData = $84c1
|
||||
maxMouseSpeed = $8501
|
||||
minMouseSpeed = $8502
|
||||
mouseAccel = $8503
|
||||
keyData = $8504
|
||||
mouseData = $8505
|
||||
inputData = $8506
|
||||
mouseSpeed = $8507
|
||||
random = $850a
|
||||
saveFontTab = $850c
|
||||
dblClickCount = $8515
|
||||
year = $8516
|
||||
month = $8517
|
||||
day = $8518
|
||||
hour = $8519
|
||||
minutes = $851a
|
||||
seconds = $851b
|
||||
alarmSetFlag = $851c
|
||||
sysDBData = $851d
|
||||
screencolors = $851e
|
||||
dlgBoxRamBuf = $851f ; to $8697
|
||||
;
|
||||
;$8698 - $8877 - various system data (keyboard queue, VLIR t&s, DBox, Menu, timers)
|
||||
;
|
||||
savedmoby2 = $88bb
|
||||
scr80polar = $88bc
|
||||
scr80colors = $88bd
|
||||
vdcClrMode = $88be
|
||||
driveData = $88bf
|
||||
ramExpSize = $88c3
|
||||
sysRAMFlg = $88c4
|
||||
firstBoot = $88c5
|
||||
curType = $88c6
|
||||
ramBase = $88c7
|
||||
inputDevName = $88cb
|
||||
memBase = $88cf ;???
|
||||
DrCCurDkNm = $88dc
|
||||
DrDCurDkNm = $88ee
|
||||
dir2Head = $8900
|
||||
savedmoby2 = $88bb
|
||||
scr80polar = $88bc
|
||||
scr80colors = $88bd
|
||||
vdcClrMode = $88be
|
||||
driveData = $88bf
|
||||
ramExpSize = $88c3
|
||||
sysRAMFlg = $88c4
|
||||
firstBoot = $88c5
|
||||
curType = $88c6
|
||||
ramBase = $88c7
|
||||
inputDevName = $88cb
|
||||
memBase = $88cf ;???
|
||||
DrCCurDkNm = $88dc
|
||||
DrDCurDkNm = $88ee
|
||||
dir2Head = $8900
|
||||
;
|
||||
SPRITE_PICS = $8a00
|
||||
spr0pic = $8a00
|
||||
spr1pic = $8a40
|
||||
spr2pic = $8a80
|
||||
spr3pic = $8ac0
|
||||
spr4pic = $8b00
|
||||
spr5pic = $8b40
|
||||
spr6pic = $8b80
|
||||
spr7pic = $8bc0
|
||||
COLOR_MATRIX = $8c00
|
||||
SPRITE_PICS = $8a00
|
||||
spr0pic = $8a00
|
||||
spr1pic = $8a40
|
||||
spr2pic = $8a80
|
||||
spr3pic = $8ac0
|
||||
spr4pic = $8b00
|
||||
spr5pic = $8b40
|
||||
spr6pic = $8b80
|
||||
spr7pic = $8bc0
|
||||
COLOR_MATRIX = $8c00
|
||||
;
|
||||
obj0Pointer = $8ff8
|
||||
obj1Pointer = $8ff9
|
||||
obj2Pointer = $8ffa
|
||||
obj3Pointer = $8ffb
|
||||
obj4Pointer = $8ffc
|
||||
obj5Pointer = $8ffd
|
||||
obj6Pointer = $8ffe
|
||||
obj7Pointer = $8fff
|
||||
obj0Pointer = $8ff8
|
||||
obj1Pointer = $8ff9
|
||||
obj2Pointer = $8ffa
|
||||
obj3Pointer = $8ffb
|
||||
obj4Pointer = $8ffc
|
||||
obj5Pointer = $8ffd
|
||||
obj6Pointer = $8ffe
|
||||
obj7Pointer = $8fff
|
||||
;
|
||||
DISK_BASE = $9000
|
||||
SCREEN_BASE = $a000
|
||||
OS_ROM = $c000
|
||||
OS_JUMPTAB = $c100
|
||||
RAMC_BASE = $de00
|
||||
RAMC_WINDOW = $df00
|
||||
EXP_BASE = $df00
|
||||
MOUSE_BASE_128 = $fd00
|
||||
MOUSE_JMP_128 = $fd00
|
||||
END_MOUSE_128 = $fe80
|
||||
MOUSE_BASE = $fe80
|
||||
MOUSE_JMP = $fe80
|
||||
config = $ff00
|
||||
END_MOUSE = $fffa
|
||||
NMI_VECTOR = $fffa
|
||||
RESET_VECTOR = $fffc
|
||||
IRQ_VECTOR = $fffe
|
||||
DISK_BASE = $9000
|
||||
SCREEN_BASE = $a000
|
||||
OS_ROM = $c000
|
||||
OS_JUMPTAB = $c100
|
||||
RAMC_BASE = $de00
|
||||
RAMC_WINDOW = $df00
|
||||
EXP_BASE = $df00
|
||||
MOUSE_BASE_128 = $fd00
|
||||
MOUSE_JMP_128 = $fd00
|
||||
END_MOUSE_128 = $fe80
|
||||
MOUSE_BASE = $fe80
|
||||
MOUSE_JMP = $fe80
|
||||
config = $ff00
|
||||
END_MOUSE = $fffa
|
||||
NMI_VECTOR = $fffa
|
||||
RESET_VECTOR = $fffc
|
||||
IRQ_VECTOR = $fffe
|
||||
;
|
||||
vicbase = $d000
|
||||
sidbase = $d400
|
||||
mmu = $d500
|
||||
VDC = $d600
|
||||
ctab = $d800
|
||||
cia1base = $dc00
|
||||
cia2base = $dd00
|
||||
vicbase = $d000
|
||||
sidbase = $d400
|
||||
mmu = $d500
|
||||
VDC = $d600
|
||||
ctab = $d800
|
||||
cia1base = $dc00
|
||||
cia2base = $dd00
|
||||
;
|
||||
mob0xpos = $d000
|
||||
mob0ypos = $d001
|
||||
mob1xpos = $d002
|
||||
mob1ypos = $d003
|
||||
mob2xpos = $d004
|
||||
mob2ypos = $d005
|
||||
mob3xpos = $d006
|
||||
mob3ypos = $d007
|
||||
mob4xpos = $d008
|
||||
mob4ypos = $d009
|
||||
mob5xpos = $d00a
|
||||
mob5ypos = $d00b
|
||||
mob6xpos = $d00c
|
||||
mob6ypos = $d00d
|
||||
mob7xpos = $d00e
|
||||
mob7ypos = $d00f
|
||||
msbxpos = $d010
|
||||
grcntrl1 = $d011
|
||||
rasreg = $d012
|
||||
lpxpos = $d013
|
||||
lpypos = $d014
|
||||
mobenble = $d015
|
||||
grcntrl2 = $d016
|
||||
grmemptr = $d018
|
||||
grirq = $d019
|
||||
grirqen = $d01a
|
||||
moby2 = $d017
|
||||
mobprior = $d01b
|
||||
mobmcm = $d01c
|
||||
mobx2 = $d01d
|
||||
mobmobcol = $d01e
|
||||
mobbakcol = $d01f
|
||||
extclr = $d020
|
||||
bakclr0 = $d021
|
||||
bakclr1 = $d022
|
||||
bakclr2 = $d023
|
||||
bakclr3 = $d024
|
||||
mcmclr0 = $d025
|
||||
mcmclr1 = $d026
|
||||
mob0clr = $d027
|
||||
mob1clr = $d028
|
||||
mob2clr = $d029
|
||||
mob3clr = $d02a
|
||||
mob4clr = $d02b
|
||||
mob5clr = $d02c
|
||||
mob6clr = $d02d
|
||||
mob7clr = $d02e
|
||||
keyreg = $d02f
|
||||
clkreg = $d030
|
||||
mob0xpos = $d000
|
||||
mob0ypos = $d001
|
||||
mob1xpos = $d002
|
||||
mob1ypos = $d003
|
||||
mob2xpos = $d004
|
||||
mob2ypos = $d005
|
||||
mob3xpos = $d006
|
||||
mob3ypos = $d007
|
||||
mob4xpos = $d008
|
||||
mob4ypos = $d009
|
||||
mob5xpos = $d00a
|
||||
mob5ypos = $d00b
|
||||
mob6xpos = $d00c
|
||||
mob6ypos = $d00d
|
||||
mob7xpos = $d00e
|
||||
mob7ypos = $d00f
|
||||
msbxpos = $d010
|
||||
grcntrl1 = $d011
|
||||
rasreg = $d012
|
||||
lpxpos = $d013
|
||||
lpypos = $d014
|
||||
mobenble = $d015
|
||||
grcntrl2 = $d016
|
||||
grmemptr = $d018
|
||||
grirq = $d019
|
||||
grirqen = $d01a
|
||||
moby2 = $d017
|
||||
mobprior = $d01b
|
||||
mobmcm = $d01c
|
||||
mobx2 = $d01d
|
||||
mobmobcol = $d01e
|
||||
mobbakcol = $d01f
|
||||
extclr = $d020
|
||||
bakclr0 = $d021
|
||||
bakclr1 = $d022
|
||||
bakclr2 = $d023
|
||||
bakclr3 = $d024
|
||||
mcmclr0 = $d025
|
||||
mcmclr1 = $d026
|
||||
mob0clr = $d027
|
||||
mob1clr = $d028
|
||||
mob2clr = $d029
|
||||
mob3clr = $d02a
|
||||
mob4clr = $d02b
|
||||
mob5clr = $d02c
|
||||
mob6clr = $d02d
|
||||
mob7clr = $d02e
|
||||
keyreg = $d02f
|
||||
clkreg = $d030
|
||||
|
||||
;
|
||||
vdcreg = $d600
|
||||
vdcdata = $d601
|
||||
vdcreg = $d600
|
||||
vdcdata = $d601
|
||||
;
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
;reassembled by Maciej 'YTM/Alliance' Witkowiak
|
||||
;4-2-99
|
||||
|
||||
bootName = $c006
|
||||
version = $c00f
|
||||
nationality = $c010
|
||||
sysFlgCopy = $c012
|
||||
c128Flag = $c013
|
||||
dateCopy = $c018
|
||||
bootName = $c006
|
||||
version = $c00f
|
||||
nationality = $c010
|
||||
sysFlgCopy = $c012
|
||||
c128Flag = $c013
|
||||
dateCopy = $c018
|
||||
@@ -4,13 +4,13 @@
|
||||
;4-2-99
|
||||
|
||||
;for C64
|
||||
;MOUSE_JMP = $fe80
|
||||
SlowMouse = $fe83
|
||||
UpdateMouse = $fe86
|
||||
SetMouse = $fe89
|
||||
;MOUSE_JMP = $fe80
|
||||
SlowMouse = $fe83
|
||||
UpdateMouse = $fe86
|
||||
SetMouse = $fe89
|
||||
|
||||
;for C128
|
||||
;MOUSE_JMP_128 = $fd00
|
||||
SlowMouse_128 = $fd03
|
||||
UpdateMouse_128 = $fd06
|
||||
SetMouse_128 = $fd09
|
||||
;MOUSE_JMP_128 = $fd00
|
||||
SlowMouse_128 = $fd03
|
||||
UpdateMouse_128 = $fd06
|
||||
SetMouse_128 = $fd09
|
||||
|
||||
@@ -5,45 +5,45 @@
|
||||
; Ullrich von Bassewitz, 2002-12-20
|
||||
;
|
||||
|
||||
.include "zeropage.inc"
|
||||
.include "joy-kernel.inc"
|
||||
.include "joy-error.inc"
|
||||
.include "geossym.inc"
|
||||
.include "zeropage.inc"
|
||||
.include "joy-kernel.inc"
|
||||
.include "joy-error.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
.macpack generic
|
||||
.macpack generic
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Header. Includes jump table
|
||||
|
||||
.segment "JUMPTABLE"
|
||||
|
||||
.segment "JUMPTABLE"
|
||||
|
||||
; Driver signature
|
||||
|
||||
.byte $6A, $6F, $79 ; "joy"
|
||||
.byte JOY_API_VERSION ; Driver API version number
|
||||
.byte $6A, $6F, $79 ; "joy"
|
||||
.byte JOY_API_VERSION ; Driver API version number
|
||||
|
||||
; Button state masks (8 values)
|
||||
|
||||
.byte $01 ; JOY_UP
|
||||
.byte $02 ; JOY_DOWN
|
||||
.byte $04 ; JOY_LEFT
|
||||
.byte $08 ; JOY_RIGHT
|
||||
.byte $10 ; JOY_FIRE
|
||||
.byte $00 ; Future expansion
|
||||
.byte $00 ; Future expansion
|
||||
.byte $00 ; Future expansion
|
||||
.byte $01 ; JOY_UP
|
||||
.byte $02 ; JOY_DOWN
|
||||
.byte $04 ; JOY_LEFT
|
||||
.byte $08 ; JOY_RIGHT
|
||||
.byte $10 ; JOY_FIRE
|
||||
.byte $00 ; Future expansion
|
||||
.byte $00 ; Future expansion
|
||||
.byte $00 ; Future expansion
|
||||
|
||||
; Jump table.
|
||||
|
||||
.word INSTALL
|
||||
.word UNINSTALL
|
||||
.word COUNT
|
||||
.word READ
|
||||
.word INSTALL
|
||||
.word UNINSTALL
|
||||
.word COUNT
|
||||
.word READ
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
||||
JOY_COUNT = 2 ; Number of joysticks we support
|
||||
JOY_COUNT = 2 ; Number of joysticks we support
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Data.
|
||||
@@ -58,9 +58,9 @@ JOY_COUNT = 2 ; Number of joysticks we support
|
||||
;
|
||||
|
||||
INSTALL:
|
||||
lda #<JOY_ERR_OK
|
||||
ldx #>JOY_ERR_OK
|
||||
; rts ; Run into UNINSTALL instead
|
||||
lda #<JOY_ERR_OK
|
||||
ldx #>JOY_ERR_OK
|
||||
; rts ; Run into UNINSTALL instead
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; UNINSTALL routine. Is called before the driver is removed from memory.
|
||||
@@ -68,54 +68,54 @@ INSTALL:
|
||||
;
|
||||
|
||||
UNINSTALL:
|
||||
rts
|
||||
rts
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; COUNT: Return the total number of available joysticks in a/x.
|
||||
;
|
||||
|
||||
COUNT:
|
||||
lda #<JOY_COUNT
|
||||
ldx #>JOY_COUNT
|
||||
rts
|
||||
lda #<JOY_COUNT
|
||||
ldx #>JOY_COUNT
|
||||
rts
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; READ: Read a particular joystick passed in A.
|
||||
;
|
||||
|
||||
READ:
|
||||
tax
|
||||
php
|
||||
sei ; disable IRQ
|
||||
lda $01
|
||||
pha
|
||||
lda #$35
|
||||
sta $01 ; enable I/O
|
||||
tax
|
||||
php
|
||||
sei ; disable IRQ
|
||||
lda $01
|
||||
pha
|
||||
lda #$35
|
||||
sta $01 ; enable I/O
|
||||
|
||||
txa ; Joystick number into X
|
||||
bne joy2
|
||||
txa ; Joystick number into X
|
||||
bne joy2
|
||||
|
||||
; Read joystick 1
|
||||
|
||||
joy1:
|
||||
lda #$7F
|
||||
sta cia1base
|
||||
lda cia1base+1
|
||||
back: tay
|
||||
pla
|
||||
sta $01
|
||||
plp
|
||||
tya
|
||||
and #$1F
|
||||
eor #$1F
|
||||
rts
|
||||
lda #$7F
|
||||
sta cia1base
|
||||
lda cia1base+1
|
||||
back: tay
|
||||
pla
|
||||
sta $01
|
||||
plp
|
||||
tya
|
||||
and #$1F
|
||||
eor #$1F
|
||||
rts
|
||||
|
||||
; Read joystick 2
|
||||
|
||||
joy2: ldx #0
|
||||
lda #$E0
|
||||
ldy #$FF
|
||||
sta cia1base+2
|
||||
lda cia1base+1
|
||||
sty cia1base+2
|
||||
jmp back
|
||||
joy2: ldx #0
|
||||
lda #$E0
|
||||
ldy #$FF
|
||||
sta cia1base+2
|
||||
lda cia1base+1
|
||||
sty cia1base+2
|
||||
jmp back
|
||||
|
||||
@@ -4,175 +4,175 @@
|
||||
;4-2-99
|
||||
|
||||
;jump table
|
||||
InterruptMain = $c100
|
||||
InitProcesses = $c103
|
||||
RestartProcess = $c106
|
||||
EnableProcess = $c109
|
||||
BlockProcess = $c10c
|
||||
UnblockProcess = $c10f
|
||||
FreezeProcess = $c112
|
||||
UnfreezeProcess = $c115
|
||||
HorizontalLine = $c118
|
||||
InvertLine = $c11b
|
||||
RecoverLine = $c11e
|
||||
VerticalLine = $c121
|
||||
Rectangle = $c124
|
||||
FrameRectangle = $c127
|
||||
InvertRectangle = $c12a
|
||||
RecoverRectangle = $c12d
|
||||
DrawLine = $c130
|
||||
DrawPoint = $c133
|
||||
GraphicsString = $c136
|
||||
SetPattern = $c139
|
||||
GetScanLine = $c13c
|
||||
TestPoint = $c13f
|
||||
BitmapUp = $c142
|
||||
PutChar = $c145
|
||||
PutString = $c148
|
||||
UseSystemFont = $c14b
|
||||
StartMouseMode = $c14e
|
||||
DoMenu = $c151
|
||||
RecoverMenu = $c154
|
||||
RecoverAllMenus = $c157
|
||||
DoIcons = $c15a
|
||||
DShiftLeft = $c15d
|
||||
BBMult = $c160
|
||||
BMult = $c163
|
||||
DMult = $c166
|
||||
Ddiv = $c169
|
||||
DSdiv = $c16c
|
||||
Dabs = $c16f
|
||||
Dnegate = $c172
|
||||
Ddec = $c175
|
||||
ClearRam = $c178
|
||||
FillRam = $c17b
|
||||
MoveData = $c17e
|
||||
InitRam = $c181
|
||||
PutDecimal = $c184
|
||||
GetRandom = $c187
|
||||
MouseUp = $c18a
|
||||
MouseOff = $c18d
|
||||
DoPreviousMenu = $c190
|
||||
ReDoMenu = $c193
|
||||
GetSerialNumber = $c196
|
||||
Sleep = $c199
|
||||
ClearMouseMode = $c19c
|
||||
i_Rectangle = $c19f
|
||||
i_FrameRectangle = $c1a2
|
||||
i_RecoverRectangle = $c1a5
|
||||
i_GraphicsString = $c1a8
|
||||
i_BitmapUp = $c1ab
|
||||
i_PutString = $c1ae
|
||||
GetRealSize = $c1b1
|
||||
i_FillRam = $c1b4
|
||||
i_MoveData = $c1b7
|
||||
GetString = $c1ba
|
||||
GotoFirstMenu = $c1bd
|
||||
InitTextPrompt = $c1c0
|
||||
MainLoop = $c1c3
|
||||
DrawSprite = $c1c6
|
||||
GetCharWidth = $c1c9
|
||||
LoadCharSet = $c1cc
|
||||
PosSprite = $c1cf
|
||||
EnablSprite = $c1d2
|
||||
DisablSprite = $c1d5
|
||||
CallRoutine = $c1d8
|
||||
CalcBlksFree = $c1db
|
||||
ChkDkGEOS = $c1de
|
||||
NewDisk = $c1e1
|
||||
GetBlock = $c1e4
|
||||
PutBlock = $c1e7
|
||||
SetGEOSDisk = $c1ea
|
||||
SaveFile = $c1ed
|
||||
SetGDirEntry = $c1f0
|
||||
BldGDirEntry = $c1f3
|
||||
GetFreeDirBlk = $c1f6
|
||||
WriteFile = $c1f9
|
||||
BlkAlloc = $c1fc
|
||||
ReadFile = $c1ff
|
||||
SmallPutChar = $c202
|
||||
FollowChain = $c205
|
||||
GetFile = $c208
|
||||
FindFile = $c20b
|
||||
CRC = $c20e
|
||||
LdFile = $c211
|
||||
EnterTurbo = $c214
|
||||
LdDeskAcc = $c217
|
||||
ReadBlock = $c21a
|
||||
LdApplic = $c21d
|
||||
WriteBlock = $c220
|
||||
VerWriteBlock = $c223
|
||||
FreeFile = $c226
|
||||
GetFHdrInfo = $c229
|
||||
EnterDeskTop = $c22c
|
||||
StartAppl = $c22f
|
||||
ExitTurbo = $c232
|
||||
PurgeTurbo = $c235
|
||||
DeleteFile = $c238
|
||||
FindFTypes = $c23b
|
||||
RstrAppl = $c23e
|
||||
ToBASIC = $c241
|
||||
FastDelFile = $c244
|
||||
GetDirHead = $c247
|
||||
PutDirHead = $c24a
|
||||
NxtBlkAlloc = $c24d
|
||||
ImprintRectangle = $c250
|
||||
i_ImprintRectangle = $c253
|
||||
DoDlgBox = $c256
|
||||
RenameFile = $c259
|
||||
InitForIO = $c25c
|
||||
DoneWithIO = $c25f
|
||||
DShiftRight = $c262
|
||||
CopyString = $c265
|
||||
CopyFString = $c268
|
||||
CmpString = $c26b
|
||||
CmpFString = $c26e
|
||||
FirstInit = $c271
|
||||
OpenRecordFile = $c274
|
||||
CloseRecordFile = $c277
|
||||
NextRecord = $c27a
|
||||
PreviousRecord = $c27d
|
||||
PointRecord = $c280
|
||||
DeleteRecord = $c283
|
||||
InsertRecord = $c286
|
||||
AppendRecord = $c289
|
||||
ReadRecord = $c28c
|
||||
WriteRecord = $c28f
|
||||
SetNextFree = $c292
|
||||
UpdateRecordFile = $c295
|
||||
GetPtrCurDkNm = $c298
|
||||
PromptOn = $c29b
|
||||
PromptOff = $c29e
|
||||
OpenDisk = $c2a1
|
||||
DoInlineReturn = $c2a4
|
||||
GetNextChar = $c2a7
|
||||
BitmapClip = $c2aa
|
||||
FindBAMBit = $c2ad
|
||||
SetDevice = $c2b0
|
||||
IsMseInRegion = $c2b3
|
||||
ReadByte = $c2b6
|
||||
FreeBlock = $c2b9
|
||||
ChangeDiskDevice = $c2bc
|
||||
RstrFrmDialogue = $c2bf
|
||||
Panic = $c2c2
|
||||
BitOtherClip = $c2c5
|
||||
StashRAM = $c2c8
|
||||
FetchRAM = $c2cb
|
||||
SwapRAM = $c2ce
|
||||
VerifyRAM = $c2d1
|
||||
DoRAMOp = $c2d4
|
||||
InterruptMain = $c100
|
||||
InitProcesses = $c103
|
||||
RestartProcess = $c106
|
||||
EnableProcess = $c109
|
||||
BlockProcess = $c10c
|
||||
UnblockProcess = $c10f
|
||||
FreezeProcess = $c112
|
||||
UnfreezeProcess = $c115
|
||||
HorizontalLine = $c118
|
||||
InvertLine = $c11b
|
||||
RecoverLine = $c11e
|
||||
VerticalLine = $c121
|
||||
Rectangle = $c124
|
||||
FrameRectangle = $c127
|
||||
InvertRectangle = $c12a
|
||||
RecoverRectangle = $c12d
|
||||
DrawLine = $c130
|
||||
DrawPoint = $c133
|
||||
GraphicsString = $c136
|
||||
SetPattern = $c139
|
||||
GetScanLine = $c13c
|
||||
TestPoint = $c13f
|
||||
BitmapUp = $c142
|
||||
PutChar = $c145
|
||||
PutString = $c148
|
||||
UseSystemFont = $c14b
|
||||
StartMouseMode = $c14e
|
||||
DoMenu = $c151
|
||||
RecoverMenu = $c154
|
||||
RecoverAllMenus = $c157
|
||||
DoIcons = $c15a
|
||||
DShiftLeft = $c15d
|
||||
BBMult = $c160
|
||||
BMult = $c163
|
||||
DMult = $c166
|
||||
Ddiv = $c169
|
||||
DSdiv = $c16c
|
||||
Dabs = $c16f
|
||||
Dnegate = $c172
|
||||
Ddec = $c175
|
||||
ClearRam = $c178
|
||||
FillRam = $c17b
|
||||
MoveData = $c17e
|
||||
InitRam = $c181
|
||||
PutDecimal = $c184
|
||||
GetRandom = $c187
|
||||
MouseUp = $c18a
|
||||
MouseOff = $c18d
|
||||
DoPreviousMenu = $c190
|
||||
ReDoMenu = $c193
|
||||
GetSerialNumber = $c196
|
||||
Sleep = $c199
|
||||
ClearMouseMode = $c19c
|
||||
i_Rectangle = $c19f
|
||||
i_FrameRectangle = $c1a2
|
||||
i_RecoverRectangle = $c1a5
|
||||
i_GraphicsString = $c1a8
|
||||
i_BitmapUp = $c1ab
|
||||
i_PutString = $c1ae
|
||||
GetRealSize = $c1b1
|
||||
i_FillRam = $c1b4
|
||||
i_MoveData = $c1b7
|
||||
GetString = $c1ba
|
||||
GotoFirstMenu = $c1bd
|
||||
InitTextPrompt = $c1c0
|
||||
MainLoop = $c1c3
|
||||
DrawSprite = $c1c6
|
||||
GetCharWidth = $c1c9
|
||||
LoadCharSet = $c1cc
|
||||
PosSprite = $c1cf
|
||||
EnablSprite = $c1d2
|
||||
DisablSprite = $c1d5
|
||||
CallRoutine = $c1d8
|
||||
CalcBlksFree = $c1db
|
||||
ChkDkGEOS = $c1de
|
||||
NewDisk = $c1e1
|
||||
GetBlock = $c1e4
|
||||
PutBlock = $c1e7
|
||||
SetGEOSDisk = $c1ea
|
||||
SaveFile = $c1ed
|
||||
SetGDirEntry = $c1f0
|
||||
BldGDirEntry = $c1f3
|
||||
GetFreeDirBlk = $c1f6
|
||||
WriteFile = $c1f9
|
||||
BlkAlloc = $c1fc
|
||||
ReadFile = $c1ff
|
||||
SmallPutChar = $c202
|
||||
FollowChain = $c205
|
||||
GetFile = $c208
|
||||
FindFile = $c20b
|
||||
CRC = $c20e
|
||||
LdFile = $c211
|
||||
EnterTurbo = $c214
|
||||
LdDeskAcc = $c217
|
||||
ReadBlock = $c21a
|
||||
LdApplic = $c21d
|
||||
WriteBlock = $c220
|
||||
VerWriteBlock = $c223
|
||||
FreeFile = $c226
|
||||
GetFHdrInfo = $c229
|
||||
EnterDeskTop = $c22c
|
||||
StartAppl = $c22f
|
||||
ExitTurbo = $c232
|
||||
PurgeTurbo = $c235
|
||||
DeleteFile = $c238
|
||||
FindFTypes = $c23b
|
||||
RstrAppl = $c23e
|
||||
ToBASIC = $c241
|
||||
FastDelFile = $c244
|
||||
GetDirHead = $c247
|
||||
PutDirHead = $c24a
|
||||
NxtBlkAlloc = $c24d
|
||||
ImprintRectangle = $c250
|
||||
i_ImprintRectangle = $c253
|
||||
DoDlgBox = $c256
|
||||
RenameFile = $c259
|
||||
InitForIO = $c25c
|
||||
DoneWithIO = $c25f
|
||||
DShiftRight = $c262
|
||||
CopyString = $c265
|
||||
CopyFString = $c268
|
||||
CmpString = $c26b
|
||||
CmpFString = $c26e
|
||||
FirstInit = $c271
|
||||
OpenRecordFile = $c274
|
||||
CloseRecordFile = $c277
|
||||
NextRecord = $c27a
|
||||
PreviousRecord = $c27d
|
||||
PointRecord = $c280
|
||||
DeleteRecord = $c283
|
||||
InsertRecord = $c286
|
||||
AppendRecord = $c289
|
||||
ReadRecord = $c28c
|
||||
WriteRecord = $c28f
|
||||
SetNextFree = $c292
|
||||
UpdateRecordFile = $c295
|
||||
GetPtrCurDkNm = $c298
|
||||
PromptOn = $c29b
|
||||
PromptOff = $c29e
|
||||
OpenDisk = $c2a1
|
||||
DoInlineReturn = $c2a4
|
||||
GetNextChar = $c2a7
|
||||
BitmapClip = $c2aa
|
||||
FindBAMBit = $c2ad
|
||||
SetDevice = $c2b0
|
||||
IsMseInRegion = $c2b3
|
||||
ReadByte = $c2b6
|
||||
FreeBlock = $c2b9
|
||||
ChangeDiskDevice = $c2bc
|
||||
RstrFrmDialogue = $c2bf
|
||||
Panic = $c2c2
|
||||
BitOtherClip = $c2c5
|
||||
StashRAM = $c2c8
|
||||
FetchRAM = $c2cb
|
||||
SwapRAM = $c2ce
|
||||
VerifyRAM = $c2d1
|
||||
DoRAMOp = $c2d4
|
||||
|
||||
;only in GEOS 128
|
||||
TempHideMouse = $c2d7
|
||||
SetMousePicture = $c2da
|
||||
SetNewMode = $c2dd
|
||||
NormalizeX = $c2e0
|
||||
MoveBData = $c2e3
|
||||
SwapBData = $c2e6
|
||||
VerifyBData = $c2e9
|
||||
DoBOp = $c2ec
|
||||
AccessCache = $c2ef
|
||||
HideOnlyMouse = $c2f2
|
||||
SetColorMode = $c2f5
|
||||
ColorCard = $c2f8
|
||||
ColorRectangle = $c2fb
|
||||
TempHideMouse = $c2d7
|
||||
SetMousePicture = $c2da
|
||||
SetNewMode = $c2dd
|
||||
NormalizeX = $c2e0
|
||||
MoveBData = $c2e3
|
||||
SwapBData = $c2e6
|
||||
VerifyBData = $c2e9
|
||||
DoBOp = $c2ec
|
||||
AccessCache = $c2ef
|
||||
HideOnlyMouse = $c2f2
|
||||
SetColorMode = $c2f5
|
||||
ColorCard = $c2f8
|
||||
ColorRectangle = $c2fb
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
|
||||
; void FetchRAM (char REUBank, int length, char *from, char *dest);
|
||||
|
||||
.import REURegs
|
||||
.export _FetchRAM
|
||||
.import REURegs
|
||||
.export _FetchRAM
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_FetchRAM:
|
||||
jsr REURegs
|
||||
jmp FetchRAM
|
||||
jsr REURegs
|
||||
jmp FetchRAM
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
;
|
||||
; 31.12.99
|
||||
|
||||
.import popax, popa
|
||||
.import DoublePop
|
||||
.export REURegs
|
||||
.import popax, popa
|
||||
.import DoublePop
|
||||
.export REURegs
|
||||
|
||||
.include "geossym.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
REURegs:
|
||||
jsr DoublePop
|
||||
jsr popax
|
||||
sta r2L
|
||||
stx r2H
|
||||
jsr popa
|
||||
sta r3L
|
||||
rts
|
||||
jsr DoublePop
|
||||
jsr popax
|
||||
sta r2L
|
||||
stx r2H
|
||||
jsr popa
|
||||
sta r3L
|
||||
rts
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
|
||||
; void StashRAM (char REUBank, int length, char *dest, char *from);
|
||||
|
||||
.import REURegs
|
||||
.export _StashRAM
|
||||
.import REURegs
|
||||
.export _StashRAM
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_StashRAM:
|
||||
jsr REURegs
|
||||
jmp StashRAM
|
||||
jsr REURegs
|
||||
jmp StashRAM
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
; 21.12.99
|
||||
|
||||
; void SwapRAM (char REUBank, int length, char *reuaddy, char *cpuaddy);
|
||||
; note that in all REU procs last two pointers are identified like here
|
||||
; note that in all REU procs last two pointers are identified like here
|
||||
|
||||
.import REURegs
|
||||
.export _SwapRAM
|
||||
.import REURegs
|
||||
.export _SwapRAM
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_SwapRAM:
|
||||
jsr REURegs
|
||||
jmp SwapRAM
|
||||
jsr REURegs
|
||||
jmp SwapRAM
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
|
||||
; char VerifyRAM (char REUBank, int length, char *reuaddy, char *cpuaddy);
|
||||
|
||||
.import REURegs
|
||||
.export _VerifyRAM
|
||||
.import REURegs
|
||||
.export _VerifyRAM
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_VerifyRAM:
|
||||
jsr REURegs
|
||||
jsr VerifyRAM
|
||||
txa
|
||||
ldx #0
|
||||
rts
|
||||
jsr REURegs
|
||||
jsr VerifyRAM
|
||||
txa
|
||||
ldx #0
|
||||
rts
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
;4-2-99
|
||||
|
||||
;jump table
|
||||
InitForPrint = $7900
|
||||
StartPrint = $7903
|
||||
PrintBuffer = $7906
|
||||
StopPrint = $7909
|
||||
GetDimensions = $790c
|
||||
PrinsASCII = $790f
|
||||
StartASCII = $7912
|
||||
SetNLQ = $7915
|
||||
InitForPrint = $7900
|
||||
StartPrint = $7903
|
||||
PrintBuffer = $7906
|
||||
StopPrint = $7909
|
||||
GetDimensions = $790c
|
||||
PrinsASCII = $790f
|
||||
StartASCII = $7912
|
||||
SetNLQ = $7915
|
||||
|
||||
@@ -10,83 +10,83 @@
|
||||
; unsigned char get_ostype (void);
|
||||
; unsigned char get_tv (void);
|
||||
|
||||
.export _get_ostype
|
||||
.export _get_tv
|
||||
.importzp tmp1
|
||||
.export _get_ostype
|
||||
.export _get_tv
|
||||
.importzp tmp1
|
||||
|
||||
.include "const.inc"
|
||||
.include "geossym.inc"
|
||||
.include "geossym2.inc"
|
||||
.include "const.inc"
|
||||
.include "geossym.inc"
|
||||
.include "geossym2.inc"
|
||||
|
||||
_get_ostype:
|
||||
ldx #0
|
||||
lda version
|
||||
cmp #$a9
|
||||
beq geos11
|
||||
and #%11110000
|
||||
cmp #$10
|
||||
beq geos10
|
||||
lda c128Flag ; we're on at least 2.0
|
||||
cmp #$18
|
||||
beq geos_on_plus4
|
||||
ora version
|
||||
rts
|
||||
ldx #0
|
||||
lda version
|
||||
cmp #$a9
|
||||
beq geos11
|
||||
and #%11110000
|
||||
cmp #$10
|
||||
beq geos10
|
||||
lda c128Flag ; we're on at least 2.0
|
||||
cmp #$18
|
||||
beq geos_on_plus4
|
||||
ora version
|
||||
rts
|
||||
geos10:
|
||||
lda version
|
||||
rts
|
||||
lda version
|
||||
rts
|
||||
geos11:
|
||||
lda #$11
|
||||
rts
|
||||
lda #$11
|
||||
rts
|
||||
geos_on_plus4:
|
||||
lda #$04
|
||||
rts
|
||||
lda #$04
|
||||
rts
|
||||
|
||||
_get_tv:
|
||||
jsr _get_ostype
|
||||
cmp #$04
|
||||
beq plus4_get_tv
|
||||
bpl only40 ; C64 with 40 columns only
|
||||
lda graphMode
|
||||
bpl only40 ; C128 but currently on 40 columns
|
||||
ldx #1 ; COLUMNS80
|
||||
bne tvmode
|
||||
only40: ldx #0 ; COLUMNS40
|
||||
tvmode: ; PAL/NTSC check here, result in A
|
||||
jsr _get_ostype
|
||||
cmp #$04
|
||||
beq plus4_get_tv
|
||||
bpl only40 ; C64 with 40 columns only
|
||||
lda graphMode
|
||||
bpl only40 ; C128 but currently on 40 columns
|
||||
ldx #1 ; COLUMNS80
|
||||
bne tvmode
|
||||
only40: ldx #0 ; COLUMNS40
|
||||
tvmode: ; PAL/NTSC check here, result in A
|
||||
php
|
||||
sei ; disable interrupts
|
||||
lda CPU_DATA ; this is for C64
|
||||
pha
|
||||
lda #IO_IN ; enable access to I/O
|
||||
sta CPU_DATA
|
||||
bit rasreg
|
||||
bpl tvmode ; wait for rasterline 127<x<256
|
||||
lda #24 ; (rasterline now >=256!)
|
||||
sei ; disable interrupts
|
||||
lda CPU_DATA ; this is for C64
|
||||
pha
|
||||
lda #IO_IN ; enable access to I/O
|
||||
sta CPU_DATA
|
||||
bit rasreg
|
||||
bpl tvmode ; wait for rasterline 127<x<256
|
||||
lda #24 ; (rasterline now >=256!)
|
||||
modelp:
|
||||
cmp rasreg ; wait for rasterline = 24 (or 280 on PAL)
|
||||
bne modelp
|
||||
lda grcntrl1 ; 24 or 280 ?
|
||||
bpl ntsc
|
||||
lda #0 ; PAL
|
||||
beq modeend
|
||||
cmp rasreg ; wait for rasterline = 24 (or 280 on PAL)
|
||||
bne modelp
|
||||
lda grcntrl1 ; 24 or 280 ?
|
||||
bpl ntsc
|
||||
lda #0 ; PAL
|
||||
beq modeend
|
||||
ntsc:
|
||||
lda #$80 ; NTSC
|
||||
lda #$80 ; NTSC
|
||||
|
||||
modeend:
|
||||
stx tmp1
|
||||
ora tmp1
|
||||
sta tmp1
|
||||
ldx #0
|
||||
pla
|
||||
sta CPU_DATA ; restore memory config
|
||||
plp ; restore interrupt state
|
||||
lda tmp1
|
||||
rts
|
||||
stx tmp1
|
||||
ora tmp1
|
||||
sta tmp1
|
||||
ldx #0
|
||||
pla
|
||||
sta CPU_DATA ; restore memory config
|
||||
plp ; restore interrupt state
|
||||
lda tmp1
|
||||
rts
|
||||
plus4_get_tv:
|
||||
ldx #1 ; Assume PAL
|
||||
bit $FF07 ; Test bit 6
|
||||
bvc plus4pal
|
||||
dex ; NTSC
|
||||
ldx #1 ; Assume PAL
|
||||
bit $FF07 ; Test bit 6
|
||||
bvc plus4pal
|
||||
dex ; NTSC
|
||||
plus4pal:
|
||||
txa
|
||||
ldx #0
|
||||
rts
|
||||
txa
|
||||
ldx #0
|
||||
rts
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
; int GetSerialNumber (void);
|
||||
|
||||
.export _GetSerialNumber
|
||||
.export _GetSerialNumber
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
|
||||
_GetSerialNumber:
|
||||
jsr GetSerialNumber
|
||||
lda r0L
|
||||
ldx r0H
|
||||
rts
|
||||
jsr GetSerialNumber
|
||||
lda r0L
|
||||
ldx r0H
|
||||
rts
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
; void InitForIO (void);
|
||||
; void DoneWithIO (void);
|
||||
|
||||
.export _InitForIO, _DoneWithIO
|
||||
.export _InitForIO, _DoneWithIO
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "jumptab.inc"
|
||||
|
||||
_InitForIO = InitForIO
|
||||
|
||||
_DoneWithIO = DoneWithIO
|
||||
_InitForIO = InitForIO
|
||||
|
||||
_DoneWithIO = DoneWithIO
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
; void SetDevice (char newDeviceNumber);
|
||||
|
||||
.export _SetDevice
|
||||
.export _SetDevice
|
||||
|
||||
.include "jumptab.inc"
|
||||
|
||||
_SetDevice = SetDevice
|
||||
.include "jumptab.inc"
|
||||
|
||||
_SetDevice = SetDevice
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
; void ToBASIC (void);
|
||||
|
||||
.export _ToBASIC
|
||||
.export _ToBASIC
|
||||
|
||||
.include "jumptab.inc"
|
||||
.include "jumptab.inc"
|
||||
|
||||
_ToBASIC = ToBASIC
|
||||
_ToBASIC = ToBASIC
|
||||
@@ -3,75 +3,75 @@
|
||||
; 2010-08-17, Maciej 'YTM/Elysium' Witkowiak <ytm@elysium.pl>
|
||||
; 2010-08-18, Greg King
|
||||
|
||||
.include "zeropage.inc"
|
||||
.include "tgi-kernel.inc"
|
||||
.include "tgi-error.inc"
|
||||
.include "const.inc"
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
.include "geossym2.inc"
|
||||
|
||||
.macpack generic
|
||||
.include "zeropage.inc"
|
||||
.include "tgi-kernel.inc"
|
||||
.include "tgi-error.inc"
|
||||
.include "const.inc"
|
||||
.include "jumptab.inc"
|
||||
.include "geossym.inc"
|
||||
.include "geossym2.inc"
|
||||
|
||||
.macpack generic
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
||||
VDC_ADDR_REG := $D600 ; VDC address
|
||||
VDC_DATA_REG := $D601 ; VDC data
|
||||
VDC_ADDR_REG := $D600 ; VDC address
|
||||
VDC_DATA_REG := $D601 ; VDC data
|
||||
|
||||
VDC_DSP_HI = 12 ; registers used
|
||||
VDC_DSP_LO = 13
|
||||
VDC_DATA_HI = 18
|
||||
VDC_DATA_LO = 19
|
||||
VDC_VSCROLL = 24
|
||||
VDC_HSCROLL = 25
|
||||
VDC_COLORS = 26
|
||||
VDC_CSET = 28
|
||||
VDC_COUNT = 30
|
||||
VDC_DATA = 31
|
||||
VDC_DSP_HI = 12 ; registers used
|
||||
VDC_DSP_LO = 13
|
||||
VDC_DATA_HI = 18
|
||||
VDC_DATA_LO = 19
|
||||
VDC_VSCROLL = 24
|
||||
VDC_HSCROLL = 25
|
||||
VDC_COLORS = 26
|
||||
VDC_CSET = 28
|
||||
VDC_COUNT = 30
|
||||
VDC_DATA = 31
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Header. Includes jump table and constants.
|
||||
|
||||
.segment "JUMPTABLE"
|
||||
.segment "JUMPTABLE"
|
||||
|
||||
; First part of the header is a structure that has a magic signature,
|
||||
; and defines the capabilities of the driver.
|
||||
|
||||
.byte $74, $67, $69 ; "tgi"
|
||||
.byte TGI_API_VERSION ; TGI API version number
|
||||
xres: .word 320 ; X resolution
|
||||
yres: .word 200 ; Y resolution
|
||||
.byte 2 ; Number of drawing colors
|
||||
pages: .byte 1 ; Number of screens available
|
||||
.byte 8 ; System font X size
|
||||
.byte 8 ; System font Y size
|
||||
aspect: .word $00D4 ; Aspect ratio (based on 4/3 display)
|
||||
.byte 0 ; TGI driver flags
|
||||
.byte $74, $67, $69 ; "tgi"
|
||||
.byte TGI_API_VERSION ; TGI API version number
|
||||
xres: .word 320 ; X resolution
|
||||
yres: .word 200 ; Y resolution
|
||||
.byte 2 ; Number of drawing colors
|
||||
pages: .byte 1 ; Number of screens available
|
||||
.byte 8 ; System font X size
|
||||
.byte 8 ; System font Y size
|
||||
aspect: .word $00D4 ; Aspect ratio (based on 4/3 display)
|
||||
.byte 0 ; TGI driver flags
|
||||
|
||||
; Next comes the jump table. With the exception of IRQ, all entries must be
|
||||
; valid, and may point to an RTS for test versions (function not implemented).
|
||||
|
||||
.addr INSTALL
|
||||
.addr UNINSTALL
|
||||
.addr INIT
|
||||
.addr DONE
|
||||
.addr GETERROR
|
||||
.addr CONTROL
|
||||
.addr CLEAR
|
||||
.addr SETVIEWPAGE
|
||||
.addr SETDRAWPAGE
|
||||
.addr SETCOLOR
|
||||
.addr SETPALETTE
|
||||
.addr GETPALETTE
|
||||
.addr GETDEFPALETTE
|
||||
.addr SETPIXEL
|
||||
.addr GETPIXEL
|
||||
.addr LINE
|
||||
.addr BAR
|
||||
.addr TEXTSTYLE
|
||||
.addr OUTTEXT
|
||||
.addr 0 ; IRQ entry is unused
|
||||
.addr INSTALL
|
||||
.addr UNINSTALL
|
||||
.addr INIT
|
||||
.addr DONE
|
||||
.addr GETERROR
|
||||
.addr CONTROL
|
||||
.addr CLEAR
|
||||
.addr SETVIEWPAGE
|
||||
.addr SETDRAWPAGE
|
||||
.addr SETCOLOR
|
||||
.addr SETPALETTE
|
||||
.addr GETPALETTE
|
||||
.addr GETDEFPALETTE
|
||||
.addr SETPIXEL
|
||||
.addr GETPIXEL
|
||||
.addr LINE
|
||||
.addr BAR
|
||||
.addr TEXTSTYLE
|
||||
.addr OUTTEXT
|
||||
.addr 0 ; IRQ entry is unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Data.
|
||||
@@ -79,50 +79,50 @@ aspect: .word $00D4 ; Aspect ratio (based on 4/3 display)
|
||||
; Variables mapped to the zero-page segment variables. Some of these are
|
||||
; used for passing parameters to the driver.
|
||||
|
||||
X1 = ptr1
|
||||
Y1 = ptr2
|
||||
X2 = ptr3
|
||||
Y2 = ptr4
|
||||
X1 = ptr1
|
||||
Y1 = ptr2
|
||||
X2 = ptr3
|
||||
Y2 = ptr4
|
||||
|
||||
; Absolute variables used in the code
|
||||
|
||||
.bss
|
||||
|
||||
SCRBASE:
|
||||
.res 1 ; High byte of screen base (64k VDC only)
|
||||
.res 1 ; High byte of screen base (64k VDC only)
|
||||
|
||||
ERROR:
|
||||
.res 1 ; Error code
|
||||
.res 1 ; Error code
|
||||
PALETTE:
|
||||
.res 2 ; The current palette
|
||||
.res 2 ; The current palette
|
||||
|
||||
BITMASK:
|
||||
.res 1 ; $00 = clear, $01 = set pixels
|
||||
.res 1 ; $00 = clear, $01 = set pixels
|
||||
|
||||
OLDCOLOR:
|
||||
.res 1 ; colors before entering gfx mode
|
||||
.res 1 ; colors before entering gfx mode
|
||||
|
||||
; Text output stuff
|
||||
TEXTMAGX:
|
||||
.res 1
|
||||
.res 1
|
||||
TEXTMAGY:
|
||||
.res 1
|
||||
.res 1
|
||||
TEXTDIR:
|
||||
.res 1
|
||||
.res 1
|
||||
|
||||
; Constants and tables
|
||||
|
||||
.rodata
|
||||
|
||||
DEFPALETTE:
|
||||
.byte $00, $0f ; White on black
|
||||
.byte $00, $0f ; White on black
|
||||
PALETTESIZE = * - DEFPALETTE
|
||||
|
||||
; color translation table (indexed by VIC color)
|
||||
COLTRANS:
|
||||
.byte $00, $0f, $08, $06, $0a, $04, $02, $0c
|
||||
.byte $0d, $0b, $09, $01, $0e, $05, $03, $07
|
||||
; colors BROWN and GRAY3 are wrong
|
||||
.byte $00, $0f, $08, $06, $0a, $04, $02, $0c
|
||||
.byte $0d, $0b, $09, $01, $0e, $05, $03, $07
|
||||
; colors BROWN and GRAY3 are wrong
|
||||
|
||||
.code
|
||||
|
||||
@@ -135,97 +135,97 @@ COLTRANS:
|
||||
;
|
||||
|
||||
INSTALL:
|
||||
lda version ; if GEOS 1.0...
|
||||
and #$f0
|
||||
cmp #$10
|
||||
beq @L40
|
||||
lda c128Flag ; at least GEOS 2.0, but we're on C128?
|
||||
bpl @L40
|
||||
lda graphMode ; GEOS 2.0, C128, but is 80 column screen enabled?
|
||||
bmi @L80
|
||||
@L40: rts ; leave default values for 40 column screen
|
||||
lda version ; if GEOS 1.0...
|
||||
and #$f0
|
||||
cmp #$10
|
||||
beq @L40
|
||||
lda c128Flag ; at least GEOS 2.0, but we're on C128?
|
||||
bpl @L40
|
||||
lda graphMode ; GEOS 2.0, C128, but is 80 column screen enabled?
|
||||
bmi @L80
|
||||
@L40: rts ; leave default values for 40 column screen
|
||||
|
||||
; check for VDC version and update register $19 value
|
||||
; check for VDC version and update register $19 value
|
||||
|
||||
@L80:
|
||||
; double the x resolution and halve the aspect ratio
|
||||
; double the x resolution and halve the aspect ratio
|
||||
|
||||
asl xres
|
||||
rol xres+1
|
||||
asl xres
|
||||
rol xres+1
|
||||
|
||||
lsr aspect+1
|
||||
ror aspect
|
||||
lsr aspect+1
|
||||
ror aspect
|
||||
|
||||
; update number of available screens
|
||||
; update number of available screens
|
||||
|
||||
ldx #VDC_CSET ; determine size of RAM...
|
||||
jsr VDCReadReg
|
||||
sta tmp1
|
||||
ora #%00010000
|
||||
jsr VDCWriteReg ; turn on 64k
|
||||
ldx #VDC_CSET ; determine size of RAM...
|
||||
jsr VDCReadReg
|
||||
sta tmp1
|
||||
ora #%00010000
|
||||
jsr VDCWriteReg ; turn on 64k
|
||||
|
||||
jsr settestadr1 ; save original value of test byte
|
||||
jsr VDCReadByte
|
||||
sta tmp2
|
||||
jsr settestadr1 ; save original value of test byte
|
||||
jsr VDCReadByte
|
||||
sta tmp2
|
||||
|
||||
lda #$55 ; write $55 here
|
||||
ldy #ptr1
|
||||
jsr test64k ; read it here and there
|
||||
lda #$aa ; write $aa here
|
||||
ldy #ptr2
|
||||
jsr test64k ; read it here and there
|
||||
lda #$55 ; write $55 here
|
||||
ldy #ptr1
|
||||
jsr test64k ; read it here and there
|
||||
lda #$aa ; write $aa here
|
||||
ldy #ptr2
|
||||
jsr test64k ; read it here and there
|
||||
|
||||
jsr settestadr1
|
||||
lda tmp2
|
||||
jsr VDCWriteByte ; restore original value of test byte
|
||||
jsr settestadr1
|
||||
lda tmp2
|
||||
jsr VDCWriteByte ; restore original value of test byte
|
||||
|
||||
lda ptr1 ; do bytes match?
|
||||
cmp ptr1+1
|
||||
bne @have64k
|
||||
lda ptr2
|
||||
cmp ptr2+1
|
||||
bne @have64k
|
||||
lda ptr1 ; do bytes match?
|
||||
cmp ptr1+1
|
||||
bne @have64k
|
||||
lda ptr2
|
||||
cmp ptr2+1
|
||||
bne @have64k
|
||||
|
||||
ldx #VDC_CSET
|
||||
lda tmp1
|
||||
jsr VDCWriteReg ; restore 16/64k flag
|
||||
jmp @endok ; and leave default values for 16k
|
||||
ldx #VDC_CSET
|
||||
lda tmp1
|
||||
jsr VDCWriteReg ; restore 16/64k flag
|
||||
jmp @endok ; and leave default values for 16k
|
||||
|
||||
@have64k:
|
||||
lda #4
|
||||
sta pages
|
||||
lda #4
|
||||
sta pages
|
||||
@endok:
|
||||
lda #0
|
||||
sta SCRBASE ; draw page 0 as default
|
||||
rts
|
||||
lda #0
|
||||
sta SCRBASE ; draw page 0 as default
|
||||
rts
|
||||
|
||||
test64k:
|
||||
sta tmp1
|
||||
sty ptr3
|
||||
lda #0
|
||||
sta ptr3+1
|
||||
jsr settestadr1
|
||||
lda tmp1
|
||||
jsr VDCWriteByte ; write $55
|
||||
jsr settestadr1
|
||||
jsr VDCReadByte ; read here
|
||||
pha
|
||||
jsr settestadr2
|
||||
jsr VDCReadByte ; and there
|
||||
ldy #1
|
||||
sta (ptr3),y
|
||||
pla
|
||||
dey
|
||||
sta (ptr3),y
|
||||
rts
|
||||
sta tmp1
|
||||
sty ptr3
|
||||
lda #0
|
||||
sta ptr3+1
|
||||
jsr settestadr1
|
||||
lda tmp1
|
||||
jsr VDCWriteByte ; write $55
|
||||
jsr settestadr1
|
||||
jsr VDCReadByte ; read here
|
||||
pha
|
||||
jsr settestadr2
|
||||
jsr VDCReadByte ; and there
|
||||
ldy #1
|
||||
sta (ptr3),y
|
||||
pla
|
||||
dey
|
||||
sta (ptr3),y
|
||||
rts
|
||||
|
||||
settestadr1:
|
||||
ldy #$02 ; test page 2 (here)
|
||||
.byte $2c
|
||||
ldy #$02 ; test page 2 (here)
|
||||
.byte $2c
|
||||
settestadr2:
|
||||
ldy #$42 ; or page 64+2 (there)
|
||||
lda #0
|
||||
jmp VDCSetSourceAddr
|
||||
ldy #$42 ; or page 64+2 (there)
|
||||
lda #0
|
||||
jmp VDCSetSourceAddr
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; UNINSTALL routine. Is called before the driver is removed from memory. May
|
||||
@@ -235,7 +235,7 @@ settestadr2:
|
||||
;
|
||||
|
||||
UNINSTALL:
|
||||
rts
|
||||
rts
|
||||
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
@@ -253,32 +253,32 @@ UNINSTALL:
|
||||
;
|
||||
|
||||
INIT:
|
||||
ldx #$01
|
||||
stx BITMASK ; solid black as pattern
|
||||
lda #1
|
||||
jsr SetPattern
|
||||
lda #ST_WR_FORE ; write only on foreground
|
||||
sta dispBufferOn
|
||||
ldx #$01
|
||||
stx BITMASK ; solid black as pattern
|
||||
lda #1
|
||||
jsr SetPattern
|
||||
lda #ST_WR_FORE ; write only on foreground
|
||||
sta dispBufferOn
|
||||
|
||||
lda graphMode
|
||||
bmi @L80
|
||||
lda graphMode
|
||||
bmi @L80
|
||||
|
||||
; Remember current color value (40 columns)
|
||||
lda screencolors
|
||||
sta OLDCOLOR
|
||||
jmp @L99
|
||||
lda screencolors
|
||||
sta OLDCOLOR
|
||||
jmp @L99
|
||||
|
||||
; Remember current color value (80 columns)
|
||||
@L80: lda scr80colors
|
||||
sta OLDCOLOR
|
||||
@L99: lda #0
|
||||
jsr SETVIEWPAGE ; switch into viewpage 0
|
||||
@L80: lda scr80colors
|
||||
sta OLDCOLOR
|
||||
@L99: lda #0
|
||||
jsr SETVIEWPAGE ; switch into viewpage 0
|
||||
|
||||
; Done, reset the error code
|
||||
|
||||
lda #TGI_ERR_OK
|
||||
sta ERROR
|
||||
rts
|
||||
lda #TGI_ERR_OK
|
||||
sta ERROR
|
||||
rts
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; DONE: Will be called to switch the graphics device back into text mode.
|
||||
@@ -289,35 +289,35 @@ INIT:
|
||||
;
|
||||
|
||||
DONE:
|
||||
lda #0
|
||||
jsr SETVIEWPAGE ; switch into viewpage 0
|
||||
lda #0
|
||||
jsr SETVIEWPAGE ; switch into viewpage 0
|
||||
|
||||
lda graphMode
|
||||
bmi @L80
|
||||
lda graphMode
|
||||
bmi @L80
|
||||
|
||||
lda OLDCOLOR
|
||||
sta screencolors ; restore color for 40 columns
|
||||
ldx #0
|
||||
@L1: sta COLOR_MATRIX,x
|
||||
sta COLOR_MATRIX+$0100,x
|
||||
sta COLOR_MATRIX+$0200,x
|
||||
sta COLOR_MATRIX+1000-256,x
|
||||
inx
|
||||
bne @L1
|
||||
rts
|
||||
lda OLDCOLOR
|
||||
sta screencolors ; restore color for 40 columns
|
||||
ldx #0
|
||||
@L1: sta COLOR_MATRIX,x
|
||||
sta COLOR_MATRIX+$0100,x
|
||||
sta COLOR_MATRIX+$0200,x
|
||||
sta COLOR_MATRIX+1000-256,x
|
||||
inx
|
||||
bne @L1
|
||||
rts
|
||||
|
||||
@L80: lda OLDCOLOR ; restore color for 80 columns
|
||||
ldx #VDC_COLORS
|
||||
jmp VDCWriteReg
|
||||
@L80: lda OLDCOLOR ; restore color for 80 columns
|
||||
ldx #VDC_COLORS
|
||||
jmp VDCWriteReg
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; GETERROR: Return the error code in A and clear it.
|
||||
|
||||
GETERROR:
|
||||
ldx #TGI_ERR_OK
|
||||
lda ERROR
|
||||
stx ERROR
|
||||
rts
|
||||
ldx #TGI_ERR_OK
|
||||
lda ERROR
|
||||
stx ERROR
|
||||
rts
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; CONTROL: Platform/driver specific entry point.
|
||||
@@ -326,9 +326,9 @@ GETERROR:
|
||||
;
|
||||
|
||||
CONTROL:
|
||||
lda #TGI_ERR_INV_FUNC
|
||||
sta ERROR
|
||||
rts
|
||||
lda #TGI_ERR_INV_FUNC
|
||||
sta ERROR
|
||||
rts
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; CLEAR: Clears the screen.
|
||||
@@ -337,29 +337,29 @@ CONTROL:
|
||||
;
|
||||
|
||||
CLEAR:
|
||||
lda curPattern
|
||||
pha
|
||||
lda #0
|
||||
jsr SetPattern
|
||||
ldx #0
|
||||
stx r3L
|
||||
stx r3H
|
||||
stx r2L
|
||||
lda #199
|
||||
sta r2H
|
||||
lda graphMode
|
||||
bpl @L40
|
||||
lda #>639 ; 80 columns
|
||||
ldx #<639
|
||||
bne @L99
|
||||
@L40: lda #>319 ; 40 columns
|
||||
ldx #<319
|
||||
@L99: sta r4H
|
||||
stx r4L
|
||||
jsr Rectangle
|
||||
pla
|
||||
sta curPattern
|
||||
rts
|
||||
lda curPattern
|
||||
pha
|
||||
lda #0
|
||||
jsr SetPattern
|
||||
ldx #0
|
||||
stx r3L
|
||||
stx r3H
|
||||
stx r2L
|
||||
lda #199
|
||||
sta r2H
|
||||
lda graphMode
|
||||
bpl @L40
|
||||
lda #>639 ; 80 columns
|
||||
ldx #<639
|
||||
bne @L99
|
||||
@L40: lda #>319 ; 40 columns
|
||||
ldx #<319
|
||||
@L99: sta r4H
|
||||
stx r4L
|
||||
jsr Rectangle
|
||||
pla
|
||||
sta curPattern
|
||||
rts
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; SETVIEWPAGE: Set the visible page. Called with the new page in A (0..n).
|
||||
@@ -369,15 +369,15 @@ CLEAR:
|
||||
;
|
||||
|
||||
SETVIEWPAGE:
|
||||
ldx graphMode
|
||||
bmi @L80
|
||||
rts
|
||||
@L80: clc
|
||||
ror
|
||||
ror
|
||||
ror
|
||||
ldx #VDC_DSP_HI
|
||||
jmp VDCWriteReg
|
||||
ldx graphMode
|
||||
bmi @L80
|
||||
rts
|
||||
@L80: clc
|
||||
ror
|
||||
ror
|
||||
ror
|
||||
ldx #VDC_DSP_HI
|
||||
jmp VDCWriteReg
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; SETDRAWPAGE: Set the drawable page. Called with the new page in A (0..n).
|
||||
@@ -387,15 +387,15 @@ SETVIEWPAGE:
|
||||
;
|
||||
|
||||
SETDRAWPAGE:
|
||||
ldx graphMode
|
||||
bmi @L80
|
||||
rts
|
||||
@L80: clc
|
||||
ror
|
||||
ror
|
||||
ror
|
||||
sta SCRBASE
|
||||
rts
|
||||
ldx graphMode
|
||||
bmi @L80
|
||||
rts
|
||||
@L80: clc
|
||||
ror
|
||||
ror
|
||||
ror
|
||||
sta SCRBASE
|
||||
rts
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; SETCOLOR: Set the drawing color (in A). The new color is already checked
|
||||
@@ -405,11 +405,11 @@ SETDRAWPAGE:
|
||||
;
|
||||
|
||||
SETCOLOR:
|
||||
tax
|
||||
beq @L1
|
||||
lda #1
|
||||
tax
|
||||
beq @L1
|
||||
lda #1
|
||||
@L1: sta BITMASK
|
||||
jmp SetPattern ; need to have either 0 or 1
|
||||
jmp SetPattern ; need to have either 0 or 1
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; SETPALETTE: Set the palette (not available with all drivers/hardware).
|
||||
@@ -420,46 +420,46 @@ SETCOLOR:
|
||||
;
|
||||
|
||||
SETPALETTE:
|
||||
jsr GETERROR ; clear error (if any)
|
||||
jsr GETERROR ; clear error (if any)
|
||||
|
||||
ldy #PALETTESIZE - 1
|
||||
@L1: lda (ptr1),y ; Copy the palette
|
||||
and #$0F ; Make a valid color
|
||||
sta PALETTE,y
|
||||
dey
|
||||
bpl @L1
|
||||
ldy #PALETTESIZE - 1
|
||||
@L1: lda (ptr1),y ; Copy the palette
|
||||
and #$0F ; Make a valid color
|
||||
sta PALETTE,y
|
||||
dey
|
||||
bpl @L1
|
||||
|
||||
; Put colors from palette into screen
|
||||
|
||||
lda graphMode
|
||||
bmi @L80
|
||||
lda graphMode
|
||||
bmi @L80
|
||||
|
||||
lda PALETTE+1 ; foreground
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
ora PALETTE ; background
|
||||
ldx #0
|
||||
@L2: sta COLOR_MATRIX,x
|
||||
sta COLOR_MATRIX+$0100,x
|
||||
sta COLOR_MATRIX+$0200,x
|
||||
sta COLOR_MATRIX+1000-256,x
|
||||
inx
|
||||
bne @L2
|
||||
rts
|
||||
lda PALETTE+1 ; foreground
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
ora PALETTE ; background
|
||||
ldx #0
|
||||
@L2: sta COLOR_MATRIX,x
|
||||
sta COLOR_MATRIX+$0100,x
|
||||
sta COLOR_MATRIX+$0200,x
|
||||
sta COLOR_MATRIX+1000-256,x
|
||||
inx
|
||||
bne @L2
|
||||
rts
|
||||
|
||||
@L80: ldy PALETTE+1 ; Foreground color
|
||||
lda COLTRANS,y
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
ldy PALETTE ; Background color
|
||||
ora COLTRANS,y
|
||||
@L80: ldy PALETTE+1 ; Foreground color
|
||||
lda COLTRANS,y
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
asl a
|
||||
ldy PALETTE ; Background color
|
||||
ora COLTRANS,y
|
||||
|
||||
ldx #VDC_COLORS
|
||||
jmp VDCWriteReg
|
||||
ldx #VDC_COLORS
|
||||
jmp VDCWriteReg
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; GETPALETTE: Return the current palette in A/X. Even drivers that cannot
|
||||
@@ -470,9 +470,9 @@ SETPALETTE:
|
||||
;
|
||||
|
||||
GETPALETTE:
|
||||
lda #<PALETTE
|
||||
ldx #>PALETTE
|
||||
rts
|
||||
lda #<PALETTE
|
||||
ldx #>PALETTE
|
||||
rts
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; GETDEFPALETTE: Return the default palette for the driver in A/X. All
|
||||
@@ -484,9 +484,9 @@ GETPALETTE:
|
||||
;
|
||||
|
||||
GETDEFPALETTE:
|
||||
lda #<DEFPALETTE
|
||||
ldx #>DEFPALETTE
|
||||
rts
|
||||
lda #<DEFPALETTE
|
||||
ldx #>DEFPALETTE
|
||||
rts
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; SETPIXEL: Draw one pixel at X1/Y1 = ptr1/ptr2 with the current drawing
|
||||
@@ -497,18 +497,18 @@ GETDEFPALETTE:
|
||||
;
|
||||
|
||||
SETPIXEL:
|
||||
lda X1
|
||||
ldx X1+1
|
||||
ldy Y1
|
||||
sta r3L
|
||||
stx r3H
|
||||
sty r11L
|
||||
sec
|
||||
lda BITMASK ; set or clear C flag
|
||||
bne @L1
|
||||
clc
|
||||
@L1: lda #0
|
||||
jmp DrawPoint
|
||||
lda X1
|
||||
ldx X1+1
|
||||
ldy Y1
|
||||
sta r3L
|
||||
stx r3H
|
||||
sty r11L
|
||||
sec
|
||||
lda BITMASK ; set or clear C flag
|
||||
bne @L1
|
||||
clc
|
||||
@L1: lda #0
|
||||
jmp DrawPoint
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; GETPIXEL: Read the color value of a pixel and return it in A/X. The
|
||||
@@ -517,19 +517,19 @@ SETPIXEL:
|
||||
|
||||
|
||||
GETPIXEL:
|
||||
lda X1
|
||||
ldx X1+1
|
||||
ldy Y1
|
||||
sta r3L
|
||||
stx r3H
|
||||
sty r11L
|
||||
jsr TestPoint
|
||||
ldx #0
|
||||
bcc @L1
|
||||
inx
|
||||
@L1: txa
|
||||
ldx #0
|
||||
rts
|
||||
lda X1
|
||||
ldx X1+1
|
||||
ldy Y1
|
||||
sta r3L
|
||||
stx r3H
|
||||
sty r11L
|
||||
jsr TestPoint
|
||||
ldx #0
|
||||
bcc @L1
|
||||
inx
|
||||
@L1: txa
|
||||
ldx #0
|
||||
rts
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; LINE: Draw a line from X1/Y1 to X2/Y2, where X1/Y1 = ptr1/ptr2 and
|
||||
@@ -539,24 +539,24 @@ GETPIXEL:
|
||||
;
|
||||
|
||||
LINE:
|
||||
lda X1
|
||||
ldx X1+1
|
||||
ldy Y1
|
||||
sta r3L
|
||||
stx r3H
|
||||
sty r11L
|
||||
lda X2
|
||||
ldx X2+1
|
||||
ldy Y2
|
||||
sta r4L
|
||||
stx r4H
|
||||
sty r11H
|
||||
sec
|
||||
lda BITMASK ; set or clear C flag
|
||||
bne @L1
|
||||
clc
|
||||
@L1: lda #0
|
||||
jmp DrawLine
|
||||
lda X1
|
||||
ldx X1+1
|
||||
ldy Y1
|
||||
sta r3L
|
||||
stx r3H
|
||||
sty r11L
|
||||
lda X2
|
||||
ldx X2+1
|
||||
ldy Y2
|
||||
sta r4L
|
||||
stx r4H
|
||||
sty r11H
|
||||
sec
|
||||
lda BITMASK ; set or clear C flag
|
||||
bne @L1
|
||||
clc
|
||||
@L1: lda #0
|
||||
jmp DrawLine
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; BAR: Draw a filled rectangle with the corners X1/Y1, X2/Y2, where
|
||||
@@ -575,19 +575,19 @@ LINE:
|
||||
;
|
||||
|
||||
BAR:
|
||||
lda X1
|
||||
ldx X1+1
|
||||
ldy Y1
|
||||
sta r3L
|
||||
stx r3H
|
||||
sty r2L
|
||||
lda X2
|
||||
ldx X2+1
|
||||
ldy Y2
|
||||
sta r4L
|
||||
stx r4H
|
||||
sty r2H
|
||||
jmp Rectangle
|
||||
lda X1
|
||||
ldx X1+1
|
||||
ldy Y1
|
||||
sta r3L
|
||||
stx r3H
|
||||
sty r2L
|
||||
lda X2
|
||||
ldx X2+1
|
||||
ldy Y2
|
||||
sta r4L
|
||||
stx r4H
|
||||
sty r2H
|
||||
jmp Rectangle
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; TEXTSTYLE: Set the style used when calling OUTTEXT. Text scaling in X and Y
|
||||
@@ -597,10 +597,10 @@ BAR:
|
||||
;
|
||||
|
||||
TEXTSTYLE:
|
||||
stx TEXTMAGX
|
||||
sty TEXTMAGY
|
||||
sta TEXTDIR
|
||||
rts
|
||||
stx TEXTMAGX
|
||||
sty TEXTMAGY
|
||||
sta TEXTDIR
|
||||
rts
|
||||
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
@@ -612,69 +612,69 @@ TEXTSTYLE:
|
||||
;
|
||||
|
||||
OUTTEXT:
|
||||
lda TEXTDIR
|
||||
; cmp #TGI_TEXT_HORIZONTAL ; this is equal 0
|
||||
bne @vertical
|
||||
lda TEXTDIR
|
||||
; cmp #TGI_TEXT_HORIZONTAL ; this is equal 0
|
||||
bne @vertical
|
||||
|
||||
lda X1 ; horizontal text output
|
||||
ldx X1+1
|
||||
ldy Y1
|
||||
sta r11L
|
||||
stx r11H
|
||||
sty r1H
|
||||
lda ptr3
|
||||
ldx ptr3+1
|
||||
sta r0L
|
||||
stx r0H
|
||||
jmp PutString
|
||||
lda X1 ; horizontal text output
|
||||
ldx X1+1
|
||||
ldy Y1
|
||||
sta r11L
|
||||
stx r11H
|
||||
sty r1H
|
||||
lda ptr3
|
||||
ldx ptr3+1
|
||||
sta r0L
|
||||
stx r0H
|
||||
jmp PutString
|
||||
|
||||
@vertical:
|
||||
lda X1 ; vertical text output
|
||||
ldx X1+1
|
||||
ldy Y1
|
||||
sta r11L
|
||||
stx r11H
|
||||
sty r1H
|
||||
ldy #0
|
||||
lda (ptr3),y
|
||||
beq @end
|
||||
jsr PutChar
|
||||
inc ptr3
|
||||
bne @L1
|
||||
inc ptr3+1
|
||||
@L1: lda Y1
|
||||
clc
|
||||
adc #8
|
||||
sta Y1
|
||||
bne @vertical
|
||||
@end: rts
|
||||
lda X1 ; vertical text output
|
||||
ldx X1+1
|
||||
ldy Y1
|
||||
sta r11L
|
||||
stx r11H
|
||||
sty r1H
|
||||
ldy #0
|
||||
lda (ptr3),y
|
||||
beq @end
|
||||
jsr PutChar
|
||||
inc ptr3
|
||||
bne @L1
|
||||
inc ptr3+1
|
||||
@L1: lda Y1
|
||||
clc
|
||||
adc #8
|
||||
sta Y1
|
||||
bne @vertical
|
||||
@end: rts
|
||||
|
||||
;-------------
|
||||
; VDC helpers
|
||||
|
||||
VDCSetSourceAddr:
|
||||
pha
|
||||
tya
|
||||
ldx #VDC_DATA_HI
|
||||
jsr VDCWriteReg
|
||||
pla
|
||||
ldx #VDC_DATA_LO
|
||||
bne VDCWriteReg
|
||||
pha
|
||||
tya
|
||||
ldx #VDC_DATA_HI
|
||||
jsr VDCWriteReg
|
||||
pla
|
||||
ldx #VDC_DATA_LO
|
||||
bne VDCWriteReg
|
||||
|
||||
VDCReadByte:
|
||||
ldx #VDC_DATA
|
||||
ldx #VDC_DATA
|
||||
VDCReadReg:
|
||||
stx VDC_ADDR_REG
|
||||
@L0: bit VDC_ADDR_REG
|
||||
bpl @L0
|
||||
lda VDC_DATA_REG
|
||||
rts
|
||||
stx VDC_ADDR_REG
|
||||
@L0: bit VDC_ADDR_REG
|
||||
bpl @L0
|
||||
lda VDC_DATA_REG
|
||||
rts
|
||||
|
||||
VDCWriteByte:
|
||||
ldx #VDC_DATA
|
||||
ldx #VDC_DATA
|
||||
VDCWriteReg:
|
||||
stx VDC_ADDR_REG
|
||||
@L0: bit VDC_ADDR_REG
|
||||
bpl @L0
|
||||
sta VDC_DATA_REG
|
||||
rts
|
||||
stx VDC_ADDR_REG
|
||||
@L0: bit VDC_ADDR_REG
|
||||
bpl @L0
|
||||
sta VDC_DATA_REG
|
||||
rts
|
||||
|
||||
Reference in New Issue
Block a user