adjust memory map for dskread/write, joypad fixes

This commit is contained in:
dschmenk 2014-02-14 08:57:31 -08:00
parent f683d6a051
commit 0534cca1f6
10 changed files with 79 additions and 38 deletions

5
debian/changelog vendored
View File

@ -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
* Add VSDRIVE functionality
* Fix recursive call request (FUSE mount w/ pidrive active)
* 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

2
debian/postinst vendored
View File

@ -70,7 +70,7 @@ case "$1" in
if [ -e /usr/share/a2pi/A2VD2.PO ] || [ -L /usrshare/a2pi/A2VD2.PO ] ; then
rm /usr/share/a2pi/A2VD2.PO
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
#
# Add schmenk.is-a-geek.com to apt sources

View File

@ -11,6 +11,9 @@ BINTYPE = \#060000
SYSTYPE = \#ff0000
TXTTYPE = \#040000
clean:
-rm $(ROM) $(VDRV) $(VCLK) *.o *~
all: $(ROM) $(VDRV) $(VCLK)
$(ROM): rom.s

View File

@ -92,6 +92,12 @@ SRCH EQU $09
;*
DRVRDST EQU $D742
DRVRLEN EQU 125
LDA SLOTIDX
LSR
LSR
LSR
LSR
STA SLOTNUM
LDA #$60
STA CLKJMP ; UNHOOK CLOCK DRIVER (WITH RTS)
LDA #<DRVRELOC
@ -127,21 +133,15 @@ SFIXLP: LDA SFIXUPTBL,X
DEX
LDA SFIXUPTBL,X
STA DSTL
LDA SLOTIDX
LSR
LSR
LSR
LSR
LDA SLOTNUM
CLC
ADC (DSTPTR),Y
STA (DSTPTR),Y
DEX
BPL SFIXLP
BIT $C08A ; EBABLE ROM
LDA SLOTIDX
LSR
LSR
LSR
LDA SLOTNUM
ASL
TAX
LDA DEV1H,X
CMP #$DE ; GNODEV
@ -183,12 +183,35 @@ DEV2LP: LDA DEVLST,X
ORA #$81
STA DEVLST,X
INC DEVCNT
BNE EXIT
BNE PRSLOT
NXTDEV2:
INX
CPX #14
BNE DEV2LP
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
;*

Binary file not shown.

Binary file not shown.

BIN
share/UTILS.PO Executable file

Binary file not shown.

View File

@ -13,6 +13,8 @@ struct timespec tv;
struct input_event evkey, evrelx, evrely, evsync;
#define PEN_UP 0
#define PEN_DOWN 1
#define PEN_SCALE 3
#define PEN_NOISE 127
#define BTTN_IO 0xC061
#define READGP0 0x320
#define READGP1 0x328
@ -23,7 +25,6 @@ char readgp[] = {
0x98, // TYA
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.
*/
@ -41,7 +42,7 @@ static void sig_bye(int signo)
void main(int argc, char **argv)
{
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];
int pifd = a2open("127.0.0.1");
@ -128,6 +129,8 @@ void main(int argc, char **argv)
a2quickcall(pifd, READGP0, &upx);
a2read(pifd, BTTN_IO, 2, prevbttns);
a2quickcall(pifd, READGP1, &upy);
upx += 2;
upy += 2;
gptoggle = 0;
pen = PEN_UP;
evrelx.value = 0;
@ -141,7 +144,7 @@ void main(int argc, char **argv)
if (gptoggle)
{
a2quickcall(pifd, READGP0, &relx);
if (relx == upx && rely == upy)
if (relx <= upx || rely <= upy)
{
if (pen == PEN_DOWN)
{
@ -150,22 +153,37 @@ void main(int argc, char **argv)
write(joyfd, &evrelx, sizeof(evrelx));
write(joyfd, &evrely, sizeof(evrely));
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;
}
else if (pen == PEN_UP && (relx != upx && rely != upy))
else if (pen == PEN_UP && (relx > upx && rely > upy))
{
pen = PEN_DOWN;
cntrx = relx;
cntry = rely;
downx = cntrx = relx;
downy = cntry = rely;
}
if (pen == PEN_DOWN)
{
evrelx.value = (relx - cntrx);
evrely.value = (rely - cntry);
if (abs(relx - cntrx) < PEN_NOISE && abs(rely - cntry) < PEN_NOISE)
{
evrelx.value = (relx - cntrx) * PEN_SCALE;
evrely.value = (rely - cntry) * PEN_SCALE;
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);
}

View File

@ -1,31 +1,29 @@
#include "a2lib.c"
char online[] = {
// ORG $300
// ORG $301
0x20, 0x00, 0xBF, // JSR $BF00 (PRODOS)
0xC5, // DB ON_LINE
0x08, 0x03, // DW PARAMS
0x60, // RTS
0xEA,
// PARAMS @ $308
0x02, // PARAM_COUNT
0x60, // UNIT_NUM = DRIVE 0, SLOT 6
0x00, 0x20 // DATA_BUFFER = $2000
};
char readblk[] = {
// ORG $300
// ORG $301
0x20, 0x00, 0xBF, // JSR $BF00 (PRODOS)
0x80, // DB READ_BLOCK
0x08, 0x03, // DW PARAMS
0x60, // RTS
0xEA,
// PARAMS @ $308
0x03, // PARAM_COUNT
0x60, // UNIT_NUM = DRIVE 0, SLOT 6
0x00, 0x20, // DATA_BUFFER = $2000
0x00, 0x00 // BLOCK_NUM
};
#define ORG 0x0300
#define ORG 0x0301
#define BLOCK_NUM 0x030C
#define DATA_BUFFER 0x2000
char dsk[280][512];

View File

@ -1,31 +1,29 @@
#include "a2lib.c"
char online[] = {
// ORG $300
// ORG $301
0x20, 0x00, 0xBF, // JSR $BF00 (PRODOS)
0xC5, // DB ON_LINE
0x08, 0x03, // DW PARAMS
0x60, // RTS
0xEA,
// PARAMS @ $308
0x02, // PARAM_COUNT
0x60, // UNIT_NUM = DRIVE 0, SLOT 6
0x00, 0x20 // DATA_BUFFER = $2000
};
char writeblk[] = {
// ORG $300
// ORG $301
0x20, 0x00, 0xBF, // JSR $BF00 (PRODOS)
0x81, // DB WRITE_BLOCK
0x08, 0x03, // DW PARAMS
0x60, // RTS
0xEA,
// PARAMS @ $308
0x03, // PARAM_COUNT
0x60, // UNIT_NUM = DRIVE 0, SLOT 6
0x00, 0x20, // DATA_BUFFER = $2000
0x00, 0x00 // BLOCK_NUM
};
#define ORG 0x0300
#define ORG 0x0301
#define BLOCK_NUM 0x030C
#define DATA_BUFFER 0x2000
char dsk[280][512];