Skip to content

Commit d3caa19

Browse files
asiekierkamysterymath
authored andcommitted
[PCE] Fix issues.
1 parent 2b05b08 commit d3caa19

File tree

5 files changed

+235
-138
lines changed

5 files changed

+235
-138
lines changed

mos-platform/pce/libpce/include/pce/vdc.h

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void pce_vdc_set_copy_word(void);
6565
* @brief Set the VDC's copy method to copy every row.
6666
* Alias for @ref pce_vdc_set_copy_word .
6767
*/
68-
#define pce_vdc_set_copy_row() pce_vdc_set_copy_word()
68+
void pce_vdc_set_copy_row(void);
6969

7070
/**
7171
* @brief Set the VDC's copy method to copy every 32nd word.
@@ -75,7 +75,7 @@ void pce_vdc_set_copy_32_words(void);
7575
* @brief Set the VDC's copy method to copy every column for a 32-wide display.
7676
* Alias for @ref pce_vdc_set_copy_32_words .
7777
*/
78-
#define pce_vdc_set_copy_column_32() pce_vdc_set_copy_32_words()
78+
void pce_vdc_set_copy_column_32(void);
7979

8080
/**
8181
* @brief Set the VDC's copy method to copy every 64th word.
@@ -85,7 +85,7 @@ void pce_vdc_set_copy_64_words(void);
8585
* @brief Set the VDC's copy method to copy every column for a 64-wide display.
8686
* Alias for @ref pce_vdc_set_copy_64_words .
8787
*/
88-
#define pce_vdc_set_copy_column_64() pce_vdc_set_copy_64_words()
88+
void pce_vdc_set_copy_column_64(void);
8989

9090
/**
9191
* @brief Set the VDC's copy method to copy every 128th word.
@@ -95,7 +95,7 @@ void pce_vdc_set_copy_128_words(void);
9595
* @brief Set the VDC's copy method to copy every column for a 128-wide display.
9696
* Alias for @ref pce_vdc_set_copy_128_words .
9797
*/
98-
#define pce_vdc_set_copy_column_128() pce_vdc_set_copy_128_words()
98+
void pce_vdc_set_copy_column_128(void);
9999

100100
/**
101101
* @brief Copy data from RAM to VRAM.
@@ -144,17 +144,15 @@ bool pce_vdc_dma_finished(void);
144144
* - VCE_COLORBURST_OFF
145145
*/
146146
void pce_vdc_set_width_tiles(uint8_t tiles, uint8_t vce_flags);
147-
#define pce_vdc_set_width(pixels, vce_flags) pce_vdc_set_width_tiles((pixels) >> 3, vce_flags)
147+
void pce_vdc_set_width(uint16_t pixels, uint8_t vce_flags);
148148

149149
/**
150150
* @brief Set the VDC height, in raster lines.
151151
*
152152
* @param lines The number of raster lines.
153153
*/
154154
void pce_vdc_set_height(uint8_t lines);
155-
#define pce_vdc_set_resolution(width_pixels, height_pixels, vce_flags) \
156-
pce_vdc_set_width(width_pixels, vce_flags); \
157-
pce_vdc_set_height(height_pixels)
155+
void pce_vdc_set_resolution(uint16_t width_pixels, uint8_t height_pixels, uint8_t vce_flags);
158156

159157
/**
160158
* @brief Set the VDC background size.
@@ -187,62 +185,62 @@ void pce_vdc_disable(uint8_t value);
187185
/**
188186
* @brief Enable the background layer.
189187
*/
190-
#define pce_vdc_bg_enable() pce_vdc_enable(VDC_CONTROL_ENABLE_BG)
188+
void pce_vdc_bg_enable(void);
191189

192190
/**
193191
* @brief Disable the background layer.
194192
*/
195-
#define pce_vdc_bg_disable() pce_vdc_disable(VDC_CONTROL_ENABLE_BG)
193+
void pce_vdc_bg_disable(void);
196194

197195
/**
198196
* @brief Enable the sprite layer.
199197
*/
200-
#define pce_vdc_sprite_enable() pce_vdc_enable(VDC_CONTROL_ENABLE_SPRITE)
198+
void pce_vdc_sprite_enable(void);
201199

202200
/**
203201
* @brief Disable the sprite layer.
204202
*/
205-
#define pce_vdc_sprite_disable() pce_vdc_disable(VDC_CONTROL_ENABLE_SPRITE)
203+
void pce_vdc_sprite_disable(void);
206204

