From b001b2c00d72ea28e9272c30a53fcf83e21c9249 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 9 Feb 2016 22:44:51 -0500 Subject: cart image works now --- newtitle.s | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 59 insertions(+), 13 deletions(-) (limited to 'newtitle.s') diff --git a/newtitle.s b/newtitle.s index 798320d..5fdf37e 100644 --- a/newtitle.s +++ b/newtitle.s @@ -2,8 +2,23 @@ ; cl65 -o newtitle.xex -t none newtitle.s ; It contains only an init routine, no run address. + .ifdef CART_TARGET +origin = * + .else .include "atari.inc" + ; where our screen was loaded (see newtitle.pl) +;screendata = $2400 + + ; homebrew atari xex header + .word $ffff + .word origin + .word end-1 + +; .org $a800 + .org origin + .endif + ; location sound code will look at to see whether sound ; is disabled (0 = enabled, !0 = disabled). If you ; change this here, change it in sounds.h also! @@ -16,21 +31,17 @@ fontsave = $03c1 color1save = $03c2 color2save = $003c3 - ; where our screen was loaded (see newtitle.pl) -;screendata = $2400 - - ; homebrew atari xex header - .word $ffff - .word origin - .word end-1 - -; .org $a800 - .org origin - version: .incbin "ver.dat" + .ifdef CART_TARGET +dl_ram = $7000 +help_lms = dl_ram + 1 +help = $7010 +help_rom: + .else help: + .endif .incbin "help.dat" helphitbl: @@ -49,6 +60,11 @@ helplotbl: .byte <(help+96) .byte 0 + .ifdef CART_TARGET +help_size = * - help_rom + .out .sprintf("help_size == %x", help_size) + .endif + colorchoices: .byte $c0,$10,$00 colorcount = (*-colorchoices)-1 @@ -78,7 +94,7 @@ filler: totalscanlines = 184 ; aka image size / $20 topscanlines = (($1000 - (screendata .mod $1000)) / $20) -bottomscanlines = totalscanlines - topscanlines +bottomscanlines = (totalscanlines - topscanlines) .out .sprintf("topscanlines = %d", topscanlines) .out .sprintf("bottomscanlines = %d", bottomscanlines) @@ -116,12 +132,16 @@ dlist: .endrepeat dl3byte $0f | $40, screendata+(topscanlines * $20) ; Hit 4K boundary, LMS again - .repeat bottomscanlines + .repeat bottomscanlines - 1 dlbyte $0f ; 55 more scanlines of mode 8 .endrepeat + .ifdef CART_TARGET + dl3byte $01, dl_ram ; DL is mainly in ROM, jump to RAM (extra scanline) + .else dl3byte $02 | $40, version ; LMS, 1 line of GR.0 for the version help_lms = * - 2 dl3byte $41, dlist ; JVB, jump & wait for vblank + .endif .out .sprintf("dl start $%x, end $%x, size %d", dlist, *, (* - dlist) + 1) @@ -134,6 +154,30 @@ sounddisp = help + 78 ; executable code here start: + + .ifdef CART_TARGET + lda #$42 ; finish display list. this part has to be in RAM. + sta dl_ram + lda #version + sta help_lms+1 + lda #$41 + sta help_lms+2 + lda #dlist + sta help_lms+4 + + ldx #0 +@hsloop: + lda help_rom,x + sta help,x + inx + cpx #help_size + bne @hsloop + .endif + ; save old color registers and font addr. lda CHBAS sta fontsave @@ -326,6 +370,8 @@ now_on: .out .sprintf("code ends at $%x", *) end: + .ifndef CART_TARGET .word INITAD .word INITAD+1 .word start + .endif -- cgit v1.2.3