mirror of https://git.cro.wtf/kip.git
kmm32:remove step
rationale:i was thinking about adding some instructions to disable/enable interrupt vectors but, it's not really necessary to have peripherals running in parallel with the instructions on the CPU, and it simplifies code a lot by assuming they are not
This commit is contained in:
parent
0364947fcd
commit
bbe792d7ae
3
kip.c
3
kip.c
|
@ -1,7 +1,6 @@
|
|||
#include<stdio.h>
|
||||
#include<stdlib.h>
|
||||
#include"kip.h"
|
||||
#define STEP 0x1000
|
||||
IoDevice*ios;
|
||||
|
||||
I main(I ac,IM C*av[]){B*b;W l;FILE*f;
|
||||
|
@ -14,7 +13,7 @@ I main(I ac,IM C*av[]){B*b;W l;FILE*f;
|
|||
#undef X
|
||||
WIF(f,av[1],"rb",fseek(f,0,SEEK_END),l=ftell(f),fseek(f,0,SEEK_SET),b=mk(l+1),fread(b,1,l,f))
|
||||
b[l]=0,lod(b,l),front_init();
|
||||
WH(1,front_events(),emu(STEP),front_redraw())
|
||||
WH(1,front_events(),emu(),front_redraw())
|
||||
kip_deinit();}
|
||||
|
||||
V kip_deinit(V){disk_close(),front_deinit();}
|
||||
|
|
2
kmm32.c
2
kmm32.c
|
@ -64,5 +64,5 @@ _ V(*ops[])(V)=
|
|||
/*0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35*/
|
||||
{np,ex,pb,ph,pw,fb,fh,fw,mb,mh,mw,io,ii,ss,dr,sw,du,ov,ad,su,mu,di,an,or,xr,sl,sr,sa,eq,lt,gt,no,ju,jc,ca,cc};
|
||||
|
||||
V emu(W c){B m,f;while(c--&&ip<0x40000){Q((f=(m=mem[ip++])>>6)&1,swp());ops[0x3f&m]();Q(f&1,swp());}}
|
||||
V emu(V){B m,f;while(ip<0x40000){Q((f=(m=mem[ip++])>>6)&1,swp());ops[0x3f&m]();Q(f&1,swp());}}
|
||||
V lod(B*c,W l){for(ip=0;ip<l;++ip)mem[ip+0x100]=c[ip];ip=0x100;}
|
||||
|
|
Loading…
Reference in New Issue