mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-05-28 17:41:29 +00:00
synch up some old checkins from the laptop
This commit is contained in:
parent
b85932220a
commit
9e2239d871
|
@ -5,14 +5,23 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
char *device_name,errbuf[PCAP_ERRBUF_SIZE];
|
char *device_name,errbuf[PCAP_ERRBUF_SIZE];
|
||||||
|
|
||||||
|
pcap_t *handle;
|
||||||
|
|
||||||
device_name=pcap_lookupdev(errbuf);
|
device_name=pcap_lookupdev(errbuf);
|
||||||
if (device_name==NULL) {
|
if (device_name==NULL) {
|
||||||
fprintf(stderr,"Can't find default device\n");
|
fprintf(stderr,"Can't find default device %s\n",errbuf);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Using device: %s\n", device_name);
|
printf("Using device: %s\n", device_name);
|
||||||
|
|
||||||
|
handle=pcap_open_live(device_name, BUFSIZ, 1, 1000, errbuf);
|
||||||
|
if (handle==NULL) {
|
||||||
|
fprintf(stderr,"Couldn't open device %s: %s\n",
|
||||||
|
device_name,errbuf);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
99
ksp/applesoft/Makefile
Normal file
99
ksp/applesoft/Makefile
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
PCX2HGR = ../../hgr-utils/pcx2hgr
|
||||||
|
DOS33 = ../../dos33fs-utils/dos33
|
||||||
|
TXT2BAS = ../../asoft_basic-utils/tokenize_asoft
|
||||||
|
SHAPETABLE = ../../hgr-utils/shape_table
|
||||||
|
|
||||||
|
all: ksp.dsk
|
||||||
|
|
||||||
|
ACMPLX.BAS: acmplx.bas
|
||||||
|
$(TXT2BAS) < acmplx.bas > ACMPLX.BAS
|
||||||
|
|
||||||
|
CONTRACT.BAS: contract.bas
|
||||||
|
$(TXT2BAS) < contract.bas > CONTRACT.BAS
|
||||||
|
|
||||||
|
FLIGHT.BAS: flight.bas
|
||||||
|
$(TXT2BAS) < flight.bas > FLIGHT.BAS
|
||||||
|
|
||||||
|
KSP.BAS: ksp.bas
|
||||||
|
$(TXT2BAS) < ksp.bas > KSP.BAS
|
||||||
|
|
||||||
|
LAUNCH.BAS: launch.bas
|
||||||
|
$(TXT2BAS) < launch.bas > LAUNCH.BAS
|
||||||
|
|
||||||
|
LOADING.BAS: loading.bas
|
||||||
|
$(TXT2BAS) < loading.bas > LOADING.BAS
|
||||||
|
|
||||||
|
PHYSICS.BAS: physics.bas
|
||||||
|
$(TXT2BAS) < physics.bas > PHYSICS.BAS
|
||||||
|
|
||||||
|
VAB.BAS: vab.bas
|
||||||
|
$(TXT2BAS) < vab.bas > VAB.BAS
|
||||||
|
|
||||||
|
LOAD_KSP.BAS: load_ksp.bas
|
||||||
|
$(TXT2BAS) < load_ksp.bas > LOAD_KSP.BAS
|
||||||
|
|
||||||
|
ROCKET.SHAPE: ../ship2.table
|
||||||
|
$(SHAPETABLE) -b < ../ship2.table > ROCKET.SHAPE
|
||||||
|
|
||||||
|
VAB.SHAPE: ../ship.table
|
||||||
|
$(SHAPETABLE) -b < ../ship.table > VAB.SHAPE
|
||||||
|
|
||||||
|
|
||||||
|
ksp.dsk: ACMPLX.BAS \
|
||||||
|
CONTRACT.BAS \
|
||||||
|
FLIGHT.BAS \
|
||||||
|
KSP.BAS \
|
||||||
|
ROCKET.SHAPE \
|
||||||
|
VAB.SHAPE \
|
||||||
|
LOAD_KSP.BAS \
|
||||||
|
LAUNCH.BAS GLOBE.HGR LAUNCHPAD.HGR ORBIT_TOP.HGR ORBIT_RIGHT.HGR \
|
||||||
|
LOADING.BAS LOADING.HGR SQUAD.HGR TITLE.HGR \
|
||||||
|
PHYSICS.BAS \
|
||||||
|
VAB.BAS VAB.HGR
|
||||||
|
$(DOS33) -y ksp.dsk SAVE B LOADING.HGR
|
||||||
|
$(DOS33) -y ksp.dsk SAVE B SQUAD.HGR
|
||||||
|
$(DOS33) -y ksp.dsk SAVE B TITLE.HGR
|
||||||
|
$(DOS33) -y ksp.dsk SAVE A VAB.BAS
|
||||||
|
$(DOS33) -y ksp.dsk SAVE B VAB.HGR
|
||||||
|
$(DOS33) -y ksp.dsk SAVE A LOADING.BAS
|
||||||
|
$(DOS33) -y ksp.dsk SAVE A ACMPLX.BAS
|
||||||
|
$(DOS33) -y ksp.dsk SAVE A LAUNCH.BAS
|
||||||
|
$(DOS33) -y ksp.dsk SAVE B GLOBE.HGR
|
||||||
|
$(DOS33) -y ksp.dsk SAVE B LAUNCHPAD.HGR
|
||||||
|
$(DOS33) -y ksp.dsk SAVE B ORBIT_RIGHT.HGR
|
||||||
|
$(DOS33) -y ksp.dsk SAVE B ORBIT_TOP.HGR
|
||||||
|
$(DOS33) -y ksp.dsk SAVE A PHYSICS.BAS
|
||||||
|
$(DOS33) -y ksp.dsk SAVE A FLIGHT.BAS
|
||||||
|
$(DOS33) -y ksp.dsk SAVE A CONTRACT.BAS
|
||||||
|
$(DOS33) -y ksp.dsk SAVE A KSP.BAS
|
||||||
|
$(DOS33) -y ksp.dsk SAVE A LOAD_KSP.BAS
|
||||||
|
$(DOS33) -y ksp.dsk SAVE B ROCKET.SHAPE
|
||||||
|
$(DOS33) -y ksp.dsk SAVE B VAB.SHAPE
|
||||||
|
|
||||||
|
|
||||||
|
LAUNCHPAD.HGR: ../launchpad.pcx
|
||||||
|
$(PCX2HGR) ../launchpad.pcx > LAUNCHPAD.HGR
|
||||||
|
|
||||||
|
ORBIT_TOP.HGR: ../orbit_top.pcx
|
||||||
|
$(PCX2HGR) ../orbit_top.pcx > ORBIT_TOP.HGR
|
||||||
|
|
||||||
|
ORBIT_RIGHT.HGR: ../orbit_right.pcx
|
||||||
|
$(PCX2HGR) ../orbit_right.pcx > ORBIT_RIGHT.HGR
|
||||||
|
|
||||||
|
GLOBE.HGR: ../globe.pcx
|
||||||
|
$(PCX2HGR) ../globe.pcx > GLOBE.HGR
|
||||||
|
|
||||||
|
LOADING.HGR: ../loading.pcx
|
||||||
|
$(PCX2HGR) ../loading.pcx > LOADING.HGR
|
||||||
|
|
||||||
|
SQUAD.HGR: ../squad.pcx
|
||||||
|
$(PCX2HGR) ../squad.pcx > SQUAD.HGR
|
||||||
|
|
||||||
|
TITLE.HGR: ../title.pcx
|
||||||
|
$(PCX2HGR) ../title.pcx > TITLE.HGR
|
||||||
|
|
||||||
|
VAB.HGR: ../vab.pcx
|
||||||
|
$(PCX2HGR) ../vab.pcx > VAB.HGR
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *~ *.HGR *.SHAPE *.BAS
|
102
ksp/asm/ksp.s
102
ksp/asm/ksp.s
|
@ -66,6 +66,39 @@
|
||||||
; W = Which astronaut
|
; W = Which astronaut
|
||||||
; X/Y = temp X/Y
|
; X/Y = temp X/Y
|
||||||
; ZX/ZY= Vx0 and Vy0
|
; ZX/ZY= Vx0 and Vy0
|
||||||
|
|
||||||
|
.define EQU =
|
||||||
|
|
||||||
|
LOCATE_FILEM_PARAM EQU $3DC
|
||||||
|
LOCATE_RWTS_PARAM EQU $3E3
|
||||||
|
FILEMANAGER EQU $3D6
|
||||||
|
|
||||||
|
; Zero Page
|
||||||
|
|
||||||
|
;; For the disk-read code
|
||||||
|
RWTSH EQU $F1
|
||||||
|
RWTSL EQU $F0
|
||||||
|
DOSBUFH EQU $EF
|
||||||
|
DOSBUFL EQU $EE
|
||||||
|
FILEMH EQU $ED
|
||||||
|
FILEML EQU $EC
|
||||||
|
|
||||||
|
;; DOS Constants
|
||||||
|
OPEN EQU $01
|
||||||
|
CLOSE EQU $02
|
||||||
|
READ EQU $03
|
||||||
|
WRITE EQU $04
|
||||||
|
DELETE EQU $05
|
||||||
|
CATALOG EQU $06
|
||||||
|
LOCK EQU $07
|
||||||
|
UNLOCK EQU $08
|
||||||
|
RENAME EQU $09
|
||||||
|
POSITION EQU $0A
|
||||||
|
INIT EQU $0B
|
||||||
|
VERIFY EQU $0C
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;
|
;
|
||||||
; Clear screen
|
; Clear screen
|
||||||
; 10 HOME:HGR:D$=CHR$(4)
|
; 10 HOME:HGR:D$=CHR$(4)
|
||||||
|
@ -491,38 +524,45 @@
|
||||||
;9320 GOTO 9010
|
;9320 GOTO 9010
|
||||||
|
|
||||||
BLOAD:
|
BLOAD:
|
||||||
jsr find_free_dos_buffer
|
jsr LOCATE_FILEM_PARAM ; load file manager param list
|
||||||
rts
|
; Y=low, A=high
|
||||||
|
|
||||||
; See Beneath Apple DOS
|
sta FILEMH ; store pointer in page0
|
||||||
find_free_dos_buffer:
|
sty FILEML
|
||||||
lda $3D2 ; dos load point
|
|
||||||
sta $1
|
ldy #7 ; file type in offset 7
|
||||||
ldy #0
|
lda #4 ; binary file
|
||||||
sty $0
|
sta (FILEML),y
|
||||||
gbuf0:
|
|
||||||
lda ($0),Y
|
iny ; filename pointer in offset 8
|
||||||
pha
|
lda #<filename
|
||||||
|
sta (FILEML),y
|
||||||
|
lda #>filename
|
||||||
iny
|
iny
|
||||||
lda ($0),Y
|
sta (FILEML),y
|
||||||
sta $1
|
|
||||||
pla
|
ldx #1 ; open existing file
|
||||||
sta $0
|
|
||||||
bne gbuf ; got one
|
jsr open
|
||||||
lda $1
|
|
||||||
beq nbuf ; no buffers
|
jsr read
|
||||||
gbuf:
|
|
||||||
ldy #0 ; get filename
|
jsr close
|
||||||
lda ($0),Y
|
|
||||||
beq gotbuf ; it's free
|
open:
|
||||||
ldy #36 ; it's not free
|
read:
|
||||||
bne gbuf0 ; get next buffer
|
close:
|
||||||
gotbuf:
|
|
||||||
clc ; indicate got buffer
|
|
||||||
rts
|
; --- string with high-bit set, null-terminated
|
||||||
nbuf:
|
.macro aschiz str
|
||||||
sec ; indicate not free
|
.repeat .strlen (str), c
|
||||||
rts
|
.byte .strat (str, c) | $80
|
||||||
|
.endrep
|
||||||
|
.byte 0
|
||||||
|
.endmacro
|
||||||
|
|
||||||
|
.data
|
||||||
|
filename: aschiz "LOADING.HGR "
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user