From df1041d40431251e22e03ec5c4df7fc5767e1543 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Mon, 17 Aug 2026 16:03:21 +0200 Subject: Add the runrom crate and the vnf library MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The vnf library supports the runrom crate and they both combined enable users to "run" a ROM file. This is basically an emulator, but with two key differences: 1. It is to be run programatically. That is, you are not expected to play games with this, but to run code by steps, start at a given address, run a function, etc. 2. It is headless: there are no graphics displayed on screen, nor sound being delivered. Thus, the target for both these things are developers, not players. This way developers can validate code paths without needing a full blown emulator. You can write tests with this and be able to run some checks as part of your testing infrastructure. Signed-off-by: Miquel Sabaté Solà --- tests/runrom/arithlog.s | 68 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 tests/runrom/arithlog.s (limited to 'tests/runrom') diff --git a/tests/runrom/arithlog.s b/tests/runrom/arithlog.s new file mode 100644 index 0000000..99648cb --- /dev/null +++ b/tests/runrom/arithlog.s @@ -0,0 +1,68 @@ +.segment "HEADER" + .byte 'N', 'E', 'S', $1A + .byte $02, $01 + .byte $00 + .byte $00 + +.segment "CHARS" +.byte 0 + +.segment "VECTORS" + .addr reset, reset, reset + +.segment "CODE" + +reset: + lda #1 + sta $00 + + sec + adc $00 + ldx #$FF + inx + inx + sta $00, x + + clc + adc $00 + sta $02 + + txa + sec + sbc $00 + sta $03 + + sec + rol $03 + sta $04 + + sec + ror $02 + sta $05 + + asl + sta $06 + + ldy #1 + tya + and $00, x + sta $07 + + ora $00 + sta $08 + + inc $00 + eor $00 + sta $09 + + lda #$FF + clc + adc #1 + sta $0A + + lda #$00 + sec + sbc #1 + sta $0B + + rts -- cgit v1.2.3