Skip to content

MEGA65: raster position anomalies #418

Description

@lgblgblgb
  1. Raster interrupt position in V400 modes are bad. My idea back to then: raster IRQs (and/or [?] reading back current raster) always meant in physical rasters, but it seems not the case: even in V400 mode, it seems to be in "logical rasters".
    I wrote a test program, running on real MEGA65: raster bars do not change position at all if V200/V400 mode is changed!
  2. Check if it applies when reading raster position.
  3. What's about MEGA65 feature to ask raster IRQ in physical rasters? Not implemented yet at all!
  4. What's about MEGA65 feature to read current taster in physical rasters? Not implemented yet at all!
  5. Check for 1. and 2. if it applies (and how) for the C65 emulator.

Original issue (1.) has been reported by FPhoton on Discord, thanks.

The logical raster stuff (MEGA65 + C65 too?)

Thus it seems, raster IRQs ("VIC-II style") are always measured in "logical rasters" (both in V200 and V400 modes), probably that's true for both of writing (setting raster IRQ position) and reading (for querying current raster) register $D012 (MSB 8th bit in $D011.7). So probably this Xemu bug also affected the BASIC65 VSYNC command in V400 mode as it may use (AFAIK) reading raster position and not setting an IRQ. UPDATE my newer test confirmed that

The physical raster stuff (MEGA65 only)

The other part of the story, is setting raster IRQ by physical raster, and querying raster position by physical raster.

GS $D052 VIC-IV:FNRASTERLSB Read physical raster position
GS $D053.0-2 VIC-IV:FN!RASTER!MSB Read physical raster position
GS $D053.7 VIC-IV:FNRST Read raster compare source (0=VIC-IV fine raster, 1=VIC-II raster), provides same value as set in FNRSTCMP
GS $D079 VIC-IV:RASCMP Physical raster compare value to be used if FNRSTCMP is clear
GS $D07A.0-2 VIC-IV:RASCMP!MSB Raster compare value MSB
GS $D07A.7 VIC-IV:FNRST!CMP Raster compare is in physical rasters if clear, or VIC-II rasters if set

This is a bit confusing ...

My failed attempt for a test program

I tried to write a test program for running on real MEGA65. While it was useful to test V200/V400 "logical" raster stuff, it seems it does not work for physical (aka, fine?) rasters neither on the MEGA65.

My test program: raster.zip

I guess I still can't understand those registers, why are so many, how to select physical rasters to read (or generate IRQs against) instead of logical rasters, etc, whatever I tried, it didn't worked on MEGA65 either :( My test program above just relfects the state of my last experiment, I've tried several things without luck.

Raise of the Discord (MEGA65 fine rasters topic)

btoschi on Discord seems to have more information and test program as well in regards of fine raster stuff:

https://discord.com/channels/719326990221574164/977076334297743360/1322223357994729564

His test program: scrolltest.zip

Metadata

Metadata

Assignees

Projects

Status
In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions