Skip to content

Commit

Permalink
apps/cube: some minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
dinoboards committed Nov 8, 2024
1 parent 3e92471 commit 6b1de08
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions apps/cube/cube.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define LEFT 0
#define RIGHT 255
#define TOP 0
#define BOTTOM (212)
#define BOTTOM (192)
#define WIDTH (RIGHT - LEFT)
#define HEIGHT (BOTTOM - TOP)

Expand Down Expand Up @@ -126,9 +126,21 @@ void draw_cube(int24_t timeNow) {
swap_page();
}

void write_vdp_memory(uint24_t address, uint8_t value) {
const uint8_t A16_A14 = (address >> 14) & 0x07;
const uint8_t A13_A8 = (address >> 8) & 0x3F;
const uint8_t A7_A0 = address & 0xFF;

vdp_reg_write(14, A16_A14);
vdp_out_cmd(A7_A0);
vdp_out_cmd(A13_A8 | 0x40); //enable write
vdp_out_dat(value);
}


int main(/*const int argc, const char *argv[]*/) {

vdp_set_mode(7, 192, PAL);
vdp_set_mode(7, 192, NTSC);
vdp_erase_bank0(0);
vdp_erase_bank1(0);
erase_page_0();
Expand Down

0 comments on commit 6b1de08

Please sign in to comment.