239 Commits

Author SHA1 Message Date
David Hunter
0deb3ec4bc Update sys
Template_MiSTer commit b293ea0
2025-09-07 11:06:15 -07:00
David Hunter
16e5bf752c Release 20250906 (really)
Somehow managed to commit an old .rbf that had the wrong case for
"Overscan mask".
2025-09-06 22:49:36 -07:00
David Hunter
bb38c29e32 Release 20250906
This release completes my deep dive into reverse-engineering the Epoch
TV-1 video chip.

All known display issues are now resolved.

A new OSD menu option is added to mask the edges of the overscan
region -- the portions that would normally be hidden behind the
television bezel.  Most scrolling games benefit from setting this
option to "large", which is now the default.

epochtv1:
- Make overscan mask user-configurable
- Fix spr_nc might stay high after sofp_row_end
- More accurate VRAM address bus computation
- CPU ownership of VRAM bus is tied to RDB/WRB
- Re-observe WAITB and implement address-based state machine
- Remove SOFP 2-color flush state
- Hide overscan
- Fix OAM copy timing and CPU access during
- Fix interaction of sprite split attribute and 2-color mode
- Fix 2-color sprite color transform
- Fix sprite width and 2-color handling
- Implement R0.3 = disable OAM copy
- Add control register shadow copy
- Fix shadow terminology
- Registers are write-only
- Tidy row parameters
- More accurate BGM / OAM / VRAM access
- Use start_line as current row counter
- Cap sprite eval+render at 251 VRAM bus cycles

upd7800:
- upd7800: BLOCK cycles should be idle (M2), read (M3), write (M4)
- upd7800: RDB should assert in T1 on CP1 rising
2025-09-06 22:20:25 -07:00
David Hunter
0b82a8e4e2 Merge remote-tracking branch 'origin/main' into dev 2025-09-06 21:57:20 -07:00
David Hunter
5d9d315749 epochtv1: Make overscan mask user-configurable 2025-09-06 19:17:32 -07:00
David Hunter
2a1a8bced1 epochtv1: Fix spr_nc might stay high after sofp_row_end 2025-09-03 22:27:02 -07:00
David Hunter
847dbfff6e epochtv1: More accurate VRAM address bus computation 2025-09-02 23:34:32 -07:00
David Hunter
258442b68c epochtv1: CPU ownership of VRAM bus is tied to RDB/WRB
- Fix WAITB timing to be 1 cycle on writes
- Fix effect of RDB posedge on WAITB
- Cycle timing now verified to match HW for block instruction VRAM copies
2025-08-30 21:32:29 -07:00
David Hunter
f9a18fdf83 upd7800: BLOCK cycles should be idle (M2), read (M3), write (M4) 2025-08-29 23:12:27 -07:00
David Hunter
012beff0a1 upd7800: RDB should assert in T1 on CP1 rising
This advances the leading edge of RDB by a half cycle.

Also, RDB and WRB should de-assert in T3 on CP2 rising.
2025-08-29 22:53:18 -07:00
David Hunter
13db5a90e4 epochtv1: Re-observe WAITB and implement address-based state machine 2025-08-28 21:49:38 -07:00
David Hunter
bc8dd33f5f epochtv1: Remove SOFP 2-color flush state
Double the OLB write rate, so there is no need for a flush state.
2025-08-25 21:37:13 -07:00
David Hunter
36c4d5ae85 epochtv1: Hide overscan
Blacks out screen edges, to hide internal state of some games
2025-08-25 21:36:59 -07:00
David Hunter
91715ed880 epochtv1: Fix OAM copy timing and CPU access during
Improved HW testing reveals much simpler behavior than formerly documented.
2025-08-24 22:59:59 -07:00
David Hunter
e25306dfe7 epochtv1: Fix interaction of sprite split attribute and 2-color mode
Split (half-width) takes priority over 2-color mode: only 8 pixels are
fetched and rendered per row.  But the other effects of 2-color mode
-- eg, disabling double-height linked sprites -- still apply.
2025-08-24 01:13:19 -07:00
David Hunter
a0c2db1dbe epochtv1: Fix 2-color sprite color transform
HW testing reveals that:

1. Only the link X/Y bits determine how the second sprite color is
derived from the main sprite color

2. The color LSB is not affected

3. Setting only one of link X or Y rotates the 3 MSB of color

