llvm-mos-sdk
bios.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023 Adrian "asie" Siekierka
3  *
4  * Licensed under the Apache License, Version 2.0 with LLVM Exceptions,
5  * See https://github.com/llvm-mos/llvm-mos-sdk/blob/main/LICENSE for license
6  * information.
7  */
8 
9 #ifndef _PCE_CD_BIOS_H_
10 #define _PCE_CD_BIOS_H_
11 
12 #include "types.h"
13 #include <pce.h>
14 #include <stdbool.h>
15 #include <stdint.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
25 typedef enum {
42 
43 typedef enum {
79  PCE_CDB_VRAM = 0xFF
81 
82 typedef enum {
91 
92 typedef enum {
102 
106 bool pce_cdb_vram_in_use(void);
107 
111 __attribute__((noreturn)) void pce_cdb_start(void);
112 
119 
120 typedef enum {
127 
128 typedef enum {
134 
146 
160 
166 void pce_cdb_cd_seek(pce_sector_t sector);
167 
178 __attribute__((noreturn)) void pce_cdb_cd_exec(pce_sector_t sector,
182 
183 typedef enum {
190 
203  uint8_t end_type, pce_sector_t end, uint8_t mode);
204 
205 typedef enum {
211 
222 
229 
236 
243 
244 #define PCE_CDB_SUBQ_TYPE_2CH 0x0
245 #define PCE_CDB_SUBQ_TYPE_4CH 0x4
246 #define PCE_CDB_SUBQ_TYPE_DATA 0x8
247 #define PCE_CDB_SUBQ_TYPE_MASK 0xC
248 #define PCE_CDB_SUBQ_SCMS 0x2
249 #define PCE_CDB_SUBQ_PRE_EMPHASIS 0x1
250 
251 typedef struct pce_cdb_subq_data {
252  uint8_t status; // playback status
253  uint8_t control; // control/mode bits
259 
268 
269 typedef struct pce_cdb_toc_data {
270  union {
271  struct {
272  uint8_t track, track_end, __unused1;
273  };
274  struct {
276  };
277  struct {
279  };
280  };
283 
287  uint8_t track_id);
289  uint8_t track_id);
290 
297 
298 typedef enum {
308 
316 
324 
325 typedef enum {
332 
339 
343 void pce_cdb_adpcm_reset(void);
344 
355  uint16_t address);
356 
368 
380  uint16_t dest, uint16_t length);
381 
393  uint16_t dest, uint16_t length);
394 
395 typedef enum {
405 
417  uint8_t mode);
418 
427 
438  uint8_t divider);
439 
443 void pce_cdb_adpcm_stop(void);
444 
445 typedef enum {
449  ADPCM_BUSY = 0x00FF,
453  ADPCM_STOPPED = 0x0100,
459 
466 
474 
481 void pce_cdb_irq_set(uint8_t type, void (*irq_handler)(void));
482 
488 void pce_cdb_irq_enable(uint8_t mask);
489 
495 void pce_cdb_irq_disable(uint8_t mask);
496 
497 #define PCE_CDB_VDC_BG_WIDTH_32 (0)
498 #define PCE_CDB_VDC_BG_WIDTH_64 (1)
499 #define PCE_CDB_VDC_BG_WIDTH_128 (2)
500 #define PCE_CDB_VDC_BG_HEIGHT_32 (0 << 2)
501 #define PCE_CDB_VDC_BG_HEIGHT_64 (1 << 2)
502 #define PCE_CDB_VDC_BG_SIZE_32_32 \
503  (PCE_CDB_VDC_BG_WIDTH_32 | PCE_CDB_VDC_BG_HEIGHT_32)
504 #define PCE_CDB_VDC_BG_SIZE_64_32 \
505  (PCE_CDB_VDC_BG_WIDTH_64 | PCE_CDB_VDC_BG_HEIGHT_32)
506 #define PCE_CDB_VDC_BG_SIZE_128_32 \
507  (PCE_CDB_VDC_BG_WIDTH_128 | PCE_CDB_VDC_BG_HEIGHT_32)
508 #define PCE_CDB_VDC_BG_SIZE_32_64 \
509  (PCE_CDB_VDC_BG_WIDTH_32 | PCE_CDB_VDC_BG_HEIGHT_64)
510 #define PCE_CDB_VDC_BG_SIZE_64_64 \
511  (PCE_CDB_VDC_BG_WIDTH_64 | PCE_CDB_VDC_BG_HEIGHT_64)
512 #define PCE_CDB_VDC_BG_SIZE_128_64 \
513  (PCE_CDB_VDC_BG_WIDTH_128 | PCE_CDB_VDC_BG_HEIGHT_64)
514 
521 
522 #define PCE_CDB_VDC_CLOCK_5MHZ 0
523 #define PCE_CDB_VDC_CLOCK_7MHZ 1
524 
535  uint8_t height_tiles);
536 
537 #define PCE_CDB_VDC_COPY_1 0
538 #define PCE_CDB_VDC_COPY_32 1
539 #define PCE_CDB_VDC_COPY_64 2
540 #define PCE_CDB_VDC_COPY_128 3
541 
548 
554 
559 void pce_cdb_vdc_set_bg_row_copy(void);
560 
564 void pce_cdb_wait_vblank(void);
565 
570 
575 
580 
585 
589 void pce_cdb_vdc_bg_enable(void);
590 
594 void pce_cdb_vdc_bg_disable(void);
595 
599 void pce_cdb_vdc_sprite_enable(void);
600 
604 void pce_cdb_vdc_sprite_disable(void);
605 
610 
615 
616 #define PCE_CDB_SPR_INDEX ((volatile uint8_t *)0x2216)
617 #define PCE_CDB_SPRITE ((volatile vdc_sprite_t *)0x2217)
618 #define PCE_CDB_SPR_Y ((volatile uint16_t *)0x2217)
619 #define PCE_CDB_SPR_Y_LO ((volatile uint8_t *)0x2217)
620 #define PCE_CDB_SPR_Y_HI ((volatile uint8_t *)0x2218)
621 #define PCE_CDB_SPR_X ((volatile uint16_t *)0x2219)
622 #define PCE_CDB_SPR_X_LO ((volatile uint8_t *)0x2219)
623 #define PCE_CDB_SPR_X_HI ((volatile uint8_t *)0x221A)
624 #define PCE_CDB_SPR_PATTERN ((volatile uint16_t *)0x221B)
625 #define PCE_CDB_SPR_PATTERN_LO ((volatile uint8_t *)0x221B)
626 #define PCE_CDB_SPR_PATTERN_HI ((volatile uint8_t *)0x221C)
627 #define PCE_CDB_SPR_ATTR ((volatile uint16_t *)0x221D)
628 #define PCE_CDB_SPR_ATTR_LO ((volatile uint8_t *)0x221D)
629 #define PCE_CDB_SPR_ATTR_HI ((volatile uint8_t *)0x221E)
630 
631 typedef enum {
640 
647 
654 
659 
664 
671 
678 
685 
693 
701 
706 
711 
716 
721 
726 
731 
736 
741 
752 bool pce_cdb_ram_query(uint8_t *bank_start, uint8_t *bank_size);
753 
757 void pce_cdb_colors_bg_none(void);
758 
766 
770 void pce_cdb_colors_sprite_none(void);
771 
779 
790 bool pce_cdb_colors_read(void);
791 
802 bool pce_cdb_colors_set(void);
803 
804 #ifdef __cplusplus
805 }
806 #endif
807 
808 #endif /* _PCE_CD_BIOS_H_ */
end
uint8_t end
Definition: cpm.h:194
pce_cdb_subq_data_t
struct pce_cdb_subq_data pce_cdb_subq_data_t
pce_cdb_divmod_u16_result_t
struct pce_cdb_divmod_u16_result pce_cdb_divmod_u16_result_t
PCE_CDB_MASK_IRQ_VDC
@ PCE_CDB_MASK_IRQ_VDC
Definition: bios.h:94
PCE_CDB_NOT_AUDIO_TRACK
@ PCE_CDB_NOT_AUDIO_TRACK
Definition: bios.h:33
PCE_CDB_LOCATION_TYPE_TRACK
@ PCE_CDB_LOCATION_TYPE_TRACK
Definition: bios.h:123
pce_cdb_adpcm_read_next_cd
uint8_t pce_cdb_adpcm_read_next_cd(pce_sector_t sector, uint8_t length)
Read ADPCM data from CD to the ADPCM buffer, continuing where the previous pce_cdb_adpcm_read_cd_buff...
pce_cdb_divmod_s16_result
Definition: bios.h:707
pce_cdb_vram_in_use
bool pce_cdb_vram_in_use(void)
Check if VRAM is currently in use by a CD BIOS command.
PCE_CDB_SUCCESS
@ PCE_CDB_SUCCESS
Definition: bios.h:26
pce_cdb_divmod_s16
pce_cdb_divmod_s16_result_t pce_cdb_divmod_s16(int16_t a, int16_t b)
Perform a 16/16 signed division/modulo.
pce_cdb_vdc_sprite_table_set_vram_addr
void pce_cdb_vdc_sprite_table_set_vram_addr(uint16_t address)
Set the VRAM sprite table location.
std::uint16_t
::uint16_t uint16_t
Definition: cstdint:22
pce_cdb_adpcm_status_flags
pce_cdb_adpcm_status_flags
Definition: bios.h:445
pcd_cdb_irq_vector
pcd_cdb_irq_vector
Definition: bios.h:82
pce_cdb_subq_data::track_time
pce_sector_t track_time
Definition: bios.h:256
pce_cdb_bin_to_bcd
uint8_t pce_cdb_bin_to_bcd(uint8_t value)
Convert a binary number to a BCD number.
PCE_CDB_SUBCODE_T
@ PCE_CDB_SUBCODE_T
Definition: bios.h:302
pce_cdb_divmod_s16_result::quot
int16_t quot
Definition: bios.h:708
pce_cdb_subq_data
Definition: bios.h:251
pce_cdb_subq_data::control
uint8_t control
Definition: bios.h:253
PCE_CDB_MASK_IRQ_EXTERNAL
@ PCE_CDB_MASK_IRQ_EXTERNAL
Definition: bios.h:93
pce_cdb_divmod_s16_result_t
struct pce_cdb_divmod_s16_result pce_cdb_divmod_s16_result_t
PCE_CDB_ID_HBLANK
@ PCE_CDB_ID_HBLANK
Definition: bios.h:87
pce_cdb_subq_data::index
uint8_t index
Definition: bios.h:255
pce_cdb_toc_data::second
uint8_t second
Definition: bios.h:275
pce_cdb_cd_read_toc_lead_out_time
uint8_t pce_cdb_cd_read_toc_lead_out_time(pce_cdb_toc_data_t *buffer)
PCE_CDB_ADDRESS_BYTES
@ PCE_CDB_ADDRESS_BYTES
An address in the local address space (length specified in bytes).
Definition: bios.h:47
clock
long clock(void)
pce_cdb_divmod_u16
pce_cdb_divmod_u16_result_t pce_cdb_divmod_u16(uint16_t a, uint16_t b)
Perform a 16/16 unsigned division/modulo.
pce_cdb_vdc_set_copy
void pce_cdb_vdc_set_copy(uint8_t mode)
Set the automatic increment for VRAM addresses to a given mode.
pce_cdb_cd_not_ready
uint8_t pce_cdb_cd_not_ready(void)
Check if the CD drive is ready.
pce_cdb_toc_data::hi
uint8_t hi
Definition: bios.h:278
PCE_CDB_CDDA_SEARCH_PLAY_BLOCK
@ PCE_CDB_CDDA_SEARCH_PLAY_BLOCK
Definition: bios.h:208
PCE_CDB_INVALID_PARAMETER
@ PCE_CDB_INVALID_PARAMETER
Definition: bios.h:37
PCE_CDB_ID_IRQ_EXTERNAL
@ PCE_CDB_ID_IRQ_EXTERNAL
Definition: bios.h:83
PCE_CDB_NOT_READY
@ PCE_CDB_NOT_READY
Definition: bios.h:27
pce_cdb_colors_bg_none
void pce_cdb_colors_bg_none(void)
Clear the background palette RAM buffer.
pce_cdb_toc_data::minute
uint8_t minute
Definition: bios.h:275
PCE_CDB_VRAM_DMA_REPEAT_SATB
@ PCE_CDB_VRAM_DMA_REPEAT_SATB
Definition: bios.h:638
pce_cdb_mul_u16
uint32_t pce_cdb_mul_u16(uint16_t a, uint16_t b)
Perform a 16x16->32 unsigned multiplication.
PCE_CDB_MASK_HBLANK_NO_BIOS
@ PCE_CDB_MASK_HBLANK_NO_BIOS
Definition: bios.h:98
PCE_CDB_LOCATION_TYPE_TIME
@ PCE_CDB_LOCATION_TYPE_TIME
Definition: bios.h:122
PCE_CDB_MASK_HBLANK
@ PCE_CDB_MASK_HBLANK
Definition: bios.h:97
pce_cdb_toc_data::track
uint8_t track
Definition: bios.h:272
PCE_CDB_VRAM_DMA_SRC_INC
@ PCE_CDB_VRAM_DMA_SRC_INC
Definition: bios.h:634
pce_cdb_cd_read_toc_track_time
uint8_t pce_cdb_cd_read_toc_track_time(pce_cdb_toc_data_t *buffer, uint8_t track_id)
pce_cdb_cdda_read_subcode_q
uint8_t pce_cdb_cdda_read_subcode_q(pce_cdb_subq_data_t *buffer)
Read CD audio Subcode Q (timing) data.
pce.h
pce_cdb_cd_read_toc_track_count
uint8_t pce_cdb_cd_read_toc_track_count(pce_cdb_toc_data_t *buffer)
PCE_CDB_ID_VBLANK
@ PCE_CDB_ID_VBLANK
Definition: bios.h:88
PCE_CDB_FADER_PCM_2_5_SEC
@ PCE_CDB_FADER_PCM_2_5_SEC
Definition: bios.h:329
pce_cdb_divmod_s16_result::rem
int16_t rem
Definition: bios.h:709
PCE_CDB_ID_IRQ_VDC
@ PCE_CDB_ID_IRQ_VDC
Definition: bios.h:84
length
uint8_t uint16_t uint16_t length
Definition: bios.h:181
pce_cdb_address_type
pce_cdb_address_type
Definition: bios.h:43
pce_cdb_mul_u8
uint16_t pce_cdb_mul_u8(uint8_t a, uint8_t b)
Perform an 8x8->16 unsigned multiplication.
pce_cdb_subcode
pce_cdb_subcode
Definition: bios.h:298
std::uint8_t
::uint8_t uint8_t
Definition: cstdint:21
PCE_CDB_INVALID_ADDRESS
@ PCE_CDB_INVALID_ADDRESS
Definition: bios.h:36
pce_cdb_toc_data::md
uint8_t md
Definition: bios.h:278
PCE_CDB_FADER_PCM_6_SEC
@ PCE_CDB_FADER_PCM_6_SEC
Definition: bios.h:327
PCE_CDB_VRAM_DMA_DEST_DEC
@ PCE_CDB_VRAM_DMA_DEST_DEC
Definition: bios.h:637
pce_cdb_vdc_irq_scanline_enable
void pce_cdb_vdc_irq_scanline_enable(void)
Enable the scanline IRQ.
pce_cdb_divmod_u16_result
Definition: bios.h:702
PCE_CDB_FADER_ADPCM_6_SEC
@ PCE_CDB_FADER_ADPCM_6_SEC
Definition: bios.h:328
PCE_CDB_SUBCODE_S
@ PCE_CDB_SUBCODE_S
Definition: bios.h:303
PCE_CDB_NOT_DATA_TRACK
@ PCE_CDB_NOT_DATA_TRACK
Definition: bios.h:34
pce_cdb_colors_sprite_at
void pce_cdb_colors_sprite_at(void *address, uint8_t count)
Set the location of the sprite palette RAM buffer.
PCE_CDB_BASE_SET_SECOND
@ PCE_CDB_BASE_SET_SECOND
Definition: bios.h:131
pce_cdb_irq_enable
void pce_cdb_irq_enable(uint8_t mask)
Enable the specified IRQs.
PCE_CDB_VRAM_DMA_IRQ_SATB_DONE
@ PCE_CDB_VRAM_DMA_IRQ_SATB_DONE
Definition: bios.h:632
pce_cdb_toc_data::control
uint8_t control
Definition: bios.h:281
pce_cdb_toc_data
Definition: bios.h:269
pce_cdb_cdda_search
uint8_t pce_cdb_cdda_search(pce_sector_t sector, uint8_t mode)
Search for a CD audio track.
PCE_CDB_SEEK_ERROR
@ PCE_CDB_SEEK_ERROR
Definition: bios.h:31
PCE_CDB_END_OF_DISK
@ PCE_CDB_END_OF_DISK
Definition: bios.h:38
pce_cdb_sqrt
uint8_t pce_cdb_sqrt(uint16_t a)
Calculate the square root of a given value.
pce_cdb_vdc_irq_vblank_disable
void pce_cdb_vdc_irq_vblank_disable(void)
Disable the veritcal blank IRQ.
PCE_CDB_SUBCODE_W
@ PCE_CDB_SUBCODE_W
Definition: bios.h:299
PCE_CDB_CDDA_SEARCH_PAUSE_NONBLOCK
@ PCE_CDB_CDDA_SEARCH_PAUSE_NONBLOCK
Definition: bios.h:207
std::int8_t
::int8_t int8_t
Definition: cstdint:7
PCE_CDB_SUBCODE_V
@ PCE_CDB_SUBCODE_V
Definition: bios.h:300
channel
char channel
Definition: famitone2.h:31
pce_cdb_cd_read
uint8_t pce_cdb_cd_read(pce_sector_t sector, uint8_t address_type, uint16_t address, uint16_t length)
Read sectors from the CD drive.
PCE_CDB_BANK_MPR6
@ PCE_CDB_BANK_MPR6
Bank number (uses MPR6).
Definition: bios.h:71
PCE_CDB_FADER_NONE
@ PCE_CDB_FADER_NONE
Definition: bios.h:326
pce_cdb_cd_base
void pce_cdb_cd_base(pce_sector_t base, uint8_t mode)
Set the starting sector, used as an offset for future BIOS calls.
PCE_CDB_BASE_SET_FIRST
@ PCE_CDB_BASE_SET_FIRST
Definition: bios.h:130
pcd_cdb_irq_vector_mask
pcd_cdb_irq_vector_mask
Definition: bios.h:92
pce_cdb_cdda_play
uint8_t pce_cdb_cdda_play(uint8_t start_type, pce_sector_t start, uint8_t end_type, pce_sector_t end, uint8_t mode)
Play CD audio.
PCE_CDB_SUBCODE_P
@ PCE_CDB_SUBCODE_P
Definition: bios.h:306
pce_cdb_adpcm_stop
void pce_cdb_adpcm_stop(void)
Stop ADPCM playback.
pce_cdb_version
uint16_t pce_cdb_version(void)
Get the CD BIOS version.
count
const void uint16_t count
Definition: memory.h:58
PCE_CDB_LOCATION_TYPE_CURRENT
@ PCE_CDB_LOCATION_TYPE_CURRENT
Definition: bios.h:124
PCE_CDB_LOCATION_TYPE_SECTOR
@ PCE_CDB_LOCATION_TYPE_SECTOR
Definition: bios.h:121
pce_cdb_vdc_set_resolution
bool pce_cdb_vdc_set_resolution(uint8_t clock, uint8_t width_tiles, uint8_t height_tiles)
Set the video resolution.
pce_cdb_vdc_set_bg_row_copy
void pce_cdb_vdc_set_bg_row_copy(void)
Set the automatic increment for VRAM addresses to write one word per background row.
pce_cdb_mul_s8
int16_t pce_cdb_mul_s8(int8_t a, int8_t b)
Perform an 8x8->16 signed multiplication.
pce_cdb_vdc_vram_write_at
void pce_cdb_vdc_vram_write_at(uint16_t addr)
Set the VRAM write address.
pce_cdb_adpcm_stream
uint8_t pce_cdb_adpcm_stream(pce_sector_t sector, pce_sector_t length, uint8_t divider)
Begin ADPCM sample playback streamed from CD.
PCE_CDB_ADDRESS
@ PCE_CDB_ADDRESS
An address in the local address space.
Definition: bios.h:51
PCE_CDB_MASK_NMI
@ PCE_CDB_MASK_NMI
Definition: bios.h:96
PCE_CDB_BANK_MPR5
@ PCE_CDB_BANK_MPR5
Bank number (uses MPR5).
Definition: bios.h:67
pce_cdb_vdc_configure_dma
void pce_cdb_vdc_configure_dma(uint8_t value)
Configure VRAM DMA.
pce_cdb_adpcm_read_from_ram
uint8_t pce_cdb_adpcm_read_from_ram(uint8_t source_type, uint16_t source, uint16_t dest, uint16_t length)
Copy ADPCM data from RAM to the ADPCM buffer.
pce_cdb_vdc_bg_enable
void pce_cdb_vdc_bg_enable(void)
Enable the background layer.
pce_cdb_bcd_to_bin
uint8_t pce_cdb_bcd_to_bin(uint8_t value)
Convert a BCD number to a binary number.
size
unsigned size
Definition: neslib.h:185
ADPCM_BUFFER_UNDER_HALF
@ ADPCM_BUFFER_UNDER_HALF
The ADPCM controller has under 50% of the buffer.
Definition: bios.h:457
pce_cdb_vdc_sprite_table_put
void pce_cdb_vdc_sprite_table_put(void)
Put a sprite to the VRAM sprite table.
pce_cdb_vdc_irq_vblank_enable
void pce_cdb_vdc_irq_vblank_enable(void)
Enable the veritcal blank IRQ.
pce_cdb_vdc_sprite_enable
void pce_cdb_vdc_sprite_enable(void)
Enable the sprite layer.
pce_cdb_adpcm_status
uint16_t pce_cdb_adpcm_status(void)
Query the ADPCM status.
PCE_CDB_ADPCM_REPEAT
@ PCE_CDB_ADPCM_REPEAT
Loop ADPCM sample.
Definition: bios.h:403
pce_cdb_adpcm_reset
void pce_cdb_adpcm_reset(void)
Reset the ADPCM controller.
pce_cdb_toc_data::lo
uint8_t lo
Definition: bios.h:278
PCE_CDB_ID_IRQ_TIMER
@ PCE_CDB_ID_IRQ_TIMER
Definition: bios.h:85
PCE_CDB_CDDA_PLAY_ONE_SHOT
@ PCE_CDB_CDDA_PLAY_ONE_SHOT
Definition: bios.h:186
PCE_CDB_SUBCODE_R
@ PCE_CDB_SUBCODE_R
Definition: bios.h:304
std::int16_t
::int16_t int16_t
Definition: cstdint:8
PCE_CDB_CDDA_PLAY_REPEAT
@ PCE_CDB_CDDA_PLAY_REPEAT
Definition: bios.h:185
PCE_CDB_READ_ERROR
@ PCE_CDB_READ_ERROR
Definition: bios.h:30
PCE_CDB_VRAM_DMA_SRC_DEC
@ PCE_CDB_VRAM_DMA_SRC_DEC
Definition: bios.h:635
pce_cdb_vdc_irq_scanline_set
void pce_cdb_vdc_irq_scanline_set(uint16_t line)
Set the scanline #, on which the scanline IRQ should be emitted.
PCE_CDB_VRAM_DMA_IRQ_DONE
@ PCE_CDB_VRAM_DMA_IRQ_DONE
Definition: bios.h:633
PCE_CDB_BANK_MPR4
@ PCE_CDB_BANK_MPR4
Bank number (uses MPR4).
Definition: bios.h:63
pce_cdb_colors_set
bool pce_cdb_colors_set(void)
Queue a color transfer from the RAM buffers to the VCE.
pce_cdb_cd_read_toc_track_sector
uint8_t pce_cdb_cd_read_toc_track_sector(pce_cdb_toc_data_t *buffer, uint8_t track_id)
PCE_CDB_VRAM_BYTES
@ PCE_CDB_VRAM_BYTES
VRAM address (length specified in bytes).
Definition: bios.h:75
PCE_CDB_HEADER_READ_ERROR
@ PCE_CDB_HEADER_READ_ERROR
Definition: bios.h:32
pce_cdb_vdc_bg_sprite_enable
void pce_cdb_vdc_bg_sprite_enable(void)
Enable the background and sprite layer.
PCE_CDB_BASE_SET_NONE
@ PCE_CDB_BASE_SET_NONE
Definition: bios.h:132
PCE_CDB_MASK_IRQ_TIMER
@ PCE_CDB_MASK_IRQ_TIMER
Definition: bios.h:95
PCE_CDB_ID_SOFT_RESET
@ PCE_CDB_ID_SOFT_RESET
Definition: bios.h:89
pce_cdb_colors_sprite_none
void pce_cdb_colors_sprite_none(void)
Clear the sprite palette RAM buffer.
pce_cdb_fader_mode
pce_cdb_fader_mode
Definition: bios.h:325
pce_cdb_vdc_bg_disable
void pce_cdb_vdc_bg_disable(void)
Disable the background layer.
PCE_CDB_MASK_VBLANK
@ PCE_CDB_MASK_VBLANK
Definition: bios.h:99
PCE_CDB_ID_NMI
@ PCE_CDB_ID_NMI
Definition: bios.h:86
pce_cdb_vdc_vram_dma_flags
pce_cdb_vdc_vram_dma_flags
Definition: bios.h:631
pce_cdb_cd_seek
void pce_cdb_cd_seek(pce_sector_t sector)
Seek the CD drive to the specified sector.
PCE_CDB_SUBCODE_U
@ PCE_CDB_SUBCODE_U
Definition: bios.h:301
pce_cdb_cd_scan
uint8_t pce_cdb_cd_scan(void)
Initialize information about the currently inserted CD.
pce_cdb_adpcm_play
uint8_t pce_cdb_adpcm_play(uint16_t address, uint16_t length, uint8_t divider, uint8_t mode)
Begin ADPCM sample playback from the ADPCM buffer.
pce_cdb_adpcm_read_from_cd
uint8_t pce_cdb_adpcm_read_from_cd(pce_sector_t sector, uint8_t length, uint16_t address)
Read ADPCM data from CD to the ADPCM buffer.
PCE_CDB_CDDA_PLAY_PREVIOUS
@ PCE_CDB_CDDA_PLAY_PREVIOUS
Definition: bios.h:188
pce_cdb_cd_read_subcode_bits
bool pce_cdb_cd_read_subcode_bits(uint8_t *buffer)
Read the current CD subcode bits.
pce_cdb_toc_data_t
struct pce_cdb_toc_data pce_cdb_toc_data_t
pce_cdb_error_code
pce_cdb_error_code
Definition: bios.h:25
address_type
uint8_t address_type
Definition: bios.h:179
pce_cdb_vdc_sprite_disable
void pce_cdb_vdc_sprite_disable(void)
Disable the sprite layer.
PCE_CDB_VRAM
@ PCE_CDB_VRAM
VRAM address.
Definition: bios.h:79
address
uint8_t uint16_t address
Definition: bios.h:180
PCE_CDB_LOCATION_TYPE_UNTIL_END
@ PCE_CDB_LOCATION_TYPE_UNTIL_END
Definition: bios.h:125
pce_cdb_toc_data::frame
uint8_t frame
Definition: bios.h:275
PCE_CDB_CDDA_SEARCH_PLAY_NONBLOCK
@ PCE_CDB_CDDA_SEARCH_PLAY_NONBLOCK
Definition: bios.h:209
pce_cdb_vdc_irq_scanline_disable
void pce_cdb_vdc_irq_scanline_disable(void)
Disable the scanline IRQ.
PCE_CDB_CDDA_SEARCH_PAUSE_BLOCK
@ PCE_CDB_CDDA_SEARCH_PAUSE_BLOCK
Definition: bios.h:206
types.h
ADPCM_BUSY
@ ADPCM_BUSY
If any of these bits are set, the ADPCM controller is busy.
Definition: bios.h:449
PCE_CDB_VRAM_DMA_DEST_INC
@ PCE_CDB_VRAM_DMA_DEST_INC
Definition: bios.h:636
pce_cdb_subq_data::status
uint8_t status
Definition: bios.h:252
PCE_CDB_NOT_PLAYING_AUDIO
@ PCE_CDB_NOT_PLAYING_AUDIO
Definition: bios.h:40
pce_cdb_wait_vblank
void pce_cdb_wait_vblank(void)
Wait for VBlank.
PCE_CDB_SUBCODE_Q
@ PCE_CDB_SUBCODE_Q
Definition: bios.h:305
pce_cdb_cdda_read_sample
uint16_t pce_cdb_cdda_read_sample(uint8_t channel)
Read the currently played CD audio sample.
PCE_CDB_ADPCM_ONE_SHOT
@ PCE_CDB_ADPCM_ONE_SHOT
Play ADPCM sample once.
Definition: bios.h:399
PCE_CDB_INVALID_PARAMETER_LIST
@ PCE_CDB_INVALID_PARAMETER_LIST
Definition: bios.h:39
pce_cdb_subq_data::track
uint8_t track
Definition: bios.h:254
pce_cdb_toc_data::track_end
uint8_t track_end
Definition: bios.h:272
PCD_CDB_DRIVE_OPEN
@ PCD_CDB_DRIVE_OPEN
Definition: bios.h:29
pce_cdb_cd_busy
uint8_t pce_cdb_cd_busy(void)
Check if the CD drive is busy.
PCE_CDB_BANK_MPR2
@ PCE_CDB_BANK_MPR2
Bank number (uses MPR2).
Definition: bios.h:55
pce_cdb_vdc_bg_set_size
void pce_cdb_vdc_bg_set_size(uint8_t size)
Set the BG size to the specified value.
pce_cdb_base_set_mode
pce_cdb_base_set_mode
Definition: bios.h:128
pce_cdb_vdc_bg_sprite_disable
void pce_cdb_vdc_bg_sprite_disable(void)
Disable the background and sprite layer.
pce_cdb_adpcm_mode
pce_cdb_adpcm_mode
Definition: bios.h:395
pce_cdb_adpcm_continue
uint8_t pce_cdb_adpcm_continue(uint8_t mode)
Continue existing ADPCM sample playback.
PCE_CDB_CDDA_PLAY_MUTE
@ PCE_CDB_CDDA_PLAY_MUTE
Definition: bios.h:184
pce_cdb_irq_disable
void pce_cdb_irq_disable(uint8_t mask)
Disable the specified IRQs.
pce_cdb_cdda_pause
uint8_t pce_cdb_cdda_pause(void)
Pause CD audio playback.
pce_cdb_fader
void pce_cdb_fader(uint8_t mode)
Configure the CD unit's audio fader.
PCE_CDB_MASK_VBLANK_NO_BIOS
@ PCE_CDB_MASK_VBLANK_NO_BIOS
Definition: bios.h:100
pce_cdb_adpcm_write_to_ram
uint8_t pce_cdb_adpcm_write_to_ram(uint16_t source, uint8_t dest_type, uint16_t dest, uint16_t length)
Copy ADPCM data from the ADPCM buffer to RAM.
pce_cdb_ram_query
bool pce_cdb_ram_query(uint8_t *bank_start, uint8_t *bank_size)
Query for the presence of additional RAM.
PCE_CDB_INVALID_COMMAND
@ PCE_CDB_INVALID_COMMAND
Definition: bios.h:35
std::uint32_t
::uint32_t uint32_t
Definition: cstdint:23
pce_cdb_location_type
pce_cdb_location_type
Definition: bios.h:120
PCE_CDB_NO_DISC
@ PCE_CDB_NO_DISC
Definition: bios.h:28
pce_sector
Definition: types.h:23
pce_cdb_colors_read
bool pce_cdb_colors_read(void)
Queue a color transfer from the VCE to the RAM buffers.
ADPCM_STOPPED
@ ADPCM_STOPPED
The ADPCM controller is not playing audio.
Definition: bios.h:453
mode
const void uint16_t uint8_t mode
Definition: memory.h:58
pce_cdb_divmod_u16_result::rem
uint16_t rem
Definition: bios.h:704
PCE_CDB_FADER_ADPCM_2_5_SEC
@ PCE_CDB_FADER_ADPCM_2_5_SEC
Definition: bios.h:330
PCE_CDB_BASE_SET_BOTH
@ PCE_CDB_BASE_SET_BOTH
Definition: bios.h:129
PCE_CDB_BANK_MPR3
@ PCE_CDB_BANK_MPR3
Bank number (uses MPR3).
Definition: bios.h:59
pce_cdb_subq_data::total_time
pce_sector_t total_time
Definition: bios.h:257
pce_cdb_cd_reset
uint8_t pce_cdb_cd_reset(void)
Reset the CD drive.
PCE_CDB_CDDA_PLAY_NOT_BUSY
@ PCE_CDB_CDDA_PLAY_NOT_BUSY
Definition: bios.h:187
pce_cdb_cdda_search_mode
pce_cdb_cdda_search_mode
Definition: bios.h:205
pce_cdb_vdc_sprite_table_clear
void pce_cdb_vdc_sprite_table_clear(void)
Clear the VRAM sprite table.
pce_cdb_vdc_vram_read_at
void pce_cdb_vdc_vram_read_at(uint16_t addr)
Set the VRAM read address.
pce_cdb_vdc_set_bg_column_copy
void pce_cdb_vdc_set_bg_column_copy(void)
Set the automatic increment for VRAM addresses to write one word per background column.
pce_cdb_irq_set
void pce_cdb_irq_set(uint8_t type, void(*irq_handler)(void))
Set the IRQ handler for a given interrupt.
pce_cdb_colors_bg_at
void pce_cdb_colors_bg_at(void *address, uint8_t count)
Set the location of the background palette RAM buffer.
pce_cdb_divmod_u16_result::quot
uint16_t quot
Definition: bios.h:703
pce_cdb_cdda_play_mode
pce_cdb_cdda_play_mode
Definition: bios.h:183