Jump to content
IGNORED

My experiments with Atari 7800


Eagle

Recommended Posts

19 minutes ago, eed002 said:

Thanks. This was helpful as well...

 

https://sites.google.com/site/atari7800wiki/graphics-modes

The "See the 7800 Software Guide for a description of these modes" mention at that page, be sure it is not an outdated one with a number of inaccuracies and missing information.

 

Here is the corrected and updated version:

http://7800.8bitdev.org/index.php/7800_Software_Guide

  • Like 3
Link to comment
Share on other sites

Just example of code in assembly

Showing the difference between code for A7800 and MariaEci

It's just showing one sprite with random data.

 

;
;change here to chose with platform you want
MariaEci equ yes
;
YES	equ 1	;code for Atari XL/XE
NO	equ 0	;code for Atari7800
;

	.if MariaEci=no
	opt f+h-m+
	.endif

	.if MariaEci=Yes
maria_pbi		= $08
MARIA_BASE 		= $d100
MIRQ_STATUS		= MARIA_BASE + $10
MIRQ_FLCLR		= MARIA_BASE + $10
MIRQ_CONTROL	= MARIA_BASE + $11
MIRQ_LVECTOR	= MARIA_BASE + $12
MIRQ_HVECTOR	= MARIA_BASE + $13
BGEN			= MARIA_BASE +$47
EXT256KB		= MARIA_BASE +$4E
PORTB			= $D301 
DMACTL			= $d400
NMIEN			= $d40e
PDVREG 			= $D1FF  ;;; PBI IRQ FLAG
PDVRS 			= $0248
BACKGRND        = MARIA_BASE + $20     ;Background Color
MSTAT           = MARIA_BASE +$28
DPPH            = MARIA_BASE +$2C
DPPL            = MARIA_BASE +$30
CHARBASE        = MARIA_BASE +$34 
OFFSET	        = MARIA_BASE +$38
CTRL            = MARIA_BASE +$3C

P0C1            =     MARIA_BASE +$21     ;Palette 0 - Color 1
P0C2            =     MARIA_BASE +$22     ;Palette 0 - Color 2
P0C3            =     MARIA_BASE +$23     ;Palette 0 - Color 3
	.else

INPTCTRL	=	$01	;INPUT PORT CONTROL ("VBLANK" IN TIA )
BACKGRND	=	$20	;BACKGROUND COLOR
P0C1		=	$21	;PALETTE 0 - COLOR 1
P0C2		=	$22	;	   - COLOR 2
P0C3		=	$23	;	   - COLOR 3
MSTAT		=	$28	;MARIA STATUS
DPPH		=	$2C	;DISPLAY LIST LIST POINT HIGH BYTE
DPPL		=	$30	;DISPLAY LIST LIST POINT LOW BYTE
CHBASE		=	$34	;CHARACTER BASE ADDRESS
OFFSET		=	$38	;FOR FUTURE EXPANSION - STORE ZER0 HERE
CTRL		=	$3C	;MARIA CONTROL REGISTER
	
	.endif
;Warning	
;no cart header for 7800
;use 7800header tool and 7800sign
;http://7800.8bitdev.org/index.php/7800AsmDevKit

		org $8000
Start
		.if MariaEci=Yes
			sei          
			lda PORTB	 ; disable basic
			ora #$01
			sta PORTB
			lda #$00
			sta DMACTL
			sta NMIEN
			lda #maria_pbi 
			sta PDVRS 
			sta PDVREG       ; --- pbi maria init
			lda #$00
			sta MIRQ_CONTROL ; maria irq off
			sta BGEN
			sta EXT256KB
			sta OFFSET
		.else
			sei					;Disable interrupts
			cld					;Clear decimal mode
			MVA #$07 INPTCTRL
			MVA	#$7F CTRL
			MVA	#$00 OFFSET
			MVA #$00 INPTCTRL
			ldx	#$FF			;Reset stack pointer
			txs
		.endif

		mva	#$00 BACKGRND\ mva #$08 P0C1\ mva #$14 P0C2\ mva #$0c P0C3
		
		jsr	WaitVBLANK	;wait until no DMA would happen
		lda	#<DLL	;set display list list address
		sta DPPL
	    lda	#>DLL
	    sta	DPPH	

		lda	#$40
		sta	CTRL	;DMA on, 160A/160B mode
loop	jmp loop

DLL
		.rept 3
		.byte	$0F,>emptyline,<emptyline	;$0F - DLL entry 16 lines
		.endr

		.byte 	$0F,>onelineDL,<onelineDL
		
		.rept 16
		.byte	$0F,>emptyline,<emptyline
		.endr

;DL entry 4 bytes
onelineDL		.byte <sprite,$1e,>sprite,78	;LSB,Size 2 byte + colour pallet 0,MSB,XPOS
			.byte 0,0	;end of Displaylist
;
emptyline	.byte 0,0

WaitVBLANK:	
WaitVBoff:
		bit		MSTAT
		bmi		WaitVBoff
WaitVBon:
		bit		MSTAT
		bpl		WaitVBon
		rts

;Dummy nmi/irq
Dummy	RTI
		org $A000
sprite
		.rept 16 #
		.byte [:1*16]+:1,[:1*16]+:1		;random data to show sprite - 4096 bytes
		.align 256						;gfx data every 256 bytes
		.endr
		

		.if MariaEci=YES
		run start
		.else

	 ORG	$fff8
	.byte	$FF		;Region verification
	.byte	$87		;ROM start $8000
	.word	Dummy
	.word	START
	.word	Dummy
		.endif
		

 

Multiplatform.asm

  • Like 2
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...