234 Commits

Author SHA1 Message Date
1a7a8c4484 serial_transfer: add 'rate' command
This makes it possible to change the serial baud rate without
uploading a new serial transfer program. I'm not sure how useful this
will be, but it is simple enough to add.

The client program is also substantially improved. Sincerely I do not
understand how/why this works. Experimentally, I found that feeding
the ft232h data in chunks of up to roughly 384 bytes works reliably,
both for reads and writes. Larger chunk sizes are (as expected)
faster, but the tranfers do not appear to be consistently correct in
this case.

I have no logical explanation for this. The size of the ft232h FIFO is
1K each for the transmit and receive buffer respectively.

This also enables RTS/CTS hardware flow control. Surprisingly, this
doesn't appear to affect reliability significantly.
2024-03-15 18:33:15 +08:00
d912278afd serial_transfer: self-relocate to the end of system memory
The serial_transfer loader, as long as the target program voluntarily
terminates itself at some point, is able to load multiple programs
consecutively without requiring a physical power cycle to reload the
transfer program from CD.

The current example.mk juggles between two different "memory layouts",
one for "burn to a physical CD" and another for "load via serial
cable". Because the serial_transfer program now relocates itself to
the end of system memory, this means the 0x8c010000 area is now usable
by programs that are loaded by serial_transfer.
2024-03-13 20:56:37 +08:00
0806ed9ac7 example: verify everything compiles successfully 2024-03-09 19:05:41 +08:00
57a8862ac3 modifier_volume: fix example 2024-03-09 18:42:44 +08:00
3a92dd070c macaw_multipass: fix example
The prior issue with this example was almost certainly related to OPB
overflow, due to an incorrect tile area calculation.
2024-03-09 18:39:46 +08:00
ae7f35191d example/sprite: update 2024-03-09 18:16:44 +08:00
f8dc9f1250 example: add video_output example
The intent of this example is to change video output modes in response
to swapping the cable type.
2024-03-09 17:15:36 +08:00
2a121625c8 suzanne_profile: correct periperipheral comment 2024-03-09 09:19:48 +08:00
c0e10fe8f1 vga: delete
This is replaced with the (slightly cleaner) holly/video_output.
2024-03-08 20:46:55 +08:00
0deedb9858 serial_transfer: increase serial line speed to 312500 bps
Interestingly, this did not cause a perceptible improvement in the
overall data transfer rate.
2024-03-04 16:44:03 +08:00
0ff0aa5346 example/aica_gdrom: play audio read from gdrom
This still has issues, notably:

Despite the first 16kbytes of audio being loaded prior to starting the
AICA ARM7 CPU, the GDROM drive returns "busy" for the following
~48kbytes. This in turn causes the AICA to play audio from
uninitialized memory.

There is also a separate issue where the timing of changing the start
address of the audio channel causes a faint popping sound throughout
the audio playback.

I should do more timing experiments with the GDROM drive, and improve
this example to play the audio with fewer artifacts.
2024-03-04 16:40:25 +08:00
0aea1d0db2 example/aica_gdrom: initial
aica_gdrom currently copies from system ram to AICA ram, 128 bytes at
a time, synchronized with the AICA sample timer.
2024-03-01 19:38:47 +08:00
73a685face aica: use SCIPD to detect TIMA overflow
Real hardware does not support TIMA reads--SCIPD is the correct way to
achieve this.
2024-03-01 15:26:47 +08:00
57721c485f example/arm: rename to channel 2024-02-29 17:32:54 +08:00
150a415433 example/arm/Makefile: remove implicit "circular dependency" 2024-02-29 17:27:06 +08:00
3338b611c1 aica: initial working example
This plays 10 seconds of PCM audio via the AICA ARM CPU.
2024-02-29 16:51:25 +08:00
10d17d3c98 example: add gdrom_iso9660
This combines my iso9660 parsing code, with all of the prior gdrom packet
interface / command code.

The example, on real Dreamcast hardware, displays the first 2048 bytes [1] of every
file in the root directory on the serial console.

[1] or the size of the file, whichever is smaller
2024-02-27 00:28:39 +08:00
c45cb293f0 gdrom/command_packet_format: improve initializer; add _data() method 2024-02-26 20:32:33 +08:00
41b707e75d gdrom: add gdrom_bits 2024-02-26 18:04:23 +08:00
c95182081a gdrom: add gdrom_command_packet_format.hpp
This re-uses most of the code from the ta_parameter_format
generator--this was factored out to "generic_sparse_struct.py".
2024-02-26 15:31:40 +08:00
c2e596a1c0 regs: add g1_if GDUNLOCK register 2024-02-25 13:32:40 +08:00
e4c2a047fa example: add gdrom_test
This successfully reads the first 17 sectors of the first data track
of a CD.
2024-02-25 13:27:39 +08:00
38b4dda6ab software_ta: gouraud shading experiment 2024-02-24 09:31:21 +08:00
59708cc3cf examples: add software_ta 2024-02-23 23:47:43 +08:00
4e71e002bf examples: add dump_object_list 2024-02-23 18:14:24 +08:00
aed943ccad heart: duplicate pi declaration 2024-02-23 15:27:16 +08:00
31eb0df508 maple: remove all remaining uses of the two-argument "dma_start"
After thinking about this more, I realized it is probably never useful, and
certainly completely incorrect in all of the cases it was still being used in
the examples.
2024-02-03 10:15:39 +08:00
dfc14d8658 maple: move ocbp inline assembly to dma_start
Necessarily, this means that dma_start must now know what the size of the
response is, so that it can issue the appropriate number of ocbp instructions.

