[stella] Another kernel is rolling

Subject: [stella] Another kernel is rolling
From: "Aaron" <stella-receiver@xxxxxxxxxxxxxxxxx>
Date: Tue, 29 Mar 2005 01:44:45 -0500
I've been trying to figure this out for a while now...  The latest version
of Fall Down works fine in Stella and Z26, but several people have
reported that the title screen rolls on a real machine (I can't test it

I've been able to narrow the problem down to somewhere in the following
code...  Basically, disabling everything between the lines ;-- read input
-- and .wait_overscan: makes the screen stable, but re-enabling any one
block (I've tried most of them individually) makes it roll again.

I've looked for the obvious missing # character, but couldn't find one. 
Also the way I'm doing vblank hasn't changed in ages, and none of the
previous versions rolled (from what I've heard at least), so I don't think
that's the problem.

The display code right before this uses a brk to WSYNC for however many
lines.  Nothing special.  The code after it does a jmp (jump_addr) and
then goes into the VERTICAL_SYNC macro.

So I don't know...  is there anything really obviously wrong with what
I've written here?  If not, are there any common errors that only affect
real hardware?

Anyway, there's also a .bin attached if anyone wants to take a look...


    ;**** overscan - 30 lines ****
    lda #2
    sta VBLANK

    sty PF1
    sty PF2
    sta WSYNC

    lda #overscan_timer
    sta TIM64T

    lda #<display_title
    sta jump_addr
    lda #>display_title
    sta jump_addr+1

    ;--- read input ---
    lda #0
    sta title_mode_change

    ldx #5
    lda SWCHB
    jsr title_read_input
    bcc .no_reset
        lda #0
        sta sound
        sta sound+1
        sta subsound
        sta subsound+1
        sta sound_timer
        sta sound_timer+1

        jsr advance_track
        jsr title_reset_music

    ldx #3
        lda SWCHA
        jsr title_read_input
        bpl .input_loop

    ldx #4
    lda SWCHB
    jsr title_read_input

    ;--- change game mode ---

    lda #nmodes                 ;This is the easter egg...
    sta scratch                 ;if P0 presses up and P1 presses down,
    lda SWCHA                   ;we increase the number of available modes
    and #%00010010              ;by two.
    bne .no_easter_egg
        inc scratch
        inc scratch

    lax mode
    adc title_mode_change

    bpl .mode_high_enough
        lda #nmodes-1
	cmp scratch
	bcc .mode_in_bounds
		lda #0
    sta mode

    cpx mode
    beq .no_mode_change

        lda title_timer_h
        and #%00000111
        sta title_timer_h

        ;On every mode change, we'll reload the
        ;high score from the eeprom if it's present.
        ;This takes a whole TV frame, so first we'll
        ;do a quick test to see if the eeprom is
        ;there, and if not we can skip the whole

        jsr i2c_startwrite
        bcs .no_eeprom
            lda #<reset
            sta jump_addr
            lda #>reset
            sta jump_addr+1
        jsr i2c_stopwrite


    ;--- check if the game should start ---
    lda INPT4
    and INPT5                   ;either player can start the game
    and #%10000000
    bne .noexit
        ;bit 7 is CLEAR if fire was pressed
        jsr title_init_game
        jmp .wait_overscan      ;title_timer overlaps with the
                                ;data that we just cleared

    lda #title_speed
    adc title_timer_l
    sta title_timer_l

    lda title_timer_h
    adc #0
    sta title_timer_h
    bcc .no_attract
        ;go into attract mode - just the AI playing
        lda #nmodes
        sta mode

        jsr title_init_game

    lda INTIM
    bne .wait_overscan
    sta WSYNC

Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://stella.biglist.com

[demime 1.01d removed an attachment of type application/x-zip which had a name of rolling_ntsc_fd.zip]

Current Thread