Merge pull request #1036 from oliverschmidt/master
Several minor retrocomputing changes.
This commit is contained in:
commit
6c706e53ee
|
@ -89,7 +89,7 @@ fixup: .byte fixup02-fixup01, fixup03-fixup02, fixup04-fixup03
|
|||
.byte fixup29-fixup28, fixup30-fixup29, fixup31-fixup30
|
||||
.byte fixup32-fixup31, fixup33-fixup32, fixup34-fixup33
|
||||
.byte fixup35-fixup34, fixup36-fixup35, fixup37-fixup36
|
||||
.byte fixup38-fixup37, fixup39-fixup38, fixup40-fixup39
|
||||
.byte fixup38-fixup37, fixup39-fixup38
|
||||
|
||||
fixups = * - fixup
|
||||
|
||||
|
@ -272,9 +272,7 @@ fixup22:lda ethdata
|
|||
bcs :++
|
||||
|
||||
; Yes, skip packet
|
||||
; Remove and release RX packet from the FIFO
|
||||
lda #%10000000
|
||||
fixup23:sta ethmmucr
|
||||
jsr releasepacket
|
||||
|
||||
; No packet available
|
||||
lda #$00
|
||||
|
@ -285,7 +283,7 @@ fixup23:sta ethmmucr
|
|||
; Read bytes into buffer
|
||||
: jsr adjustptr
|
||||
:
|
||||
fixup24:lda ethdata
|
||||
fixup23:lda ethdata
|
||||
sta (ptr),y
|
||||
iny
|
||||
bne :-
|
||||
|
@ -294,8 +292,7 @@ fixup24:lda ethdata
|
|||
bpl :-
|
||||
|
||||
; Remove and release RX packet from the FIFO
|
||||
lda #%10000000
|
||||
fixup25:sta ethmmucr
|
||||
jsr releasepacket
|
||||
|
||||
; Return packet length
|
||||
lda len
|
||||
|
@ -313,19 +310,19 @@ send:
|
|||
; Allocate memory for TX
|
||||
txa
|
||||
ora #%00100000
|
||||
fixup26:sta ethmmucr
|
||||
fixup24:sta ethmmucr
|
||||
|
||||
; 8 retries
|
||||
ldy #$08
|
||||
|
||||
; Wait for allocation ready
|
||||
:
|
||||
fixup27:lda ethist
|
||||
fixup25:lda ethist
|
||||
and #%00001000 ; ALLOC INT
|
||||
bne :+
|
||||
|
||||
; Shouldn't we do something here to actively free memory,
|
||||
; maybe removing and releasing an RX packet from the FIFO ???
|
||||
; No space avaliable, skip a received frame
|
||||
jsr releasepacket
|
||||
|
||||
; And try again
|
||||
dey
|
||||
|
@ -335,21 +332,21 @@ fixup27:lda ethist
|
|||
|
||||
; Acknowledge interrupt, is it necessary ???
|
||||
: lda #%00001000
|
||||
fixup28:sta ethack
|
||||
fixup26:sta ethack
|
||||
|
||||
; Set packet address
|
||||
fixup29:lda etharr
|
||||
fixup30:sta ethpnr
|
||||
fixup27:lda etharr
|
||||
fixup28:sta ethpnr
|
||||
|
||||
lda #$00
|
||||
ldx #%01000000 ; AUTO INCR.
|
||||
fixup31:sta ethptr
|
||||
fixup32:stx ethptr+1
|
||||
fixup29:sta ethptr
|
||||
fixup30:stx ethptr+1
|
||||
|
||||
; Status written by CSMA
|
||||
lda #$00
|
||||
fixup33:sta ethdata
|
||||
fixup34:sta ethdata
|
||||
fixup31:sta ethdata
|
||||
fixup32:sta ethdata
|
||||
|
||||
; Check packet length parity:
|
||||
; - Even packet length -> carry set -> add 6 bytes
|
||||
|
@ -361,10 +358,10 @@ fixup34:sta ethdata
|
|||
; The packet contains 3 extra words
|
||||
lda len
|
||||
adc #$05 ; Actually 5 or 6 depending on carry
|
||||
fixup35:sta ethdata
|
||||
fixup33:sta ethdata
|
||||
lda len+1
|
||||
adc #$00
|
||||
fixup36:sta ethdata
|
||||
fixup34:sta ethdata
|
||||
|
||||
; Send the packet
|
||||
; ---------------
|
||||
|
@ -372,7 +369,7 @@ fixup36:sta ethdata
|
|||
; Write bytes from buffer
|
||||
jsr adjustptr
|
||||
: lda (ptr),y
|
||||
fixup37:sta ethdata
|
||||
fixup35:sta ethdata
|
||||
iny
|
||||
bne :-
|
||||
inc ptr+1
|
||||
|
@ -390,13 +387,13 @@ fixup37:sta ethdata
|
|||
|
||||
; No
|
||||
: lda #$00
|
||||
fixup38:sta ethdata ; Fill byte
|
||||
fixup36:sta ethdata ; Fill byte
|
||||
:
|
||||
fixup39:sta ethdata ; Control byte
|
||||
fixup37:sta ethdata ; Control byte
|
||||
|
||||
; Add packet to FIFO
|
||||
lda #%11000000 ; ENQUEUE PACKET - transmit packet
|
||||
fixup40:sta ethmmucr
|
||||
fixup38:sta ethmmucr
|
||||
clc
|
||||
rts
|
||||
|
||||
|
@ -407,6 +404,14 @@ exit:
|
|||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
releasepacket:
|
||||
; Remove and release RX packet from the FIFO
|
||||
lda #%10000000
|
||||
fixup39:sta ethmmucr
|
||||
rts
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
adjustptr:
|
||||
lda len
|
||||
ldx len+1
|
||||
|
|
|
@ -55,7 +55,7 @@ endif
|
|||
|
||||
disk: all
|
||||
cp $(CONTIKI)/tools/$(TARGET)/prodos.dsk contiki.dsk
|
||||
java -jar $(AC) -p contiki.dsk contiki.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -p contiki.dsk contiki.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 contiki.dsk contiki bin < $(CONTIKI_PROJECT).$(TARGET)
|
||||
java -jar $(AC) -p contiki.dsk contiki.cfg bin 0 < $(CONTIKI)/tools/$(TARGET)/sample.cfg
|
||||
java -jar $(AC) -p contiki.dsk cs8900a.eth rel 0 < cs8900a.eth
|
||||
|
|
|
@ -64,5 +64,6 @@
|
|||
#define WWW_CONF_MAX_FORMACTIONLEN 20
|
||||
#define WWW_CONF_MAX_INPUTNAMELEN 20
|
||||
#define WWW_CONF_MAX_INPUTVALUELEN 20
|
||||
#define WWW_CONF_WGET_EXEC(url) exec("wget", url)
|
||||
|
||||
#endif /* CONTIKI_CONF_H_ */
|
||||
|
|
|
@ -32,13 +32,14 @@
|
|||
;
|
||||
;---------------------------------------------------------------------
|
||||
.constructor init_pfs
|
||||
.destructor done_pfs
|
||||
.destructor done_pfs
|
||||
.importzp ptr1
|
||||
.import popax, _uip_aligned_buf
|
||||
.export _pfs_open, _pfs_read, _pfs_close
|
||||
.import popax, _uip_aligned_buf
|
||||
.export _pfs_open, _pfs_read, _pfs_close
|
||||
;---------------------------------------------------------------------
|
||||
pathname := $0280
|
||||
mli := $BF00
|
||||
level := $BF94
|
||||
|
||||
OPEN_CALL = $C8
|
||||
READ_CALL = $CA
|
||||
|
@ -68,8 +69,11 @@ close_fd: .byte $00 ;REF_NUM
|
|||
.segment "INIT"
|
||||
|
||||
init_pfs:
|
||||
; Get prefix len of path used to load binary
|
||||
ldx pathname
|
||||
; Allow exec() to keep file open
|
||||
inc level
|
||||
|
||||
; Get prefix len of path used to load binary
|
||||
ldx pathname
|
||||
: lda pathname,x
|
||||
cmp #'/'
|
||||
beq :+
|
||||
|
@ -80,6 +84,15 @@ init_pfs:
|
|||
;---------------------------------------------------------------------
|
||||
.code
|
||||
|
||||
done_pfs:
|
||||
; Close all file
|
||||
lda #$00
|
||||
jsr _pfs_close
|
||||
|
||||
; Allow exec() to keep file open
|
||||
dec level
|
||||
rts
|
||||
|
||||
_pfs_open:
|
||||
; Pop and store name
|
||||
jsr popax
|
||||
|
@ -131,11 +144,8 @@ _pfs_read:
|
|||
ldx read_count_out+1
|
||||
rts
|
||||
|
||||
done_pfs:
|
||||
lda #$00
|
||||
|
||||
_pfs_close:
|
||||
; Store fd
|
||||
; Store fd
|
||||
sta close_fd
|
||||
|
||||
jsr mli
|
||||
|
@ -147,6 +157,6 @@ _pfs_close:
|
|||
error:
|
||||
; Return -1
|
||||
lda #$FF
|
||||
tax
|
||||
rts
|
||||
tax
|
||||
rts
|
||||
;---------------------------------------------------------------------
|
||||
|
|
|
@ -73,14 +73,14 @@ apple2: contiki-apple2-1.dsk contiki-apple2-2.dsk contiki-apple2-3.dsk contiki-a
|
|||
|
||||
contiki-apple2-1.dsk: apple2enh-makes
|
||||
cp ../apple2enh/prodos.dsk $@
|
||||
java -jar $(AC) -p $@ menu.system sys 0 < ../apple2enh/menu.system
|
||||
java -jar $(AC) -p $@ ethconfi.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ethconfi bin 0 < ../../cpu/6502/ethconfig/ethconfig.apple2enh
|
||||
java -jar $(AC) -p $@ ipconfig.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ipconfig bin 0 < ../../cpu/6502/ipconfig/ipconfig.apple2enh
|
||||
java -jar $(AC) -p $@ webbrows.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -p $@ menu.system sys < ../apple2enh/menu.system
|
||||
java -jar $(AC) -p $@ ethconfi.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ethconfi bin < ../../cpu/6502/ethconfig/ethconfig.apple2enh
|
||||
java -jar $(AC) -p $@ ipconfig.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ipconfig bin < ../../cpu/6502/ipconfig/ipconfig.apple2enh
|
||||
java -jar $(AC) -p $@ webbrows.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ webbrows bin < ../../examples/webbrowser/webbrowser.apple2enh
|
||||
java -jar $(AC) -p $@ wget.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -p $@ wget.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ wget bin < ../../examples/wget/wget.apple2enh
|
||||
java -jar $(AC) -p $@ contiki.cfg bin 0 < ../apple2enh/default.cfg
|
||||
java -jar $(AC) -p $@ cs8900a.eth rel 0 < ../../cpu/6502/ethconfig/cs8900a.eth
|
||||
|
@ -90,14 +90,14 @@ contiki-apple2-1.dsk: apple2enh-makes
|
|||
|
||||
contiki-apple2-2.dsk: apple2enh-makes
|
||||
cp ../apple2enh/prodos.dsk $@
|
||||
java -jar $(AC) -p $@ menu.system sys 0 < ../apple2enh/menu.system
|
||||
java -jar $(AC) -p $@ ethconfi.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ethconfi bin 0 < ../../cpu/6502/ethconfig/ethconfig.apple2enh
|
||||
java -jar $(AC) -p $@ ipconfig.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ipconfig bin 0 < ../../cpu/6502/ipconfig/ipconfig.apple2enh
|
||||
java -jar $(AC) -p $@ irc.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -p $@ menu.system sys < ../apple2enh/menu.system
|
||||
java -jar $(AC) -p $@ ethconfi.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ethconfi bin < ../../cpu/6502/ethconfig/ethconfig.apple2enh
|
||||
java -jar $(AC) -p $@ ipconfig.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ipconfig bin < ../../cpu/6502/ipconfig/ipconfig.apple2enh
|
||||
java -jar $(AC) -p $@ irc.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ irc bin < ../../examples/irc/irc-client.apple2enh
|
||||
java -jar $(AC) -p $@ breadbox.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -p $@ breadbox.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ breadbox bin < ../../../contikiprojects/vandenbrande.com/twitter/platform/apple2enh/breadbox64.apple2enh
|
||||
java -jar $(AC) -p $@ contiki.cfg bin 0 < ../apple2enh/default.cfg
|
||||
java -jar $(AC) -p $@ cs8900a.eth rel 0 < ../../cpu/6502/ethconfig/cs8900a.eth
|
||||
|
@ -107,14 +107,14 @@ contiki-apple2-2.dsk: apple2enh-makes
|
|||
|
||||
contiki-apple2-3.dsk: apple2enh-makes
|
||||
cp ../apple2enh/prodos.dsk $@
|
||||
java -jar $(AC) -p $@ menu.system sys 0 < ../apple2enh/menu.system
|
||||
java -jar $(AC) -p $@ ethconfi.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ethconfi bin 0 < ../../cpu/6502/ethconfig/ethconfig.apple2enh
|
||||
java -jar $(AC) -p $@ ipconfig.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ipconfig bin 0 < ../../cpu/6502/ipconfig/ipconfig.apple2enh
|
||||
java -jar $(AC) -p $@ email.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -p $@ menu.system sys < ../apple2enh/menu.system
|
||||
java -jar $(AC) -p $@ ethconfi.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ethconfi bin < ../../cpu/6502/ethconfig/ethconfig.apple2enh
|
||||
java -jar $(AC) -p $@ ipconfig.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ipconfig bin < ../../cpu/6502/ipconfig/ipconfig.apple2enh
|
||||
java -jar $(AC) -p $@ email.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ email bin < ../../examples/email/email-client.apple2enh
|
||||
java -jar $(AC) -p $@ ftp.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -p $@ ftp.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ftp bin < ../../examples/ftp/ftp-client.apple2enh
|
||||
java -jar $(AC) -p $@ contiki.cfg bin 0 < ../apple2enh/default.cfg
|
||||
java -jar $(AC) -p $@ cs8900a.eth rel 0 < ../../cpu/6502/ethconfig/cs8900a.eth
|
||||
|
@ -124,14 +124,14 @@ contiki-apple2-3.dsk: apple2enh-makes
|
|||
|
||||
contiki-apple2-4.dsk: apple2enh-makes
|
||||
cp ../apple2enh/prodos.dsk $@
|
||||
java -jar $(AC) -p $@ menu.system sys 0 < ../apple2enh/menu.system
|
||||
java -jar $(AC) -p $@ ethconfi.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ethconfi bin 0 < ../../cpu/6502/ethconfig/ethconfig.apple2enh
|
||||
java -jar $(AC) -p $@ ipconfig.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ipconfig bin 0 < ../../cpu/6502/ipconfig/ipconfig.apple2enh
|
||||
java -jar $(AC) -p $@ webserv.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -p $@ menu.system sys < ../apple2enh/menu.system
|
||||
java -jar $(AC) -p $@ ethconfi.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ethconfi bin < ../../cpu/6502/ethconfig/ethconfig.apple2enh
|
||||
java -jar $(AC) -p $@ ipconfig.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ipconfig bin < ../../cpu/6502/ipconfig/ipconfig.apple2enh
|
||||
java -jar $(AC) -p $@ webserv.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ webserv bin < ../../examples/webserver/webserver-example.apple2enh
|
||||
java -jar $(AC) -p $@ telnetd.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -p $@ telnetd.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ telnetd bin < ../../examples/telnet-server/telnet-server.apple2enh
|
||||
java -jar $(AC) -p $@ contiki.cfg bin 0 < ../apple2enh/default.cfg
|
||||
java -jar $(AC) -p $@ cs8900a.eth rel 0 < ../../cpu/6502/ethconfig/cs8900a.eth
|
||||
|
@ -145,26 +145,26 @@ contiki-apple2-4.dsk: apple2enh-makes
|
|||
|
||||
contiki-apple2.2mg: apple2enh-makes
|
||||
cp ../apple2enh/prodos.2mg $@
|
||||
java -jar $(AC) -p $@ menu.system sys 0 < ../apple2enh/menu.system
|
||||
java -jar $(AC) -p $@ ethconfi.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ethconfi bin 0 < ../../cpu/6502/ethconfig/ethconfig.apple2enh
|
||||
java -jar $(AC) -p $@ ipconfig.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ipconfig bin 0 < ../../cpu/6502/ipconfig/ipconfig.apple2enh
|
||||
java -jar $(AC) -p $@ webbrows.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -p $@ menu.system sys < ../apple2enh/menu.system
|
||||
java -jar $(AC) -p $@ ethconfi.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ethconfi bin < ../../cpu/6502/ethconfig/ethconfig.apple2enh
|
||||
java -jar $(AC) -p $@ ipconfig.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ipconfig bin < ../../cpu/6502/ipconfig/ipconfig.apple2enh
|
||||
java -jar $(AC) -p $@ webbrows.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ webbrows bin < ../../examples/webbrowser/webbrowser.apple2enh
|
||||
java -jar $(AC) -p $@ wget.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -p $@ wget.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ wget bin < ../../examples/wget/wget.apple2enh
|
||||
java -jar $(AC) -p $@ irc.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -p $@ irc.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ irc bin < ../../examples/irc/irc-client.apple2enh
|
||||
java -jar $(AC) -p $@ breadbox.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -p $@ breadbox.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ breadbox bin < ../../../contikiprojects/vandenbrande.com/twitter/platform/apple2enh/breadbox64.apple2enh
|
||||
java -jar $(AC) -p $@ email.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -p $@ email.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ email bin < ../../examples/email/email-client.apple2enh
|
||||
java -jar $(AC) -p $@ ftp.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -p $@ ftp.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ ftp bin < ../../examples/ftp/ftp-client.apple2enh
|
||||
java -jar $(AC) -p $@ webserv.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -p $@ webserv.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ webserv bin < ../../examples/webserver/webserver-example.apple2enh
|
||||
java -jar $(AC) -p $@ telnetd.system sys 0 < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -p $@ telnetd.system sys < $(CC65_HOME)/targetutil/loader.system
|
||||
java -jar $(AC) -cc65 $@ telnetd bin < ../../examples/telnet-server/telnet-server.apple2enh
|
||||
java -jar $(AC) -p $@ contiki.cfg bin 0 < ../apple2enh/default.cfg
|
||||
java -jar $(AC) -p $@ cs8900a.eth rel 0 < ../../cpu/6502/ethconfig/cs8900a.eth
|
||||
|
|
Loading…
Reference in a new issue