mirror of
https://git.sr.ht/~rabbits/uxn
synced 2024-11-30 17:53:01 +00:00
Removed peek16
This commit is contained in:
parent
0ee477615b
commit
4789d8ccef
4 changed files with 15 additions and 10 deletions
|
@ -146,7 +146,9 @@ file_deo(Device *d, Uint8 port)
|
|||
{
|
||||
Uint16 a, b, res;
|
||||
switch(port) {
|
||||
case 0x1: d->vector = peek16(d->dat, 0x0); break;
|
||||
case 0x1:
|
||||
DEVPEEK16(d->vector, 0x0);
|
||||
break;
|
||||
case 0x9:
|
||||
DEVPEEK16(a, 0x8);
|
||||
res = file_init(&d->mem[a]);
|
||||
|
|
|
@ -31,8 +31,6 @@ WITH REGARD TO THIS SOFTWARE.
|
|||
#define DEVW(d, x, y) { dev = (d); if(bs) { DEVW8((x), (y) >> 8); DEVW8((x) + 1, (y)); } else { DEVW8((x), (y)) } }
|
||||
#define WARP(x) { if(bs) u->ram.ptr = (x); else u->ram.ptr += (Sint8)(x); }
|
||||
|
||||
Uint16 peek16(Uint8 *m, Uint16 a) { Uint16 r = m[a] << 8; return r + m[a + 1]; }
|
||||
|
||||
int
|
||||
uxn_eval(Uxn *u, Uint16 vec)
|
||||
{
|
||||
|
|
|
@ -48,8 +48,6 @@ typedef struct Uxn {
|
|||
Device dev[16];
|
||||
} Uxn;
|
||||
|
||||
Uint16 peek16(Uint8 *m, Uint16 a);
|
||||
|
||||
int uxn_boot(Uxn *c, Uint8 *memory);
|
||||
int uxn_eval(Uxn *u, Uint16 vec);
|
||||
int uxn_halt(Uxn *u, Uint8 error, char *name, int id);
|
||||
|
|
17
src/uxnemu.c
17
src/uxnemu.c
|
@ -217,13 +217,16 @@ audio_deo(Device *d, Uint8 port)
|
|||
UxnAudio *c = &uxn_audio[d - devaudio0];
|
||||
if(!audio_id) return;
|
||||
if(port == 0xf) {
|
||||
Uint16 addr, adsr;
|
||||
SDL_LockAudioDevice(audio_id);
|
||||
c->len = peek16(d->dat, 0xa);
|
||||
c->addr = &d->mem[peek16(d->dat, 0xc)];
|
||||
DEVPEEK16(adsr, 0x8);
|
||||
DEVPEEK16(c->len, 0xa);
|
||||
DEVPEEK16(addr, 0xc);
|
||||
c->addr = &d->mem[addr];
|
||||
c->volume[0] = d->dat[0xe] >> 4;
|
||||
c->volume[1] = d->dat[0xe] & 0xf;
|
||||
c->repeat = !(d->dat[0xf] & 0x80);
|
||||
audio_start(c, peek16(d->dat, 0x8), d->dat[0xf] & 0x7f);
|
||||
audio_start(c, adsr, d->dat[0xf] & 0x7f);
|
||||
SDL_UnlockAudioDevice(audio_id);
|
||||
SDL_PauseAudioDevice(audio_id, 0);
|
||||
}
|
||||
|
@ -444,8 +447,12 @@ run(Uxn *u)
|
|||
SDL_free(event.drop.file);
|
||||
}
|
||||
/* Audio */
|
||||
else if(event.type >= audio0_event && event.type < audio0_event + POLYPHONY)
|
||||
uxn_eval(u, peek16((devaudio0 + (event.type - audio0_event))->dat, 0));
|
||||
else if(event.type >= audio0_event && event.type < audio0_event + POLYPHONY) {
|
||||
Device *d = devaudio0 + (event.type - audio0_event);
|
||||
Uint16 res;
|
||||
DEVPEEK16(res, 0x00);
|
||||
uxn_eval(u, res);
|
||||
}
|
||||
/* Mouse */
|
||||
else if(event.type == SDL_MOUSEMOTION)
|
||||
mouse_pos(devmouse,
|
||||
|
|
Loading…
Reference in a new issue