remove duplicate start functions

This is now provided by default in saturn/common.mk.

Also updates moved header names, changed bit macro names, and changes
to the common.mk build process.
This commit is contained in:
Zack Buhman 2023-07-30 18:03:19 +00:00
parent 7ec3ec5480
commit 511bfd1d0c
21 changed files with 26 additions and 107 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
*.d
*.gch
*.o
*.elf

View File

@ -81,7 +81,7 @@ common/keyboard.hpp: common/keyboard.py
common/keyboard.cpp: common/keyboard.py common/keyboard.hpp
python common/keyboard.py definition > $@
smpc/input_keyboard.o: common/keyboard.hpp
smpc/input_keyboard.cpp.d: common/keyboard.hpp
smpc/input_keyboard.elf: smpc/input_keyboard.o sh/lib1funcs.o res/dejavusansmono.font.bin.o common/keyboard.o common/draw_font.o common/palette.o
@ -90,7 +90,7 @@ wordle/main_saturn.o: common/keyboard.hpp
wordle/word_list.hpp: wordle/word_list.csv wordle/word_list.py
python wordle/word_list.py > $@
wordle/wordle.o: wordle/word_list.hpp
wordle/wordle.cpp.d: wordle/word_list.hpp
wordle/wordle.elf: wordle/main_saturn.o wordle/wordle.o wordle/draw.o sh/lib1funcs.o res/dejavusansmono.font.bin.o common/keyboard.o common/draw_font.o common/palette.o

View File

@ -325,8 +325,8 @@ void main()
2-word: value of bit 5-0 * 0x4000
*/
vdp2.reg.MPOFN = MPOFN__N0MP(0); // bits 8~6
vdp2.reg.MPABN0 = MPABN0__N0MPB(0) | MPABN0__N0MPA(plane_a); // bits 5~0
vdp2.reg.MPCDN0 = MPABN0__N0MPD(0) | MPABN0__N0MPC(0); // bits 5~0
vdp2.reg.MPABN0 = MPABN0__N0MPB(plane_a) | MPABN0__N0MPA(plane_a); // bits 5~0
vdp2.reg.MPCDN0 = MPCDN0__N0MPD(plane_a) | MPCDN0__N0MPC(plane_a); // bits 5~0
// zeroize character/cell data from 0 up to plane_a_offset
fill<uint32_t>(&vdp2.vram.u32[(0 / 4)], 0, plane_offset(plane_a));

View File

@ -15,6 +15,14 @@ include $(LIB)/m68k/common.mk
synth 101s $* 441 vol -10dB
mv $@.raw $@
# 88200 bytes
%-44100-s16be-1ch-1sec.pcm: Makefile
sox \
-r 44100 -e signed-integer -b 16 -c 1 -n -B \
$@.raw \
synth 1 sin 440 vol -10dB
mv $@.raw $@
%.pcm.o: %.pcm
$(BUILD_BINARY_O)

View File

@ -4,7 +4,7 @@
extern void * _jojo_start __asm("_binary_jojo_11025_s16be_1ch_pcm_start");
static volatile int32_t frame = 0x0;
static int32_t frame = 0x0;
constexpr int32_t tactl = 7;
constexpr int32_t frame_size = ((1 << tactl) * 256) / (44100 / 11025);

View File

@ -2,7 +2,7 @@
#include "scsp.h"
extern void * _sine_start __asm("_binary_sine_44100_s16be_1ch_pcm_start");
extern void * _sine_start __asm("_binary_sine_44100_s16be_1ch_1sec_pcm_start");
void main()
{

View File

@ -4,7 +4,7 @@
#include "smpc.h"
#include "sh2.h"
#include "vec.hpp"
#include "vec3.hpp"
#include "fp.hpp"
#include "raytracing.hpp"
@ -22,9 +22,9 @@ inline constexpr T rgb(const vec3& color)
vec3 c = functor1(clamp, color) * fp16_16(channel_mask);
T red = static_cast<T>(c.r.value >> 16);
T green = static_cast<T>(c.g.value >> 16);
T blue = static_cast<T>(c.b.value >> 16);
T red = static_cast<T>(c.x.value >> 16);
T green = static_cast<T>(c.y.value >> 16);
T blue = static_cast<T>(c.z.value >> 16);
return (1 << last_bit)
| (blue << (P * 2))
@ -84,7 +84,8 @@ void start_slave()
*/
sh2_vec[0x94] = (uint32_t)(&slave_main);
for (volatile int i = 0; i < 10; i++);
for (int i = 0; i < 10; i++)
asm volatile ("nop");
smpc.reg.SF = 1;
smpc.reg.COMREG = COMREG__SSHON;
@ -92,7 +93,7 @@ void start_slave()
while ((smpc.reg.SF & 0x01) == 1);
}
void main_asdf()
void main()
{
// DISP: Please make sure to change this bit from 0 to 1 during V blank.
vdp2.reg.TVMD = ( TVMD__DISP | TVMD__LSMD__NON_INTERLACE
@ -131,10 +132,3 @@ void main_asdf()
render(0, put_pixel);
}
extern "C"
void start(void)
{
main_asdf();
while (1) {}
}

View File

@ -1,6 +1,6 @@
#include <stdint.h>
#include "vec.hpp"
#include "vec3.hpp"
#include "fp.hpp"
#include "raytracing.hpp"

View File

@ -33,10 +33,3 @@ void main()
slot.LOOP |= LOOP__KYONEX;
}
extern "C"
void start(void)
{
main();
while (1);
}

