Thelen Posted November 30, 2022 Share Posted November 30, 2022 (edited) 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 November 30, 2022 by Thelen Quote Link to comment Share on other sites More sharing options...
+Stephen Posted November 30, 2022 Share Posted November 30, 2022 I've just been including vbxe.lib (from candle's scroll code) and calling the routine. Are you not using MADS, or just looking for a non macro version? Quote Link to comment Share on other sites More sharing options...
tebe Posted November 30, 2022 Share Posted November 30, 2022 https://github.com/tebe6502/Mad-Pascal/blob/master/base/atari/vbxedetect.asm http://atariki.krap.pl/index.php/Wykrycie_VBXE 2 Quote Link to comment Share on other sites More sharing options...
Thelen Posted December 1, 2022 Author Share Posted December 1, 2022 13 hours ago, tebe said: https://github.com/tebe6502/Mad-Pascal/blob/master/base/atari/vbxedetect.asm Thanks! Will check that out! Quote Link to comment Share on other sites More sharing options...
Thelen Posted December 1, 2022 Author Share Posted December 1, 2022 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 🙂 Quote Link to comment Share on other sites More sharing options...
+Stephen Posted December 1, 2022 Share Posted December 1, 2022 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. Quote Link to comment Share on other sites More sharing options...
Thelen Posted December 1, 2022 Author Share Posted December 1, 2022 53 minutes ago, Stephen said: What version of Altirra are you using? I'm using the ARM64 version 4.01 What's happening at your configuration is also strange... Quote Link to comment Share on other sites More sharing options...
phaeron Posted December 2, 2022 Share Posted December 2, 2022 12 hours ago, Thelen said: I'm using the ARM64 version 4.01 What's happening at your configuration is also strange... This is a bug in the scroll demo, the palette load routine uses $D6xx regardless of the detected address. 2 Quote Link to comment Share on other sites More sharing options...
+Stephen Posted December 2, 2022 Share Posted December 2, 2022 @phaeron - any idea why my particular config is not detecting VBXE at $D700? I haven't stepped through the detection code, or tried testing registers to see what happens when changing from $D600 to $D700 yet. Quote Link to comment Share on other sites More sharing options...
Thelen Posted December 2, 2022 Author Share Posted December 2, 2022 @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 🙂 Quote Link to comment Share on other sites More sharing options...
+Stephen Posted December 2, 2022 Share Posted December 2, 2022 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. 1 Quote Link to comment Share on other sites More sharing options...
Thelen Posted December 7, 2022 Author Share Posted December 7, 2022 (edited) 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 December 7, 2022 by Thelen Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted December 7, 2022 Share Posted December 7, 2022 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 2 1 Quote Link to comment Share on other sites More sharing options...
Thelen Posted December 7, 2022 Author Share Posted December 7, 2022 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? Quote Link to comment Share on other sites More sharing options...
Thelen Posted December 8, 2022 Author Share Posted December 8, 2022 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. Quote Link to comment Share on other sites More sharing options...
Rybags Posted December 8, 2022 Share Posted December 8, 2022 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. 1 Quote Link to comment Share on other sites More sharing options...
shanti77 Posted December 8, 2022 Share Posted December 8, 2022 You can also save references to one page in the code, e.g. _ad0 sta $d641 , then after checking the VBXE address, change the high byte for all such references: sta _ad0+2 sta _ad1+2 ... 2 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.