Jump to content
IGNORED

Detecting VBXE $d600 or $d700 (or no VBXE)


Thelen

Recommended Posts

Hi All,

I've been trying to get a example to work in my code, but can't get it to work. Been looking at  sroll sample code from Candle with the files VBXE.LIB & Scroll.asm. Since I'm not very familiar with all the (great!) MADS assembler Macro/pseudo codes I don't really understand how it works..

Is there maybe some 'easy' example how to do this for people like me? 🙂 🙂

Thanks!
 

Edited by Thelen
Link to comment
Share on other sites

There's something strange with the Scroll example from @Candle (I'm doing something wrong probably). When I start Scroll.com in Altirra with the VBXE @ $D600 it works fine. When I'm setting the VBXE in Altirra to $D700 all the stuff that should be blitted is black.. And that's precisely the problem I'm encountering when using this part of code in my software (blackscreen, eveything on my screen is being blitted)

It looks like that the third and fourth line of:

 

.if .not .def __VBXE_AUTO__ .and .not .def __VBXE_D700__	; default case - vbxe at 0xd640
VBXE_BASE		equ	0xd600
.elseif .not .def __VBXE_AUTO__ .and def __VBXE_D700__		; vbxe is assumed to be under 0xd740
VBXE_BASE		equ	0xd700
.else								; vbxe should be autodetected
VBXE_BASE		equ	0x0000
.endif


Never wil be true/set... And again - probably I'm overseeing something here 🙂
 

Link to comment
Share on other sites

29 minutes ago, Thelen said:

When I'm setting the VBXE in Altirra to $D700 all the stuff that should be blitted is black

What version of Altirra are you using?  I just tried this, and when I set VBXE to $D700 (I even closed and restarted the emulator), the code still detects VBXE at $D640 and works properly.  This is using Altirra 64-bit 4.10-test 27.  I don't have an easy way of testing this on real hardware.

2022-12-01_095622.png

Link to comment
Share on other sites

@Stephen, I see in your screenshot you are using the blitter sprite demo, not the scroller demo - perhaps the scroller demo will detect your VBXE at $D700?

 

 

15 hours ago, phaeron said:

This is a bug in the scroll demo, the palette load routine uses $D6xx regardless of the detected address

That explains a lot 🙂

Link to comment
Share on other sites

47 minutes ago, Thelen said:

@Stephen, I see in your screenshot you are using the blitter sprite demo, not the scroller demo - perhaps the scroller demo will detect your VBXE at $D700?

 

 

That explains a lot 🙂

That is my demo code I am working on - but using the detect routine provided in vbxe.lib.  But I will try the working scroller demo just to make sure.  I'll also do some probing of various VBXE registers so I can see what is being returned.

  • Like 1
Link to comment
Share on other sites

The detection of the VBXE at $D640 or $D740 is working, but I still can't understand how the VBXE base adressing switch is done...

When I change the code of the base setting at the top in the VBXE.lib file it still works, I don't understand what the __VBXE_AUTO__ and __VBXE_D700__ are doing..

 

.if  .not .def haha; default case - vbxe at 0xd640
VBXE_BASE		equ	0xd600
.elseif def hihi		; vbxe is assumed to be under 0xd740
VBXE_BASE		equ	0xd700
;.else								; vbxe should be autodetected
;VBXE_BASE		equ	0x0000
.endif

Maybe someone can point me to a non-macro 'just 6502 assembly' example 🙂

Edited by Thelen
Link to comment
Share on other sites

You could use the detection method from the (open source) U1MB plugin for VBXE, which appears to work reliably. Here it is with U1MB stuff quickly removed:

 

VBXE_CR_VERSION		= $40		;core version ($10 = FX)

Temp1	equ $80


.proc DetectVBXE
	lda #0
	sta Temp1
	lda #$D6
Loop
	sta Temp1+1
	ldy #VBXE_CR_VERSION
	lda (Temp1),y
	cmp #$10
	beq Found
	cmp #$11
	beq Found
	
	lda #$D7
	cmp Temp1+1
	bne Loop

	mva #0 VBXEPage	; say there's no VBXE
	sta VBXECoreType
	rts ; return z=1
	
Found
	tax	; save version
	ldy #VBXE_CR_REVISION	; now get core FX version and revision
	lda (Temp1),y
	pha	; save revision
	
	ldy #1
	txa	; $10 = FX, $11 = GTIA

	lsr
	scc
	iny
	sty VBXECoreType

	lsr
	lsr
	lsr
	sta VBXECoreRevMaj
	
	ldy #' '
	pla	; get revision
	spl
	ldy #'r'
	sty VBXERFlag
	
	and #$7F	; discard 'r' flag
	sta VBXECoreRevMin
	
	mva Temp1+1 VBXEPage	; remember the VBXE Base address
	rts	; return z=0
.endp


VBXECoreType	; 0 = not present, 1 = FX, 2 = GTIA
	.ds 1
VBXECoreRevMaj	; BCD
	.ds 1
VBXECoreRevMin	; BCD
	.ds 1
VBXERFlag	; 'r' = 'R' core, else space
	.ds 1
VBXEPage	; $D6/D7
	.ds 1

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, flashjazzcat said:

You could use the detection method from the (open source) U1MB plugin for VBXE

Thank you!

Then VBXEPage location will hold the base address, $d6/D7 - how can I translate it to the correct equ's like

 

VBXE_VIDEO_CONTROL	equ	VBXE_BASE+0x40
VBXE_XDL_ADR0		equ	VBXE_BASE+0x41
VBXE_MINOR		equ	VBXE_BASE+0x41
VBXE_XDL_ADR1		equ	VBXE_BASE+0x42
VBXE_XDL_ADR2		equ	VBXE_BASE+0x43
VBXE_CSEL			equ	VBXE_BASE+0x44

That VBXE_BASE will hold $d600 or $d700?

 

Link to comment
Share on other sites

Finally I get it 🙂

It has nothing to do with the setting equ's for the VBXE, VBXE registers will be accessed by writing $d7 or $d6 to zeropage (VBXEBase at the scroller sample) with the vblda & vbsta macro's.

This is interersting, and a great working concept - but will take up a lot of extra cycles I think - especially when setting/modifying lots of blitterblocks 🙂 But  I understand that there is no other option to do this.
 

Link to comment
Share on other sites

An alternative can be to do D6 and D7 versions of your program.

Or use self-modifying code but then you'd need to keep track of every D6 occurrence and INC them if the D7 install is detected.

Blitter blocks - generally you only access the registers when pointing to the initial BCB and starting a blit sequence so it's not much.

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...