4. Setting both link bits inverts the (3 MSB of) color
2025-08-23 18:03:32 -07:00
David Hunter
62165f0348 Add render_tb VRAM binaries 2025-08-23 17:59:23 -07:00
David Hunter
944856179b epochtv1: Fix sprite width and 2-color handling
These got broken in the VRAM refactor.
2025-08-21 20:54:27 -07:00
David Hunter
0e007c4689 Update scv_tb .gtkw 2025-08-17 20:52:36 -07:00
David Hunter
be48df1102 epochtv1: Implement R0.3 = disable OAM copy 2025-08-17 20:50:50 -07:00
David Hunter
e4bb5e5960 epochtv1: Add control register shadow copy 2025-08-17 20:50:50 -07:00
David Hunter
9bb4bdee77 epochtv1: Fix shadow terminology 2025-08-17 20:50:50 -07:00
David Hunter
8be787aec3 epochtv1: Registers are write-only 2025-08-17 20:50:50 -07:00
David Hunter
ffcaa576d6 epochtv1: Tidy row parameters 2025-08-17 20:50:50 -07:00
David Hunter
1f848e9070 epochtv1: More accurate BGM / OAM / VRAM access
- Don't copy BGM to a shadow copy
- CPU access to BGM and rendering can occur concurrently
- VRAM bus cycle rate is 1/2 pixel clock rate
- CPU access to VRAM zeroes concurrent sprite data read
- WAITB asserts on CSB, de-asserts on VRAM cycle
2025-08-17 20:50:45 -07:00
David Hunter
6ea5f74a54 Update readme with current status 2025-05-26 22:07:07 -07:00
David Hunter
ce0632dde1 epochtv1: Use start_line as current row counter
This mirrors how actual silicon behaves. Weird edge cases that, for
example, seemingly cause the sprite to wrap around the top of the
screen, are faithfully reproduced.
2025-04-20 19:55:26 -07:00
David Hunter
75e5fcf546 epochtv1: Cap sprite eval+render at 251 VRAM bus cycles
- Re-codify sofp FSM to produce _next, simplifying old and new state actions
- Extend VRAM fetch to the full 2px cycle length
- VRAM fetch must start one cycle before drawing
- Register sprite VRAM address on fetches
2025-04-14 21:02:24 -07:00
David Hunter
7f147e954d epochtv1: render sprites two rows at a time
- change the VRAM memory bus interface to match HW
- render background live, mix with OLB scanout
2025-04-11 22:40:34 -07:00
David Hunter
3c2282bd95 epochtv1: Tweak docs 2025-04-06 13:19:52 -07:00
David Hunter
0e2651042e epochtv1: Document background rendering details 2025-03-23 22:31:36 -07:00
David Hunter
aeac73c482 epochtv1: More sprite rendering 2025-03-23 22:31:35 -07:00
David Hunter
a17d728916 Fix row numbers 2025-02-17 22:23:23 -08:00
David Hunter
cfa1d96faa epochtv1: Sprite rendering 2025-02-17 20:07:28 -08:00
David Hunter
d1cdb2ec74 Release 20250131
upd7800: A few fixes, found by running cputest on HW, which should
have no effect whatsoever on any game.

epochtv1: Based on testing actual HW:
- Widen output to 204x230
- Fix background and sprite alignment
- Add OSD option to select RGB vs. RF color palette
2025-01-31 21:07:42 -08:00
David Hunter
26a15b6c3f epochtv1: Add OSD option to select RGB vs. RF color palette 2025-01-26 22:49:16 -08:00
David Hunter
198c4a84c4 epochtv1: Mimic RGB connector signal level fall off 2025-01-22 22:18:03 -08:00
David Hunter
b3953734e6 epochtv1: Align background and sprites to render window
Window alignment now matches real HW.
2025-01-20 21:54:10 -08:00
David Hunter
77c5c5e36b epochtv1: Output the full render area, minus the edges
Use full 208 x 232 render window for sync (DE).  Blacken pixels
outside a slightly smaller visible window.
2025-01-20 14:54:35 -08:00
David Hunter
0fc325cb88 epochtv1: Document screen size, char/sprite render coordinates 2025-01-20 14:13:59 -08:00
David Hunter
157af22018 upd7800: DAA does not clear the HC flag 2025-01-18 22:47:42 -08:00
David Hunter
6904332527 upd7800: BLOCK ignores SK flag 2025-01-18 22:47:42 -08:00
David Hunter
0874281f08 upd7800: $xx + $xF + 1 (carry in) sets HC=1 2025-01-18 22:22:30 -08:00
David Hunter
6b4017ef1a Release 20241231
Various accuracy improvements

Mappy is playable again. (Must have been a fix in there somewhere.)
2024-12-31 23:59:35 -08:00
David Hunter
561464e588 upd7800: Fix STM following skipped instruction 2024-12-31 23:26:40 -08:00
David Hunter
1c0f8e6162 upd7800: BLOCK: Don't use skip to stop repeat 2024-12-31 19:34:08 -08:00
David Hunter
ffd25540e3 upd7800: Correct cycle count of special reg. instructions 2024-12-31 18:19:51 -08:00
David Hunter
f576f3ed7c upd7800: Latch cl_skip to avoid invalidation by interrupt 2024-12-31 17:23:20 -08:00
David Hunter
a85d0627c6 upd7800: M1 should stay low during interrupt entry 2024-12-31 17:21:53 -08:00
David Hunter
2e9cd25399 upd7800: Trim unneeded idle cycles from move ins. ucode 2024-12-31 16:19:34 -08:00