Skip to content

Instantly share code, notes, and snippets.

@blondie7575
Created March 12, 2013 23:49
Show Gist options
  • Save blondie7575/5148152 to your computer and use it in GitHub Desktop.
Save blondie7575/5148152 to your computer and use it in GitHub Desktop.
; Name: VeronicaROM.s
; Author: Quinn Dunki
; Copyright: ©2012 Quinn Dunki
; License: All Rights Reserved
;
; 6052 code for Veronica's main system ROM
; For details, see http://www.quinndunki.com/blondihacks
;
; Zero Page:
; $00..$01: Subroutine parameter 1
; $10..$11: Scratch
.org $f000
ramCheck:
lda #$01 ; Clear screen
sta $efff
lda #$00
sta $efff
lda #<prompt ; Show prompt
sta $00
lda #>prompt
sta $01
jsr printStr
lda #$00 ; Initialize test address
sta $00
lda #$02
sta $01
loop:
ldy #$00 ; Store and retrieve the test value
lda #$42
sta ($00),y
lda #$00
lda ($00),y
cmp #$42
beq goodChar
lda #$03
sta $efff
lda #$58
sta $efff
jmp next
goodChar:
lda #$03
sta $efff
lda #$4F
sta $efff
next:
inc $00 ; Increment the 16-bit test address
bne checkForDone
inc $01
checkForDone:
lda $01
cmp #$df ; Have we reached the last address?
bne loop
lda $00
cmp #$ff
bne loop
jmp spinlock
success:
lda #$01
sta $efff
lda #$24
sta $efff
jmp spinlock
fail:
lda #$01
sta $efff
lda #$30
sta $efff
jmp spinlock
spinlock:
jmp spinlock
printStr: ; Args: Address of string to print
ldy #$00
printStrLoop:
lda ($00),y ; Render the next character
beq printStrNull
tax
lda #$03
sta $efff
txa
sta $efff
inc $00 ; Increment pointer
bne printStrLoop
inc $01
jmp printStrLoop
printStrNull:
rts
prompt:
.byte "VERONICA RAM CHECK ",$00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment