My First C64/X16 Programs!

Chat about anything CX16 related that doesn't fit elsewhere
SlithyMatt
Posts: 913
Joined: Tue Apr 28, 2020 2:45 am

My First C64/X16 Programs!

Post by SlithyMatt »


I have started working on a double-buffered line graphics capability with this: 


 

Using the GEOS frame buffer API gives you flicker, it seems, no matter what. My implementation has two 16-color frame buffers that it switches between, drawing one while displaying the other.

User avatar
desertfish
Posts: 1094
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

My First C64/X16 Programs!

Post by desertfish »


"but you will need  C64/C128 with a SuperCPU v2 and 16MB RAM"  <- from that wolf3d page.. that's not really a c64 as I remember it ?

geek504
Posts: 95
Joined: Wed Aug 26, 2020 4:52 pm

My First C64/X16 Programs!

Post by geek504 »



1 hour ago, desertfish said:




"but you will need  C64/C128 with a SuperCPU v2 and 16MB RAM"  <- from that wolf3d page.. that's not really a c64 as I remember it ?



That’s why I am wanting the X16 to be at least 20MHz! We could do so much with that ?























SuperCPUv2

Processor: 

WDC 65C816S

Architecture: 

8/16-bit

Clock Speed: 

20 MHz

Opcodes: 

Documented 6510 opcodes only

User avatar
desertfish
Posts: 1094
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

My First C64/X16 Programs!

Post by desertfish »


The 65c02 cpu can't run that fast as far as I know and remember: constraints spark creativity ?

geek504
Posts: 95
Joined: Wed Aug 26, 2020 4:52 pm

My First C64/X16 Programs!

Post by geek504 »



4 hours ago, desertfish said:




The 65c02 cpu can't run that fast as far as I know and remember: constraints spark creativity ?



Max speed as per spec is 14MHz, that's acceptable!

FPGA implementation at 100MHz with pin-compatible format: (need some adjustments for X16's memory banks)

http://www.e-basteln.de/computing/65f02/65f02/

I admit, I am suffering from feature-request syndrome! Coming from an Apple ][, the X16's 320x200x256 and 640x480x16 is nirvana in itself, the X16's 8MHz clock speed is way better than the ]['s 1MHz, and 2MB is more than I would need for my programming desires. So yeah, the X16 is just fine the way it is... let's make use of our creativity as you say! Our version of Wolf3D has to be creatively different!

geek504
Posts: 95
Joined: Wed Aug 26, 2020 4:52 pm

My First C64/X16 Programs!

Post by geek504 »



11 hours ago, SlithyMatt said:




My implementation has two 16-color frame buffers that it switches between



Is this documented anywhere? I couldn't find any info on other graphics mode.

SlithyMatt
Posts: 913
Joined: Tue Apr 28, 2020 2:45 am

My First C64/X16 Programs!

Post by SlithyMatt »



1 hour ago, geek504 said:




Is this documented anywhere? I couldn't find any info on other graphics mode.



It's all in the VERA doc. Bitmap graphics modes can be 2, 4, 16, or 256 colors.

image.thumb.png.2eec93f064a7fc5fb9e299a8c633d4f1.png

SerErris
Posts: 172
Joined: Sat Aug 08, 2020 9:18 am

My First C64/X16 Programs!

Post by SerErris »


AND .. you can set both layers to Bitmap mode However that is most likely not what you want.

What you want is:

Lets assume you want a 320x200x4bpp bitmap with double buffer

You start to use Layer0 for that. You set tile base to $04000 (if you do not need your text buffer, you can start at $00000) then build whatever you want in that screen ...

Then you start building your next frame in area starting @$10000 .. after you are finished rendering it, you set the tilebase to $10000

Then you start to build in $04000 again ... flip back tilebase and so on.

That is how you can do double buffering with VERA.

geek504
Posts: 95
Joined: Wed Aug 26, 2020 4:52 pm

My First C64/X16 Programs!

Post by geek504 »



1 hour ago, SlithyMatt said:




Bitmap graphics modes can be 2, 4, 16, or 256 colors.



 



Gotcha! I just did a cursory view at the SCREEN function and only saw this:




































Mode

Description

Comment

$00

40x30 text

 

$01

80x30 text

(currently unsupported)

$02

80x60 text

 

$80

320x200@256c

40x25 text

 

$81

640x400@16c

(currently unsupported)

I expected other "modes" to be already pre-defined and not for the user to set it up manually...

geek504
Posts: 95
Joined: Wed Aug 26, 2020 4:52 pm

My First C64/X16 Programs!

Post by geek504 »



18 minutes ago, SerErris said:




That is how you can do double buffering with VERA.



Gotcha! But I think we don't have enough VRAM for two 320x200x256 buffers... that's why SlithyMatt did 2 pages with 16 colors each.

Edit: DOH! 4bpp = 16 colors... I should go get my coffee...

I'm going to start some assembly coding and would like to ask: What workflow are you guys following? Which assembler? What steps to get the binary file inside the emulator? etc. I think my way is just too slow...

Post Reply