-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nmk/nmk16.cpp: Adjusted values for proper screen size, timings and interrupts, according to real hw #12529
Conversation
Merge master
Merge master
Merge master
* removed from: `macross2`, `tdragon2`, `sabotenb`, `bjtwin`, `nouryoku`, and clones of all them * added to: `tharrier`, `bioship`, `vandyke`, and clones
…KTAIL` flag on afega and nmk16 games: * removed from: `ssmissin`, `airattck`, and clones of all them * added to: `stagger1`, `grdnstrm`, and clones
…fix flipscreen on 'bioship` and `vandyke`
I think the information on the PROM use should go in the driver so it doesn't get lost here? |
@mamehaze what would be the best place to put that info? On the driver header, maybe? I could paste all the text above on there, if that's fine |
Hi @sergiopolog. I like Haze, but he's not a member of the team so his suggestions are not rules. Our preference would be for MAME to use the actual PROM data live, so that changing the contents of the PROM would alter the video parameters. That would be great for people who want to make their own games on these boards, and it would work more like hardware. The code scanning the PROMs to compute the parameters would then be an excellent place to put those comments. |
@rb6502 ok, then I will include all the above as complementary info on the code I will submit in my next PR, including the code to use the actual data from PROM to trigger interrupts |
Thanks, looking forward to it! |
…gger1`, `grdnstrm` and clones
Fixed screen size, interrupts and raster timings on nmk16 driver to be more accurate with original hw.
This hardware relies on two counters and the contents of two PROMs for the timing signals generation. The counters are implemented inside NMK-902 custom chip (except
tharrier
) for all "low-res" games and are used to address the entries on each PROM in a sequential way. On "hi-res" games, one of the counters is implement outside the custom chip, due to they decided to boost up the horizontal resolution.0x40
and goes to0xFF
having 192 steps. As each step is 2 px, so the total H-size is 384px wide. PROM entries from0x00
to0x39
address are never used.0x00
and goes to0xFF
having 256 steps. As each step is 2 px, the total H-size is 512px wide. All PROM entries are used.0x75
and goes to0xFF
having 139 steps. As each step is 2 lines, the total V-size is 278 lines high. PROM entries from0x00
address to0x74
are never used.Going into more detail:
The H-timing PROMs is a 82S129 (256x4bit) (first 64 entries are not used in "low-res") and the format is:
Considering that and looking at the contents of the PROM, the horizontal timings are below:
Each line: ( 6MHz / 384 pixels per line ) = 15625Hz = 64 usec
Each line: ( 8MHz / 512 pixels per line ) = 15625Hz = 64 usec
For V-timing PROM, it's a 82S135 (256x8bit) (first 117 entries are not used) and the format is:
Considering that and looking at the content of the PROM, the vertical timings are below:
VBLANK time: ( 6MHz / 384 pixels per line ) / 54 lines per VBlank = 289.35185185Hz = 3456 usec
Active video time: ( 6MHz / 384 pixels per line ) / 224 lines per Active = 69.75446428Hz = 14336 usec
Time between IRQ1: ( 6MHz / 384 pixels per line ) / 128 lines between IRQ1s = 122.0703125Hz = 8192 usec
Given that, the screen size, HBlank and VBlank are adjusted on each case. Interrupts and video offsets are also fixed to their proper positions.
On a later Pull-Request I'll submit new code for triggering interrupts based on the actual contents on the V-timing PROM, in order to trigger the interrupts dynamically and allowing each game trigger them by its own, instead of hardcoding them on the code. It's known that IRQ1 in 'bioship' and 'vandyke` is a bit shifted compared to other games, and some hi-res games don't use IRQ2.
No clue how they implemented it on Afega games hw, but they work in the same way.
Additionally, flip-screen is fixed for
vandyke
,bioship
and clones. Contrary to rest of games,vandyke
writes a 1 instead of 0 when flip-screen is required, so a new adapter handler is added for that special case.Adjusted
MACHINE_NO_COCKTAIL
flag on:macross2
,tdragon2
,sabotenb
,bjtwin
,nouryoku
,ssmissin
,airattck
and clones of all themtharrier
,stagger1
,grdnstrm
, and clones