sy2002 / MiSTer2MEGA65

Framework to simplify porting MiSTer (and other) cores to the MEGA65
GNU General Public License v3.0
35 stars 9 forks source link

Show the input CORE screen resolution (and the name and version of the core) #5

Closed MJoergen closed 1 year ago

MJoergen commented 1 year ago

The M2M framework now automatically detects the screen resolution (i.e. visible pixels) received from the CORE. Inside the "monitor" this can be retrieved as follows:

QMON> MEMORY/CHANGE ADDRESS=FFF4 CURRENT VALUE=0101 NEW VALUE=00FF
QMON> MEMORY/CHANGE ADDRESS=FFF5 CURRENT VALUE=0001 NEW VALUE=0010
QMON> MEMORY/DUMP START ADDRESS=7003 END ADDRESS=7004

7003: 0180 010E 

The above is from the C64MEGA65 core, and shows that the horizontal size is 0x0180 = 384 pixels, while the vertical size is 0x010E = 270 lines.

This information should also be available without having to enter the "monitor". E.g. either displayed to UART upon start-up, and/or visible somewhere in the OSM.

sy2002 commented 1 year ago

When implementing this feature we should also show the CORE's name/version together with the input core screen resolution. I will take this info from config.vhd and combine it with the info described above.

MJoergen commented 1 year ago

Please also add the following:

sy2002 commented 1 year ago

Should preferably be rounded to one decimal

@MJoergen As you are the math wizard: QNICE does not have any floating point maths. Can you help me with a simple floating point algorithm either written in C or in QNICE assembly (latter one preferred since a lot is on my plate for the release)? These are the operations that we have: 32bit multiplication, 32bit division, 3bit addition, 32bit subtraction.

MJoergen commented 1 year ago

Just for the record, these are all the variables provided:

MJoergen commented 1 year ago

Should preferably be rounded to one decimal

@MJoergen As you are the math wizard: QNICE does not have any floating point maths. Can you help me with a simple floating point algorithm either written in C or in QNICE assembly (latter one preferred since a lot is on my plate for the release)? These are the operations that we have: 32bit multiplication, 32bit division, 3bit addition, 32bit subtraction.

Ok, then I suggest we for now just forget the floating point and just print out the result of integer division.

For some later project, I suggest we add a more general floating point library to QNICE.

For the record, one algorithm to achieve the requested "division rounded to one decimal" is the following:

MJoergen commented 1 year ago

I've changed the register yet again, so that they now match the parameters found in M2M/vhdl/av_pipeline/video_modes_pkg.vhd:

I suggest you just display these raw values in decimal, without any further post-processing.

For the user it is relevant to be able to determine the following derived quantities:

MJoergen commented 1 year ago

Perhaps displaying V_TOTAL = V_PIXELS + V_PULSE + V_BP + V_FP and H_TOTAL = H_PIXELS + H_PULSE + H_BP + H_FP would be nice for the user.

sy2002 commented 1 year ago

Done with this commit: 98f4fe8c1505bbace1501bb0a3c9608492c96188