User Tools

Site Tools


base:assembling_your_own_cart_rom_image

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
base:assembling_your_own_cart_rom_image [2015-04-17 04:30] – external edit 127.0.0.1base:assembling_your_own_cart_rom_image [2017-06-30 18:35] (current) – Missing padding in .crt header marvin
Line 83: Line 83:
 ;this is for a 8KB cart!! ;this is for a 8KB cart!!
 *=$0000 *=$0000
- .asc "C64 CARTRIDGE "+ .asc "C64 CARTRIDGE   "
  .byte $00,$00 ;header length  .byte $00,$00 ;header length
  .byte $00,$40 ;header length  .byte $00,$40 ;header length
Line 171: Line 171:
 </code> </code>
  
 +===== 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.
 +
 +<code>
 +;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/docs directory is here:
 +;file://dreamass-master/docs/dreamass.html#Outfiles
 +#outfile @, sort, $00, "crtheader", "chip1header", "romsegment"
 +
 +;Calculation of the start address that must be given.
 +;StartAddress=StartAddressOfCartROM-CRTheaderLenght-ChipHeaderLenght
 +;StartAddress=$(8000-40-10)=$7fb0
 +
 +;Definition of segments
 +#segdef "crtheader",$7fb0-$7ff0,fillup,force            ;CRT header
 +#segdef "chip1header",$7ff0-$8000,fillup                ;CHIP header
 +#segdef "romsegment",$8000-$a000,fillup,force           ;ROM
 +
 +    .segment "crtheader"                ;CRT header
 +    .pet "c64 cartridge   "             ;16 byte long
 +    .byte $00,$00                       ;File header length  ($00000040,  in  high/low  format,
 +    .byte $00,$40                       ;calculated from offset $0000). Default value is $40 = 64
 +    .word $0001                         ;crt version 1.0 = {$01, $00} (high/low, presently 01.00)
 +    .word $0000                         ;hardver type ($0000, high/low)
 +    .byte $00                           ;Signal of the ExROM Line (for Memory configuration)
 +                                        ;Cartridge port EXROM line status
 +                                        ; 0 - inactive
 +                                        ; 1 - active
 +    .byte $00                           ;Signal of the Game Line (for Memory configuration)
 +                                        ;Cartridge port GAME line status
 +                                        ; 0 - inactive
 +                                        ; 1 - active
 +    .byte $00,$00,$00,$00,$00,$00       ;Reserved for future use
 +    .pet "test my cartridge 08kb"       ;32 byte long, uppercase,  padded with null characters)
 +                                        ;name of the cartridge (Null-terminated String)
 +                                        ;DreamAss fill up automatically the remained bytes,
 +                                        ;thanks to fillup,force options in
 +                                        ; #segdef "crtheader",$7fb0-$7ff0,fillup,force
 +                                        ;End of CRT header.
 +
 +;0040-xxxx Cartridge contents (called CHIP PACKETS, as there  can be more than one  per  CRT  file).
 +
 +    .segment "chip1header"              ;CHIP header segment
 +    .pet "chip"                         ;$40-$43 Contained ROM signature "CHIP"
 +                                        ;(note there can be more than one image in a .CRT file)
 +    .byte $00,$00,$20,$10               ;$44-$47 Total packet length ($00002010,  ROM  image  size  and
 +                                        ;CHIP header combined) (high/low format)
 +                                        ;here the value is $2000 +$10 that is 8192+16=8208 byte
 +    .byte $00,$00                       ;$48-$49 chip type 0, that is ROM
 +                                        ; 0 - ROM
 +                                        ; 1 - RAM, no ROM data
 +                                        ; 2 - Flash ROM
 +    .byte $00,$00                       ;$4A-$4B bank value of 0
 +                                        ;Bank number ($0000 - normal cartridge)
 +    .byte $80,$00                       ;$4C-$4D $8000 that is 32768 is Starting load address (high/low format)
 +    .byte $20,$00                       ;$4E-$4F ROM image size in bytes, here $2000 that is 8192 byte = 8KiB
 +                                        ;(high/low  format,  typically $2000 or $4000)
 +
 +                                        ;0050-xxxx - ROM data
 +;ROM part follows...
 +chrget   = $0073
 +txtptr   = $007a
 +ierror   = $0300
 +imain    = $0302
 +igone    = $0308
 +gone     = $a7e4
 +chkcom   = $aefd
 +frmnum   = $ad8a
 +getadr   = $b7f7
 +chrout   = $ffd2
 +border   = $d020
 +screen   = $d021
 +text     = $0286
 +
 +    .segment "romsegment"                       ;ROM segment
 +
 +    .word coldstart                     ;coldstart vector
 +    .word warmstart                     ;warmstart vector
 +    .byte $C3,$C2,$CD,$38,$30           ;"CBM8O".
 +                                        ;Needed to autostart Cartridge.
 +
 +coldstart:
 +;       KERNAL RESET ROUTINE
 +    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                          ;screen border
 +    lda #$f6                            ;C64 default screen color
 +    sta screen                          ;screen
 +
 +    jsr write0                          ;write text to screen
 +
 +stophere:
 +    jmp stophere                        ;Short cycle, to stop here program.
 +
 +;write text to screen
 +
 +write0:
 +    ldx #0
 +write1:
 +    lda txt1,x
 +    beq done1
 +    jsr $ffd2
 +    inx
 +    bne write1
 +done1:
 +    rts
 +txt1:
 +    .pet 8,14,13,"     *** Pal Csanyi's Cartridge ***",13," is 8kb of size",13," Informations about the Cartridge",13,0
 +</code>
base/assembling_your_own_cart_rom_image.1429237828.txt.gz · Last modified: 2016-05-15 10:50 (external edit)