Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Jessica Hawkwell
/
kcpu
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 88a0a581
authored
Oct 01, 2017
by
Jessica Hawkwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed some broken things
1 parent
78af4d11
Pipeline
#212
passed
in 1 minute 6 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
10 deletions
pom.xml
src/main/java/me/felinewith/kcpu/KBoard.java
src/main/java/me/felinewith/kcpu/Kcpu.java
src/main/java/me/felinewith/kcpu/util/HardwareMemIrq.java
src/main/java/me/felinewith/kcpu/util/HardwareRecvIrq.java
pom.xml
View file @
88a0a58
...
...
@@ -186,6 +186,10 @@
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-dependency-plugin
</artifactId>
<version>
3.0.1
</version>
<configuration>
<excludeScope>
test
</excludeScope>
<includeScope>
compile
</includeScope>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
...
...
src/main/java/me/felinewith/kcpu/KBoard.java
View file @
88a0a58
...
...
@@ -81,12 +81,14 @@ public class KBoard extends BaseDevice implements IMemory {
@Override
public
void
memIrq
(
short
addr
,
byte
irq
)
{
short
dev
=
checkDevice
(
addr
);
short
rdev
=
(
short
)(
0x0f
&
dev
);
StackTraceElement
ste
=
Thread
.
currentThread
().
getStackTrace
()[
1
];
StackTraceElement
[]
stes
=
Thread
.
currentThread
().
getStackTrace
();
StackTraceElement
ste
=
stes
[
2
];
String
className
=
ste
.
getClassName
();
System
.
err
.
format
(
"\t\t%s\n"
,
ste
.
getClassName
());
int
sendIrq
=
16
;
int
a
;
for
(
a
=
0
;
a
<
16
;
a
++)
{
if
(
devices
[
a
].
getClass
().
getCanonicalName
().
equals
(
className
))
{
if
(
(
devices
[
a
]
!=
null
)
&&
devices
[
a
].
getClass
().
getCanonicalName
().
equals
(
className
))
{
sendIrq
=
a
;
break
;
}
...
...
src/main/java/me/felinewith/kcpu/Kcpu.java
View file @
88a0a58
...
...
@@ -127,11 +127,6 @@ public class Kcpu extends BaseDevice {
log
(
"%04x : [%10s] %04x ->"
,
pc
,
((
od
==
null
)?
"nop"
:
od
.
name
()),
ref
);
log
(
" %04x %04x %04x %04x "
,
registers
[
0
],
registers
[
1
],
registers
[
2
],
registers
[
3
]);
// bring up the program counter
if
(
od
==
null
)
{
pc
+=
12
;
return
;
}
// inc if nop
pc
+=
4
;
pc
+=
(((
0x0700
&
ref
)
>>
8
)
*
2
);
// this works because the value starts counting at 1
switch
(
0x0700
&
ref
)
{
case
0x0000
:
ref
+=
ValueType
.
R
.
getValue
();
...
...
@@ -144,7 +139,16 @@ public class Kcpu extends BaseDevice {
if
((
0x0700
&
ref
)
>=
0x0200
)
{
log
(
" %2s.%04x"
,
ValueType
.
valueOf
(
ref
,
1
),
values
[
1
]);
}
if
((
0x0700
&
ref
)
>=
0x0300
)
{
log
(
" %2s.%04x"
,
ValueType
.
valueOf
(
ref
,
2
),
values
[
2
]);
}
if
((
0x0700
&
ref
)
>=
0x0400
)
{
log
(
" %2s.%04x"
,
ValueType
.
valueOf
(
ref
,
3
),
values
[
3
]);
}
logln
(
""
);
// bring up the program counter
if
(
od
==
null
)
{
pc
+=
12
;
// inc if nop
logln
(
"\t[X]"
);
return
;
}
else
{
logln
(
""
);
}
pc
+=
4
;
pc
+=
(((
0x0700
&
ref
)
>>
8
)
*
2
);
if
(
od
.
hasHandler
()
)
{
registers
=
od
.
call
(
pc
,
ref
,
registers
,
values
,
kboard
);
...
...
src/main/java/me/felinewith/kcpu/util/HardwareMemIrq.java
View file @
88a0a58
...
...
@@ -19,7 +19,7 @@ public class HardwareMemIrq extends TimerTask {
i
=
irq
;
}
@Override
public
void
run
()
{
Thread
.
currentThread
().
setName
(
String
.
format
(
"memIRQ-%02x
-%x"
,
id
,
Thread
.
currentThread
().
getId
()
));
Thread
.
currentThread
().
setName
(
String
.
format
(
"memIRQ-%02x
_%04x-%x"
,
i
,
a
,
Thread
.
currentThread
().
getId
()
));
id
.
memIrq
(
a
,
i
);
}
}
src/main/java/me/felinewith/kcpu/util/HardwareRecvIrq.java
View file @
88a0a58
...
...
@@ -17,7 +17,7 @@ public class HardwareRecvIrq extends TimerTask {
i
=
irq
;
}
@Override
public
void
run
()
{
Thread
.
currentThread
().
setName
(
String
.
format
(
"recvIRQ-%02x
_%02x-%x"
,
id
,
i
,
Thread
.
currentThread
().
getId
()
));
Thread
.
currentThread
().
setName
(
String
.
format
(
"recvIRQ-%02x
-%x"
,
i
,
Thread
.
currentThread
().
getId
()
));
id
.
recvIrq
(
i
);
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment