mirror of
https://github.com/dschmenk/apple2pi.git
synced 2024-11-24 12:31:30 +00:00
adjust memory map for dskread/write, joypad fixes
This commit is contained in:
parent
f683d6a051
commit
0534cca1f6
5
debian/changelog
vendored
5
debian/changelog
vendored
@ -1,11 +1,12 @@
|
|||||||
a2pi (0.1.8-2) unstable; urgency=low
|
a2pi (0.1.8-3) unstable; urgency=low
|
||||||
|
|
||||||
* Fix FUSE create file function
|
* Fix FUSE create file function
|
||||||
* Add VSDRIVE functionality
|
* Add VSDRIVE functionality
|
||||||
* Fix recursive call request (FUSE mount w/ pidrive active)
|
* Fix recursive call request (FUSE mount w/ pidrive active)
|
||||||
* Fix symlinks for A2VDx.PO updating
|
* Fix symlinks for A2VDx.PO updating
|
||||||
|
* Add UTILS.PO image for comms programs and file manipulation
|
||||||
|
|
||||||
-- David Schmenk <dschmenk@gmail.com> Tue, 04 Feb 2014 13:43:53 -0800
|
-- David Schmenk <dschmenk@gmail.com> Tue, 13 Feb 2014 15:31:23 -0800
|
||||||
|
|
||||||
a2pi (0.1.7-3) unstable; urgency=low
|
a2pi (0.1.7-3) unstable; urgency=low
|
||||||
|
|
||||||
|
2
debian/postinst
vendored
2
debian/postinst
vendored
@ -70,7 +70,7 @@ case "$1" in
|
|||||||
if [ -e /usr/share/a2pi/A2VD2.PO ] || [ -L /usrshare/a2pi/A2VD2.PO ] ; then
|
if [ -e /usr/share/a2pi/A2VD2.PO ] || [ -L /usrshare/a2pi/A2VD2.PO ] ; then
|
||||||
rm /usr/share/a2pi/A2VD2.PO
|
rm /usr/share/a2pi/A2VD2.PO
|
||||||
fi
|
fi
|
||||||
ln -s /usr/share/a2pi/BLANK.PO /usr/share/a2pi/A2VD2.PO
|
ln -s /usr/share/a2pi/UTILS.PO /usr/share/a2pi/A2VD2.PO
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
# Add schmenk.is-a-geek.com to apt sources
|
# Add schmenk.is-a-geek.com to apt sources
|
||||||
|
@ -11,6 +11,9 @@ BINTYPE = \#060000
|
|||||||
SYSTYPE = \#ff0000
|
SYSTYPE = \#ff0000
|
||||||
TXTTYPE = \#040000
|
TXTTYPE = \#040000
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-rm $(ROM) $(VDRV) $(VCLK) *.o *~
|
||||||
|
|
||||||
all: $(ROM) $(VDRV) $(VCLK)
|
all: $(ROM) $(VDRV) $(VCLK)
|
||||||
|
|
||||||
$(ROM): rom.s
|
$(ROM): rom.s
|
||||||
|
@ -92,6 +92,12 @@ SRCH EQU $09
|
|||||||
;*
|
;*
|
||||||
DRVRDST EQU $D742
|
DRVRDST EQU $D742
|
||||||
DRVRLEN EQU 125
|
DRVRLEN EQU 125
|
||||||
|
LDA SLOTIDX
|
||||||
|
LSR
|
||||||
|
LSR
|
||||||
|
LSR
|
||||||
|
LSR
|
||||||
|
STA SLOTNUM
|
||||||
LDA #$60
|
LDA #$60
|
||||||
STA CLKJMP ; UNHOOK CLOCK DRIVER (WITH RTS)
|
STA CLKJMP ; UNHOOK CLOCK DRIVER (WITH RTS)
|
||||||
LDA #<DRVRELOC
|
LDA #<DRVRELOC
|
||||||
@ -127,21 +133,15 @@ SFIXLP: LDA SFIXUPTBL,X
|
|||||||
DEX
|
DEX
|
||||||
LDA SFIXUPTBL,X
|
LDA SFIXUPTBL,X
|
||||||
STA DSTL
|
STA DSTL
|
||||||
LDA SLOTIDX
|
LDA SLOTNUM
|
||||||
LSR
|
|
||||||
LSR
|
|
||||||
LSR
|
|
||||||
LSR
|
|
||||||
CLC
|
CLC
|
||||||
ADC (DSTPTR),Y
|
ADC (DSTPTR),Y
|
||||||
STA (DSTPTR),Y
|
STA (DSTPTR),Y
|
||||||
DEX
|
DEX
|
||||||
BPL SFIXLP
|
BPL SFIXLP
|
||||||
BIT $C08A ; EBABLE ROM
|
BIT $C08A ; EBABLE ROM
|
||||||
LDA SLOTIDX
|
LDA SLOTNUM
|
||||||
LSR
|
ASL
|
||||||
LSR
|
|
||||||
LSR
|
|
||||||
TAX
|
TAX
|
||||||
LDA DEV1H,X
|
LDA DEV1H,X
|
||||||
CMP #$DE ; GNODEV
|
CMP #$DE ; GNODEV
|
||||||
@ -183,12 +183,35 @@ DEV2LP: LDA DEVLST,X
|
|||||||
ORA #$81
|
ORA #$81
|
||||||
STA DEVLST,X
|
STA DEVLST,X
|
||||||
INC DEVCNT
|
INC DEVCNT
|
||||||
BNE EXIT
|
BNE PRSLOT
|
||||||
NXTDEV2:
|
NXTDEV2:
|
||||||
INX
|
INX
|
||||||
CPX #14
|
CPX #14
|
||||||
BNE DEV2LP
|
BNE DEV2LP
|
||||||
EXIT: RTS
|
JMP EXIT
|
||||||
|
PRSLOT: LDA SLOTNUM
|
||||||
|
ORA #'0'
|
||||||
|
STA DR1
|
||||||
|
STA DR2
|
||||||
|
LDY #$00
|
||||||
|
JSR PRMSG
|
||||||
|
DEC DEVCNT
|
||||||
|
BEQ EXIT
|
||||||
|
INY
|
||||||
|
PRMSG: LDA MSG,Y
|
||||||
|
BEQ EXIT
|
||||||
|
ORA #$80
|
||||||
|
JSR COUT
|
||||||
|
INY
|
||||||
|
BNE PRMSG
|
||||||
|
EXIT: RTS
|
||||||
|
MSG: DB "PIDRIVES AVAILABLE AT ,S"
|
||||||
|
DR1: DB "0,D1"
|
||||||
|
DB 0
|
||||||
|
DB " AND ,S"
|
||||||
|
DR2: DB "0,D2"
|
||||||
|
DB 0
|
||||||
|
SLOTNUM: DB 0
|
||||||
;*
|
;*
|
||||||
;* FIXUP TABLE
|
;* FIXUP TABLE
|
||||||
;*
|
;*
|
||||||
|
Binary file not shown.
BIN
share/BLANK.PO
BIN
share/BLANK.PO
Binary file not shown.
BIN
share/UTILS.PO
Executable file
BIN
share/UTILS.PO
Executable file
Binary file not shown.
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2013, David Schmenk
|
* Copyright 2013, David Schmenk
|
||||||
*/
|
*/
|
||||||
#include "a2lib.c"
|
#include "a2lib.c"
|
||||||
@ -13,6 +13,8 @@ struct timespec tv;
|
|||||||
struct input_event evkey, evrelx, evrely, evsync;
|
struct input_event evkey, evrelx, evrely, evsync;
|
||||||
#define PEN_UP 0
|
#define PEN_UP 0
|
||||||
#define PEN_DOWN 1
|
#define PEN_DOWN 1
|
||||||
|
#define PEN_SCALE 3
|
||||||
|
#define PEN_NOISE 127
|
||||||
#define BTTN_IO 0xC061
|
#define BTTN_IO 0xC061
|
||||||
#define READGP0 0x320
|
#define READGP0 0x320
|
||||||
#define READGP1 0x328
|
#define READGP1 0x328
|
||||||
@ -23,7 +25,6 @@ char readgp[] = {
|
|||||||
0x98, // TYA
|
0x98, // TYA
|
||||||
0x60, // RTS
|
0x60, // RTS
|
||||||
};
|
};
|
||||||
int accel[20] = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5, 7, 9, 10};
|
|
||||||
/*
|
/*
|
||||||
* Error handling.
|
* Error handling.
|
||||||
*/
|
*/
|
||||||
@ -41,7 +42,7 @@ static void sig_bye(int signo)
|
|||||||
void main(int argc, char **argv)
|
void main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
struct uinput_user_dev uidev;
|
struct uinput_user_dev uidev;
|
||||||
int a2fd, joyfd, relx, rely, pen, upx, upy, cntrx, cntry, gptoggle;
|
int a2fd, joyfd, relx, rely, pen, upx, upy, downx, downy, cntrx, cntry, gptoggle;
|
||||||
unsigned char prevbttns[2], bttns[2];
|
unsigned char prevbttns[2], bttns[2];
|
||||||
|
|
||||||
int pifd = a2open("127.0.0.1");
|
int pifd = a2open("127.0.0.1");
|
||||||
@ -128,6 +129,8 @@ void main(int argc, char **argv)
|
|||||||
a2quickcall(pifd, READGP0, &upx);
|
a2quickcall(pifd, READGP0, &upx);
|
||||||
a2read(pifd, BTTN_IO, 2, prevbttns);
|
a2read(pifd, BTTN_IO, 2, prevbttns);
|
||||||
a2quickcall(pifd, READGP1, &upy);
|
a2quickcall(pifd, READGP1, &upy);
|
||||||
|
upx += 2;
|
||||||
|
upy += 2;
|
||||||
gptoggle = 0;
|
gptoggle = 0;
|
||||||
pen = PEN_UP;
|
pen = PEN_UP;
|
||||||
evrelx.value = 0;
|
evrelx.value = 0;
|
||||||
@ -141,7 +144,7 @@ void main(int argc, char **argv)
|
|||||||
if (gptoggle)
|
if (gptoggle)
|
||||||
{
|
{
|
||||||
a2quickcall(pifd, READGP0, &relx);
|
a2quickcall(pifd, READGP0, &relx);
|
||||||
if (relx == upx && rely == upy)
|
if (relx <= upx || rely <= upy)
|
||||||
{
|
{
|
||||||
if (pen == PEN_DOWN)
|
if (pen == PEN_DOWN)
|
||||||
{
|
{
|
||||||
@ -150,22 +153,37 @@ void main(int argc, char **argv)
|
|||||||
write(joyfd, &evrelx, sizeof(evrelx));
|
write(joyfd, &evrelx, sizeof(evrelx));
|
||||||
write(joyfd, &evrely, sizeof(evrely));
|
write(joyfd, &evrely, sizeof(evrely));
|
||||||
write(joyfd, &evsync, sizeof(evsync));
|
write(joyfd, &evsync, sizeof(evsync));
|
||||||
|
if (downx == cntrx && downy == cntry)
|
||||||
|
{
|
||||||
|
evkey.code = BTN_LEFT;
|
||||||
|
evkey.value = 1;
|
||||||
|
write(joyfd, &evkey, sizeof(evkey));
|
||||||
|
write(joyfd, &evsync, sizeof(evsync));
|
||||||
|
evkey.value = 0;
|
||||||
|
write(joyfd, &evkey, sizeof(evkey));
|
||||||
|
write(joyfd, &evsync, sizeof(evsync));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pen = PEN_UP;
|
pen = PEN_UP;
|
||||||
}
|
}
|
||||||
else if (pen == PEN_UP && (relx != upx && rely != upy))
|
else if (pen == PEN_UP && (relx > upx && rely > upy))
|
||||||
{
|
{
|
||||||
pen = PEN_DOWN;
|
pen = PEN_DOWN;
|
||||||
cntrx = relx;
|
downx = cntrx = relx;
|
||||||
cntry = rely;
|
downy = cntry = rely;
|
||||||
}
|
}
|
||||||
if (pen == PEN_DOWN)
|
if (pen == PEN_DOWN)
|
||||||
{
|
{
|
||||||
evrelx.value = (relx - cntrx);
|
if (abs(relx - cntrx) < PEN_NOISE && abs(rely - cntry) < PEN_NOISE)
|
||||||
evrely.value = (rely - cntry);
|
{
|
||||||
write(joyfd, &evrelx, sizeof(evrelx));
|
evrelx.value = (relx - cntrx) * PEN_SCALE;
|
||||||
write(joyfd, &evrely, sizeof(evrely));
|
evrely.value = (rely - cntry) * PEN_SCALE;
|
||||||
write(joyfd, &evsync, sizeof(evsync));
|
write(joyfd, &evrelx, sizeof(evrelx));
|
||||||
|
write(joyfd, &evrely, sizeof(evrely));
|
||||||
|
write(joyfd, &evsync, sizeof(evsync));
|
||||||
|
cntrx = relx;
|
||||||
|
cntry = rely;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (isdebug) fprintf(stderr, "a2joypad (%d, %d) [%d %d] pen=%d\n", relx, rely, bttns[0] >> 7, bttns[1] >> 7, pen);
|
if (isdebug) fprintf(stderr, "a2joypad (%d, %d) [%d %d] pen=%d\n", relx, rely, bttns[0] >> 7, bttns[1] >> 7, pen);
|
||||||
}
|
}
|
||||||
|
@ -1,31 +1,29 @@
|
|||||||
#include "a2lib.c"
|
#include "a2lib.c"
|
||||||
|
|
||||||
char online[] = {
|
char online[] = {
|
||||||
// ORG $300
|
// ORG $301
|
||||||
0x20, 0x00, 0xBF, // JSR $BF00 (PRODOS)
|
0x20, 0x00, 0xBF, // JSR $BF00 (PRODOS)
|
||||||
0xC5, // DB ON_LINE
|
0xC5, // DB ON_LINE
|
||||||
0x08, 0x03, // DW PARAMS
|
0x08, 0x03, // DW PARAMS
|
||||||
0x60, // RTS
|
0x60, // RTS
|
||||||
0xEA,
|
|
||||||
// PARAMS @ $308
|
// PARAMS @ $308
|
||||||
0x02, // PARAM_COUNT
|
0x02, // PARAM_COUNT
|
||||||
0x60, // UNIT_NUM = DRIVE 0, SLOT 6
|
0x60, // UNIT_NUM = DRIVE 0, SLOT 6
|
||||||
0x00, 0x20 // DATA_BUFFER = $2000
|
0x00, 0x20 // DATA_BUFFER = $2000
|
||||||
};
|
};
|
||||||
char readblk[] = {
|
char readblk[] = {
|
||||||
// ORG $300
|
// ORG $301
|
||||||
0x20, 0x00, 0xBF, // JSR $BF00 (PRODOS)
|
0x20, 0x00, 0xBF, // JSR $BF00 (PRODOS)
|
||||||
0x80, // DB READ_BLOCK
|
0x80, // DB READ_BLOCK
|
||||||
0x08, 0x03, // DW PARAMS
|
0x08, 0x03, // DW PARAMS
|
||||||
0x60, // RTS
|
0x60, // RTS
|
||||||
0xEA,
|
|
||||||
// PARAMS @ $308
|
// PARAMS @ $308
|
||||||
0x03, // PARAM_COUNT
|
0x03, // PARAM_COUNT
|
||||||
0x60, // UNIT_NUM = DRIVE 0, SLOT 6
|
0x60, // UNIT_NUM = DRIVE 0, SLOT 6
|
||||||
0x00, 0x20, // DATA_BUFFER = $2000
|
0x00, 0x20, // DATA_BUFFER = $2000
|
||||||
0x00, 0x00 // BLOCK_NUM
|
0x00, 0x00 // BLOCK_NUM
|
||||||
};
|
};
|
||||||
#define ORG 0x0300
|
#define ORG 0x0301
|
||||||
#define BLOCK_NUM 0x030C
|
#define BLOCK_NUM 0x030C
|
||||||
#define DATA_BUFFER 0x2000
|
#define DATA_BUFFER 0x2000
|
||||||
char dsk[280][512];
|
char dsk[280][512];
|
||||||
@ -65,4 +63,4 @@ int main(int argc, char **argv)
|
|||||||
fclose(dskfile);
|
fclose(dskfile);
|
||||||
}
|
}
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -1,31 +1,29 @@
|
|||||||
#include "a2lib.c"
|
#include "a2lib.c"
|
||||||
|
|
||||||
char online[] = {
|
char online[] = {
|
||||||
// ORG $300
|
// ORG $301
|
||||||
0x20, 0x00, 0xBF, // JSR $BF00 (PRODOS)
|
0x20, 0x00, 0xBF, // JSR $BF00 (PRODOS)
|
||||||
0xC5, // DB ON_LINE
|
0xC5, // DB ON_LINE
|
||||||
0x08, 0x03, // DW PARAMS
|
0x08, 0x03, // DW PARAMS
|
||||||
0x60, // RTS
|
0x60, // RTS
|
||||||
0xEA,
|
|
||||||
// PARAMS @ $308
|
// PARAMS @ $308
|
||||||
0x02, // PARAM_COUNT
|
0x02, // PARAM_COUNT
|
||||||
0x60, // UNIT_NUM = DRIVE 0, SLOT 6
|
0x60, // UNIT_NUM = DRIVE 0, SLOT 6
|
||||||
0x00, 0x20 // DATA_BUFFER = $2000
|
0x00, 0x20 // DATA_BUFFER = $2000
|
||||||
};
|
};
|
||||||
char writeblk[] = {
|
char writeblk[] = {
|
||||||
// ORG $300
|
// ORG $301
|
||||||
0x20, 0x00, 0xBF, // JSR $BF00 (PRODOS)
|
0x20, 0x00, 0xBF, // JSR $BF00 (PRODOS)
|
||||||
0x81, // DB WRITE_BLOCK
|
0x81, // DB WRITE_BLOCK
|
||||||
0x08, 0x03, // DW PARAMS
|
0x08, 0x03, // DW PARAMS
|
||||||
0x60, // RTS
|
0x60, // RTS
|
||||||
0xEA,
|
|
||||||
// PARAMS @ $308
|
// PARAMS @ $308
|
||||||
0x03, // PARAM_COUNT
|
0x03, // PARAM_COUNT
|
||||||
0x60, // UNIT_NUM = DRIVE 0, SLOT 6
|
0x60, // UNIT_NUM = DRIVE 0, SLOT 6
|
||||||
0x00, 0x20, // DATA_BUFFER = $2000
|
0x00, 0x20, // DATA_BUFFER = $2000
|
||||||
0x00, 0x00 // BLOCK_NUM
|
0x00, 0x00 // BLOCK_NUM
|
||||||
};
|
};
|
||||||
#define ORG 0x0300
|
#define ORG 0x0301
|
||||||
#define BLOCK_NUM 0x030C
|
#define BLOCK_NUM 0x030C
|
||||||
#define DATA_BUFFER 0x2000
|
#define DATA_BUFFER 0x2000
|
||||||
char dsk[280][512];
|
char dsk[280][512];
|
||||||
@ -87,4 +85,4 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
a2close(pifd);
|
a2close(pifd);
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user