Skip to content

Instantly share code, notes, and snippets.

* Reads a ROM file and returns a vector containing
* its bytes if successful. Otherwise an error string
* if the file is too large or IoError is raised */
fn read_rom(file_path: String) -> Result<Vec<u8>,String> {
match File::open(&Path::new(file_path)).read_to_end() {
Ok(rom_contents) => {
/* Programs start at address 0x200, in original implementation
* 0x000 - 0x1FF reserved for VM, just pad start of mem with
import java.util.Random;
public class BirthdaySimulation
{
public static void main(String [] args) {
Random rand = new Random();
int month = rand.nextInt(12);
int day = getDayInMonth(month);
@RossMeikleham
RossMeikleham / VMU Flash Memory Specification
Last active January 30, 2023 19:32
VMU Flash Memory Specification
Copied from http://mc.pp.se/dc/vms/flashmem.html
VMS Flashrom
The VMS flash memory contains 128 kilobytes of storage. These are divided into 256 blocks of 512 bytes each. Of these blocks, 200 are available for user files. The rest of the blocks contain filesystem information, or are simply not used at all.
The allocation of the 256 blocks is as follows:
0
.
.
.
@RossMeikleham
RossMeikleham / gist:7770485
Created December 3, 2013 14:57
Robolectric and ActiveAndroid SQL exception
java.lang.RuntimeException: java.lang.RuntimeException: SQL exception in endTransaction
at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:231)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)