View File

@ -239,10 +239,3 @@ void main()
init_sound();
}
extern "C"
void start(void)
{
main();
while (1);
}

View File

@ -43,10 +43,3 @@ void main()
// do nothing while the sound CPU manipulates the SCSP
}
extern "C"
void start(void)
{
main();
while (1);
}

View File

@ -373,10 +373,3 @@ void main()
scu.reg.IST = 0;
scu.reg.IMS &= ~(IMS__SMPC);
}
extern "C"
void start(void)
{
main();
while (1);
}

View File

@ -462,10 +462,3 @@ void main()
scu.reg.IST = 0;
scu.reg.IMS = ~(IMS__SMPC | IMS__V_BLANK_IN);
}
extern "C"
void start(void)
{
main();
while (1);
}

View File

@ -204,10 +204,3 @@ void main()
// start drawing (execute the command list) on every frame
vdp1.reg.PTMR = PTMR__PTM__FRAME_CHANGE;
}
extern "C"
void start(void)
{
main();
while (1) {}
}

View File

@ -150,10 +150,3 @@ void main()
// start drawing (execute the command list) on every frame
vdp1.reg.PTMR = PTMR__PTM__FRAME_CHANGE;
}
extern "C"
void start(void)
{
main();
while (1) {}
}

View File

@ -193,10 +193,3 @@ void main()
scu.reg.IST = 0;
scu.reg.IMS = ~(IMS__V_BLANK_IN);
}
extern "C"
void start(void)
{
main();
while (1) {}
}

View File

@ -146,10 +146,3 @@ void main()
// start drawing (execute the command list) on every frame
vdp1.reg.PTMR = PTMR__PTM__FRAME_CHANGE;
}
extern "C"
void start(void)
{
main();
while (1) {}
}

View File

@ -73,10 +73,3 @@ void main()
// start drawing (execute the command list) on every frame
vdp1.reg.PTMR = PTMR__PTM__FRAME_CHANGE;
}
extern "C"
void start(void)
{
main();
while (1) {}
}

View File

@ -103,10 +103,3 @@ void main()
// start drawing (execute the command list) on every frame
vdp1.reg.PTMR = PTMR__PTM__FRAME_CHANGE;
}
extern "C"
void start(void)
{
main();
while (1) {}
}

View File

@ -12,7 +12,7 @@
#include <stdint.h>
#include "vdp2.h"
#include "../common/vdp2_func.h"
#include "../common/vdp2_func.hpp"
extern void * _butterfly_data_pal_start __asm("_binary_res_butterfly_data_pal_start");
extern void * _butterfly_data_pal_size __asm("_binary_res_butterfly_data_pal_size");
@ -107,8 +107,8 @@ void main()
constexpr int plane_size = page_size * 1;
vdp2.reg.MPOFN = MPOFN__N0MP(0); // bits 8~6
vdp2.reg.MPABN0 = MPABN0__N0MPB(0) | MPABN0__N0MPA(plane_a); // bits 5~0
vdp2.reg.MPCDN0 = MPABN0__N0MPD(0) | MPABN0__N0MPC(0); // bits 5~0
vdp2.reg.MPABN0 = MPABN0__N0MPB(plane_a) | MPABN0__N0MPA(plane_a); // bits 5~0
vdp2.reg.MPCDN0 = MPCDN0__N0MPD(plane_a) | MPCDN0__N0MPC(plane_a); // bits 5~0
constexpr int cell_size = (8 * 8) * 2; // N0CHCN__2048_COLOR (16-bit)
constexpr int character_size = cell_size * (1 * 1); // N0CHSZ__1x1_CELL

View File

@ -248,10 +248,3 @@ void main()
scu.reg.IST = 0;
scu.reg.IMS = ~(IMS__SMPC | IMS__V_BLANK_IN);
}
extern "C"
void start(void)
{
main();
while (1);
}