From 8deeb216cbff4e578284fc040d8f0b51e96d4b04 Mon Sep 17 00:00:00 2001 From: spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> Date: Wed, 29 Jun 2022 13:09:57 +0200 Subject: Add -g to default flags, update changelog and known bugs --- doc/known_bugs.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'doc/known_bugs.md') diff --git a/doc/known_bugs.md b/doc/known_bugs.md index e39da43..9e83f03 100644 --- a/doc/known_bugs.md +++ b/doc/known_bugs.md @@ -1,8 +1,9 @@ # Known PSn00bSDK bugs -This is an incomplete list of things that are currently broken (or not behaving -as they should, or untested on real hardware) and haven't yet been fixed. +This is an incomplete list of things that are known to be currently broken (or +not behaving as they should, or untested on real hardware) and haven't yet been +fixed. ## Toolchain @@ -15,18 +16,28 @@ as they should, or untested on real hardware) and haven't yet been fixed. them. It might be necessary to list such symbols in a dummy array to prevent the compiler from stripping them away from the executable. +- Link-time optimization is broken due to GCC not supporting it when linking + weak functions written in assembly. + ## Libraries `psxgpu`: -- In some *very rare* cases, `VSync()` seems to crash the system by performing - unaligned accesses for unknown reasons. +- `LoadImage()` and `StoreImage()` use DMA to transfer data to/from the GPU. + As the DMA channel is configured to transfer 8 words (32 bytes) at a time, + the length of the data *must* be a multiple of 32 bytes. Attempting to + transfer any data whose length isn't a multiple of 32 bytes will result in + `DrawSync()` hanging and never returning, however a warning will be printed + on the debug console. `psxspu`: +- `SpuCtrlSync()` locks up on MAME, making any code that tries to initialize + the SPU hang. It works on other emulators as well as on real hardware. + - Calls to `SpuSetTransferMode()` are ignored. SPU transfers are always performed using DMA, which imposes limitations such as the data length having - to be a multiple of 64 bytes. + to be a multiple of 16 words (64 bytes, see above). `psxetc`: @@ -40,4 +51,4 @@ as they should, or untested on real hardware) and haven't yet been fixed. See [README.md in the examples directory](../examples/README.md#examples-summary). ----------------------------------------- -_Last updated on 2022-02-03 by spicyjpeg_ +_Last updated on 2022-06-29 by spicyjpeg_ -- cgit v1.2.3 From f2e946cc0f9730c0da56aae533b3429a0381003e Mon Sep 17 00:00:00 2001 From: spicyjpeg Date: Sun, 21 Aug 2022 23:36:45 +0200 Subject: Fix psxetc bugs, IRQ controller register size --- doc/known_bugs.md | 11 ++++------- libpsn00b/include/hwregs_c.h | 6 +++--- libpsn00b/psxetc/interrupts.c | 5 +++-- libpsn00b/psxgpu/common.c | 2 +- 4 files changed, 11 insertions(+), 13 deletions(-) (limited to 'doc/known_bugs.md') diff --git a/doc/known_bugs.md b/doc/known_bugs.md index 9e83f03..3fbfdc2 100644 --- a/doc/known_bugs.md +++ b/doc/known_bugs.md @@ -32,12 +32,9 @@ fixed. `psxspu`: -- `SpuCtrlSync()` locks up on MAME, making any code that tries to initialize - the SPU hang. It works on other emulators as well as on real hardware. - -- Calls to `SpuSetTransferMode()` are ignored. SPU transfers are always - performed using DMA, which imposes limitations such as the data length having - to be a multiple of 16 words (64 bytes, see above). +- `SpuInit()`, `SpuRead()` and `SpuWrite()` may take several seconds on MAME + due to the SPU status register being emulated incorrectly. They work as + expected on other emulators as well as on real hardware. `psxetc`: @@ -51,4 +48,4 @@ fixed. See [README.md in the examples directory](../examples/README.md#examples-summary). ----------------------------------------- -_Last updated on 2022-06-29 by spicyjpeg_ +_Last updated on 2022-08-21 by spicyjpeg_ diff --git a/libpsn00b/include/hwregs_c.h b/libpsn00b/include/hwregs_c.h index 7b80590..b205b87 100644 --- a/libpsn00b/include/hwregs_c.h +++ b/libpsn00b/include/hwregs_c.h @@ -14,7 +14,7 @@ /* Constants */ -#define IOBASE 0x1f800000 +#define IOBASE 0xbf800000 #define F_CPU 33868800UL #define F_GPU 53222400UL @@ -96,8 +96,8 @@ /* IRQ controller */ -#define IRQ_STAT _MMIO32(IOBASE | 0x1070) -#define IRQ_MASK _MMIO32(IOBASE | 0x1074) +#define IRQ_STAT _MMIO16(IOBASE | 0x1070) +#define IRQ_MASK _MMIO16(IOBASE | 0x1074) /* DMA */ diff --git a/libpsn00b/psxetc/interrupts.c b/libpsn00b/psxetc/interrupts.c index 32e91f0..859209a 100644 --- a/libpsn00b/psxetc/interrupts.c +++ b/libpsn00b/psxetc/interrupts.c @@ -18,7 +18,8 @@ static void (*_irq_handlers[NUM_IRQ_CHANNELS])(void); static void (*_dma_handlers[NUM_DMA_CHANNELS])(void); static int _num_dma_handlers = 0; -static uint32_t _saved_irq_mask, _saved_dma_dpcr, _saved_dma_dicr; +static uint16_t _saved_irq_mask; +static uint32_t _saved_dma_dpcr, _saved_dma_dicr; static int _isr_installed = 0; /* Custom ISR jmp_buf */ @@ -52,7 +53,7 @@ static const struct JMP_BUF _isr_jmp_buf = { /* Internal IRQ and DMA handlers */ static void _global_isr(void) { - uint32_t stat = IRQ_STAT, mask = IRQ_MASK; + uint16_t stat = IRQ_STAT, mask = IRQ_MASK; // Clear all IRQ flags in one shot. This is not the "proper" way to do it // but it's much faster than clearing one flag at a time. diff --git a/libpsn00b/psxgpu/common.c b/libpsn00b/psxgpu/common.c index de60df4..cef1508 100644 --- a/libpsn00b/psxgpu/common.c +++ b/libpsn00b/psxgpu/common.c @@ -215,7 +215,7 @@ void DrawOTag(const uint32_t *ot) { // condition where the DMA transfer could end while interrupts are being // disabled. Interrupts are disabled through the IRQ_MASK register rather // than by calling EnterCriticalSection() for performance reasons. - uint32_t mask = IRQ_MASK; + uint16_t mask = IRQ_MASK; IRQ_MASK = 0; if (DMA_CHCR(2) & (1 << 24)) { -- cgit v1.2.3