Jump to content
IGNORED

Altirra w/VBXE emulation


phaeron

Recommended Posts

It is a PBI device, but there is no reason why serial devices couldn't go 15 units (this is PBI which can do more, i.e. up to 255 units, but the serial I/O protocol could suffer major confusion seeing such a request when no PBI is present, so I think 15 - i.e. SIO device $3F - is a reasonable maximum).

Link to comment
Share on other sites

Update: I copied the 16 MB ATR file over to test.atr, mounted it and tried to format. But the SDX formatter reported, that the disk is a 180k DD image, so I went to check the returned PERCOM block. Here it is: $39 $00 $12 $00 $00 $00 $01 $00 $FF $00 $00 $00, which is 57 tracks * 18 sectors * 256 bytes = 256 KB. The valid PERCOM block for such an image should be $01 $00 $fe $ff $00 $04 $01 $00 $FF $00 $00 $00 (1 track * 65534 sectors * 256 bytes = ~16 MB).

 

A 32 MB image under Altirra returns basically the same PERCOM block as above except that the sector size is correct ($39 $00 $12 $00 $00 $00 $02 $00 $FF $00 $00 $00 = 57 tracks * 18 sectors * 512 bytes = 512 KB). Again, it should be $01 $00 $FF $FF $00 $04 $02 $00 $FF $00 $00 $00 = 1 track * 65535 sectors * 512 bytes = ~32 MB).

 

EDIT: although the emulator does correctly recognize the image sector size, it does not transfer 512-byte sectors correctly, it looks like it cut the transfer after the first 256 bytes. SIO of course expects more data, so timeout occurs eventually.

Edited by drac030
Link to comment
Share on other sites

These updates are great: VBXE emulation is probably already at the stage where I can use it for the bulk of my development. As draco said, practically speaking it would be nice to see the program remember its settings, such as mounted ATRs and carts. Since the cursor keys still seem quirkily mapped out to me (shift+ctrl+down arrow works, but shift+down arrow produces the same keyscan code), I'm hoping I can customise the keyboard to my liking. However, I'm assuming the key assignments won't be remembered between sessions yet.

 

The keyboard is not currently customizable since there are too many quirks to it: one is that some of the keys are mapped as characters instead of virtkeys, to avoid excessively weird mappings on international keyboards. However, I'm open to suggestions.

 

In this particular case, I'm not sure what to do, since on a real Atari keyboard you need to press Ctrl to use the arrow keys, and therefore Ctrl+arrow and Ctrl+Shift+Arrow aren't well defined.

Link to comment
Share on other sites

could You get jealous of this? even a bit? (or byte..)

 

Meh, sorry. To me, it looks like one of those WPF demos that is nice and scrolly, but when you actually sit down and think about it, you can't find a whole lot of uses for it. Bitmap/tile view on memory? Yeah, definitely. Animated and flashing effects? Sorry, I want my debugger snappy and fast.

Link to comment
Share on other sites

I'd just like a decent and configurable trace facility.

 

Problem with the A800Win+ one is it traces execution/registers just fine, but there's no tracking of memory or hardware registers.

 

Something simple like an old/new status of locations that are modified by instructions would be nice.

 

Also nice would be the ability to selectively omit sections of code, or change verbosity.

Link to comment
Share on other sites

and maybe automaticly load symbol file... generated by MADS...

 

Actually, Altirra is already supposed to load a .lst and .lab file when loading an EXE, but for some reason this is not working correctly in current builds -- you have to manually load them with .loadsym. The list modules (lm) command will show if this is set up correctly. If it is, then Altirra will actually allow you to do source level debugging on the .s/xasm files.

 

Another quick way is to use Debug > Open Source File command on the listing (.lst) file; you'll get the entire dump of your executable, but you can set breakpoints and step in the listing view.

post-16457-12618168864_thumb.png

Link to comment
Share on other sites

The keyboard is not currently customizable since there are too many quirks to it: one is that some of the keys are mapped as characters instead of virtkeys, to avoid excessively weird mappings on international keyboards. However, I'm open to suggestions.

 

In this particular case, I'm not sure what to do, since on a real Atari keyboard you need to press Ctrl to use the arrow keys, and therefore Ctrl+arrow and Ctrl+Shift+Arrow aren't well defined.

I'll sit down and try and work out a suggested mapping today. Sorry to keep going on about the keyboard, but this is probably the only thing stopping me from making the switch to Altirra at the moment. I'm just difficult, because I insist on using every available code on the keyboard. :)

Link to comment
Share on other sites

btw. just have seen that every time I am calling Altirra a new instance is created... is there a way to reset the actual instance when assembling a new version of code and getting Altirra reboot the new build instead of creating a new instance? I just realised that I had 6 instances running... ;)

Link to comment
Share on other sites

ok... again me with the attribute map... as I have no access to the real hardware at the moment...

 

is it correct what Altirra displays?

xdl		.byte 52,0,23 ;24 blank scanlines
	.byte 101000,%10001010
	.byte 191 ;191 scanlines
	.byte $00,$10,$00 ;attribute map adress $001000=$1000[0]+$4000
	.byte 0,160
	.byte 1,0

