| ... | ... |
@@ -41,14 +41,10 @@ int |
| 41 | 41 |
uxn_eval(Uxn *u, Uint16 pc) |
| 42 | 42 |
{
|
| 43 | 43 |
unsigned int a, b, c, j, k, bs, instr, errcode; |
| 44 |
- unsigned int limit = LIMIT; |
|
| 45 | 44 |
Uint8 kptr, *sp; |
| 46 | 45 |
Stack *src, *dst; |
| 47 |
- if(!pc || u->devold[0].dat[0xf]) return 0; |
|
| 46 |
+ if(!pc || u->dev[0x0f]) return 0; |
|
| 48 | 47 |
while((instr = u->ram[pc++])) {
|
| 49 |
- if(!limit--) {
|
|
| 50 |
- limit = LIMIT; |
|
| 51 |
- } |
|
| 52 | 48 |
/* Return Mode */ |
| 53 | 49 |
if(instr & 0x40) {
|
| 54 | 50 |
src = u->rst; dst = u->wst; |
| ... | ... |
@@ -125,13 +121,3 @@ uxn_boot(Uxn *u, Uint8 *ram, Dei *dei, Deo *deo) |
| 125 | 121 |
u->deo = deo; |
| 126 | 122 |
return 1; |
| 127 | 123 |
} |
| 128 |
- |
|
| 129 |
-Device * |
|
| 130 |
-uxn_port(Uxn *u, Uint8 id, Uint8 (*deifn)(Device *d, Uint8 port), void (*deofn)(Device *d, Uint8 port)) |
|
| 131 |
-{
|
|
| 132 |
- Device *d = &u->devold[id]; |
|
| 133 |
- d->u = u; |
|
| 134 |
- d->dei = deifn; |
|
| 135 |
- d->deo = deofn; |
|
| 136 |
- return d; |
|
| 137 |
-} |
| ... | ... |
@@ -451,12 +451,12 @@ review(char *filename) |
| 451 | 451 |
static void |
| 452 | 452 |
writesym(char *filename) |
| 453 | 453 |
{
|
| 454 |
+ int i; |
|
| 454 | 455 |
char symdst[0x60]; |
| 455 | 456 |
FILE *fp; |
| 456 | 457 |
if(slen(filename) > 0x60 - 5) |
| 457 | 458 |
return; |
| 458 | 459 |
fp = fopen(scat(scpy(filename, symdst, slen(filename) + 1), ".sym"), "w"); |
| 459 |
- int i; |
|
| 460 | 460 |
if(fp != NULL) {
|
| 461 | 461 |
for(i = 0; i < p.llen; i++) {
|
| 462 | 462 |
fwrite(&p.labels[i].addr + 1, 1, 1, fp); |
| ... | ... |
@@ -48,7 +48,7 @@ static SDL_Thread *stdin_thread; |
| 48 | 48 |
|
| 49 | 49 |
/* devices */ |
| 50 | 50 |
|
| 51 |
-static Device *devscreen, *devaudio0; |
|
| 51 |
+static Device *devaudio0; |
|
| 52 | 52 |
static Uint8 zoom = 1; |
| 53 | 53 |
static Uint32 stdin_event, audio0_event; |
| 54 | 54 |
static Uint64 exec_deadline, deadline_interval, ms_interval; |
| ... | ... |
@@ -213,7 +213,6 @@ static void |
| 213 | 213 |
emu_deo(Uxn *u, Uint8 addr, Uint8 v) |
| 214 | 214 |
{
|
| 215 | 215 |
Uint8 p = addr & 0x0f, d = addr & 0xf0; |
| 216 |
- Uint16 mask = 0x1 << (d >> 4); |
|
| 217 | 216 |
u->dev[addr] = v; |
| 218 | 217 |
switch(d) {
|
| 219 | 218 |
case 0x00: |
| ... | ... |
@@ -450,11 +449,10 @@ handle_events(Uxn *u) |
| 450 | 449 |
static int |
| 451 | 450 |
run(Uxn *u) |
| 452 | 451 |
{
|
| 453 |
- Device *devsys = &u->devold[0]; |
|
| 454 | 452 |
Uint64 now = SDL_GetPerformanceCounter(), frame_end, frame_interval = SDL_GetPerformanceFrequency() / 60; |
| 455 | 453 |
for(;;) {
|
| 456 | 454 |
/* .System/halt */ |
| 457 |
- if(devsys->dat[0xf]) |
|
| 455 |
+ if(u->dev[0x0f]) |
|
| 458 | 456 |
return error("Run", "Ended.");
|
| 459 | 457 |
frame_end = now + frame_interval; |
| 460 | 458 |
exec_deadline = now + deadline_interval; |