Skip to content

Commit

Permalink
Merge pull request #73 from jbrandwood/master
Browse files Browse the repository at this point in the history
Implement jump tables for "switch()" statements + more.
  • Loading branch information
jbrandwood authored Feb 7, 2025
2 parents d69059b + 5348fb8 commit f0763a0
Show file tree
Hide file tree
Showing 20 changed files with 3,883 additions and 987 deletions.
2 changes: 1 addition & 1 deletion examples/asm/elmer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#

PREREQS = ipl-scd
SUBDIRS = rom-bare-hello rom-bare-buftest rom-bare-mwrtest rom-bare-rcrtest rom-bare-tiatest \
SUBDIRS = rom-bare-hello rom-bare-buftest rom-bare-dmatest rom-bare-mwrtest rom-bare-rcrtest rom-bare-tiatest \
rom-core-hello rom-core-hugerom rom-core-okitest \
scd-bios-hello scd-bios-hello-error \
cd-core-1stage cd-core-2stage cd-core-scsitest \
Expand Down
3 changes: 3 additions & 0 deletions examples/asm/elmer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ This directory contains a number of example programs and utilities for developin
* rom-bare-buftest
- A HuCARD ROM to compare a PC Engine emulator's buffered VDC reading with real PC Engine console hardware.

* rom-bare-dmatest
- A HuCARD ROM to compare a PC Engine emulator's VDC SATB-DMA and VRAM-DMA timing with real PC Engine console hardware.

* rom-bare-mwrtest
- A HuCARD ROM to compare a PC Engine emulator's VDC VRAM read/write timings with real PC Engine console hardware.

Expand Down
51 changes: 51 additions & 0 deletions examples/asm/elmer/doc/pcengine-notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,54 @@ These basically correspond to VCE line 260, which is the start of the VSYNC
pulse.

(N.B. Add +64 for the RCR line.)



; ***************************************************************************
; PC ENGINE VDC DMA TIMINGS
; ***************************************************************************

Resolution ............................................... 256x222 .. 256x224

LINE-220-RCR-to-VBLANK CPU cycles ........................... 1010 ..... 1920
LINE-220-RCR-to-SATB-DMA-END CPU cycles ..................... 2398 ..... 3308
LINE-220-RCR-to-128-WORD-VRAM-DMA-END CPU cycles ............ 1702 ..... 2612
LINE-220-RCR-to-256-WORD-VRAM-DMA-END CPU cycles ............ 2396 ..... 3306
LINE-220-RCR-to-512-WORD-VRAM-DMA-END CPU cycles ............ 3782 ..... 4692
LINE-220-RCR-to-SATB-AND-256-WORD-VRAM-DMA-END CPU cycles ... 3790 ..... 4700

1388 CPU cycles = 1040 VDC cycles for 256-word SATB-DMA


Resolution ............................................... 352x222 .. 352x224

LINE-220-RCR-to-VBLANK CPU cycles ........................... 1002 ..... 1912
LINE-220-RCR-to-SATB-DMA-END CPU cycles ..................... 2042 ..... 2952
LINE-220-RCR-to-128-WORD-VRAM-DMA-END CPU cycles ............ 1522 ..... 2432
LINE-220-RCR-to-256-WORD-VRAM-DMA-END CPU cycles ............ 2042 ..... 2952
LINE-220-RCR-to-512-WORD-VRAM-DMA-END CPU cycles ............ 3080 ..... 3990
LINE-220-RCR-to-SATB-AND-256-WORD-VRAM-DMA-END CPU cycles ... 3084 ..... 3994

1040 CPU cycles = 1040 VDC cycles for 256-word SATB-DMA


Resolution ............................................... 512x222 .. 512x224

LINE-220-RCR-to-VBLANK CPU cycles ........................... 1016 ..... 1926
LINE-220-RCR-to-SATB-DMA-END CPU cycles ..................... 1700 ..... 2610
LINE-220-RCR-to-128-WORD-VRAM-DMA-END CPU cycles ............ 1358 ..... 2268
LINE-220-RCR-to-256-WORD-VRAM-DMA-END CPU cycles ............ 1700 ..... 2610
LINE-220-RCR-to-512-WORD-VRAM-DMA-END CPU cycles ............ 2386 ..... 3296
LINE-220-RCR-to-SATB-AND-256-WORD-VRAM-DMA-END CPU cycles ... 2390 ..... 3300

684 CPU cycles = 1026 VDC cycles for 256-word SATB-DMA


Resolution (TV Sports Football: VSW=0, VDS=20 22-lines) .. 352x240 .. 352x242

LINE-220-RCR-to-VBLANK CPU cycles ........................... 9192 ..... 9646
LINE-220-RCR-to-SATB-DMA-END CPU cycles .................... 10232 .... 10686
LINE-220-RCR-to-128-WORD-VRAM-DMA-END CPU cycles ............ 9712 .... 10168
LINE-220-RCR-to-256-WORD-VRAM-DMA-END CPU cycles ........... 10232 .... 10686
LINE-220-RCR-to-512-WORD-VRAM-DMA-END CPU cycles ........... 11270 .... 11724
LINE-220-RCR-to-SATB-AND-256-WORD-VRAM-DMA-END CPU cycles .. 11274 .... 11728
11 changes: 11 additions & 0 deletions examples/asm/elmer/rom-bare-dmatest/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
all: dmatest.pce

include ../Make_ex.inc

AFLAGS ?= --newproc --strip -m -l 2 -S -gA

SRC_INC = pceas.inc pcengine.inc joypad.asm tty.asm vce.asm vdc.asm
SRC_OVL = dmatest.asm

dmatest.pce: $(SRC_OVL) $(SRC_INC)
$(AS) $(AFLAGS) --raw dmatest.asm
Loading

0 comments on commit f0763a0

Please sign in to comment.