207205
/**
208206
* @brief Enable the scanline IRQ.
209207
*/
210-
#define pce_vdc_irq_scanline_enable() pce_vdc_enable(VDC_CONTROL_IRQ_SCANLINE)
208+
void pce_vdc_irq_scanline_enable(void);
211209

212210
/**
213211
* @brief Disable the scanline IRQ.
214212
*/
215-
#define pce_vdc_irq_scanline_disable() pce_vdc_disable(VDC_CONTROL_IRQ_SCANLINE)
213+
void pce_vdc_irq_scanline_disable(void);
216214

217215
/**
218216
* @brief Enable the sprite collision IRQ.
219217
*/
220-
#define pce_vdc_irq_sprite_collide_enable() pce_vdc_enable(VDC_CONTROL_IRQ_SPRITE_COLLIDE)
218+
void pce_vdc_irq_sprite_collide_enable(void);
221219

222220
/**
223221
* @brief Disable the sprite collision IRQ.
224222
*/
225-
#define pce_vdc_irq_sprite_collide_disable() pce_vdc_disable(VDC_CONTROL_IRQ_SPRITE_COLLIDE)
223+
void pce_vdc_irq_sprite_collide_disable(void);
226224

227225
/**
228226
* @brief Enable the sprite overflow IRQ.
229227
*/
230-
#define pce_vdc_irq_sprite_overflow_enable() pce_vdc_enable(VDC_CONTROL_IRQ_SPRITE_OVERFLOW)
228+
void pce_vdc_irq_sprite_overflow_enable(void);
231229

232230
/**
233231
* @brief Disable the sprite overflow IRQ.
234232
*/
235-
#define pce_vdc_irq_sprite_overflow_disable() pce_vdc_disable(VDC_CONTROL_IRQ_SPRITE_OVERFLOW)
233+
void pce_vdc_irq_sprite_overflow_disable(void);
236234

237235
/**
238236
* @brief Enable the veritcal blank IRQ.
239237
*/
240-
#define pce_vdc_irq_vblank_enable() pce_vdc_enable(VDC_CONTROL_IRQ_VBLANK)
238+
void pce_vdc_irq_vblank_enable(void);
241239

242240
/**
243241
* @brief Disable the veritcal blank IRQ.
244242
*/
245-
#define pce_vdc_irq_vblank_disable() pce_vdc_disable(VDC_CONTROL_IRQ_VBLANK)
243+
void pce_vdc_irq_vblank_disable(void);
246244

247245
/**
248246
* @brief SuperGrafx: Check for presence.
@@ -278,12 +276,12 @@ void pce_sgx_vdc_set(uint8_t id);
278276
/**
279277
* @brief SuperGrafx: Get the current VDC's index port location.
280278
*/
281-
volatile uint8_t *pce_sgx_vdc_get_index();
279+
volatile uint8_t *pce_sgx_vdc_get_index(void);
282280

283281
/**
284282
* @brief SuperGrafx: Get the current VDC's data port location.
285283
*/
286-
volatile uint16_t *pce_sgx_vdc_get_data();
284+
volatile uint16_t *pce_sgx_vdc_get_data(void);
287285

288286
#ifdef __cplusplus
289287
}

mos-platform/pce/libpce/src/memory.S

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ pce_memop:
2626
stx __rc6
2727
ldx __rc3
2828
stx __rc7
29+
; fall into __pce_memop_inner
30+
; Inner version of pce_memop, more suitable for ASM calling.
31+
;
32+
; __rc4-__rc5 source
33+
; __rc6-__rc7 dest
34+
; __rc8-__rc9 length
35+
; A mode
36+
; clobbers __rc10, preserves __rc3
2937
__pce_memop_inner:
3038
ldy __rc3
3139
sta __rc3

mos-platform/pce/libpce/src/psg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void __pce_psg_init(void);
1515

1616
void pce_psg_reset(void) {
1717
*IO_PSG_VOLUME = 0;
18-
for (uint8_t i = 0; i < 6; i++) {
18+
for (uint8_t i = 0; i < 6; i++) {
1919
*IO_PSG_CH_SELECT = i;
2020
*IO_PSG_CH_CONTROL = 0;
2121
*IO_PSG_CH_NOISE = 0;

0 commit comments

Comments
 (0)