Jump to content

My experiments with Atari 7800


Recommended Posts

Maria 160B mode for background and sprites

GFX from A8 version by @Tezz Vega and @tebe

Sprites version by @TIX colored by me to 160B

Also I did conversion test of G2F picture by Odyn1ec





  • Like 12
Link to comment
Share on other sites

@Defender_2600 unfortunately I can use only 128px for background.

@TIX BJ is 3rd or 4th on my list TODO, so plenty of time left.


Today next test, Polish classic game FRED

ps. sorry for background, I was to lazy today :D 





edit: wider background





Edited by Eagle
  • Like 10
Link to comment
Share on other sites

9 hours ago, Eagle said:

Today next test, Polish classic game FRED

Impressive scrolling!  


While I have a few ideas on how to have different elements of a scrolling background have different palettes, my own scrolling engine assumes a single palette for the whole thing (or at least per zone).  I'm curious as to the approach/limitations you have for system, and how many cycles you have left!


Link to comment
Share on other sites

Thanks @Revontuli

Scroll is using 126 cycles per each line. This is direct mode 160A (21 tiles 8px wide per line)

So around 1000 for full screen plus few hundreds every 8 frame for updating the right side of the screen.

DMA usage is not bad for a screen with no background. I would say 200 Maria cycles on average per line (empty tiles are pointing DMA holes saving cycles)

With background layer DMA usage is very close to Maria limits. (this was just done as prof of concept) 

But in Fred, all the animations and movements of the enemies were done on the chars, so I'm sure it could work well.

I'll give some code example later.


  • Like 1
Link to comment
Share on other sites

@karri yes


There is so many variants, so let me explain easiest one. 

Scrolling screen to the left (like Fred, Mario Bros, etc.)

Mode 160A, tiles 16x16, each tile can have pallet 0-7


For one line Display list example in MADS (# is counter in mads, :21 repeat line 21 times and increase counter)


line0    :21 .byte <TileFred,$1e,>TileFred,#*8


Mads will generate 21 headers 4 bytes each

It will look like this


			.byte <TileFred,$1e,>TileFred,0
  			.byte <TileFred,$1e,>TileFred,8
  			.byte <TileFred,$1e,>TileFred,16
  			.byte <TileFred,$1e,>TileFred,24
  			.byte <TileFred,$1e,>TileFred,160	;tile 21 outside visible screen - X position = 160



to scroll left you need decrease Xpos for every tile (4th byte of every header)

Again in MADS will look like this


    :21 dec line0+3+[#*4]


this will generate 21 lines 


		dec line0+3+0
		dec line0+3+4
		dec line0+3+8
		dec line0+3+12
		dec line0+3+16
		dec line0+3+80


then you check all xpos in line0 and update them


	ldx #$00
	lda line0+3,x
	cmp #$F8	;or $f9 depends when you'r checking
	beq update_column
	cpx #21*4	;21 headers
	bne loop
; no time for update tiles

;in X you have column for every line
;store on zeropage or somwhere

	lda #160	;change full column xpos to outside screen on the right side
	sta line0+3,x
	sta line1+3,x
	sta line2+3,x
	sta line12+3,x
;update lsb,msb and colour for new tiles on the right side
; if tiles is empty/background set msb=$F0 to holey DMA
; for saving cycles you don't need update colour and lsb then as well

	lda #<lsb_new_tile
	sta line0+0,x  
	lda #>msb_new_tile
	sta line0+2,x
	lda #colour_and_width_new_tile
	sta line0+1,x
	lda #<lsb_new_tile
	sta line1+0,x  
	lda #>msb_new_tile
	sta line1+2,x
	lda #colour_and_width_new_tile
	sta line1+1,x
; repeat this again for next lines



I hope it helps. 


edit: changed rows to columns (sorry for confusion) 

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

Yes, I got it.


Obviously I made one mistake in Wizzy. I update the tiles too late when they are in the viewport.


But I might do this fine tuning later when I know how much resources are left.


Currently I do my displaylist modifications during the screen blank time.

So I scroll just 7 zones during the first irq, and the remaining 7 during the next irq.

This housekeeping with irq's allow me to run sfx sound effects and vgm player

using irq's as well.

; The horizontal scrolls need a number of lines to scroll
; It will scroll scrri lines per irq and change the _scrptr
; and decrement the _scrri
.macro addoff off
	ldy	#4*off
	lda	(_scrptr),y
	adc	#8
	sta	(_scrptr),y

	lda	_scrri
	bne	@L1
	clc		; Slot not used
	addoff 0
	addoff 1
	addoff 2
	addoff 3
	addoff 4
	addoff 5
	addoff 6
	addoff 7
	addoff 8
	addoff 9
	addoff 10
	lda	_scrptr
	adc	_rowoff
	sta	_scrptr
	bcc	@L2
	inc	_scrptr+1
@L2:	dec	_scrri
	lda	_scrri
	bne	@L1


The vertical scroll was easier to do.

.macro movdll from, to
	lda	_dll+1+3*from
	sta	_dll+1+3*to
	lda	_dll+2+3*from
	sta	_dll+2+3*to

 	; Push first pointer on stack
	lda	_dll+3*3+1
	lda	_dll+3*3+2
	movdll 4, 3
	movdll 5, 4
	movdll 6, 5
	movdll 7, 6
	movdll 8, 7
	movdll 9, 8
	movdll 10, 9
	movdll 11, 10
	movdll 12, 11
	movdll 13, 12
	movdll 14, 13
	movdll 15, 14
	movdll 16, 15
	sta	_dll+3*16+2
	sta	_dll+3*16+1
	lda	#$00
	sta	_scrup
	rts		; Slot used already
	clc		; Slot not used


I realized that this does not make much sense without the main program that uses the irq.


	rowoff = sizeof(Zone);
	if (left) {
		// Move scenery right in two parts
		// to reduce load during flyback
		scrptr = &bgzones[0].extra[0].hpos;
		scrri = 7;
		while (scrri)
		scrptr = &bgzones[7].extra[0].hpos;
		scrri = SCREEN_HEIGHT - 7;
		while (scrri)


PS. I am dreaming on visiting Silly Ventures in August. With a playable version of Wizzy.

  • Like 3
Link to comment
Share on other sites

No is LZSS player, it's little bit different.

I published source code on AArea discord and we working on it.

I will publish here later when is don, so everyone can make cart with any Pokey music he want.


Below few old ones (pal only)


BombJack by Miker




Easter by Miker


Flimbo by Miker




Bubble Shooter


Edited by Eagle
  • Like 5
  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...
12 hours ago, Stephen said:

Fantastic!  That's quite impressive.

Not really, this is just my old code from A800. 

Title is made in G2F by Vidol, and have only 7 colours when I'm using 13 (160B)

Game graphics is from C64, background will be in 4 colours, but bottom it's 25 in 160B (I'm hardly using few for now)

Will se how full gameplay will work then I may decide to put extra background layer to make parallax effect.


I'm attaching one of the latest version for A8. 

For Altira you have to go to System>Configure system>Memory>Power-up-pattern>Cleared (I didn't clear memory under OS)



Please do not put this on A8 forum :D 



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

Just few enemies left to add.

Weapon up, bottom scroll slow down.

Every object in code has his own colour/trajectory/energy level et.

Need to redraw some gfx, will try new level tomorrow and add jeep logic (it's done just need copy/paste from my old code)



most of the code should be done by the next week 



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

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.

  • Recently Browsing   0 members

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