Felix icon indicating copy to clipboard operation
Felix copied to clipboard

Flip mode

Open fdescharmes opened this issue 4 years ago • 2 comments

This is probably an enhancement also.

Flip mode does not work, and drawing sprites in flip mode displays garbage on screen.

When you will want to add the feature, this test ROM may help, it does only 3 things:

  1. initial: display a sprite
  2. after joystick press: flip the screen
  3. after another joystick press: redisplay the sprite in another position flip.zip

This is the sourcecode for Flip in BLL kit (@42BS will explain better than me)

` ; ; c: Flip() ; extern char * ScreenBuffer; ; ; Switch right/left ; global _Flip

	xref _viddma,_sprsys
xrefzp __viddma,__sprsys
	xrefzp _ScreenBuffer,_RenderBuffer
	
            

_Flip: lda __sprsys ; load from RAM-shadow eor #8 sta __sprsys sta _sprsys

            lda __viddma
            eor #2
            sta __viddma
            sta _viddma
	ldy _ScreenBuffer
	ldx _ScreenBuffer+1
            and #2
            beq _Flip1
              clc
	  tya
              adc #<(8159)
              tay
              txa
              adc #>(8159)
              tax

_Flip1: sty $fd94 stx $fd95 rts `

fdescharmes avatar Oct 26 '21 07:10 fdescharmes

From the doc: "When the screen is flipped, the data is read from RAM starting at the bottom of the screen" Therefore the "plus 8159". (Why not 8160 is lost in the past :( )

42Bastian avatar Oct 26 '21 07:10 42Bastian

Thanks. Sample program will be handy.

laoo avatar Oct 26 '21 07:10 laoo