Open blakewford opened 11 years ago
Hi Blake... sorry for the slow replies - I'm working away and have little down time at the moment. Okay, I'm not 100% clear on what the issue is. Please could you email me the ,bytepusher file (markymiddleton@gmail.com) and I'll investigate?
Looking at the spec, the Outer loop says:
BTW if you are into writing virtual machines take a look at the programming contest: http://www.boundvariable.org/task.shtml for an awesome puzzle. This is what got me interested in the whole virtual machine thing. It's a bit awkward to do in java, but in C# I absolutely nailed it. I came up with a really elegant solution. I think a nice solution could be done in Ruby (this'll be my next challenge!). What about an android version ? or even a .bytepusher version!!!
I realized sometime later that my implementation broke the existing roms. This makes me sad, because the work I am doing with BytePusher requires a lot more code than graphics or audio resources. I want the pc to never be arbitrarily reset to 0. I am going to take this up with Javamannen and possibly fork.
Hey man,
So I've been thinking of a way around my blocker, and I'd like the ability to do some DMA in conjunction with the standard Byte Pusher runtime. Any issues with adding a public accessor method to the VM class for the mem block?
Here is my version of BytePusherVM.java
Added ---> private int pc = 0; <--- public BytePusherVM(BytePusherIODriver ioDriver) { this.ioDriver = ioDriver; }
<---Removed line while ((i = rom.read()) != -1) { mem[pc++] = (char)i; } Added --->
pc = getVal(2, 3); <--- }
<----Removed Line int i = 0x10000; while (i-- != 0) { mem[getVal(pc + 3, 3)] = mem[getVal(pc, 3)]; pc = getVal(pc + 6, 3); }
This allows the pc to continue updating after 0x10000 instructions I have an example .bytepusher file, but I cannot find a way to attach it.