base:assembling_your_own_cart_rom_image
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
base:assembling_your_own_cart_rom_image [2015-04-17 04:30] – external edit 127.0.0.1 | base:assembling_your_own_cart_rom_image [2016-05-19 17:30] – [CBM80 Autostart Cartridge developed with DreamAss] csanyipal | ||
---|---|---|---|
Line 171: | Line 171: | ||
</ | </ | ||
+ | ===== CBM80 Autostart Cartridge developed with DreamAss ===== | ||
+ | By Csanyi Pal | ||
+ | |||
+ | This cart rom image is just for experimenting how can one assemble her/his own cart rom image with DreamAss. | ||
+ | It can be run in VICE x64sc emulator. | ||
+ | |||
+ | < | ||
+ | ;HOW TO COMPILE | ||
+ | ;dreamass -o TestMyCart.crt TestMyCart.src | ||
+ | ;HOW TO VERIFY CRT IMAGE | ||
+ | ;cartconv -f TestMyCart.crt | ||
+ | ;HOW TO RUN in VICE's x64sc emulator | ||
+ | ;x64sc -cartcrt TestMyCart.crt | ||
+ | |||
+ | ;DreamAss documentation is after unpacking and running make in dreamass-master directorty | ||
+ | ;and after that running make in dreamass-master/ | ||
+ | ; | ||
+ | #outfile @, sort, $00, " | ||
+ | |||
+ | ; | ||
+ | ; | ||
+ | ; | ||
+ | |||
+ | ;Definition of segments | ||
+ | #segdef " | ||
+ | #segdef " | ||
+ | #segdef " | ||
+ | |||
+ | .segment " | ||
+ | .pet "c64 cartridge | ||
+ | .byte $00, | ||
+ | .byte $00, | ||
+ | .word $0001 ;crt version 1.0 = {$01, $00} (high/low, presently 01.00) | ||
+ | .word $0000 ; | ||
+ | .byte $00 ; | ||
+ | ;Cartridge port EXROM line status | ||
+ | ; 0 - inactive | ||
+ | ; 1 - active | ||
+ | .byte $00 ; | ||
+ | ;Cartridge port GAME line status | ||
+ | ; 0 - inactive | ||
+ | ; 1 - active | ||
+ | .byte $00, | ||
+ | .pet "test my cartridge 08kb" | ||
+ | ;name of the cartridge (Null-terminated String) | ||
+ | ;DreamAss fill up automatically the remained bytes, | ||
+ | ;thanks to fillup, | ||
+ | ; #segdef " | ||
+ | ;End of CRT header. | ||
+ | |||
+ | ;0040-xxxx Cartridge contents (called CHIP PACKETS, as there can be more than one per CRT file). | ||
+ | |||
+ | .segment " | ||
+ | .pet " | ||
+ | ;(note there can be more than one image in a .CRT file) | ||
+ | .byte $00, | ||
+ | ;CHIP header combined) (high/low format) | ||
+ | ;here the value is $2000 +$10 that is 8192+16=8208 byte | ||
+ | .byte $00, | ||
+ | ; 0 - ROM | ||
+ | ; 1 - RAM, no ROM data | ||
+ | ; 2 - Flash ROM | ||
+ | .byte $00, | ||
+ | ;Bank number ($0000 - normal cartridge) | ||
+ | .byte $80, | ||
+ | .byte $20, | ||
+ | ; | ||
+ | |||
+ | ;0050-xxxx - ROM data | ||
+ | ;ROM part follows... | ||
+ | chrget | ||
+ | txtptr | ||
+ | ierror | ||
+ | imain = $0302 | ||
+ | igone = $0308 | ||
+ | gone = $a7e4 | ||
+ | chkcom | ||
+ | frmnum | ||
+ | getadr | ||
+ | chrout | ||
+ | border | ||
+ | screen | ||
+ | text = $0286 | ||
+ | |||
+ | .segment " | ||
+ | |||
+ | .word coldstart | ||
+ | .word warmstart | ||
+ | .byte $C3, | ||
+ | ;Needed to autostart Cartridge. | ||
+ | |||
+ | coldstart: | ||
+ | ; | ||
+ | stx $d016 ; Turn on VIC for PAL / NTSC check | ||
+ | jsr $fda3 ; IOINIT - Init CIA chips | ||
+ | jsr $fd50 ; RANTAM - Clear/test system RAM | ||
+ | jsr $fd15 ; RESTOR - Init KERNAL RAM vectors | ||
+ | jsr $ff5b ; CINT - Init VIC and screen editor | ||
+ | cli ; Re-enable IRQ interrupts | ||
+ | |||
+ | warmstart: | ||
+ | ; Write here your code! | ||
+ | lda #$fe ;C64 default border color | ||
+ | sta border | ||
+ | lda #$f6 ;C64 default screen color | ||
+ | sta screen | ||
+ | |||
+ | jsr write0 | ||
+ | |||
+ | stophere: | ||
+ | jmp stophere | ||
+ | |||
+ | ;write text to screen | ||
+ | |||
+ | write0: | ||
+ | ldx #0 | ||
+ | write1: | ||
+ | lda txt1,x | ||
+ | beq done1 | ||
+ | jsr $ffd2 | ||
+ | inx | ||
+ | bne write1 | ||
+ | done1: | ||
+ | rts | ||
+ | txt1: | ||
+ | .pet 8, | ||
+ | </ |
base/assembling_your_own_cart_rom_image.txt · Last modified: 2017-06-30 18:35 by marvin