This also cleans up the inconsistent _command_buf and _recieve_buf declarations.
2024-02-03 09:52:21 +08:00
511d99563d maple_bus_commands: zero-sized structs should be zero sized
From the GCC manual.

> GCC permits a C structure to have no members:

struct empty {
};

> The structure has size zero. In C++, empty structures are part of the
> language. G++ treats empty structures as if they had a single member of type
> char.

I was not aware of the different behavior in C++.

This fixes every maple example--most were broken for multiple reasons, including
this one.

This also enables SH4 caching. This includes linking code/data into the P1
area (previously this was not the case).

The maple examples (which indeed involve much use of DMA) require much work to
successfully work with the operand and copyback caches. The vibration example
currently is the most complete, though I should consider more on how I want to
structure maple response operand cache invalidation more generally.
2024-02-02 22:05:10 +08:00
a71ac1c4b1 suzanne_profile: remove tearing
Though I did spend much time thinking about this, my idea was not correct.

The "tearing" and "previous frame is being shown while it is being drawn" is
simply because that's exactly what the logic in holly/core.cpp did.

This is no longer the case--by the time the newly-created core_flip function is
called, the core render is complete, and we should switch the FB_R_SOF1 to the
current framebuffer, not the one that is going to be written on next frame.

This also modifies alt.lds so that (non-startup) code now runs in the P1 area,
with operand/instruction/copyback caches enabled. This caused a 10x speed
increase in my testing.
2024-02-02 13:11:32 +08:00
b17e075138 add verite font
There are still texture sampling issues that I don't understand. Until
I properly understand this, using (bitmap) fonts that have
power-of-two dimensions seem to produce "acceptable but incorrect"
results.
2024-02-02 09:19:09 +08:00
62f47f8f0b example/clipping: face_vtn 2024-02-02 08:36:51 +08:00
f400fe6412 example: suzanne_profile: incomplete
This has turned in to an experiment related to texture sampling behavior on the
Dreamcast.
2024-02-02 08:18:18 +08:00
0381d356bb example: add clipping_textured 2024-01-27 12:20:15 +08:00
b4239dcfe8 geometry/circle: add texture coordinates
Blender also generated a different triangulation.
2024-01-27 10:58:39 +08:00
4842ab0e4f example: add clipping2
Unlike the previous clipping example, this clipping example preserves
surface normals.
2024-01-27 10:20:46 +08:00
e54d762a20 example/viewing_system: add "viewer" concept 2024-01-11 15:34:55 +08:00
6836790205 add viewing_system
This is inspirted by the book "3D Computer Graphics" by Alan Watt.
2024-01-06 18:43:57 +08:00
c9b57abf81 example: add clipping 2024-01-06 11:32:41 +08:00
1f6a29f379 example: update several examples 2024-01-03 23:32:37 +08:00
dcb9f36120 sh7091_bits.ods: partial
Notably missing is:

- BSC (PDTRA / PCTRA)

This also updates a handful of files to use the new sh7091_bits.hpp.
2024-01-01 23:43:06 +08:00
0b6c650ebd common.mk: add headless csv build rule 2024-01-01 00:58:10 +08:00
e8aea009c6 example: add heart
I originally planned to make this a render-to-texture demo, but this
is fairly interesting by itself.
2023-12-31 20:19:41 +08:00
b6457bf687 modifier_volume_with_two_volumes: add simple controller input
The plane can be moved around with the analog stick and analog
triggers of the controller connected to port 1.
2023-12-30 23:08:13 +08:00
8e534e9e25 example: modifier_volume_with_two_volumes: textured 2023-12-30 22:22:50 +08:00
549254615e example: modifier_volume_with_two_volumes 2023-12-30 21:50:54 +08:00
de76c0bed2 ta_parameter_format: generate TA parameter formats from csv
This replaces all handwritten TA parameter format structures with
automatically generated structures.

All valid TA parameter formats are now declared.
2023-12-30 18:55:09 +08:00
7f9469c9a7 regs/gen/ta_parameter_format: incomplete 2023-12-30 17:38:15 +08:00
5db6272ceb example: add modifier volume
This creates a modifier volume with a cube that intersects a plane.
2023-12-30 15:11:22 +08:00
4bb04a0362 example: add maple_analog
Also adds the incomplete modifier_volume example.

This also adds vec2 for UV coordinates, and obj_to_cpp has been
modified to parse vertex texture coordinates from obj files.
2023-12-30 10:53:39 +08:00