repo_id
string
size
int64
file_path
string
content
string
xem/nes
2,397
nes-test-roms/nes_instr_test/source/06-abs_xy.s
;CALIBRATE=1 .include "instr_test.inc" instrs: entry $BD,"LDA a,X" ; AXY = a,XY entry $B9,"LDA a,Y" entry $BC,"LDY a,X" entry $BE,"LDX a,Y" entry $9D,"STA a,X" ; a,XY = A entry $99,"STA a,Y" entry $FE,"INC a,X" ; a,XY = op a,XY entry $DE,"DEC a,X" entry $1E,"ASL a,X" entry $5E,"LSR a,X" entry $3E,"ROL a...
xem/nes
1,442
nes-test-roms/nes_instr_test/source/07-ind_x.s
;CALIBRATE=1 .include "instr_test.inc" instrs: entry $A1,"LDA (z,X)" ; A = (z,X) entry $81,"STA (z,X)" ; (z,X) = A entry $C1,"CMP (z,X)" ; A op (z,X) entry $61,"ADC (z,X)" ; A = A op (z,X) entry $E1,"SBC (z,X)" entry $01,"ORA (z,X)" entry $21,"AND (z,X)" entry $41,"EOR (z,X)" .ifndef OFFICIAL_ONLY entry...
xem/nes
1,510
nes-test-roms/nes_instr_test/source/05-absolute.s
;CALIBRATE=1 .include "instr_test.inc" instrs: entry $AD,"LDA a" ; AXY = a entry $AE,"LDX a" entry $AC,"LDY a" entry $8D,"STA a" ; a = AXY entry $8E,"STX a" entry $8C,"STY a" entry $EE,"INC a" ; a = op a entry $CE,"DEC a" entry $0E,"ASL a" entry $4E,"LSR a" entry $2E,"ROL a" entry $6E,"ROR a" entry ...
xem/nes
1,128
nes-test-roms/nes_instr_test/source/11-special.s
CUSTOM_IRQ=1 .include "shell.inc" irq: pla pha rti jmp_6ff: .byte $6C ; JMP ($6FF) (to avoid warning) .word $6FF main: setb SNDMODE,$40 ; disable frame IRQ set_test 3,"JMP ($6FF) should get high byte from $600" setb $6FF,$F0 setb $600,$07 setb $700,$06 setb $7F0,$E8 ; INX setb $7F1,$60 ; RTS setb $6...
xem/nes
1,565
nes-test-roms/nes_instr_test/source/03-zero_page.s
;CALIBRATE=1 .include "instr_test.inc" instrs: entry $A5,"LDA z" ; AXY = z entry $A6,"LDX z" entry $A4,"LDY z" entry $85,"STA z" ; z = AXY entry $86,"STX z" entry $84,"STY z" entry $E6,"INC z" ; z = op z entry $C6,"DEC z" entry $06,"ASL z" entry $46,"LSR z" entry $26,"ROL z" entry $66,"ROR z" entry ...
xem/nes
1,326
nes-test-roms/nes_instr_test/source/08-ind_y.s
;CALIBRATE=1 .include "instr_test.inc" instrs: entry $B1,"LDA (z),Y" ; A = (z),Y entry $91,"STA (z),Y" ; (z),Y = A entry $D1,"CMP (z),Y" ; A op (z),Y entry $11,"ORA (z),Y" ; A = A op (z),Y entry $F1,"SBC (z),Y" entry $71,"ADC (z),Y" entry $31,"AND (z),Y" entry $51,"EOR (z),Y" .ifndef OFFICIAL_ONLY entry...
xem/nes
1,241
nes-test-roms/nes_instr_test/source/02-immediate.s
;CALIBRATE=1 .include "instr_test.inc" instrs: entry $A9,"LDA #n" ; AXY = #n entry $A2,"LDX #n" entry $A0,"LDY #n" entry $69,"ADC #n" ; A = A op #n entry $E9,"SBC #n" entry $09,"ORA #n" entry $29,"AND #n" entry $49,"EOR #n" entry $C9,"CMP #n" ; AXY op #n entry $E0,"CPX #n" entry $C0,"CPY #n" .ifndef OFF...
xem/nes
1,363
nes-test-roms/nes_instr_test/source/10-stack.s
;CALIBRATE=1 .include "instr_test.inc" instrs: entry $48,"PHA" entry $08,"PHP" entry $68,"PLA" entry $28,"PLP" entry $9A,"TXS" entry $BA,"TSX" instrs_size = * - instrs instr_template: pha jmp instr_done instr_template_size = * - instr_template values2: .byte 0,$FF,$01,$02,$04,$08,$10,$20,$40,$80 values2...
xem/nes
1,886
nes-test-roms/nes_instr_test/source/04-zp_xy.s
;CALIBRATE=1 .include "instr_test.inc" instrs: entry $B5,"LDA z,X" ; AXY = z,XY entry $B4,"LDY z,X" entry $B6,"LDX z,Y" entry $95,"STA z,X" ; z,XY = AXY entry $94,"STY z,X" entry $96,"STX z,Y" entry $F6,"INC z,X" ; z,XY = op z,XY entry $D6,"DEC z,X" entry $16,"ASL z,X" entry $56,"LSR z,X" entry $36,"ROL...
xem/nes
2,073
nes-test-roms/nes_instr_test/source/common/testing.s
; Utilities for writing test ROMs ; In NVRAM so these can be used before initializing runtime, ; then runtime initialized without clearing them nv_res test_code ; code of current test nv_res test_name,2 ; address of name of current test, or 0 of none ; Sets current test code and optional name. Also resets ; checksum...
xem/nes
2,481
nes-test-roms/nes_instr_test/source/common/print.s
; Prints values in various ways to output, ; including numbers and strings. newline = 10 ; Prints indicated register to console as two hex ; chars and space ; Preserved: A, X, Y, flags print_a: php pha print_reg_: jsr print_hex lda #' ' jsr print_char_ pla plp rts print_x: php pha txa jmp print_reg_ pri...
xem/nes
1,322
nes-test-roms/nes_instr_test/source/common/build_rom.s
; Builds program as iNES ROM .if 0 ; Options to set before .include "shell.inc": CHR_RAM=1 ; Use CHR-RAM instead of CHR-ROM CART_WRAM=1 ; Use mapper that supports 8K WRAM in cart CUSTOM_MAPPER=n ; Specify mapper number .endif .ifndef CUSTOM_MAPPER .ifdef CART_WRAM CUSTOM_MAPPER = 2 ; UNROM .else CUSTOM_MAPPER...
xem/nes
3,669
nes-test-roms/nes_instr_test/source/common/console.s
; Scrolling text console with line wrapping, 30x29 characters. ; Buffers lines for speed. Will work even if PPU doesn't ; support scrolling (until text reaches bottom). Keeps border ; along bottom in case TV cuts it off. ; ; Defers most initialization until first newline, at which ; point it clears nametable and makes ...
xem/nes
1,930
nes-test-roms/nes_instr_test/source/common/build_nsf.s
; Builds program as NSF music file .ifndef NSF_SONG_COUNT NSF_SONG_COUNT = 1 .endif .ifndef CUSTOM_NSF_HEADER .segment "HEADER" .byte "NESM",26,1 .byte NSF_SONG_COUNT .byte 1 ; start with first song .word load_addr,reset,nsf_play .endif .segment "DMC" load_addr: .ifndef CUSTOM_NSF_VECTORS .segment "VECT...
xem/nes
1,451
nes-test-roms/nes_instr_test/source/common/text_out.s
; Text output as expanding zero-terminated string at text_out_base ; The final exit result byte is written here final_result = $6000 ; Text output is written here as an expanding ; zero-terminated string text_out_base = $6004 bss_res text_out_temp zp_res text_out_addr,2 init_text_out: ldx #0 ; Executing from $6...
xem/nes
2,104
nes-test-roms/nes_instr_test/source/common/ppu.s
; PPU utilities ; Special tile images tile_blank = 0 tile_color1 = 1 tile_color2 = 2 tile_solid = 3 tile_upper_left = 4 tile_upper_right = 5 tile_lower_left = 6 tile_lower_right = 7 tile_upper_left_lower_right = 8 bss_res ppu_not_present...
xem/nes
5,082
nes-test-roms/nes_instr_test/source/common/shell.s
; Common routines and runtime ; Detect inclusion loops (otherwise ca65 goes crazy) .ifdef SHELL_INCLUDED .error "shell.s included twice" .end .endif SHELL_INCLUDED = 1 ; Number of clocks delay before reset is jumped to .ifndef DEVCART_DELAY DEVCART_DELAY = 0 .endif ;**** Special globals **** ; Temporary variable...
xem/nes
3,443
nes-test-roms/nes_instr_test/source/common/delay.s
; Delays in CPU clocks, milliseconds, etc. All routines are re-entrant ; (no global data). No routines touch X or Y during execution. ; Code generated by macros is relocatable; it contains no JMPs to itself. zp_byte delay_temp_ ; only written to ; Delays n clocks, from 2 to 16777215 ; Preserved: A, X, Y, flags .macro...
xem/nes
2,121
nes-test-roms/nes_instr_test/source/common/instr_test_end.s
zp_byte instrs_idx zp_byte failed_count main: ldx #$A2 txs jsr init_crc_fast ; Test each instruction lda #0 @loop: sta instrs_idx tay jsr reset_crc lda instrs,y jsr test_instr jsr check_result lda instrs_idx clc adc #4 cmp #instrs_size bne @loop lda failed_count jne test_failed jmp tests_...
xem/nes
1,277
nes-test-roms/nes_instr_test/source/common/crc.s
; CRC-32 checksum calculation zp_res checksum,4 zp_byte checksum_temp zp_byte checksum_off_ ; Turns CRC updating on/off. Allows nesting. ; Preserved: A, X, Y crc_off: dec checksum_off_ rts crc_on: inc checksum_off_ beq :+ jpl internal_error ; catch unbalanced crc calls : rts ; Initializes checksum modul...
xem/nes
1,835
nes-test-roms/volume_tests/src/pads.s
; Copyright (c) 2009 Damian Yerrick ; ; This work is provided 'as-is', without any express or implied ; warranty. In no event will the authors be held liable for any ; damages arising from the use of this work. ; ; Permission is granted to anyone to use this work for any ; purpose, including commercial applications, an...
xem/nes
4,397
nes-test-roms/volume_tests/src/sound.s
; Copyright (c) 2009 Damian Yerrick ; ; This work is provided 'as-is', without any express or implied ; warranty. In no event will the authors be held liable for any ; damages arising from the use of this work. ; ; Permission is granted to anyone to use this work for any ; purpose, including commercial applications, an...
xem/nes
2,196
nes-test-roms/volume_tests/src/hello.s
; Copyright (c) 2009 Damian Yerrick ; ; This work is provided 'as-is', without any express or implied ; warranty. In no event will the authors be held liable for any ; damages arising from the use of this work. ; ; Permission is granted to anyone to use this work for any ; purpose, including commercial applications, an...
xem/nes
4,339
nes-test-roms/apu_test/source/7-dmc_basics.s
; Verifies basic DMC operation .include "apu_shell.inc" ; Delays n DMC sample bytes, assuming DMC is running at maximum rate .macro delay_dmc n delay 54*8 * (n) .endmacro main: ; Setup setb chan_bit,$10 ; so should_be_* will work setb $4012,<((dmc_sample-$C000)/$40) setb $4010,$0F delay 428*9 set_test...
xem/nes
1,207
nes-test-roms/apu_test/source/4-jitter.s
; Tests for APU clock jitter. Also tests basic timing of frame irq flag ; since it's needed to determine jitter. .include "shell.inc" ; Returns current jitter in A. Takes an even number of clocks. get_jitter: delay 3 ; make routine an even number of clocks setb SNDMODE,$40 ; clear frame irq flag set...
xem/nes
1,599
nes-test-roms/apu_test/source/1-len_ctr.s
; Tests length counter operation for the four main channels .include "apu_shell.inc" main: test_main_chans test jmp tests_passed test: set_test 2,"Problem with length counter load or $4015" mov $4015,chan_bit ; enable channel setb {$4003,x},len_2 ; load length jsr should_be_playing set_test 3,"Prob...
xem/nes
1,491
nes-test-roms/apu_test/source/5-len_timing.s
; Verifies timing of length counter clocks in both modes .include "apu_shell.inc" main: test_main_chans test_chan jmp tests_passed .macro test len,clk,mode,time jsr sync_apu delay 3 setb {$4003,x},len setb SNDMODE,clk*$C0 ; optionally clock length lda #mode sta SNDMODE ; begin mode delay time-4 lda...
xem/nes
1,852
nes-test-roms/apu_test/source/common/testing.s
; Utilities for writing test ROMs ; In NVRAM so these can be used before initializing runtime, ; then runtime initialized without clearing them nv_res test_code ; code of current test nv_res test_name,2 ; address of name of current test, or 0 of none ; Sets current test code and optional name. Also resets ; checksum...
xem/nes
2,841
nes-test-roms/apu_test/source/common/print.s
; Prints values in various ways to output, ; including numbers and strings. newline = 10 zp_byte print_temp_ ; Prints indicated register to console as two hex ; chars and space ; Preserved: A, X, Y, flags print_a: php pha print_reg_: jsr print_hex lda #' ' jsr print_char_ pla plp rts print_x: php pha txa...
xem/nes
3,089
nes-test-roms/apu_test/source/common/shell_misc.s
; Reports internal error and exits program internal_error: print_str newline,"Internal error" lda #255 jmp exit .import __NVRAM_LOAD__, __NVRAM_SIZE__ .macro fill_ram_ Begin, End ; Simpler to count from negative size up to 0, ; and adjust address downward to compensate ; for initial low byte in Y index .local ...
xem/nes
1,483
nes-test-roms/apu_test/source/common/build_rom.s
; Builds program as iNES ROM ; Default is 32K PRG and 8K CHR ROM, NROM (0) .if 0 ; Options to set before .include "shell.inc": CHR_RAM=1 ; Use CHR-RAM instead of CHR-ROM CART_WRAM=1 ; Use mapper that supports 8K WRAM in cart CUSTOM_MAPPER=n ; Specify mapper number .endif .ifndef CUSTOM_MAPPER .ifdef CART_...
xem/nes
5,404
nes-test-roms/apu_test/source/common/console.s
; Scrolling text console with word wrapping, 30x29 characters. ; ; * Defers PPU initialization until first flush/ newline. ; * Works even if PPU doesn't support scrolling. ; * Keeps border around edge of screen for TV overscan. ; * Requires vertical or single-screen mirroring. ; * Requires ASCII font in CHR. .ifndef C...
xem/nes
1,096
nes-test-roms/apu_test/source/common/text_out.s
; Text output as expanding zero-terminated string at text_out_base ; The final exit result byte is written here final_result = $6000 ; Text output is written here as an expanding ; zero-terminated string text_out_base = $6004 bss_res text_out_temp zp_res text_out_addr,2 init_text_out: ldx #0 ; Put valid data fi...
xem/nes
3,060
nes-test-roms/apu_test/source/common/ppu.s
; PPU utilities bss_res ppu_not_present ; Sets PPUADDR to w ; Preserved: X, Y .macro set_ppuaddr w bit PPUSTATUS setb PPUADDR,>w setb PPUADDR,<w .endmacro ; Delays by no more than n scanlines .macro delay_scanlines n .if CLOCK_RATE <> 1789773 .error "Currently only supports NTSC" .endif delay ((n)*341)/3 .e...
xem/nes
2,698
nes-test-roms/apu_test/source/common/shell.s
; Shell that sets up testing framework and calls main ; Detect inclusion loops (otherwise ca65 goes crazy) .ifdef SHELL_INCLUDED .error "shell.s included twice" .end .endif SHELL_INCLUDED = 1 ; Temporary variables that ANY routine might modify, so ; only use them between routine calls. temp = <$A temp2 = <$B tem...
xem/nes
3,437
nes-test-roms/apu_test/source/common/delay.s
; Delays in CPU clocks, milliseconds, etc. All routines are re-entrant ; (no global data). No routines touch X or Y during execution. ; Code generated by macros is relocatable; it contains no JMPs to itself. zp_byte delay_temp_ ; only written to ; Delays n clocks, from 2 to 16777215 ; Preserved: A, X, Y, flags .macro...
xem/nes
1,632
nes-test-roms/apu_test/source/common/crc.s
; CRC-32 checksum calculation zp_res checksum,4 zp_byte checksum_temp zp_byte checksum_off_ ; Turns CRC updating on/off. Allows nesting. ; Preserved: A, X, Y crc_off: dec checksum_off_ rts crc_on: inc checksum_off_ beq :+ jpl internal_error ; catch unbalanced crc calls : rts ; Initializes checksum modul...
xem/nes
1,061
nes-test-roms/apu_reset/source/4017_written.s
; At power, $4017 = $00. ; At reset, $4017 mode is unchanged, but IRQ inhibit ; flag is sometimes cleared. CUSTOM_RESET=1 .include "shell.inc" .include "run_at_reset.s" nv_res log,4 reset: setb $4015,$01 setb $4000,0 setb $4001,$7F setb $4002,$FF setb $4003,$28 delay 29831*2-5*6-9-7 lda $4015 sta log+0 ...
xem/nes
1,218
nes-test-roms/apu_reset/source/works_immediately.s
; At power and reset, $4017, $4015, and length counters work ; immediately. CUSTOM_RESET=1 .include "shell.inc" .include "run_at_reset.s" nv_res log,4 reset: ; Triangle linear counter setb $4008,$FF setb $4017,$80 setb $4015,$0F ; Setup channels setb $4000,$00 setb $4001,$7F setb $4002,$FF setb $4003,...
xem/nes
1,852
nes-test-roms/apu_reset/source/common/testing.s
; Utilities for writing test ROMs ; In NVRAM so these can be used before initializing runtime, ; then runtime initialized without clearing them nv_res test_code ; code of current test nv_res test_name,2 ; address of name of current test, or 0 of none ; Sets current test code and optional name. Also resets ; checksum...
xem/nes
2,841
nes-test-roms/apu_reset/source/common/print.s
; Prints values in various ways to output, ; including numbers and strings. newline = 10 zp_byte print_temp_ ; Prints indicated register to console as two hex ; chars and space ; Preserved: A, X, Y, flags print_a: php pha print_reg_: jsr print_hex lda #' ' jsr print_char_ pla plp rts print_x: php pha txa...
xem/nes
3,089
nes-test-roms/apu_reset/source/common/shell_misc.s
; Reports internal error and exits program internal_error: print_str newline,"Internal error" lda #255 jmp exit .import __NVRAM_LOAD__, __NVRAM_SIZE__ .macro fill_ram_ Begin, End ; Simpler to count from negative size up to 0, ; and adjust address downward to compensate ; for initial low byte in Y index .local ...
xem/nes
1,483
nes-test-roms/apu_reset/source/common/build_rom.s
; Builds program as iNES ROM ; Default is 32K PRG and 8K CHR ROM, NROM (0) .if 0 ; Options to set before .include "shell.inc": CHR_RAM=1 ; Use CHR-RAM instead of CHR-ROM CART_WRAM=1 ; Use mapper that supports 8K WRAM in cart CUSTOM_MAPPER=n ; Specify mapper number .endif .ifndef CUSTOM_MAPPER .ifdef CART_...
xem/nes
1,118
nes-test-roms/apu_reset/source/common/run_at_reset.s
; Keeps track of number of times reset, and prompts user. power_flag_value = $42 nv_res power_flag_ nv_res num_resets_ ; Out: A = number of times NES has been reset since turned on ; Preserved: X, Y num_resets: lda power_flag_ cmp #power_flag_value bne :+ lda num_resets_ rts : lda #0 rts ; Prompts user...
xem/nes
5,404
nes-test-roms/apu_reset/source/common/console.s
; Scrolling text console with word wrapping, 30x29 characters. ; ; * Defers PPU initialization until first flush/ newline. ; * Works even if PPU doesn't support scrolling. ; * Keeps border around edge of screen for TV overscan. ; * Requires vertical or single-screen mirroring. ; * Requires ASCII font in CHR. .ifndef C...
xem/nes
1,096
nes-test-roms/apu_reset/source/common/text_out.s
; Text output as expanding zero-terminated string at text_out_base ; The final exit result byte is written here final_result = $6000 ; Text output is written here as an expanding ; zero-terminated string text_out_base = $6004 bss_res text_out_temp zp_res text_out_addr,2 init_text_out: ldx #0 ; Put valid data fi...
xem/nes
3,060
nes-test-roms/apu_reset/source/common/ppu.s
; PPU utilities bss_res ppu_not_present ; Sets PPUADDR to w ; Preserved: X, Y .macro set_ppuaddr w bit PPUSTATUS setb PPUADDR,>w setb PPUADDR,<w .endmacro ; Delays by no more than n scanlines .macro delay_scanlines n .if CLOCK_RATE <> 1789773 .error "Currently only supports NTSC" .endif delay ((n)*341)/3 .e...
xem/nes
2,698
nes-test-roms/apu_reset/source/common/shell.s
; Shell that sets up testing framework and calls main ; Detect inclusion loops (otherwise ca65 goes crazy) .ifdef SHELL_INCLUDED .error "shell.s included twice" .end .endif SHELL_INCLUDED = 1 ; Temporary variables that ANY routine might modify, so ; only use them between routine calls. temp = <$A temp2 = <$B tem...
xem/nes
3,437
nes-test-roms/apu_reset/source/common/delay.s
; Delays in CPU clocks, milliseconds, etc. All routines are re-entrant ; (no global data). No routines touch X or Y during execution. ; Code generated by macros is relocatable; it contains no JMPs to itself. zp_byte delay_temp_ ; only written to ; Delays n clocks, from 2 to 16777215 ; Preserved: A, X, Y, flags .macro...
xem/nes
1,632
nes-test-roms/apu_reset/source/common/crc.s
; CRC-32 checksum calculation zp_res checksum,4 zp_byte checksum_temp zp_byte checksum_off_ ; Turns CRC updating on/off. Allows nesting. ; Preserved: A, X, Y crc_off: dec checksum_off_ rts crc_on: inc checksum_off_ beq :+ jpl internal_error ; catch unbalanced crc calls : rts ; Initializes checksum modul...
xem/nes
9,413
nes-test-roms/spritecans-2011/src/sprite.s
; ; sprite.asm ; 64 Sprite Cans intro for NES ; Copyright 2000-2011 Damian Yerrick ;;; Copyright (C) 2000-2011 Damian Yerrick ; ; This program is free software; you can redistribute it and/or ; modify it under the terms of the GNU General Public License ; as published by the Free Software Foundation; either vers...
xem/nes
2,026
nes-test-roms/spritecans-2011/src/paldetect.s
; ; NES TV system detection code ; Copyright 2011 Damian Yerrick ; ; Copying and distribution of this file, with or without ; modification, are permitted in any medium without royalty ; provided the copyright notice and this notice are preserved. ; This file is offered as-is, without any warranty. ; .export getTVSystem...
xem/nes
6,765
nes-test-roms/spritecans-2011/src/music.s
; music.s ; part of sound engine for LJ65 ;;; Copyright (C) 2009-2011 Damian Yerrick ; ; This program is free software; you can redistribute it and/or ; modify it under the terms of the GNU General Public License ; as published by the Free Software Foundation; either version 3 ; of the License, or (at your opt...
xem/nes
7,092
nes-test-roms/spritecans-2011/src/sound.s
; sound.s ; part of sound engine for LJ65 ;;; Copyright (C) 2009-2011 Damian Yerrick ; ; This program is free software; you can redistribute it and/or ; modify it under the terms of the GNU General Public License ; as published by the Free Software Foundation; either version 3 ; of the License, or (at your opt...
xem/nes
6,300
nes-test-roms/spritecans-2011/src/musicseq.s
; ; Music sequence data for Sprite Cans Demo ; Copyright 2010 Damian Yerrick ; Copyright 1984 Ray Lynch ; ; To the extent permitted by law, copying and distribution of this ; file, with or without modification, are permitted in any medium ; without royalty provided the copyright notice and this notice are ; preserved i...
xem/nes
1,282
nes-test-roms/instr_test-v3/source/01-implied.s
.include "instr_test.inc" instrs: entry $2A,"ROL A" ; A = op A entry $0A,"ASL A" entry $6A,"ROR A" entry $4A,"LSR A" entry $8A,"TXA" ; AXY = AXY entry $98,"TYA" entry $AA,"TAX" entry $A8,"TAY" entry $E8,"INX" ; XY = op XY entry $C8,"INY" entry $CA,"DEX" entry $88,"DEY" entry $38,"SEC" ; flags = op fl...
xem/nes
2,384
nes-test-roms/instr_test-v3/source/06-abs_xy.s
.include "instr_test.inc" instrs: entry $BD,"LDA a,X" ; AXY = a,XY entry $B9,"LDA a,Y" entry $BC,"LDY a,X" entry $BE,"LDX a,Y" entry $9D,"STA a,X" ; a,XY = A entry $99,"STA a,Y" entry $FE,"INC a,X" ; a,XY = op a,XY entry $DE,"DEC a,X" entry $1E,"ASL a,X" entry $5E,"LSR a,X" entry $3E,"ROL a,X" entry $7...
xem/nes
1,538
nes-test-roms/instr_test-v3/source/07-ind_x.s
.include "instr_test.inc" instrs: entry $A1,"LDA (z,X)" ; A = (z,X) entry $81,"STA (z,X)" ; (z,X) = A entry $C1,"CMP (z,X)" ; A op (z,X) entry $61,"ADC (z,X)" ; A = A op (z,X) entry $E1,"SBC (z,X)" entry $01,"ORA (z,X)" entry $21,"AND (z,X)" entry $41,"EOR (z,X)" .ifndef OFFICIAL_ONLY entry $03,"SLO (z,...
xem/nes
1,497
nes-test-roms/instr_test-v3/source/05-absolute.s
.include "instr_test.inc" instrs: entry $AD,"LDA a" ; AXY = a entry $AE,"LDX a" entry $AC,"LDY a" entry $8D,"STA a" ; a = AXY entry $8E,"STX a" entry $8C,"STY a" entry $EE,"INC a" ; a = op a entry $CE,"DEC a" entry $0E,"ASL a" entry $4E,"LSR a" entry $2E,"ROL a" entry $6E,"ROR a" entry $6D,"ADC a" ;...
xem/nes
1,552
nes-test-roms/instr_test-v3/source/03-zero_page.s
.include "instr_test.inc" instrs: entry $A5,"LDA z" ; AXY = z entry $A6,"LDX z" entry $A4,"LDY z" entry $85,"STA z" ; z = AXY entry $86,"STX z" entry $84,"STY z" entry $E6,"INC z" ; z = op z entry $C6,"DEC z" entry $06,"ASL z" entry $46,"LSR z" entry $26,"ROL z" entry $66,"ROR z" entry $65,"ADC z" ;...
xem/nes
1,313
nes-test-roms/instr_test-v3/source/08-ind_y.s
.include "instr_test.inc" instrs: entry $B1,"LDA (z),Y" ; A = (z),Y entry $91,"STA (z),Y" ; (z),Y = A entry $D1,"CMP (z),Y" ; A op (z),Y entry $11,"ORA (z),Y" ; A = A op (z),Y entry $F1,"SBC (z),Y" entry $71,"ADC (z),Y" entry $31,"AND (z),Y" entry $51,"EOR (z),Y" .ifndef OFFICIAL_ONLY entry $13,"SLO (z)...
xem/nes
1,128
nes-test-roms/instr_test-v3/source/15-special.s
CUSTOM_IRQ=1 .include "shell.inc" irq: pla pha rti jmp_6ff: .byte $6C ; JMP ($6FF) (to avoid warning) .word $6FF main: setb SNDMODE,$40 ; disable frame IRQ set_test 3,"JMP ($6FF) should get high byte from $600" setb $6FF,$F0 setb $600,$07 setb $700,$06 setb $7F0,$E8 ; INX setb $7F1,$60 ; RTS setb $6...
xem/nes
1,228
nes-test-roms/instr_test-v3/source/02-immediate.s
.include "instr_test.inc" instrs: entry $A9,"LDA #n" ; AXY = #n entry $A2,"LDX #n" entry $A0,"LDY #n" entry $69,"ADC #n" ; A = A op #n entry $E9,"SBC #n" entry $09,"ORA #n" entry $29,"AND #n" entry $49,"EOR #n" entry $C9,"CMP #n" ; AXY op #n entry $E0,"CPX #n" entry $C0,"CPY #n" .ifndef OFFICIAL_ONLY e...
xem/nes
1,350
nes-test-roms/instr_test-v3/source/10-stack.s
.include "instr_test.inc" instrs: entry $48,"PHA" entry $08,"PHP" entry $68,"PLA" entry $28,"PLP" entry $9A,"TXS" entry $BA,"TSX" instrs_size = * - instrs instr_template: pha jmp instr_done instr_template_size = * - instr_template values2: .byte 0,$FF,$01,$02,$04,$08,$10,$20,$40,$80 values2_size = * - v...
xem/nes
1,873
nes-test-roms/instr_test-v3/source/04-zp_xy.s
.include "instr_test.inc" instrs: entry $B5,"LDA z,X" ; AXY = z,XY entry $B4,"LDY z,X" entry $B6,"LDX z,Y" entry $95,"STA z,X" ; z,XY = AXY entry $94,"STY z,X" entry $96,"STX z,Y" entry $F6,"INC z,X" ; z,XY = op z,XY entry $D6,"DEC z,X" entry $16,"ASL z,X" entry $56,"LSR z,X" entry $36,"ROL z,X" entry ...
xem/nes
1,875
nes-test-roms/instr_test-v3/source/common/testing.s
; Utilities for writing test ROMs ; In NVRAM so these can be used before initializing runtime, ; then runtime initialized without clearing them nv_res test_code ; code of current test nv_res test_name,2 ; address of name of current test, or 0 of none ; Sets current test code and optional name. Also resets ; checksum...
xem/nes
3,234
nes-test-roms/instr_test-v3/source/common/print.s
; Prints values in various ways to output, ; including numbers and strings. newline = 10 zp_byte print_temp_ ; Prints indicated register to console as two hex ; chars and space ; Preserved: A, X, Y, flags print_a: php pha print_reg_: jsr print_hex lda #' ' jsr print_char_ pla plp rts print_x: php pha txa...
xem/nes
5,224
nes-test-roms/instr_test-v3/source/common/crc_fast.s
; Fast table-based CRC-32 ; Initializes fast CRC tables and resets checksum. ; Preserved: Y init_crc_fast = reset_crc ; Updates checksum with byte from A ; Preserved: X, Y ; Time: 54 clocks update_crc_fast: stx checksum_temp ; Updates checksum with byte from A ; Preserved: Y ; Time: 42 clocks .macro update_crc_fast...
xem/nes
3,456
nes-test-roms/instr_test-v3/source/common/shell_misc.s
; Reports internal error and exits program internal_error: assert_failed: pla tay pla init_cpu_regs print_str newline,"internal error, PC=" jsr print_hex jsr print_y lda #255 jmp exit .import __NVRAM_LOAD__, __NVRAM_SIZE__ .macro fill_ram_ Begin, End ; Simpler to count from negative size up to 0, ; and adj...
xem/nes
2,088
nes-test-roms/instr_test-v3/source/common/build_rom.s
; Builds program as iNES ROM ; Default is 32K PRG and 8K CHR ROM, NROM (0) ; CHR_RAM selects UNROM (2) ; CART_WRAM selects MMC1 (1) .if 0 ; Options to set before .include "shell.inc": CHR_RAM = 1 ; Use CHR-RAM instead of CHR-ROM CART_WRAM = 1 ; Use mapper that supports 8K WRAM in cart MAPPER = n ; Specify ...
xem/nes
5,438
nes-test-roms/instr_test-v3/source/common/console.s
; Scrolling text console with word wrapping, 30x29 characters. ; ; * Defers PPU initialization until first flush/ newline. ; * Works even if PPU doesn't support scrolling. ; * Keeps border around edge of screen for TV overscan. ; * Requires vertical or single-screen mirroring. ; * Requires ASCII font in CHR. .ifndef C...
xem/nes
1,096
nes-test-roms/instr_test-v3/source/common/text_out.s
; Text output as expanding zero-terminated string at text_out_base ; The final exit result byte is written here final_result = $6000 ; Text output is written here as an expanding ; zero-terminated string text_out_base = $6004 bss_res text_out_temp zp_res text_out_addr,2 init_text_out: ldx #0 ; Put valid data fi...
xem/nes
3,100
nes-test-roms/instr_test-v3/source/common/ppu.s
; PPU utilities bss_res ppu_not_present ; Sets PPUADDR to w ; Preserved: X, Y .macro set_ppuaddr w bit PPUSTATUS setb PPUADDR,>w setb PPUADDR,<w .endmacro ; Delays by no more than n scanlines .macro delay_scanlines n .if CLOCK_RATE <> 1789773 .error "Currently only supports NTSC" .endif delay ((n)*341)/3 .e...
xem/nes
2,752
nes-test-roms/instr_test-v3/source/common/shell.s
; Shell that sets up testing framework and calls main ; Detect inclusion loops (otherwise ca65 goes crazy) .ifdef SHELL_INCLUDED .error "shell.s included twice" .end .endif SHELL_INCLUDED = 1 ; Temporary variables that ANY routine might modify, so ; only use them between routine calls. temp = <$A temp2 = <$B tem...
xem/nes
3,734
nes-test-roms/instr_test-v3/source/common/delay.s
; Delays in CPU clocks, milliseconds, etc. All routines are re-entrant ; (no global data). No routines touch X or Y during execution. ; Code generated by macros is relocatable; it contains no JMPs to itself. zp_res delay_temp_ ; only written to ; Delays n clocks, from 2 to 16777215 ; Preserved: A, X, Y, flags .macro ...
xem/nes
2,410
nes-test-roms/instr_test-v3/source/common/instr_test_end.s
; Offset of current instruction zp_byte instrs_idx zp_byte failed_count main: ; Stack slightly lower than top ldx #$A2 txs jsr init_crc_fast ; Test each instruction lda #0 @loop: sta instrs_idx tay jsr reset_crc lda instrs,y jsr test_instr jsr check_result lda instrs_idx clc adc #4 cmp #instrs...
xem/nes
1,600
nes-test-roms/instr_test-v3/source/common/crc.s
; CRC-32 checksum calculation zp_res checksum,4 ; Current CRC-32; no need to invert zp_byte checksum_temp zp_byte checksum_off_ ; Turns CRC updating on/off. Allows nesting. ; Preserved: A, X, Y crc_off: dec checksum_off_ rts crc_on: inc checksum_off_ beq :+ jpl internal_error ; catch unbalanced crc calls :...
xem/nes
1,111
nes-test-roms/dmc_dma_during_read4/source/double_2007_read.s
; Double read of $2007 sometimes ignores extra ; read, and puts odd things into buffer. ; ; Output (depends on CPU-PPU synchronization): ;22 33 44 55 66 ;22 44 55 66 77 or ;22 33 44 55 66 or ;02 44 55 66 77 or ;32 44 55 66 77 or ;85CFD627 or F018C287 or 440EF923 or E52F41A5 CHR_RAM=1 .include "shell.inc" begin: ...
xem/nes
1,059
nes-test-roms/dmc_dma_during_read4/source/read_write_2007.s
; Read of $2007 just before write behaves normally. ; ; Output: ;33 11 22 33 09 55 66 77 ;33 11 22 33 09 55 66 77 CHR_RAM=1 .include "shell.inc" begin: ; Disable PPU jsr wait_vbl lda #0 sta PPUMASK ; Fill VRAM with $11 22 33 44 55 66 77 lda #0 sta PPUADDR sta P...
xem/nes
1,157
nes-test-roms/dmc_dma_during_read4/source/dma_2007_read.s
; DMC DMA during $2007 read causes 2-3 extra $2007 ; reads before real read. ; ; Number of extra reads depends in CPU-PPU ; synchronization at reset. ; ; Output: ;11 22 ;11 22 ;33 44 or 44 55 ;11 22 ;11 22 ;159A7A8F or 5E3DF9C4 iter = 5 ; how many times the test is run time = 14 ; adjusts time of first DMA dma ...
xem/nes
1,221
nes-test-roms/dmc_dma_during_read4/source/dma_2007_write.s
; DMC DMA during $2007 write has no effect. ; ; Output: ;22 11 22 AA 44 55 66 77 ;22 11 22 AA 44 55 66 77 ;22 11 22 AA 44 55 66 77 ;22 11 22 AA 44 55 66 77 ;22 11 22 AA 44 55 66 77 iter = 5 ; how many times the test is run time = 11 ; adjusts time of first DMA dma = 1 ; set to 0 to disable DMA .include "co...
xem/nes
2,223
nes-test-roms/dmc_dma_during_read4/source/common/testing.s
; Utilities for writing test ROMs zp_res test_code,1 ; code of current test zp_res test_name,2 ; address of name of current test, or 0 of none ; Reports that all tests passed tests_passed: .if !BUILD_MULTI jsr print_filename print_str "Passed" .endif lda #0 jmp exit ; Reports that the current test failed. Pr...
xem/nes
2,326
nes-test-roms/dmc_dma_during_read4/source/common/print.s
; Prints values in various ways to output, including numbers and strings. newline = 10 ; Prints indicated register to console as two hex chars and space ; Preserved: A, X, Y, P print_a: php pha print_reg_: jsr print_hex lda #' ' jsr print_char_ pla plp rts print_x: php pha txa jmp print_reg_ print_y: p...
xem/nes
3,161
nes-test-roms/dmc_dma_during_read4/source/common/console.s
; Scrolling text console with line wrapping, 30x30 characters. ; Buffers lines for speed. Will work even if PPU doesn't ; support scrolling (until text reaches bottom). ; ** ASCII font must already be in CHR, and mirroring ; must be vertical or single-screen. ; Number of characters of margin on left and right, to avoi...
xem/nes
2,604
nes-test-roms/dmc_dma_during_read4/source/common/sync_dmc.s
; Synchronizes to DMC and times a piece of code ; Synchronizes precisely with DMC timer ; Preserved: X, Y ; Time: 8 msec avg, 17 msec max .align 64 sync_dmc: ; Setup lda #$80 sta $4010 lda #0 sta $4013 sta SNDCHN ; Start twice (first will clear immediately) lda #$...
xem/nes
2,505
nes-test-roms/dmc_dma_during_read4/source/common/delay.s
; Delays in clocks and milliseconds. All routines re-entrant ; (no global data). ; Delays n milliseconds (1/1000 second) ; n can range from 0 to 1100. ; Preserved: X, Y .macro delay_msec n .if (n) < 0 .or (n) > 1100 .error "time out of range" .endif delay ((n)*CLOCK_RATE+500)/1000 .endmacro ; Delays n m...
xem/nes
1,260
nes-test-roms/dmc_dma_during_read4/source/common/crc.s
; CRC-32 checksum calculation zp_res checksum,4 zp_byte checksum_temp zp_byte checksum_off_ ; Turns CRC updating on/off. Allows nesting. ; Preserved: X, Y crc_off: dec checksum_off_ rts crc_on: inc checksum_off_ beq :+ jpl internal_error ; catch unbalanced crc calls : rts ; Initializes checksum module. ...
xem/nes
1,856
nes-test-roms/oam_read/source/common/testing.s
; Utilities for writing test ROMs ; In NVRAM so these can be used before initializing runtime, ; then runtime initialized without clearing them nv_res test_code ; code of current test nv_res test_name,2 ; address of name of current test, or 0 of none ; Sets current test code and optional name. Also resets ; checksum...
xem/nes
2,583
nes-test-roms/oam_read/source/common/print.s
; Prints values in various ways to output, ; including numbers and strings. newline = 10 zp_byte print_temp_ ; Prints indicated register to console as two hex ; chars and space ; Preserved: A, X, Y, flags print_a: php pha print_reg_: jsr print_hex lda #' ' jsr print_char_ pla plp rts print_x: php pha txa...
xem/nes
1,480
nes-test-roms/oam_read/source/common/build_rom.s
; Builds program as iNES ROM ; Default is 16K PRG and 8K CHR ROM, NROM (0) .if 0 ; Options to set before .include "shell.inc": CHR_RAM=1 ; Use CHR-RAM instead of CHR-ROM CART_WRAM=1 ; Use mapper that supports 8K WRAM in cart CUSTOM_MAPPER=n ; Specify mapper number .endif .ifndef CUSTOM_MAPPER .ifdef CART_...
xem/nes
3,732
nes-test-roms/oam_read/source/common/console.s
; Scrolling text console with line wrapping, 30x29 characters. ; Buffers lines for speed. Will work even if PPU doesn't ; support scrolling (until text reaches bottom). Keeps border ; along bottom in case TV cuts it off. ; ; Defers most initialization until first newline, at which ; point it clears nametable and makes ...
xem/nes
1,096
nes-test-roms/oam_read/source/common/text_out.s
; Text output as expanding zero-terminated string at text_out_base ; The final exit result byte is written here final_result = $6000 ; Text output is written here as an expanding ; zero-terminated string text_out_base = $6004 bss_res text_out_temp zp_res text_out_addr,2 init_text_out: ldx #0 ; Put valid data fi...
xem/nes
1,824
nes-test-roms/oam_read/source/common/ppu.s
; PPU utilities bss_res ppu_not_present ; Sets PPUADDR to w ; Preserved: X, Y .macro set_ppuaddr w bit PPUSTATUS setb PPUADDR,>w setb PPUADDR,<w .endmacro ; Delays by no more than n scanlines .macro delay_scanlines n .if CLOCK_RATE <> 1789773 .error "Currently only supports NTSC" .endif delay ((n)*341)/3 .e...
xem/nes
4,636
nes-test-roms/oam_read/source/common/shell.s
; Common routines and runtime ; Detect inclusion loops (otherwise ca65 goes crazy) .ifdef SHELL_INCLUDED .error "shell.s included twice" .end .endif SHELL_INCLUDED = 1 ;**** Special globals **** ; Temporary variables that ANY routine might modify, so ; only use them between routine calls. temp = <$A temp2 = <$B...
xem/nes
3,437
nes-test-roms/oam_read/source/common/delay.s
; Delays in CPU clocks, milliseconds, etc. All routines are re-entrant ; (no global data). No routines touch X or Y during execution. ; Code generated by macros is relocatable; it contains no JMPs to itself. zp_byte delay_temp_ ; only written to ; Delays n clocks, from 2 to 16777215 ; Preserved: A, X, Y, flags .macro...
xem/nes
1,632
nes-test-roms/oam_read/source/common/crc.s
; CRC-32 checksum calculation zp_res checksum,4 zp_byte checksum_temp zp_byte checksum_off_ ; Turns CRC updating on/off. Allows nesting. ; Preserved: A, X, Y crc_off: dec checksum_off_ rts crc_on: inc checksum_off_ beq :+ jpl internal_error ; catch unbalanced crc calls : rts ; Initializes checksum modul...
xem/nes
2,037
nes-test-roms/instr_misc/source/03-dummy_reads.s
; Tests some instructions that do dummy reads before the real read/write. ; Doesn't test all instructions. ; ; Tests LDA and STA with modes (ZP,X), (ZP),Y and ABS,X ; Dummy reads for the following cases are tested: ; ; LDA ABS,X or (ZP),Y when carry is generated from low byte ; STA ABS,X or (ZP),Y ; ROL ABS,X always ....
xem/nes
1,931
nes-test-roms/instr_misc/source/04-dummy_reads_apu.s
; Tests dummy reads for (hopefully) ALL instructions which do them, ; including unofficial ones. Prints opcode(s) of failed ; instructions. Requires that APU implement $4015 IRQ flag reading. .include "shell.inc" zp_byte opcode zp_byte errors begin: setb SNDMODE,0 lda SNDCHN delay 30000 setw addr,SNDCHN+3 rts ...
xem/nes
1,856
nes-test-roms/instr_misc/source/common/testing.s
; Utilities for writing test ROMs ; In NVRAM so these can be used before initializing runtime, ; then runtime initialized without clearing them nv_res test_code ; code of current test nv_res test_name,2 ; address of name of current test, or 0 of none ; Sets current test code and optional name. Also resets ; checksum...
xem/nes
2,660
nes-test-roms/instr_misc/source/common/print.s
; Prints values in various ways to output, ; including numbers and strings. newline = 10 zp_byte print_temp_ ; Prints indicated register to console as two hex ; chars and space ; Preserved: A, X, Y, flags print_a: php pha print_reg_: jsr print_hex lda #' ' jsr print_char_ pla plp rts print_x: php pha txa...