post-528-126185827962_thumb.png

Edited by Heaven/TQA
Link to comment
Share on other sites

;VBXE Core 1.20
;color attribute test


MEMAC_B_CTL equ $5d

bank0	equ $00
vbxe_bank equ $4000

	org $3000
init:	jsr vbxe_detect
	bcc vbxe_detected
init0	lda 53770
	sta $d01a
	jmp init0
;vbxe found
vbxe_detected:
;move XDL to $000000 VBXE RAM
	lda #$80+bank0
	sta $d65d 

	jsr clr_bank0
	
	ldx #12
vbxe0	lda xdl,x
	sta vbxe_bank,x
	dex
	bpl vbxe0

	lda #$00 ;XDL at $000000
	sta $d641
	lda #$00
	sta $d642
	lda #$00
	sta $d643
	lda #1 ;enable xdl
	sta $d640
loop	lda #50
	sta 540
loop0	lda 540
	bne loop0
	jsr set_color_ram
	jmp loop
	
set_color_ram ldx #0
setc0	lda #0
	sta vbxe_bank+$1000,x
	sta vbxe_bank+$1000+1,x
	lda 53770
	sta $bc40,x
	and #$f0
	ora #8
	sta vbxe_bank+$1000+2,x
	lda #0
	sta vbxe_bank+$1000+3,x
	inx
	inx
	inx
	inx
	cpx #160
	bcc setc0
	rts
	
	jmp *

vbxe_detect
       jsr ?try
       bcc ?clr

       inc _vbxe_write+2

?try    ldx $4000
       ldy #MEMAC_B_CTL
       lda #$80
       jsr _vbxe_write
       cpx $4000
       bne ?fnd
       jsr ?clr
       inx
       stx $4000
       lda #$80
       jsr _vbxe_write
       cpx $4000
       bne ?fnd
       sec
       .byte $24
?fnd    clc
?clr    lda #$00
_vbxe_write
       sta $d600,y
       rts

;clear bank #0 = $4000-$7fff window		
clr_bank0: 	ldy #63
clr_bank00 	ldx #0
		txa
clr_bank01 	sta vbxe_bank,x
		inx
		bne clr_bank01
		dey
		bpl clr_bank00
		rts
		
xdl		.byte 52,0,23 ;24 blank scanlines
	.byte 101000,%10001010
	.byte 191 ;191 scanlines
	.byte $00,$10,$00 ;attribute map adress $001000=$1000[0]+$4000
	.byte 160,0
	.byte 1,0

Link to comment
Share on other sites

ok... and here is an example with Antic Mode 6...

 

the attribute cells are still 8x8 but in 320x resolution so now 1 cell covers 1/2 char... really cool...

 

;VBXE Core 1.20
;color attribute test


MEMAC_B_CTL equ $5d

bank0	equ $00
vbxe_bank equ $4000

count	equ $b0

	org $3000
init:	jsr vbxe_detect
	bcc vbxe_detected
init0	lda 53770
	sta $d01a
	jmp init0
;vbxe found
vbxe_detected:
;move XDL to $000000 VBXE RAM
	lda #$80+bank0
	sta $d65d 

	jsr clr_bank0
	
	ldx #12
vbxe0	lda xdl,x
	sta vbxe_bank,x
	dex
	bpl vbxe0

	lda 20
	cmp 20
	beq *-2
	
	lda #0
	sta count

	lda #<display_list
	sta 560
	lda #>display_list
	sta 561
	
	lda #$00 ;XDL at $000000
	sta $d641
	lda #$00
	sta $d642
	lda #$00
	sta $d643
	lda #1 ;enable xdl
	sta $d640
loop	lda #1
	sta 540
loop0	lda 540
	bne loop0
	jsr set_color_ram
	inc start_color
	lda start_color
	sta count
	jmp loop

start_color .byte 0
	
set_color_ram ldx #0
setc0	lda count
	sta vbxe_bank+$1000,x
	lda #0
	sta vbxe_bank+$1000+1,x
	;lda 53770
	;sta $bc40,x
	;and #$f0
	;ora #8
	sta vbxe_bank+$1000+2,x
	lda #0
	sta vbxe_bank+$1000+3,x
	
	inc count
	
	inx
	inx
	inx
	inx
	cpx #160
	bcc setc0
	rts
	
	jmp *

vbxe_detect
       jsr ?try
       bcc ?clr

       inc _vbxe_write+2

?try    ldx $4000
       ldy #MEMAC_B_CTL
       lda #$80
       jsr _vbxe_write
       cpx $4000
       bne ?fnd
       jsr ?clr
       inx
       stx $4000
       lda #$80
       jsr _vbxe_write
       cpx $4000
       bne ?fnd
       sec
       .byte $24
?fnd    clc
?clr    lda #$00
_vbxe_write
       sta $d600,y
       rts

;clear bank #0 = $4000-$7fff window		
clr_bank0: 	ldy #63
clr_bank00 	ldx #0
		txa
clr_bank01 	sta vbxe_bank,x
		inx
		bne clr_bank01
		dey
		bpl clr_bank00
		rts
		
