CARVIEW |
Select Language
HTTP/2 200
date: Wed, 15 Oct 2025 01:43:28 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=90463c32438605631a3308a632668110f2ca8df894012a63752c0d6cea68f6a1a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22vgk_facRdmeU8tIAa7T1Ghjzskeqh5Cc%22%3B%7D; HttpOnly; Path=/
cf-ray: 98eba0314b80c7d3-BLR
C64 NMI Digi player - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- NMI player by Scan/House Designs/DESiRE (Richard Loerakker)
- This is a small example of playing 8-bit samples at 8000Hz using a Commodore 64
- Compile using Kick Assembler (https://www.theweb.dk/KickAssembler/)
- Using Audacity:
- Open some audio file
- Set project frequency at 8000Hz
- Convert audio to mono
- (Apply other fx optionally)
- Select about 6 seconds of data (that's about the most that can fit uncompressed in memory)
- Choose from File menu Export Selected audio
- File type: Other uncompressed files
- Header: RAW (header-less)
- Encoding: Unsigned 8-bit PCM
- References:
- One SID channel digi: https://codebase64.org/doku.php?id=base:vicious_sid_demo_routine_explained
- How I acknowledge and exit NMI: https://codebase64.org/doku.php?id=base:quick_exit_from_interrupt
- Memory map: https://www.awsm.de/mem64/
- Kernal disassembly: https://unusedino.de/ec64/technical/aay/c64/krnromma.htm
- */
- .const samplefile = "carachangren.raw"
- .const NTSCorPAL = $02a6
- .pc = $0801 "Basic UpStart"
- :BasicUpstart2(start)
- .pc = * "Entrypoint"
- start:
- jsr $ff81 // init editor & video chips
- jsr $ff84 // init io, ports & timers
- jsr $ff8a // restore vectors to default
- lda #$00 // turn off screen
- sta $d011
- sei // set interrupt flag
- lda #$35 // turn off basic and kernal rom
- sta $01
- lda #$7f // turn off cia timers
- sta $dc0d
- sta $dd0d
- lda $dc0d // acknowledge possible pending interrupts
- lda $dd0d
- lda $d019
- lda #%00001111 // set generic volume to 15
- sta $d418
- lda #$00 // ADSR voice 3
- sta $d413
- lda #$f0
- sta $d414
- lda #<nmi // set NMI vector
- clc
- adc NTSCorPAL
- sta $fffa
- lda #>nmi
- sta $fffb
- lda #RTI
- sta $dd0c
- lda NTSCorPAL
- bne isPAL
- lda #$81
- bne isNTSC
- isPAL: lda #$7a // set NMI timer to 122 cycles (#$81 for NTSC)
- isNTSC: sta $dd04
- lda #$00
- sta $dd05
- lda #$81 // start the NMI timer
- sta $dd0d
- lda #$01
- sta $dd0e
- cli
- !:
- .label wait = * + 1
- lda #$00 // wait for sample to be finished
- beq !-
- sei
- lda #$37 // turn back on basic and kernal rom
- sta $01
- // wait a little
- ldy #$30
- rep: ldx #$00
- !: dex
- bne !-
- dey
- bne rep
- jmp 64738 // reset
- .pc = * "NMI's"
- nmi:
- nop // wait 6 cycles (otherwise a high-pitched note can be observed)
- nop // (add extra nop for NTSC)
- nop
- nop
- sta $ff
- // this is mostly cut and paste stuff from codebase
- lda #$11 // step 1 (triangle waveform, voice 3 on (ADS cycle)
- sta $d412
- lda #$09 // step 2 & 3 (voice 3 on, disabled, reset noise generator)
- sta $d412
- .label offset = *+1
- lda sample // step 4 (set high byte of frequency with sample data)
- sta $d40f
- lda #$01 // step 5 (voice 3 on, no waveform selected)
- sta $d412
- inc offset
- bne notatend
- inc offset+1
- lda offset+1
- cmp #>end_of_sample
- bne notatend
- inc wait // <- remove this if you want to loop the sample
- lda #>sample
- sta offset+1
- notatend: lda $ff
- jmp $dd0c
- .align 256
- .pc = * "8-bit sample data"
- sample: .import binary samplefile
- .pc = *
- end_of_sample:
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐⭐⭐Exchange Exploit⭐⭐
Java | 2 sec ago | 0.15 KB
-
📝 EASY MONEY GUIDE ✅ Working J
JavaScript | 3 sec ago | 0.25 KB
-
⭐⭐⭐MAKE $900 INSTANTLY⭐⭐
Java | 5 sec ago | 0.15 KB
-
🔥 Exchange profit method
JavaScript | 9 sec ago | 0.24 KB
-
⭐⭐⭐MAKE $9OO INSTANTLY D A⭐⭐
Java | 9 sec ago | 0.15 KB
-
📌 Instant BTC Profit Method ✅ Working 7
JavaScript | 10 sec ago | 0.25 KB
-
⭐⭐⭐Make $15OO in 2O minutesV G⭐⭐
Java | 13 sec ago | 0.15 KB
-
⭐⭐⭐Exploit 500$ in 15 Minutes⭐⭐
Java | 15 sec ago | 0.15 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand