Jump to content

Altirra w/VBXE emulation


152 replies to this topic

#26  

    Stargunner

  • 1,010 posts
  • Joined: 22-November 04
  • Location:Warszawa, Poland

Posted Fri Dec 25, 2009 6:55 AM

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

#27  

    Stargunner

  • 1,010 posts
  • Joined: 22-November 04
  • Location:Warszawa, Poland

Posted Fri Dec 25, 2009 4:51 PM

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, Fri Dec 25, 2009 4:55 PM.


#28  

    Dragonstomper

  • 560 posts
  • Joined: 28-October 07
  • Location:USA

Posted Fri Dec 25, 2009 5:01 PM

View Postflashjazzcat, on Fri Dec 25, 2009 5:02 AM, said:

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.

#29  

    Chopper Commander

  • 116 posts
  • Joined: 10-March 09

Posted Fri Dec 25, 2009 7:54 PM

View Postphaeron, on Fri Dec 25, 2009 12:59 AM, said:

Changes:

Phaeron, your emulator is my #1, mostly because of internal debugger :)
Do you plan to add an option to load symbols for the running program? It would be very useful.
The second question/feature request is about palette files. Do you plan to support it?

#30 ONLINE  

    Stargunner

  • 1,756 posts
  • Joined: 17-April 05
  • Location:Lublin, Poland

Posted Fri Dec 25, 2009 8:05 PM

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


#31  

    Dragonstomper

  • 560 posts
  • Joined: 28-October 07
  • Location:USA

Posted Sat Dec 26, 2009 12:53 AM

View Postcandle, on Fri Dec 25, 2009 8:05 PM, said:

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.

#32  

    Quadrunner

  • 9,751 posts
  • Joined: 29-September 05
  • Location:Australia

Posted Sat Dec 26, 2009 1:09 AM

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.

#33  

    Quadrunner

  • 7,947 posts
  • Joined: 30-September 01
  • Location:Baden-Württemberg, Germany

Posted Sat Dec 26, 2009 1:49 AM

realtime debugger... ;) one of my wishes... and maybe automaticly load symbol file... generated by MADS...

#34  

    Dragonstomper

  • 560 posts
  • Joined: 28-October 07
  • Location:USA

Posted Sat Dec 26, 2009 2:41 AM

View PostHeaven/TQA, on Sat Dec 26, 2009 1:49 AM, said:

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.

Attached Thumbnails

  • Attached Image: altirra-sourcedebugging.png


#35  

    Quadrunner

  • 7,947 posts
  • Joined: 30-September 01
  • Location:Baden-Württemberg, Germany

Posted Sat Dec 26, 2009 3:45 AM

that looks cool... now I need only a practical way to integrate Altira in my mac environment. Have not found a way yet to cofigure virtualbox to exchange data on my iMac.

#36 ONLINE  

    River Patroller

  • 4,992 posts
  • Joined: 23-November 08
  • Jumping through hOOPs...
  • Location:United Kingdom

Posted Sat Dec 26, 2009 6:28 AM

View Postphaeron, on Fri Dec 25, 2009 5:01 PM, said:

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

#37  

    Quadrunner

  • 7,947 posts
  • Joined: 30-September 01
  • Location:Baden-Württemberg, Germany

Posted Sat Dec 26, 2009 12:00 PM

Jesus... I just downloaded the VBXE samples on the Mad Team website and let them go in the emulator... I am shocked how good they are... Mr Proper looks like an Amiga game... and Rybags samples look unbelievable... ;)

#38  

    Quadrunner

  • 7,947 posts
  • Joined: 30-September 01
  • Location:Baden-Württemberg, Germany

Posted Sat Dec 26, 2009 12:44 PM

ok... reactivated my NC10+XP+Eclipse+Altirra... let me test my VBXE code for color ram... ;)

#39  

    Quadrunner

  • 7,947 posts
  • Joined: 30-September 01
  • Location:Baden-Württemberg, Germany

Posted Sat Dec 26, 2009 1:16 PM

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

#40  

    Quadrunner

  • 7,947 posts
  • Joined: 30-September 01
  • Location:Baden-Württemberg, Germany

Posted Sat Dec 26, 2009 2:10 PM

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

Attached Thumbnails

  • Attached Image: vbxe2.PNG

Edited by Heaven/TQA, Sat Dec 26, 2009 2:11 PM.


#41  

    Quadrunner

  • 7,947 posts
  • Joined: 30-September 01
  • Location:Baden-Württemberg, Germany

Posted Sat Dec 26, 2009 2:16 PM

I guess I got the error...

it must be 160,0 and not 0,160...

Attached Thumbnails

  • Attached Image: vbxe3.PNG

Edited by Heaven/TQA, Sat Dec 26, 2009 2:17 PM.


#42  

    Quadrunner

  • 7,947 posts
  • Joined: 30-September 01
  • Location:Baden-Württemberg, Germany

Posted Sat Dec 26, 2009 2:19 PM

;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


#43  

    Quadrunner

  • 7,947 posts
  • Joined: 30-September 01
  • Location:Baden-Württemberg, Germany

Posted Sat Dec 26, 2009 2:51 PM

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

Attached Thumbnails

  • Attached Image: vbxe4.PNG


#44  

    Dragonstomper

  • 861 posts
  • Joined: 07-November 06
  • Location:Canada

Posted Sat Dec 26, 2009 2:59 PM

OK, my curiosity is peaked again for the VBXE.

I just have one quick question regarding it: Can the color attribute map be fine-scrolled either horizontally or vertically?

Edited by dwhyte, Sat Dec 26, 2009 3:02 PM.


#45  

    Quadrunner

  • 7,947 posts
  • Joined: 30-September 01
  • Location:Baden-Württemberg, Germany

Posted Sat Dec 26, 2009 3:10 PM

in theory yes... see docs... 0-31 pixels in x and y direction...

not sure if Altirra does support it yet... my next test will be using 4x4 cells instead of 8x8...

#46  

    Quadrunner

  • 7,947 posts
  • Joined: 30-September 01
  • Location:Baden-Württemberg, Germany

Posted Sat Dec 26, 2009 3:34 PM

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

Attached Thumbnails

  • Attached Image: vbxe5.PNG


#47 ONLINE  

    Stargunner

  • 1,756 posts
  • Joined: 17-April 05
  • Location:Lublin, Poland

Posted Sat Dec 26, 2009 3:38 PM

Heaven, put a compiled one for me, so i could do a quick test on real hardware (or did You get Yours fixed?)

#48  

    Quadrunner

  • 7,947 posts
  • Joined: 30-September 01
  • Location:Baden-Württemberg, Germany

Posted Sat Dec 26, 2009 3:43 PM

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.

Attached Files


Edited by Heaven/TQA, Sat Dec 26, 2009 3:53 PM.


#49  

    Dragonstomper

  • 861 posts
  • Joined: 07-November 06
  • Location:Canada

Posted Sat Dec 26, 2009 4:04 PM

Thanks for the examples Heaven... This Altirra thread has got me interested in coming back to programming on the A8; as soon as I finish this damn novel I'm working on...

#50  

    Quadrunner

  • 9,751 posts
  • Joined: 29-September 05
  • Location:Australia

Posted Sat Dec 26, 2009 4:50 PM

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users