xdl		.byte 52,0,23 ;24 blank scanlines
	.byte 101000,%10001010
	.byte 191 ;191 scanlines
	.byte $00,$10,$00 ;attribute map adress $001000=$1000[0]+$4000
	.byte 160,0
	.byte 1,0

display_list
	.byte $70,$70,$70,$46
	.word text
	.byte $41
	.word display_list
	
text	dta d'VBXE VBXE VBXE VBXE VBXE'

	org $2e0
	.word init

post-528-126186067677_thumb.png

Link to comment
Share on other sites

hscrolling and vscrolling (offsetting the attribute map) seems not working?

 

anyway...here is the example with 4x4 cells...

 

;VBXE Core 1.20
;color attribute test


MEMAC_B_CTL equ $5d

bank0	equ $00
vbxe_bank equ $4000

count	equ $b0

	org $3000
init:	jsr vbxe_detect
	bcc vbxe_detected
init0	lda 53770
	sta $d01a
	jmp init0
;vbxe found
vbxe_detected:
;move XDL to $000000 VBXE RAM
	lda #$80+bank0
	sta $d65d 

	jsr clr_bank0
	
	ldx #16
vbxe0	lda xdl,x
	sta vbxe_bank,x
	dex
	bpl vbxe0

	lda 20
	cmp 20
	beq *-2
	
	lda #0
	sta count

	lda #<display_list
	sta 560
	lda #>display_list
	sta 561
	
	lda #$00 ;XDL at $000000
	sta $d641
	lda #$00
	sta $d642
	lda #$00
	sta $d643
	lda #1 ;enable xdl
	sta $d640
loop	lda #1
	sta 540
loop0	lda 540
	bne loop0
	jsr set_color_ram
	inc start_color
	;lda start_color
	lda #16
	sta count
; scrolling
	lda start_color
	and #31
	;sta vbxe_bank+11
	jmp loop

start_color .byte 0
	
set_color_ram ldx #0
setc0	lda count
	sta vbxe_bank+$1000,x
	sta vbxe_bank+$1008+320,x
	inc count
	inx
	inx
	inx
	inx
	;cpx #160
	bne setc0
	rts
	
	jmp *

vbxe_detect
       jsr ?try
       bcc ?clr

       inc _vbxe_write+2

?try    ldx $4000
       ldy #MEMAC_B_CTL
       lda #$80
       jsr _vbxe_write
       cpx $4000
       bne ?fnd
       jsr ?clr
       inx
       stx $4000
       lda #$80
       jsr _vbxe_write
       cpx $4000
       bne ?fnd
       sec
       .byte $24
?fnd    clc
?clr    lda #$00
_vbxe_write
       sta $d600,y
       rts

;clear bank #0 = $4000-$7fff window		
clr_bank0: 	ldy #63
clr_bank00 	ldx #0
		txa
clr_bank01 	sta vbxe_bank,x
		inx
		bne clr_bank01
		dey
		bpl clr_bank00
		rts
		
xdl		.byte 52,0,23 ;24 blank scanlines
	.byte 101000,%10001110
	.byte 191 ;191 scanlines
	.byte $00,$10,$00 ;attribute map adress $001000=$1000[0]+$4000
	.word 320
	.byte 0,0 ;hscroll,vscroll 0-31
	.byte 3,3 ;h-size 4 pixel, v-size 4-pixel
	.byte 1,0
	
;7060 DATA 52,0,23
;7061 DATA 40,138,191
;7062 DATA 0,0,0,160,0
;7063 DATA 1,0
;
;Line 7060 - first XDL entry for map off, overlay off, repeated for extra 23 scanlines
;Line 7061 - second XDL entry. Repeat set for 191 extra scanlines, MAPON set. End of XDL set (2.7), overlay/attribute set (2.3), map address set (2.1)
;7062 - map address at VBXE RAM $000000, step size of 160 bytes (40 x 4)
;7063 - overlay/map parameters, use palette 0/0, width normal, priority to GTIA objects 

display_list
	.byte $70,$70,$70,$46
	.word text
	.byte $41
	.word display_list
	
text	dta d'VBXE VBXE VBXE VBXE VBXE'

	org $2e0
	.word init

post-528-126186324122_thumb.png

Link to comment
Share on other sites

no... have not fixed my motherboard... still not sure who will do it... just asked ABBUC guys...

 

attachted the exe file... this should scroll?

 

as in this version I am writing into XDL+10 at $4000 bank 0 which contains the hscroll offset. (not +11)

 

exe file exchanged but Altirra still does not scroll.

vbxe1.zip

Edited by Heaven/TQA
Link to comment
Share on other sites

4x4 cells shouldn't work properly on the real hardware. That's the bummer about attribute maps.

 

Although you can tell VBXE to do small x-sized cells and it generates them, it only does 40 or so properly, then has a blank area, then does 40 again, etc.

 

I was hoping it would work, but no... would have been a cheap and easy way to do zoomers and parallax scrollers.

 

As it is, zoomers could be done using blits. Parallax scrollers still possible with overlays, but only 2-layer. Or 3 if you goto the trouble of employing PMGs.

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...