Saved six more bytes ;-)

This commit is contained in:
Oliver Schmidt 2013-11-13 23:32:49 +01:00
parent ae1a875881
commit 1bf5b4380d

View file

@ -73,8 +73,6 @@ fixup: .byte fixup02-fixup01, fixup03-fixup02, fixup04-fixup03
.byte fixup14-fixup13, fixup15-fixup14, fixup16-fixup15 .byte fixup14-fixup13, fixup15-fixup14, fixup16-fixup15
.byte fixup17-fixup16, fixup18-fixup17, fixup19-fixup18 .byte fixup17-fixup16, fixup18-fixup17, fixup19-fixup18
.byte fixup20-fixup19, fixup21-fixup20, fixup22-fixup21 .byte fixup20-fixup19, fixup21-fixup20, fixup22-fixup21
.byte fixup23-fixup22, fixup24-fixup23, fixup25-fixup24
.byte fixup26-fixup25
fixups = * - fixup fixups = * - fixup
@ -136,11 +134,10 @@ fixup02:sta isq+1
; Accept valid unicast + broadcast frames ; Accept valid unicast + broadcast frames
; PACKETPP = $0104, PPDATA = $0D05 ; PACKETPP = $0104, PPDATA = $0D05
lda #$04 lda #$04
jsr packetpp_01 jsr packetpp_a1
lda #$05 lda #$05
ldx #$0D ldx #$0D
fixup03:sta ppdata jsr ppdata_ax
fixup04:stx ppdata+1
; Set MAC address ; Set MAC address
; PACKETPP = $0158, PPDATA = MAC[0], MAC[1] ; PACKETPP = $0158, PPDATA = MAC[0], MAC[1]
@ -148,11 +145,10 @@ fixup04:stx ppdata+1
; PACKETPP = $015C, PPDATA = MAC[4], MAC[5] ; PACKETPP = $015C, PPDATA = MAC[4], MAC[5]
ldy #$58 ldy #$58
: tya : tya
jsr packetpp_01 jsr packetpp_a1
lda mac-$58,y lda mac-$58,y
ldx mac-$58+1,y ldx mac-$58+1,y
fixup05:sta ppdata jsr ppdata_ax
fixup06:stx ppdata+1
iny iny
iny iny
cpy #$58+6 cpy #$58+6
@ -161,11 +157,10 @@ fixup06:stx ppdata+1
; Turn on transmission and reception of frames ; Turn on transmission and reception of frames
; PACKETPP = $0112, PPDATA = $00D3 ; PACKETPP = $0112, PPDATA = $00D3
lda #$12 lda #$12
jsr packetpp_01 jsr packetpp_a1
lda #$D3 lda #$D3
ldx #$00 ldx #$00
fixup07:sta ppdata jsr ppdata_ax
fixup08:stx ppdata+1
rts rts
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
@ -175,8 +170,8 @@ poll:
; are any valid unicast frames avaliable ; are any valid unicast frames avaliable
; PACKETPP = $0124, PPDATA & $0D00 ? ; PACKETPP = $0124, PPDATA & $0D00 ?
lda #$24 lda #$24
jsr packetpp_01 jsr packetpp_a1
fixup09:lda ppdata+1 fixup03:lda ppdata+1
and #$0D and #$0D
bne :+ bne :+
@ -190,13 +185,13 @@ fixup09:lda ppdata+1
; Read receiver event and discard it ; Read receiver event and discard it
; RXTXREG ; RXTXREG
: :
fixup10:ldx rxtxreg+1 fixup04:ldx rxtxreg+1
fixup11:lda rxtxreg fixup05:lda rxtxreg
; Read frame length ; Read frame length
; cnt = len = RXTXREG ; cnt = len = RXTXREG
fixup12:ldx rxtxreg+1 fixup06:ldx rxtxreg+1
fixup13:lda rxtxreg fixup07:lda rxtxreg
sta len sta len
stx len+1 stx len+1
sta cnt sta cnt
@ -223,10 +218,10 @@ fixup13:lda rxtxreg
; Read bytes into buffer ; Read bytes into buffer
: jsr adjustptr : jsr adjustptr
: :
fixup14:lda rxtxreg fixup08:lda rxtxreg
sta (ptr),y sta (ptr),y
iny iny
fixup15:lda rxtxreg+1 fixup09:lda rxtxreg+1
sta (ptr),y sta (ptr),y
iny iny
bne :- bne :-
@ -249,12 +244,12 @@ send:
; Transmit command ; Transmit command
lda #$C9 lda #$C9
ldx #$00 ldx #$00
fixup16:sta txcmd fixup10:sta txcmd
fixup17:stx txcmd+1 fixup11:stx txcmd+1
lda cnt lda cnt
ldx cnt+1 ldx cnt+1
fixup18:sta txlen fixup12:sta txlen
fixup19:stx txlen+1 fixup13:stx txlen+1
; Adjust odd frame length ; Adjust odd frame length
jsr adjustcnt jsr adjustcnt
@ -265,8 +260,8 @@ fixup19:stx txlen+1
; Check for avaliable buffer space ; Check for avaliable buffer space
; PACKETPP = $0138, PPDATA & $0100 ? ; PACKETPP = $0138, PPDATA & $0100 ?
: lda #$38 : lda #$38
jsr packetpp_01 jsr packetpp_a1
fixup20:lda ppdata+1 fixup14:lda ppdata+1
and #$01 and #$01
bne :+ bne :+
@ -284,10 +279,10 @@ fixup20:lda ppdata+1
; Write bytes from buffer ; Write bytes from buffer
: jsr adjustptr : jsr adjustptr
: lda (ptr),y : lda (ptr),y
fixup21:sta rxtxreg fixup15:sta rxtxreg
iny iny
lda (ptr),y lda (ptr),y
fixup22:sta rxtxreg+1 fixup16:sta rxtxreg+1
iny iny
bne :- bne :-
inc ptr+1 inc ptr+1
@ -302,10 +297,17 @@ exit:
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
packetpp_01: packetpp_a1:
ldx #$01 ldx #$01
fixup23:sta packetpp fixup17:sta packetpp
fixup24:stx packetpp+1 fixup18:stx packetpp+1
rts
;---------------------------------------------------------------------
ppdata_ax:
fixup19:sta ppdata
fixup20:stx ppdata+1
rts rts
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
@ -313,10 +315,10 @@ fixup24:stx packetpp+1
skipframe: skipframe:
; PACKETPP = $0102, PPDATA = PPDATA | $0040 ; PACKETPP = $0102, PPDATA = PPDATA | $0040
lda #$02 lda #$02
jsr packetpp_01 jsr packetpp_a1
fixup25:lda ppdata fixup21:lda ppdata
ora #$40 ora #$40
fixup26:sta ppdata fixup22:sta ppdata
rts rts
;--------------------------------------------------------------------- ;---------------------------------------------------------------------