-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Newbie issue #2
Comments
Test so far can generate some nes and move to fceux/wine64 ... still not sure what I am doing as no simple step-by-step, guess that is not the purpose of this hack ... ; not for m1 so far !!!! ; hence no sdl2; not sure why I add these into how-to-run this system though ; let us start without sdl2 ; see https://ahefner.livejournal.com/20528.html ; then load it ; temp solution to load the asd as defined (push 'default-pathname-defaults asdf:central-registry) (asdf:load-system :asm6502) ; see https://lispcookbook.github.io/cl-cookbook/systems.html ; (nes:setup-and-emulate "") (in-package :asm6502) ; when have issue as the package defined does not have exit/quit (defpackage :nes-test-1 (in-package :nes-test-1) (in-package :asm6502) #| (write-ines (let ((context (make-instance 'basic-context :address #x8000)) ;; Program Entry Point ;#| ;; VBlank Handler (inc color) ; Increment and load color (lsr) ; Shift right two bits, so each (poke #x3F +vram-addr+) ; Reset address due to palette latching. ;; IRQ/Break Handler ;; Interrupt Vectors ; now try to run ; rlwrap sbcl --load "kwc ; see https://www.reddit.com/r/Common_Lisp/comments/14it7ag/asdfloadsystem/ ; better to use load directory like (asdf:load-asd "~/Documents/Github/asm6502/hacks/nes-hacks.asd") ; see https://lispcookbook.github.io/cl-cookbook/systems.html ; (nes:setup-and-emulate "") ; line 31 = value nil of ; (load "./hacks/music-demo.lisp") ; to see doc try (list-all-packages) |
I agree, a README and some documentation is something I've considered in
the back of my mind for some time, but also I haven't used asm6502 in
several years. I really never put it in a state where I expected other
people to use it.
I'm not what you're referring to by m1/m2 or why you'd need SDL here.
It seems like you've figured out how to build NES roms.
In practice when I've used this, I've stayed inside emacs rather than
having any kind of outside script to trigger building a rom file. Edit, C-c
C-k my buffer in SLIME (was never working on anything large enough that the
code didn't fit comfortably in one file..), then tab over to a terminal and
open the rom in my emulator of choice. I mostly use one I wrote a long time
ago (in C, not lisp...), and occasionally Nestopia if I need something more
accurate, but anything should work. I was never a big fan of FCEUX but some
versions do have a good debugger...
…On Thu, Nov 16, 2023 at 8:28 AM Kowloon walled city (coin) < ***@***.***> wrote:
Test so far can generate some nes and move to fceux/wine64 ... still not
sure what I am doing as no simple step-by-step, guess that is not the
purpose of this hack ...
; not for m1 so far !!!!
; or at least very complicated as quicklisp does not have spec for M1/M2
; hence no sdl2; not sure why I add these into how-to-run this system
though
; (ql:quickload "sdl2")
; (ql:quickload "sdl2/examples")
; (sdl2-examples:basic-test); this work under Intel Mac
; let us start without sdl2
; see https://ahefner.livejournal.com/20528.html
; and github to load the files under asm6502 (lisp)
; then load it
; rlwrap sbcl --load "kwc-to-r
; temp solution to load the asd as defined
(push '*default-pathname-defaults* asdf:*central-registry*)
(asdf:load-system :asm6502)
; see https://lispcookbook.github.io/cl-cookbook/systems.html
; how you have the asm6502 system (but not nes though)
; (nes:setup-and-emulate "")
() ; you can do nothing but what you can do
(in-package :asm6502)
; when have issue as the package defined does not have exit/quit
; try to go back to cu or
; (sb-ext:exit)
(defpackage :nes-test-1
(:use :common-lisp :asm6502 :6502 :6502-modes ;
:asm6502-nes
:asm6502-utility))
(in-package :nes-test-1)
(in-package :asm6502)
#|
(write-ines
"/tmp/nes-test-1.nes"
())
(write-ines
"nes-test-1.nes"
(let ((*context* (make-instance 'basic-context :address #x8000))
(color (zp 0)))
;; Program Entry Point
(set-label 'entry-point)
(sei) ; Disable interrupts
(cld)
(ldx (imm #xFF)) ; Init stack pointer
(txs)
(lda (imm 3))
;(sta color)
(lda (imm #x00))
;(sta color)
; color whatever you do or not do always return #<ZP {70078CDAC3}>
;#|
;; Configure PPU
(lda (imm #b10000000)) ; Enable VBlank NMI
(sta (mem +ppu-cr1+))
(lda (imm #b00000000)) ; Display off
(sta (mem +ppu-cr2+))
(jmp (mem *origin*)) ; Spin.
;; VBlank Handler
(set-label 'vblank-handler)
(lda (mem +ppu-status+)) ; Clear NMI, reset high/low state
(lda (imm #x3F)) ; Program address #x3F00
(sta (mem +vram-addr+)) ; ..write MSB
(lda (imm #x00))
(sta (mem +vram-addr+)) ; ..write LSB
(inc color) ; Increment and load color
(lda color)
(lsr) ; Shift right two bits, so each
(lsr) ; color appears for four frames.
(sta (mem +vram-io+)) ; Write color to palete.
(poke #x3F +vram-addr+) ; Reset address due to palette latching.
(poke #x00 +vram-addr+)
(rti)
;; IRQ/Break Handler
(set-label 'brk-handler)
(rti)
;; Interrupt Vectors
(advance-to +nmi-vector+)
(dw (label 'vblank-handler)) ;; NMI
(dw (label 'entry-point)) ;; RESET
(dw (label 'brk-handler)) ;; BRK/IRQ
;|#
(link *context*)
(format t "hello, world asm6250~%")
(format t "~A" color)
; )
)
)
;(exit)
|#
; the generated file can be loaded, well, anywhere even commodore
; and definitely OpenEMU (like supertank and it)
; now try to run
; rlwrap sbcl --load "kwc
; see
https://www.reddit.com/r/Common_Lisp/comments/14it7ag/asdfloadsystem/
; better to use load directory like
; ~/.config/common-lisp/source-registry.conf.d/
(asdf:load-asd "~/Documents/Github/asm6502/hacks/nes-hacks.asd")
; see https://lispcookbook.github.io/cl-cookbook/systems.html
; how you have the asm6502 system (but not nes though)
; (nes:setup-and-emulate "")
() ; you can do nothing but what you can do
; line 31 = value nil of ; (load "./hacks/music-demo.lisp")
(load "./hacks/nes-test-1.lisp")
; to see doc try
; but actually fuecu2 is better ??? and all goes somewhere on assembler
... nesmaker etc.
(list-all-packages)
—
Reply to this email directly, view it on GitHub
<#2 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABLQMNM6Z3Q2ZKEFVFRYE3YEYIITAVCNFSM6AAAAAA7NMRL22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJUGQZTQMJZGI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Sorry to bother you. But given this is well packaged, I wonder whether there could be
Thanks.
The text was updated successfully, but these errors were encountered: