Initial commit
This commit is contained in:
24
.vscode/c_cpp_properties.json
vendored
Normal file
24
.vscode/c_cpp_properties.json
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Win32",
|
||||||
|
"includePath": [
|
||||||
|
"${workspaceFolder}/**",
|
||||||
|
"C:\\SGDK\\**",
|
||||||
|
"${workspaceFolder}",
|
||||||
|
"C:\\Users\\ttibb\\Dev\\SGDK-Game\\res\\resources.h"
|
||||||
|
],
|
||||||
|
"defines": [
|
||||||
|
"_DEBUG",
|
||||||
|
"UNICODE",
|
||||||
|
"_UNICODE"
|
||||||
|
],
|
||||||
|
"windowsSdkVersion": "10.0.19041.0",
|
||||||
|
"compilerPath": "cl.exe",
|
||||||
|
"cStandard": "c17",
|
||||||
|
"cppStandard": "c++17",
|
||||||
|
"intelliSenseMode": "windows-msvc-x64"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": 4
|
||||||
|
}
|
||||||
3
out/res/resources.d
Normal file
3
out/res/resources.d
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
out/res/resources.o: res/resources.res \
|
||||||
|
C:/Users/ttibb/Dev/SGDK-Game/res/background1.png \
|
||||||
|
C:/Users/ttibb/Dev/SGDK-Game/res/Sprites/BTW-1.png
|
||||||
BIN
out/res/resources.o
Normal file
BIN
out/res/resources.o
Normal file
Binary file not shown.
BIN
out/rom.bin
Normal file
BIN
out/rom.bin
Normal file
Binary file not shown.
BIN
out/rom.out
Normal file
BIN
out/rom.out
Normal file
Binary file not shown.
BIN
out/rom_head.bin
Normal file
BIN
out/rom_head.bin
Normal file
Binary file not shown.
BIN
out/rom_head.o
Normal file
BIN
out/rom_head.o
Normal file
Binary file not shown.
BIN
out/sega.o
Normal file
BIN
out/sega.o
Normal file
Binary file not shown.
20
out/src/Main.d
Normal file
20
out/src/Main.d
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
out/src/Main.o: src/Main.c c:/SGDK/inc/genesis.h c:/SGDK/inc/types.h \
|
||||||
|
c:/SGDK/inc/config.h c:/SGDK/inc/asm.h c:/SGDK/inc/sys.h \
|
||||||
|
c:/SGDK/inc/sram.h c:/SGDK/inc/mapper.h c:/SGDK/inc/memory.h \
|
||||||
|
c:/SGDK/inc/memory_base.h c:/SGDK/inc/tools.h c:/SGDK/inc/bmp.h \
|
||||||
|
c:/SGDK/inc/maths.h c:/SGDK/inc/vdp.h c:/SGDK/inc/pal.h \
|
||||||
|
c:/SGDK/inc/dma.h c:/SGDK/inc/vdp_tile.h c:/SGDK/inc/vdp_bg.h \
|
||||||
|
c:/SGDK/inc/map.h c:/SGDK/inc/pool.h c:/SGDK/inc/object.h \
|
||||||
|
c:/SGDK/inc/font.h c:/SGDK/res/libres.h c:/SGDK/inc/string.h \
|
||||||
|
c:/SGDK/inc/tab_cnv.h c:/SGDK/inc/maths3D.h c:/SGDK/inc/vdp_spr.h \
|
||||||
|
c:/SGDK/inc/vdp_pal.h c:/SGDK/inc/vram.h c:/SGDK/inc/sprite_eng.h \
|
||||||
|
c:/SGDK/inc/sprite_eng_legacy.h c:/SGDK/inc/z80_ctrl.h \
|
||||||
|
c:/SGDK/inc/ym2612.h c:/SGDK/inc/psg.h c:/SGDK/inc/snd/sound.h \
|
||||||
|
c:/SGDK/inc/snd/xgm.h c:/SGDK/inc/snd/xgm2.h c:/SGDK/inc/snd/smp_null.h \
|
||||||
|
c:/SGDK/inc/snd/smp_null_dpcm.h c:/SGDK/inc/snd/pcm/snd_pcm.h \
|
||||||
|
c:/SGDK/inc/snd/pcm/snd_dpcm2.h c:/SGDK/inc/snd/pcm/snd_pcm4.h \
|
||||||
|
c:/SGDK/inc/joy.h c:/SGDK/inc/timer.h c:/SGDK/inc/task.h \
|
||||||
|
c:/SGDK/inc/task_cst.h c:/SGDK/inc/ext/flash-save/flash.h \
|
||||||
|
c:/SGDK/inc/types.h c:/SGDK/inc/ext/flash-save/saveman.h \
|
||||||
|
c:/SGDK/inc/ext/console.h c:/SGDK/inc/config.h c:/SGDK/inc/string.h \
|
||||||
|
c:/SGDK/inc/maths.h c:/SGDK/inc/dma.h res/resources.h
|
||||||
BIN
out/src/Main.o
Normal file
BIN
out/src/Main.o
Normal file
Binary file not shown.
665
out/symbol.txt
Normal file
665
out/symbol.txt
Normal file
@@ -0,0 +1,665 @@
|
|||||||
|
00000000 A __DYNAMIC
|
||||||
|
00000000 t _Start_Of_Rom
|
||||||
|
00000000 t _Vecteurs_68K
|
||||||
|
00000020 a bigTex1_palette_data_size
|
||||||
|
00000020 a font_pal_default_data_size
|
||||||
|
00000020 a sgdk_logo_palette_data_size
|
||||||
|
00000044 A _sdata
|
||||||
|
00000080 a bg1_palette_data_size
|
||||||
|
000000ac A stop_xgm_size
|
||||||
|
00000100 T rom_header
|
||||||
|
00000200 t _Entry_Point
|
||||||
|
0000023c t NoTMSS
|
||||||
|
00000242 t SkipInit
|
||||||
|
00000248 t _INT
|
||||||
|
0000025a t _EXTINT
|
||||||
|
00000262 a font_default_data_size
|
||||||
|
0000026c t _VINT
|
||||||
|
00000270 a bg1_tilemap_data_size
|
||||||
|
00000282 a bigTex1_animation0_frame0_tileset_data_size
|
||||||
|
0000028e t unlock
|
||||||
|
000002b0 t no_user_task
|
||||||
|
000002d2 t no_xgm_task
|
||||||
|
000002e2 t no_bmp_task
|
||||||
|
000002f8 t ldiv
|
||||||
|
00000302 t ld1
|
||||||
|
00000312 t ld2
|
||||||
|
00000320 t ld3
|
||||||
|
00000322 t lmul
|
||||||
|
0000032c t lm1
|
||||||
|
0000033c t lm2
|
||||||
|
0000034a t lm3
|
||||||
|
0000034c t lrem
|
||||||
|
00000356 t lr1
|
||||||
|
00000360 t lr2
|
||||||
|
00000370 t lr3
|
||||||
|
00000372 t ldivu
|
||||||
|
00000380 t lmulu
|
||||||
|
0000038e t lremu
|
||||||
|
0000039e t i_lmul
|
||||||
|
000003ba t i_ldiv
|
||||||
|
000003ca t nz1
|
||||||
|
000003de t is1
|
||||||
|
000003e6 t norm
|
||||||
|
000003f6 t not1
|
||||||
|
00000410 t slow
|
||||||
|
0000043a a sgdk_logo_data_size
|
||||||
|
0000043c t slower
|
||||||
|
00000440 t moreadj
|
||||||
|
0000044e t adj
|
||||||
|
00000458 t ltuns
|
||||||
|
00000468 T TSK_init
|
||||||
|
0000048e t .loop
|
||||||
|
00000496 T TSK_superPost
|
||||||
|
000004ac t no_task
|
||||||
|
000004ae T TSK_userYield
|
||||||
|
000004b6 t userYield
|
||||||
|
000004e0 T _trap_0
|
||||||
|
00000504 T flushQueue
|
||||||
|
00000518 t .fq_loop
|
||||||
|
00000526 t .fq_end
|
||||||
|
00000528 T KDebug_Alert
|
||||||
|
00000544 T memset_
|
||||||
|
000005bc T memsetU16
|
||||||
|
0000061a T memcpy_
|
||||||
|
000006be T SYS_setInterruptMaskLevel
|
||||||
|
000006d6 T SYS_getAndSetInterruptMaskLevel
|
||||||
|
000006f0 T aplib_unpack
|
||||||
|
000006f6 t aplib_decrunch
|
||||||
|
0000070a t .copy_byte
|
||||||
|
0000070c t .next_sequence_init
|
||||||
|
0000070e t .next_sequence
|
||||||
|
0000071e t .get_3_bits
|
||||||
|
0000072e t .write_byte
|
||||||
|
00000732 t .short_match
|
||||||
|
00000740 t .code_pair
|
||||||
|
0000074c t .normal_code_pair
|
||||||
|
0000075a t .compare_1280
|
||||||
|
0000075e t .compare_128
|
||||||
|
00000762 t .domatch_with_2inc
|
||||||
|
00000764 t .domatch_with_inc
|
||||||
|
00000766 t .domatch_new_lastpos
|
||||||
|
00000768 t .copy_code_pair
|
||||||
|
0000076e t .loop_do_copy
|
||||||
|
00000778 t .get_bit
|
||||||
|
00000780 t .still_bits_left
|
||||||
|
00000782 t .decode_gamma
|
||||||
|
00000784 t .get_more_gamma
|
||||||
|
0000078e t .end_decrunch
|
||||||
|
00000798 T lz4w_unpack
|
||||||
|
0000079e t lz4w_unpack_a
|
||||||
|
000007b8 t .jump_table
|
||||||
|
000009b6 a bg1_tileset_data_size
|
||||||
|
00000cb6 t .lmr_len_01
|
||||||
|
00000dca t .lmr_len_00
|
||||||
|
00000fdc t .lm_len_00
|
||||||
|
00000fe2 t .next
|
||||||
|
00000ff2 t .litE_mat0
|
||||||
|
00000ff4 t .litC_mat0
|
||||||
|
00000ff6 t .litA_mat0
|
||||||
|
00000ff8 t .lit8_mat0
|
||||||
|
00000ffa t .lit6_mat0
|
||||||
|
00000ffc t .lit4_mat0
|
||||||
|
00000ffe t .lit2_mat0
|
||||||
|
00001004 t .long_match_1
|
||||||
|
00001016 t .litF_mat0
|
||||||
|
00001018 t .litD_mat0
|
||||||
|
0000101a t .litB_mat0
|
||||||
|
0000101c t .lit9_mat0
|
||||||
|
0000101e t .lit7_mat0
|
||||||
|
00001020 t .lit5_mat0
|
||||||
|
00001022 t .lit3_mat0
|
||||||
|
00001024 t .lit1_mat0
|
||||||
|
0000102a t .long_match_2
|
||||||
|
0000103c t .lit0_mat0
|
||||||
|
00001040 t .long_match_3
|
||||||
|
00001052 t .lm_rom
|
||||||
|
0000105e t .done
|
||||||
|
00001064 t .no_byte
|
||||||
|
0000106e t .lmr_jump_table
|
||||||
|
0000146e t .litE_mat1
|
||||||
|
00001470 t .litC_mat1
|
||||||
|
00001472 t .litA_mat1
|
||||||
|
00001474 t .lit8_mat1
|
||||||
|
00001476 t .lit6_mat1
|
||||||
|
00001478 t .lit4_mat1
|
||||||
|
0000147a t .lit2_mat1
|
||||||
|
0000147c t .lit0_mat1
|
||||||
|
0000149a t .litF_mat1
|
||||||
|
0000149c t .litD_mat1
|
||||||
|
0000149e t .litB_mat1
|
||||||
|
000014a0 t .lit9_mat1
|
||||||
|
000014a2 t .lit7_mat1
|
||||||
|
000014a4 t .lit5_mat1
|
||||||
|
000014a6 t .lit3_mat1
|
||||||
|
000014a8 t .lit1_mat1
|
||||||
|
000014c8 t .litE_mat2
|
||||||
|
000014ca t .litC_mat2
|
||||||
|
000014cc t .litA_mat2
|
||||||
|
000014ce t .lit8_mat2
|
||||||
|
000014d0 t .lit6_mat2
|
||||||
|
000014d2 t .lit4_mat2
|
||||||
|
000014d4 t .lit2_mat2
|
||||||
|
000014d6 t .lit0_mat2
|
||||||
|
000014f6 t .litF_mat2
|
||||||
|
000014f8 t .litD_mat2
|
||||||
|
000014fa t .litB_mat2
|
||||||
|
000014fc t .lit9_mat2
|
||||||
|
000014fe t .lit7_mat2
|
||||||
|
00001500 t .lit5_mat2
|
||||||
|
00001502 t .lit3_mat2
|
||||||
|
00001504 t .lit1_mat2
|
||||||
|
00001526 t .litE_mat3
|
||||||
|
00001528 t .litC_mat3
|
||||||
|
0000152a t .litA_mat3
|
||||||
|
0000152c t .lit8_mat3
|
||||||
|
0000152e t .lit6_mat3
|
||||||
|
00001530 t .lit4_mat3
|
||||||
|
00001532 t .lit2_mat3
|
||||||
|
00001534 t .lit0_mat3
|
||||||
|
00001556 t .litF_mat3
|
||||||
|
00001558 t .litD_mat3
|
||||||
|
0000155a t .litB_mat3
|
||||||
|
0000155c t .lit9_mat3
|
||||||
|
0000155e t .lit7_mat3
|
||||||
|
00001560 t .lit5_mat3
|
||||||
|
00001562 t .lit3_mat3
|
||||||
|
00001564 t .lit1_mat3
|
||||||
|
00001588 t .litE_mat4
|
||||||
|
0000158a t .litC_mat4
|
||||||
|
0000158c t .litA_mat4
|
||||||
|
0000158e t .lit8_mat4
|
||||||
|
00001590 t .lit6_mat4
|
||||||
|
00001592 t .lit4_mat4
|
||||||
|
00001594 t .lit2_mat4
|
||||||
|
00001596 t .lit0_mat4
|
||||||
|
000015ba t .litF_mat4
|
||||||
|
000015bc t .litD_mat4
|
||||||
|
000015be t .litB_mat4
|
||||||
|
000015c0 t .lit9_mat4
|
||||||
|
000015c2 t .lit7_mat4
|
||||||
|
000015c4 t .lit5_mat4
|
||||||
|
000015c6 t .lit3_mat4
|
||||||
|
000015c8 t .lit1_mat4
|
||||||
|
000015ee t .litE_mat5
|
||||||
|
000015f0 t .litC_mat5
|
||||||
|
000015f2 t .litA_mat5
|
||||||
|
000015f4 t .lit8_mat5
|
||||||
|
000015f6 t .lit6_mat5
|
||||||
|
000015f8 t .lit4_mat5
|
||||||
|
000015fa t .lit2_mat5
|
||||||
|
000015fc t .lit0_mat5
|
||||||
|
00001622 t .litF_mat5
|
||||||
|
00001624 t .litD_mat5
|
||||||
|
00001626 t .litB_mat5
|
||||||
|
00001628 t .lit9_mat5
|
||||||
|
0000162a t .lit7_mat5
|
||||||
|
0000162c t .lit5_mat5
|
||||||
|
0000162e t .lit3_mat5
|
||||||
|
00001630 t .lit1_mat5
|
||||||
|
00001658 t .litE_mat6
|
||||||
|
0000165a t .litC_mat6
|
||||||
|
0000165c t .litA_mat6
|
||||||
|
0000165e t .lit8_mat6
|
||||||
|
00001660 t .lit6_mat6
|
||||||
|
00001662 t .lit4_mat6
|
||||||
|
00001664 t .lit2_mat6
|
||||||
|
00001666 t .lit0_mat6
|
||||||
|
0000168e t .litF_mat6
|
||||||
|
00001690 t .litD_mat6
|
||||||
|
00001692 t .litB_mat6
|
||||||
|
00001694 t .lit9_mat6
|
||||||
|
00001696 t .lit7_mat6
|
||||||
|
00001698 t .lit5_mat6
|
||||||
|
0000169a t .lit3_mat6
|
||||||
|
0000169c t .lit1_mat6
|
||||||
|
000016c6 t .litE_mat7
|
||||||
|
000016c8 t .litC_mat7
|
||||||
|
000016ca t .litA_mat7
|
||||||
|
000016cc t .lit8_mat7
|
||||||
|
000016ce t .lit6_mat7
|
||||||
|
000016d0 t .lit4_mat7
|
||||||
|
000016d2 t .lit2_mat7
|
||||||
|
000016d4 t .lit0_mat7
|
||||||
|
000016fe t .litF_mat7
|
||||||
|
00001700 t .litD_mat7
|
||||||
|
00001702 t .litB_mat7
|
||||||
|
00001704 t .lit9_mat7
|
||||||
|
00001706 t .lit7_mat7
|
||||||
|
00001708 t .lit5_mat7
|
||||||
|
0000170a t .lit3_mat7
|
||||||
|
0000170c t .lit1_mat7
|
||||||
|
00001738 t .litE_mat8
|
||||||
|
0000173a t .litC_mat8
|
||||||
|
0000173c t .litA_mat8
|
||||||
|
0000173e t .lit8_mat8
|
||||||
|
00001740 t .lit6_mat8
|
||||||
|
00001742 t .lit4_mat8
|
||||||
|
00001744 t .lit2_mat8
|
||||||
|
00001746 t .lit0_mat8
|
||||||
|
00001772 t .litF_mat8
|
||||||
|
00001774 t .litD_mat8
|
||||||
|
00001776 t .litB_mat8
|
||||||
|
00001778 t .lit9_mat8
|
||||||
|
0000177a t .lit7_mat8
|
||||||
|
0000177c t .lit5_mat8
|
||||||
|
0000177e t .lit3_mat8
|
||||||
|
00001780 t .lit1_mat8
|
||||||
|
000017ae t .litE_mat9
|
||||||
|
000017b0 t .litC_mat9
|
||||||
|
000017b2 t .litA_mat9
|
||||||
|
000017b4 t .lit8_mat9
|
||||||
|
000017b6 t .lit6_mat9
|
||||||
|
000017b8 t .lit4_mat9
|
||||||
|
000017ba t .lit2_mat9
|
||||||
|
000017bc t .lit0_mat9
|
||||||
|
000017ea t .litF_mat9
|
||||||
|
000017ec t .litD_mat9
|
||||||
|
000017ee t .litB_mat9
|
||||||
|
000017f0 t .lit9_mat9
|
||||||
|
000017f2 t .lit7_mat9
|
||||||
|
000017f4 t .lit5_mat9
|
||||||
|
000017f6 t .lit3_mat9
|
||||||
|
000017f8 t .lit1_mat9
|
||||||
|
00001828 t .litE_matA
|
||||||
|
0000182a t .litC_matA
|
||||||
|
0000182c t .litA_matA
|
||||||
|
0000182e t .lit8_matA
|
||||||
|
00001830 t .lit6_matA
|
||||||
|
00001832 t .lit4_matA
|
||||||
|
00001834 t .lit2_matA
|
||||||
|
00001836 t .lit0_matA
|
||||||
|
00001866 t .litF_matA
|
||||||
|
00001868 t .litD_matA
|
||||||
|
0000186a t .litB_matA
|
||||||
|
0000186c t .lit9_matA
|
||||||
|
0000186e t .lit7_matA
|
||||||
|
00001870 t .lit5_matA
|
||||||
|
00001872 t .lit3_matA
|
||||||
|
00001874 t .lit1_matA
|
||||||
|
000018a6 t .litE_matB
|
||||||
|
000018a8 t .litC_matB
|
||||||
|
000018aa t .litA_matB
|
||||||
|
000018ac t .lit8_matB
|
||||||
|
000018ae t .lit6_matB
|
||||||
|
000018b0 t .lit4_matB
|
||||||
|
000018b2 t .lit2_matB
|
||||||
|
000018b4 t .lit0_matB
|
||||||
|
000018e6 t .litF_matB
|
||||||
|
000018e8 t .litD_matB
|
||||||
|
000018ea t .litB_matB
|
||||||
|
000018ec t .lit9_matB
|
||||||
|
000018ee t .lit7_matB
|
||||||
|
000018f0 t .lit5_matB
|
||||||
|
000018f2 t .lit3_matB
|
||||||
|
000018f4 t .lit1_matB
|
||||||
|
00001928 t .litE_matC
|
||||||
|
0000192a t .litC_matC
|
||||||
|
0000192c t .litA_matC
|
||||||
|
0000192e t .lit8_matC
|
||||||
|
00001930 t .lit6_matC
|
||||||
|
00001932 t .lit4_matC
|
||||||
|
00001934 t .lit2_matC
|
||||||
|
00001936 t .lit0_matC
|
||||||
|
0000196a t .litF_matC
|
||||||
|
0000196c t .litD_matC
|
||||||
|
0000196e t .litB_matC
|
||||||
|
00001970 t .lit9_matC
|
||||||
|
00001972 t .lit7_matC
|
||||||
|
00001974 t .lit5_matC
|
||||||
|
00001976 t .lit3_matC
|
||||||
|
00001978 t .lit1_matC
|
||||||
|
000019ae t .litE_matD
|
||||||
|
000019b0 t .litC_matD
|
||||||
|
000019b2 t .litA_matD
|
||||||
|
000019b4 t .lit8_matD
|
||||||
|
000019b6 t .lit6_matD
|
||||||
|
000019b8 t .lit4_matD
|
||||||
|
000019ba t .lit2_matD
|
||||||
|
000019bc t .lit0_matD
|
||||||
|
000019f2 t .litF_matD
|
||||||
|
000019f4 t .litD_matD
|
||||||
|
000019f6 t .litB_matD
|
||||||
|
000019f8 t .lit9_matD
|
||||||
|
000019fa t .lit7_matD
|
||||||
|
000019fc t .lit5_matD
|
||||||
|
000019fe t .lit3_matD
|
||||||
|
00001a00 t .lit1_matD
|
||||||
|
00001a38 t .litE_matE
|
||||||
|
00001a3a t .litC_matE
|
||||||
|
00001a3c t .litA_matE
|
||||||
|
00001a3e t .lit8_matE
|
||||||
|
00001a40 t .lit6_matE
|
||||||
|
00001a42 t .lit4_matE
|
||||||
|
00001a44 t .lit2_matE
|
||||||
|
00001a46 t .lit0_matE
|
||||||
|
00001a7e t .litF_matE
|
||||||
|
00001a80 t .litD_matE
|
||||||
|
00001a82 t .litB_matE
|
||||||
|
00001a84 t .lit9_matE
|
||||||
|
00001a86 t .lit7_matE
|
||||||
|
00001a88 t .lit5_matE
|
||||||
|
00001a8a t .lit3_matE
|
||||||
|
00001a8c t .lit1_matE
|
||||||
|
00001ac6 t .litE_matF
|
||||||
|
00001ac8 t .litC_matF
|
||||||
|
00001aca t .litA_matF
|
||||||
|
00001acc t .lit8_matF
|
||||||
|
00001ace t .lit6_matF
|
||||||
|
00001ad0 t .lit4_matF
|
||||||
|
00001ad2 t .lit2_matF
|
||||||
|
00001ad4 t .lit0_matF
|
||||||
|
00001b0e t .litF_matF
|
||||||
|
00001b10 t .litD_matF
|
||||||
|
00001b12 t .litB_matF
|
||||||
|
00001b14 t .lit9_matF
|
||||||
|
00001b16 t .lit7_matF
|
||||||
|
00001b18 t .lit5_matF
|
||||||
|
00001b1a t .lit3_matF
|
||||||
|
00001b1c t .lit1_matF
|
||||||
|
00001b58 t myJoyHandler
|
||||||
|
00001d0a t DMA_queueDmaFast
|
||||||
|
00001e58 t DMA_doDmaFast
|
||||||
|
00001fe8 t DMA_doCPUCopyDirect
|
||||||
|
0000212c t DMA_doCPUCopy
|
||||||
|
000021e6 t Z80_getAndRequestBus.constprop.0
|
||||||
|
00002214 t externalIntCB
|
||||||
|
00002354 t _extint_dummy_callback
|
||||||
|
00002356 t read6Btn
|
||||||
|
0000249e t readMouse
|
||||||
|
000028a6 t readTeamPlayer
|
||||||
|
00003078 t readLightgun
|
||||||
|
000035f8 t readTrackball
|
||||||
|
0000382c t MEM_alloc
|
||||||
|
00003902 t MEM_free
|
||||||
|
00003914 t DMA_setBufferSize
|
||||||
|
0000396e t MEM_pack
|
||||||
|
000039d6 t _int_callback
|
||||||
|
000039d8 t _vblank_dummy_callback
|
||||||
|
000039da t _vint_dummy_callback
|
||||||
|
000039dc t _hint_dummy_callback
|
||||||
|
000039de t VDP_setHVLatching
|
||||||
|
00003a1e t updateUserTileMaxIndex
|
||||||
|
00003a20 t VDP_resetSprites
|
||||||
|
00003a48 t VDP_getPlaneAddress
|
||||||
|
00003afa t XGM_unloadDriver
|
||||||
|
00003b12 t XGM2_unloadDriver
|
||||||
|
00003b1a t SND_DPCM2_unloadDriver
|
||||||
|
00003b1a t SND_PCM_unloadDriver
|
||||||
|
00003b1a t SND_PCM4_unloadDriver
|
||||||
|
00003b1c t YM2612_reset
|
||||||
|
00003f28 t setNextXFrame.constprop.0
|
||||||
|
00003f76 t DMA_initEx.constprop.0
|
||||||
|
00003fee t VRAM_createRegion.constprop.0
|
||||||
|
0000404c t VRAM_alloc.constprop.0
|
||||||
|
0000411a t SPR_defragVRAM
|
||||||
|
000041c4 t VDP_setTileMapDataEx.constprop.0
|
||||||
|
00004298 t releaseSprite.part.0.isra.0
|
||||||
|
00004300 t SPR_addSpriteEx.constprop.0
|
||||||
|
0000446a t JOY_update
|
||||||
|
00004932 t Z80_clear
|
||||||
|
000049f4 t Z80_upload
|
||||||
|
00004b0e t Z80_upload.constprop.0
|
||||||
|
00004bea t Z80_upload.constprop.1
|
||||||
|
00004cc6 t PAL_doFadeStep
|
||||||
|
00004ce0 t VDP_drawTextEx.constprop.0
|
||||||
|
00004e50 t SND_NULL_loadDriver
|
||||||
|
00004f48 t Z80_loadDriverInternal
|
||||||
|
00005058 t getAccess
|
||||||
|
000051a8 t setFMVolume
|
||||||
|
00005240 t setPSGVolume
|
||||||
|
000052d8 t setMusicTempo.constprop.0
|
||||||
|
0000536e t setLoopNumber.constprop.0
|
||||||
|
000053bc t setTileMapDataColumnEx.constprop.0
|
||||||
|
00005526 t VDP_setTileMapDataRectEx.constprop.0
|
||||||
|
000057f0 t SPR_update
|
||||||
|
00005ff8 t VDP_waitVBlank
|
||||||
|
000061a2 T BMP_doVBlankProcess
|
||||||
|
000061ac T VDP_setAutoInc
|
||||||
|
000061c6 T memset
|
||||||
|
000061e0 t XGM2_loadDriver
|
||||||
|
00006360 t Z80_loadDriver
|
||||||
|
00006442 t Z80_init
|
||||||
|
000064a8 t XGM2_stop
|
||||||
|
0000652e t XGM2_pause
|
||||||
|
000065a0 t SYS_doVBlankProcessEx.constprop.0.isra.0
|
||||||
|
00006ade t waitSubTick.part.0
|
||||||
|
00006c9c t XGM_loadDriver
|
||||||
|
00006f4a t SND_DPCM2_loadDriver
|
||||||
|
000070f2 t SND_PCM_loadDriver
|
||||||
|
0000729a t SND_PCM4_loadDriver
|
||||||
|
0000744a t POOL_reset.constprop.0
|
||||||
|
000074c0 T memcpy
|
||||||
|
000074d0 t DMA_transfer.isra.0
|
||||||
|
000076a8 t PAL_setPalette
|
||||||
|
000076d0 t SPR_end
|
||||||
|
0000776e t SPR_initEx.constprop.0
|
||||||
|
000078d2 t updateMapsAddress
|
||||||
|
00007a80 t VDP_setReg.constprop.0
|
||||||
|
00007a9a t JOY_setSupport
|
||||||
|
00007abe t JOY_reset
|
||||||
|
0000818a t VDP_resetScreen
|
||||||
|
000086d6 t VDP_init
|
||||||
|
000087d8 t internal_reset
|
||||||
|
0000891e t VDP_drawImageEx.constprop.0.isra.0
|
||||||
|
00008bb2 t main.isra.0
|
||||||
|
00008cf6 T _start_entry
|
||||||
|
00008dbc T _reset_entry
|
||||||
|
00008dc4 T XGM_doVBlankProcess
|
||||||
|
00008e2c T MDDBG__SymbolDataPtr
|
||||||
|
00008e30 t __ErrorHandler
|
||||||
|
00008e30 t MDDBG__ErrorHandler
|
||||||
|
00008f58 t MDDBG__Error_IdleLoop
|
||||||
|
00008f72 t MDDBG__Error_InitConsole
|
||||||
|
00008f7e t MDDBG__Error_MaskStackBoundaries
|
||||||
|
00008fe8 t MDDBG__Error_DrawOffsetLocation
|
||||||
|
00008fec t MDDBG__Error_DrawOffsetLocation2
|
||||||
|
00008ff2 t MDDBG__Error_DrawOffsetLocation__inj
|
||||||
|
00009080 t MDDBG__ErrorHandler_SetupVDP
|
||||||
|
000090b6 t MDDBG__ErrorHandler_VDPConfig
|
||||||
|
000090cc t MDDBG__ErrorHandler_VDPConfig_Nametables
|
||||||
|
00009108 t MDDBG__ErrorHandler_ConsoleConfig_Initial
|
||||||
|
0000910c t MDDBG__ErrorHandler_ConsoleConfig_Shared
|
||||||
|
0000913c t MDDBG__Str_OffsetLocation_24bit
|
||||||
|
00009145 t MDDBG__Str_OffsetLocation_32bit
|
||||||
|
00009180 t MDDBG__Art1bpp_Font
|
||||||
|
0000947a t MDDBG__GetSymbolByOffset
|
||||||
|
00009794 t MDDBG__FormatString
|
||||||
|
0000986e t MDDBG__Console_Init
|
||||||
|
000098ac t MDDBG__Console_Reset
|
||||||
|
000098ae t MDDBG__Console_InitShared
|
||||||
|
000098f8 t MDDBG__Console_SetPosAsXY_Stack
|
||||||
|
000098fe t MDDBG__Console_SetPosAsXY
|
||||||
|
00009932 t MDDBG__Console_GetPosAsXY
|
||||||
|
00009958 t MDDBG__Console_StartNewLine
|
||||||
|
00009986 t MDDBG__Console_SetBasePattern
|
||||||
|
000099a2 t MDDBG__Console_SetWidth
|
||||||
|
000099c0 t MDDBG__Console_WriteLine_WithPattern
|
||||||
|
000099c2 t MDDBG__Console_WriteLine
|
||||||
|
000099c6 t MDDBG__Console_Write
|
||||||
|
00009a8c t MDDBG__Console_WriteLine_Formatted
|
||||||
|
00009a90 t MDDBG__Console_Write_Formatted
|
||||||
|
00009ac0 t MDDBG__Decomp1bpp
|
||||||
|
00009adc t MDDBG__KDebug_WriteLine_Formatted
|
||||||
|
00009ae0 t MDDBG__KDebug_Write_Formatted
|
||||||
|
00009b34 t MDDBG__KDebug_FlushLine
|
||||||
|
00009b3e t MDDBG__KDebug_WriteLine
|
||||||
|
00009b42 t MDDBG__KDebug_Write
|
||||||
|
00009b70 t MDDBG__ErrorHandler_ConsoleOnly
|
||||||
|
00009b96 t MDDBG__ErrorHandler_ClearConsole
|
||||||
|
00009bc0 t MDDBG__ErrorHandler_PauseConsole
|
||||||
|
00009bfa t MDDBG__ErrorHandler_PagesController
|
||||||
|
00009c5a t MDDBG__VSync
|
||||||
|
00009c94 t MDDBG__ErrorHandler_ExtraDebuggerList
|
||||||
|
00009ca0 t MDDBG__Debugger_AddressRegisters
|
||||||
|
00009cec t MDDBG__Debugger_Backtrace
|
||||||
|
00009d8a T _Bus_Error
|
||||||
|
00009d8a t MDDBG__BusError
|
||||||
|
00009d9e T _Address_Error
|
||||||
|
00009d9e t MDDBG__AddressError
|
||||||
|
00009db6 T _Illegal_Instruction
|
||||||
|
00009db6 t MDDBG__IllegalInstr
|
||||||
|
00009dd4 T _Zero_Divide
|
||||||
|
00009dd4 t MDDBG__ZeroDivide
|
||||||
|
00009dea T _Chk_Instruction
|
||||||
|
00009dea t MDDBG__ChkInstr
|
||||||
|
00009e04 T _Trapv_Instruction
|
||||||
|
00009e04 t MDDBG__TrapvInstr
|
||||||
|
00009e20 T _Privilege_Violation
|
||||||
|
00009e20 t MDDBG__PrivilegeViol
|
||||||
|
00009e3e T _Trace
|
||||||
|
00009e3e t MDDBG__Trace
|
||||||
|
00009e4e T _Line_1010_Emulation
|
||||||
|
00009e4e t MDDBG__Line1010Emu
|
||||||
|
00009e6a T _Line_1111_Emulation
|
||||||
|
00009e6a t MDDBG__Line1111Emu
|
||||||
|
00009e86 T _Error_Exception
|
||||||
|
00009e86 t MDDBG__ErrorExcept
|
||||||
|
00009f00 T smp_null
|
||||||
|
0000a000 T smp_null_dpcm
|
||||||
|
0000a080 T __mulsi3 /home/runner/work/m68k-elf-gcc/m68k-elf-gcc/.build/HOST-i686-w64-mingw32/m68k-elf/src/gcc/libgcc/config/m68k/lb1sf68.S:442
|
||||||
|
0000a080 T __mulsi3_internal /home/runner/work/m68k-elf-gcc/m68k-elf-gcc/.build/HOST-i686-w64-mingw32/m68k-elf/src/gcc/libgcc/config/m68k/lb1sf68.S:442
|
||||||
|
0000a0a4 T __CTOR_LIST__
|
||||||
|
0000a0ac T __CTOR_END__
|
||||||
|
0000a0ac T __DTOR_LIST__
|
||||||
|
0000a0b4 T __DTOR_END__
|
||||||
|
0000a0b4 t bg1_tileset
|
||||||
|
0000a0bc t bg1_tilemap
|
||||||
|
0000a0c6 t bg1_palette
|
||||||
|
0000a0cc T bg1
|
||||||
|
0000a0d8 t bigTex1_palette
|
||||||
|
0000a0de t bigTex1_animation0_frame0_tileset
|
||||||
|
0000a0e6 t bigTex1_animation0_frame0
|
||||||
|
0000a102 t bigTex1_animation0_frames
|
||||||
|
0000a106 t bigTex1_animation0
|
||||||
|
0000a10c t bigTex1_animations
|
||||||
|
0000a110 T bigTex1
|
||||||
|
0000a21e t tab_vol
|
||||||
|
0000b21e t psgVolTable
|
||||||
|
0000b282 t fmVolTable
|
||||||
|
0000b2e6 t palette_blue
|
||||||
|
0000b306 t palette_green
|
||||||
|
0000b326 t palette_red
|
||||||
|
0000b346 t palette_grey
|
||||||
|
0000b366 t visibilityMask.0
|
||||||
|
0000b388 t xlt.1
|
||||||
|
0000b390 t xlt_all.0
|
||||||
|
0000b3a0 t sgdk_logo_palette
|
||||||
|
0000b3a6 T sgdk_logo
|
||||||
|
0000b3b4 T font_default
|
||||||
|
0000b3bc T font_pal_default
|
||||||
|
0000b3c2 T drv_null
|
||||||
|
0000b3fc T drv_xgm
|
||||||
|
0000cafc T drv_dpcm2
|
||||||
|
0000d8fc T drv_pcm
|
||||||
|
0000e42c T drv_pcm4
|
||||||
|
0000ee9a T drv_xgm2
|
||||||
|
00010e9c T __INIT_SECTION__
|
||||||
|
00010e9e T __FINI_SECTION__
|
||||||
|
00010ea0 T _etext
|
||||||
|
00010ea0 t bg1_palette_data
|
||||||
|
00010f20 t bigTex1_palette_data
|
||||||
|
00010f40 t sgdk_logo_palette_data
|
||||||
|
00010f60 t font_pal_default_data
|
||||||
|
00010f80 T stop_xgm
|
||||||
|
0001102c t font_default_data
|
||||||
|
0001128e t sgdk_logo_data
|
||||||
|
000116c8 t bg1_tilemap_data
|
||||||
|
00011938 t bg1_tileset_data
|
||||||
|
000122ee t bigTex1_animation0_frame0_tileset_data
|
||||||
|
00012570 A _stext
|
||||||
|
e0ff0000 D task_sr
|
||||||
|
e0ff0002 D task_pc
|
||||||
|
e0ff0006 D task_regs
|
||||||
|
e0ff0042 D task_lock
|
||||||
|
e0ff0044 D _edata
|
||||||
|
e0ff0044 B _start
|
||||||
|
e0ff0044 B bmp_buffer_write
|
||||||
|
e0ff0048 B VBlankProcess
|
||||||
|
e0ff004a B hintCaller
|
||||||
|
e0ff0050 B vintCB
|
||||||
|
e0ff0054 B intCB
|
||||||
|
e0ff0058 B vtimer
|
||||||
|
e0ff005c B eintCB
|
||||||
|
e0ff0060 B intLevelSave
|
||||||
|
e0ff0062 B intTrace
|
||||||
|
e0ff0064 B dmaQueues
|
||||||
|
e0ff0068 b state
|
||||||
|
e0ff006a b vscroll_update
|
||||||
|
e0ff006b b hscroll_update
|
||||||
|
e0ff006c b fadePSGVol
|
||||||
|
e0ff006e b fadeFMVol
|
||||||
|
e0ff0070 b fadeCount
|
||||||
|
e0ff0072 b usedVDPSprite
|
||||||
|
e0ff0074 b xgm2WaitTab
|
||||||
|
e0ff007c b xgm2IdleTab
|
||||||
|
e0ff0084 b xgmTempoCnt
|
||||||
|
e0ff0088 b xgmWaitTab
|
||||||
|
e0ff00c8 b xgmIdleTab
|
||||||
|
e0ff0108 b xgmTempoDef
|
||||||
|
e0ff010a b xgmTempo
|
||||||
|
e0ff010c b busProtectSignalAddress
|
||||||
|
e0ff010e b driverFlags
|
||||||
|
e0ff0110 b currentDriver
|
||||||
|
e0ff0112 b allocStack
|
||||||
|
e0ff0252 b lastVTimer.0
|
||||||
|
e0ff0254 b text_plan
|
||||||
|
e0ff0258 b text_basetile
|
||||||
|
e0ff025a b lastVCnt
|
||||||
|
e0ff025c b windowWidthSft
|
||||||
|
e0ff025e b planeWidthSft
|
||||||
|
e0ff0260 b windowWidth
|
||||||
|
e0ff0262 b planeHeight
|
||||||
|
e0ff0264 b planeWidth
|
||||||
|
e0ff0266 b hscrl_addr
|
||||||
|
e0ff0268 b bgb_addr
|
||||||
|
e0ff026a b bga_addr
|
||||||
|
e0ff026c b window_addr
|
||||||
|
e0ff026e b lastTick
|
||||||
|
e0ff0272 b cpuFrameLoad
|
||||||
|
e0ff0274 b frameLoadIndex
|
||||||
|
e0ff0276 b frameLoads
|
||||||
|
e0ff0286 b vblankCB
|
||||||
|
e0ff028a b flags
|
||||||
|
e0ff028c b screenHeight
|
||||||
|
e0ff028e b screenWidth
|
||||||
|
e0ff0290 b maps_addr
|
||||||
|
e0ff0292 b slist_addr
|
||||||
|
e0ff0294 b vdpSpriteCache
|
||||||
|
e0ff0594 b spriteVramSize
|
||||||
|
e0ff0598 b vram
|
||||||
|
e0ff05a4 b lastSprite
|
||||||
|
e0ff05a8 b firstSprite
|
||||||
|
e0ff05ac b spritesPool
|
||||||
|
e0ff05b0 b fadeCounter
|
||||||
|
e0ff05b2 b heap
|
||||||
|
e0ff05b6 b free.lto_priv.0
|
||||||
|
e0ff05ba b randomSeedSet
|
||||||
|
e0ff05bc b joyEventCB
|
||||||
|
e0ff05c0 b retry
|
||||||
|
e0ff05c1 b phase.lto_priv.1
|
||||||
|
e0ff05c2 b gun
|
||||||
|
e0ff05c3 b extSet
|
||||||
|
e0ff05c4 b disableIntStack
|
||||||
|
e0ff05c6 b joyAxisY
|
||||||
|
e0ff05d6 b joyAxisX
|
||||||
|
e0ff05e6 b joyState
|
||||||
|
e0ff05f6 b portSupport
|
||||||
|
e0ff05f8 b portType
|
||||||
|
e0ff05fa b gport
|
||||||
|
e0ff05fc b regValues
|
||||||
|
e0ff0610 b flag
|
||||||
|
e0ff0612 b maxTransferPerFrame
|
||||||
|
e0ff0614 b queueSize
|
||||||
|
e0ff0616 b nextDataBuffer
|
||||||
|
e0ff061a b queueTransferSize
|
||||||
|
e0ff061c b queueIndexLimit
|
||||||
|
e0ff061e b queueIndex
|
||||||
|
e0ff0620 b dmaDataBuffer
|
||||||
|
e0ff0624 b dataBufferSize
|
||||||
|
e0ff0626 b phase.lto_priv.0
|
||||||
|
e0ff0628 b joyType
|
||||||
|
e0ff0630 b buttonString
|
||||||
|
e0ff0634 b debugString
|
||||||
|
e0ff0684 B _bend
|
||||||
|
e1000000 A __stack
|
||||||
BIN
res/Sprites/BTW-1.png
Normal file
BIN
res/Sprites/BTW-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 630 B |
BIN
res/background1.png
Normal file
BIN
res/background1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.6 KiB |
BIN
res/foreground1.png
Normal file
BIN
res/foreground1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
9
res/resources.h
Normal file
9
res/resources.h
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#include <genesis.h>
|
||||||
|
|
||||||
|
#ifndef _RES_RESOURCES_H_
|
||||||
|
#define _RES_RESOURCES_H_
|
||||||
|
|
||||||
|
extern const Image bg1;
|
||||||
|
extern const SpriteDefinition bigTex1;
|
||||||
|
|
||||||
|
#endif // _RES_RESOURCES_H_
|
||||||
2
res/resources.res
Normal file
2
res/resources.res
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
IMAGE bg1 "background1.png" BEST ALL
|
||||||
|
SPRITE bigTex1 "Sprites\BTW-1.png" 8 8 FAST
|
||||||
106
src/Main.c
Normal file
106
src/Main.c
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
#include <genesis.h>
|
||||||
|
#include <resources.h>
|
||||||
|
|
||||||
|
char debugString[80];
|
||||||
|
char* buttonString;
|
||||||
|
char* clearString = " ";
|
||||||
|
Sprite* player;
|
||||||
|
|
||||||
|
void myJoyHandler( u16 joy, u16 changed, u16 state)
|
||||||
|
{
|
||||||
|
strcpy(debugString, "");
|
||||||
|
if (joy == JOY_1)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (JOY_getJoypadType(JOY_1) == JOY_TYPE_PAD6 )
|
||||||
|
{
|
||||||
|
buttonString = "6 Button Connected";
|
||||||
|
}
|
||||||
|
else if (JOY_getJoypadType(JOY_1) == JOY_TYPE_PAD3)
|
||||||
|
{
|
||||||
|
buttonString = "3 Button Connected";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
buttonString = "Controller Not Found";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (state & BUTTON_START)
|
||||||
|
{
|
||||||
|
strcat(debugString, " Start ");
|
||||||
|
}
|
||||||
|
if (state & BUTTON_A)
|
||||||
|
{
|
||||||
|
strcat(debugString, " A ");
|
||||||
|
}
|
||||||
|
if (state & BUTTON_B)
|
||||||
|
{
|
||||||
|
strcat(debugString, " B ");
|
||||||
|
}
|
||||||
|
if (state & BUTTON_C)
|
||||||
|
{
|
||||||
|
strcat(debugString, " C ");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if(state & BUTTON_X){
|
||||||
|
strcat(debugString, " X ");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(state & BUTTON_Y){
|
||||||
|
strcat(debugString, " Y ");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(state & BUTTON_Z){
|
||||||
|
strcat(debugString, " Z ");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((strlen(debugString) == 0)){
|
||||||
|
strcpy(debugString, "None");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(bool hard)
|
||||||
|
{
|
||||||
|
JOY_init();
|
||||||
|
JOY_setEventHandler( &myJoyHandler );
|
||||||
|
|
||||||
|
u16 ind = TILE_USER_INDEX;
|
||||||
|
|
||||||
|
SPR_init();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
PAL_setPalette(PAL0, bg1.palette->data, DMA);
|
||||||
|
PAL_setPalette(PAL2, bigTex1.palette->data, DMA);
|
||||||
|
player = SPR_addSprite(&bigTex1, 0,0, TILE_ATTR(PAL2,false,false,false));
|
||||||
|
|
||||||
|
VDP_drawImageEx(BG_B, &bg1,TILE_ATTR_FULL(PAL0, false, false, false, ind), 0, 0, false, true);
|
||||||
|
while(TRUE)
|
||||||
|
{
|
||||||
|
VDP_drawImageEx(BG_B, &bg1,TILE_ATTR_FULL(PAL0, false, false, false, ind), 0, 0, false, true);
|
||||||
|
|
||||||
|
SPR_update();
|
||||||
|
|
||||||
|
// read input
|
||||||
|
// move sprite
|
||||||
|
// update score
|
||||||
|
// draw current screen (logo, start screen, settings, game, gameover, credits...)
|
||||||
|
VDP_drawText(clearString, 2, 5);
|
||||||
|
VDP_drawText(buttonString, 2, 5);
|
||||||
|
|
||||||
|
|
||||||
|
VDP_drawText(clearString, 14, 13);
|
||||||
|
VDP_drawText(debugString, 14, 13);
|
||||||
|
|
||||||
|
// wait for screen refresh and do all SGDK VBlank tasks
|
||||||
|
SYS_doVBlankProcess();
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
33
src/boot/rom_head.c
Normal file
33
src/boot/rom_head.c
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
#include "genesis.h"
|
||||||
|
|
||||||
|
__attribute__((externally_visible))
|
||||||
|
const ROMHeader rom_header = {
|
||||||
|
#if (ENABLE_BANK_SWITCH != 0)
|
||||||
|
"SEGA SSF ",
|
||||||
|
#elif (MODULE_MEGAWIFI != 0)
|
||||||
|
"SEGA MEGAWIFI ",
|
||||||
|
#else
|
||||||
|
"SEGA MEGA DRIVE ",
|
||||||
|
#endif
|
||||||
|
"(C)SGDK 2024 ",
|
||||||
|
"SAMPLE PROGRAM ",
|
||||||
|
"SAMPLE PROGRAM ",
|
||||||
|
"GM 00000000-00",
|
||||||
|
0x000,
|
||||||
|
"JD ",
|
||||||
|
0x00000000,
|
||||||
|
#if (ENABLE_BANK_SWITCH != 0)
|
||||||
|
0x003FFFFF,
|
||||||
|
#else
|
||||||
|
0x000FFFFF,
|
||||||
|
#endif
|
||||||
|
0xE0FF0000,
|
||||||
|
0xE0FFFFFF,
|
||||||
|
"RA",
|
||||||
|
0xF820,
|
||||||
|
0x00200000,
|
||||||
|
0x0020FFFF,
|
||||||
|
" ",
|
||||||
|
"DEMONSTRATION PROGRAM ",
|
||||||
|
"JUE "
|
||||||
|
};
|
||||||
367
src/boot/sega.s
Normal file
367
src/boot/sega.s
Normal file
@@ -0,0 +1,367 @@
|
|||||||
|
#include "task_cst.h"
|
||||||
|
|
||||||
|
.section .text.keepboot
|
||||||
|
|
||||||
|
*-------------------------------------------------------
|
||||||
|
*
|
||||||
|
* Sega startup code for the GNU Assembler
|
||||||
|
* Translated from:
|
||||||
|
* Sega startup code for the Sozobon C compiler
|
||||||
|
* Written by Paul W. Lee
|
||||||
|
* Modified by Charles Coty
|
||||||
|
* Modified by Stephane Dallongeville
|
||||||
|
*
|
||||||
|
*-------------------------------------------------------
|
||||||
|
|
||||||
|
.globl rom_header
|
||||||
|
|
||||||
|
.org 0x00000000
|
||||||
|
|
||||||
|
_Start_Of_Rom:
|
||||||
|
_Vecteurs_68K:
|
||||||
|
dc.l __stack /* Stack address */
|
||||||
|
dc.l _Entry_Point /* Program start address */
|
||||||
|
dc.l _Bus_Error
|
||||||
|
dc.l _Address_Error
|
||||||
|
dc.l _Illegal_Instruction
|
||||||
|
dc.l _Zero_Divide
|
||||||
|
dc.l _Chk_Instruction
|
||||||
|
dc.l _Trapv_Instruction
|
||||||
|
dc.l _Privilege_Violation
|
||||||
|
dc.l _Trace
|
||||||
|
dc.l _Line_1010_Emulation
|
||||||
|
dc.l _Line_1111_Emulation
|
||||||
|
dc.l _Error_Exception, _Error_Exception, _Error_Exception, _Error_Exception
|
||||||
|
dc.l _Error_Exception, _Error_Exception, _Error_Exception, _Error_Exception
|
||||||
|
dc.l _Error_Exception, _Error_Exception, _Error_Exception, _Error_Exception
|
||||||
|
dc.l _Error_Exception
|
||||||
|
dc.l _INT
|
||||||
|
dc.l _EXTINT
|
||||||
|
dc.l _INT
|
||||||
|
dc.l hintCaller
|
||||||
|
dc.l _INT
|
||||||
|
dc.l _VINT
|
||||||
|
dc.l _INT
|
||||||
|
dc.l _trap_0 /* Resume supervisor task */
|
||||||
|
dc.l _INT,_INT,_INT,_INT,_INT,_INT,_INT
|
||||||
|
dc.l _INT,_INT,_INT,_INT,_INT,_INT,_INT,_INT
|
||||||
|
dc.l _INT,_INT,_INT,_INT,_INT,_INT,_INT,_INT
|
||||||
|
dc.l _INT,_INT,_INT,_INT,_INT,_INT,_INT,_INT
|
||||||
|
|
||||||
|
rom_header:
|
||||||
|
.incbin "out/rom_head.bin", 0, 0x100
|
||||||
|
|
||||||
|
_Entry_Point:
|
||||||
|
* disable interrupts
|
||||||
|
move #0x2700,%sr
|
||||||
|
|
||||||
|
* Configure a USER_STACK_LENGTH bytes user stack at bottom, and system stack on top of it
|
||||||
|
move %sp, %usp
|
||||||
|
sub #USER_STACK_LENGTH, %sp
|
||||||
|
|
||||||
|
* Halt Z80 (need to be done as soon as possible on reset)
|
||||||
|
move.l #0xA11100,%a0 /* Z80_HALT_PORT */
|
||||||
|
move.w #0x0100,%d0
|
||||||
|
move.w %d0,(%a0) /* HALT Z80 */
|
||||||
|
move.w %d0,0x0100(%a0) /* END RESET Z80 */
|
||||||
|
|
||||||
|
tst.l 0xa10008
|
||||||
|
bne.s SkipInit
|
||||||
|
|
||||||
|
tst.w 0xa1000c
|
||||||
|
bne.s SkipInit
|
||||||
|
|
||||||
|
* Check Version Number
|
||||||
|
move.b -0x10ff(%a0),%d0
|
||||||
|
andi.b #0x0f,%d0
|
||||||
|
beq.s NoTMSS
|
||||||
|
|
||||||
|
* Sega Security Code (SEGA)
|
||||||
|
move.l #0x53454741,0x2f00(%a0)
|
||||||
|
|
||||||
|
NoTMSS:
|
||||||
|
jmp _start_entry
|
||||||
|
|
||||||
|
SkipInit:
|
||||||
|
jmp _reset_entry
|
||||||
|
|
||||||
|
|
||||||
|
*------------------------------------------------
|
||||||
|
*
|
||||||
|
* interrupt functions
|
||||||
|
*
|
||||||
|
*------------------------------------------------
|
||||||
|
|
||||||
|
_INT:
|
||||||
|
movem.l %d0-%d1/%a0-%a1,-(%sp)
|
||||||
|
move.l intCB, %a0
|
||||||
|
jsr (%a0)
|
||||||
|
movem.l (%sp)+,%d0-%d1/%a0-%a1
|
||||||
|
rte
|
||||||
|
|
||||||
|
_EXTINT:
|
||||||
|
movem.l %d0-%d1/%a0-%a1,-(%sp)
|
||||||
|
move.l eintCB, %a0
|
||||||
|
jsr (%a0)
|
||||||
|
movem.l (%sp)+,%d0-%d1/%a0-%a1
|
||||||
|
rte
|
||||||
|
|
||||||
|
_VINT:
|
||||||
|
btst #5, (%sp) /* Skip context switch if not in user task */
|
||||||
|
bne.s no_user_task
|
||||||
|
|
||||||
|
tst.w task_lock
|
||||||
|
bne.s 1f
|
||||||
|
move.w #0, -(%sp) /* TSK_superPend() will return 0 */
|
||||||
|
bra.s unlock /* If lock == 0, supervisor task is not locked */
|
||||||
|
|
||||||
|
1:
|
||||||
|
bcs.s no_user_task /* If lock < 0, super is locked with infinite wait */
|
||||||
|
subq.w #1, task_lock /* Locked with wait, subtract 1 to the frame count */
|
||||||
|
bne.s no_user_task /* And do not unlock if we did not reach 0 */
|
||||||
|
move.w #1, -(%sp) /* TSK_superPend() will return 1 */
|
||||||
|
|
||||||
|
unlock:
|
||||||
|
/* Save bg task registers (excepting a7, that is stored in usp) */
|
||||||
|
move.l %a0, task_regs
|
||||||
|
lea (task_regs + UTSK_REGS_LEN), %a0
|
||||||
|
movem.l %d0-%d7/%a1-%a6, -(%a0)
|
||||||
|
|
||||||
|
move.w (%sp)+, %d0 /* Load return value previously pushed to stack */
|
||||||
|
|
||||||
|
move.w (%sp)+, task_sr /* Pop user task sr and pc, and save them, */
|
||||||
|
move.l (%sp)+, task_pc /* so they can be restored later. */
|
||||||
|
movem.l (%sp)+, %d2-%d7/%a2-%a6 /* Restore non clobberable registers */
|
||||||
|
|
||||||
|
no_user_task:
|
||||||
|
/* At this point, we always have in the stack the SR and PC of the task */
|
||||||
|
/* we want to jump after processing the interrupt, that might be the */
|
||||||
|
/* point where we came from (if there is no context switch) or the */
|
||||||
|
/* supervisor task (if we unlocked it). */
|
||||||
|
|
||||||
|
movem.l %d0-%d1/%a0-%a1,-(%sp)
|
||||||
|
ori.w #0x0001, intTrace /* in V-Int */
|
||||||
|
addq.l #1, vtimer /* increment frame counter (more a vint counter) */
|
||||||
|
btst #3, VBlankProcess+1 /* PROCESS_XGM_TASK ? (use VBlankProcess+1 as btst is a byte operation) */
|
||||||
|
beq.s no_xgm_task
|
||||||
|
|
||||||
|
jsr XGM_doVBlankProcess /* do XGM vblank task */
|
||||||
|
|
||||||
|
no_xgm_task:
|
||||||
|
btst #1, VBlankProcess+1 /* PROCESS_BITMAP_TASK ? (use VBlankProcess+1 as btst is a byte operation) */
|
||||||
|
beq.s no_bmp_task
|
||||||
|
|
||||||
|
jsr BMP_doVBlankProcess /* do BMP vblank task */
|
||||||
|
|
||||||
|
no_bmp_task:
|
||||||
|
move.l vintCB, %a0 /* load user callback */
|
||||||
|
jsr (%a0) /* call user callback */
|
||||||
|
andi.w #0xFFFE, intTrace /* out V-Int */
|
||||||
|
movem.l (%sp)+,%d0-%d1/%a0-%a1
|
||||||
|
rte
|
||||||
|
|
||||||
|
*------------------------------------------------
|
||||||
|
*
|
||||||
|
* Copyright (c) 1988 by Sozobon, Limited. Author: Johann Ruegg
|
||||||
|
*
|
||||||
|
* Permission is granted to anyone to use this software for any purpose
|
||||||
|
* on any computer system, and to redistribute it freely, with the
|
||||||
|
* following restrictions:
|
||||||
|
* 1) No charge may be made other than reasonable charges for reproduction.
|
||||||
|
* 2) Modified versions must be clearly marked as such.
|
||||||
|
* 3) The authors are not responsible for any harmful consequences
|
||||||
|
* of using this software, even if they result from defects in it.
|
||||||
|
*
|
||||||
|
*------------------------------------------------
|
||||||
|
|
||||||
|
ldiv:
|
||||||
|
move.l 4(%a7),%d0
|
||||||
|
bpl ld1
|
||||||
|
neg.l %d0
|
||||||
|
ld1:
|
||||||
|
move.l 8(%a7),%d1
|
||||||
|
bpl ld2
|
||||||
|
neg.l %d1
|
||||||
|
eor.b #0x80,4(%a7)
|
||||||
|
ld2:
|
||||||
|
bsr i_ldiv /* d0 = d0/d1 */
|
||||||
|
tst.b 4(%a7)
|
||||||
|
bpl ld3
|
||||||
|
neg.l %d0
|
||||||
|
ld3:
|
||||||
|
rts
|
||||||
|
|
||||||
|
lmul:
|
||||||
|
move.l 4(%a7),%d0
|
||||||
|
bpl lm1
|
||||||
|
neg.l %d0
|
||||||
|
lm1:
|
||||||
|
move.l 8(%a7),%d1
|
||||||
|
bpl lm2
|
||||||
|
neg.l %d1
|
||||||
|
eor.b #0x80,4(%a7)
|
||||||
|
lm2:
|
||||||
|
bsr i_lmul /* d0 = d0*d1 */
|
||||||
|
tst.b 4(%a7)
|
||||||
|
bpl lm3
|
||||||
|
neg.l %d0
|
||||||
|
lm3:
|
||||||
|
rts
|
||||||
|
|
||||||
|
lrem:
|
||||||
|
move.l 4(%a7),%d0
|
||||||
|
bpl lr1
|
||||||
|
neg.l %d0
|
||||||
|
lr1:
|
||||||
|
move.l 8(%a7),%d1
|
||||||
|
bpl lr2
|
||||||
|
neg.l %d1
|
||||||
|
lr2:
|
||||||
|
bsr i_ldiv /* d1 = d0%d1 */
|
||||||
|
move.l %d1,%d0
|
||||||
|
tst.b 4(%a7)
|
||||||
|
bpl lr3
|
||||||
|
neg.l %d0
|
||||||
|
lr3:
|
||||||
|
rts
|
||||||
|
|
||||||
|
ldivu:
|
||||||
|
move.l 4(%a7),%d0
|
||||||
|
move.l 8(%a7),%d1
|
||||||
|
bsr i_ldiv
|
||||||
|
rts
|
||||||
|
|
||||||
|
lmulu:
|
||||||
|
move.l 4(%a7),%d0
|
||||||
|
move.l 8(%a7),%d1
|
||||||
|
bsr i_lmul
|
||||||
|
rts
|
||||||
|
|
||||||
|
lremu:
|
||||||
|
move.l 4(%a7),%d0
|
||||||
|
move.l 8(%a7),%d1
|
||||||
|
bsr i_ldiv
|
||||||
|
move.l %d1,%d0
|
||||||
|
rts
|
||||||
|
*
|
||||||
|
* A in d0, B in d1, return A*B in d0
|
||||||
|
*
|
||||||
|
i_lmul:
|
||||||
|
move.l %d3,%a2 /* save d3 */
|
||||||
|
move.w %d1,%d2
|
||||||
|
mulu %d0,%d2 /* d2 = Al * Bl */
|
||||||
|
|
||||||
|
move.l %d1,%d3
|
||||||
|
swap %d3
|
||||||
|
mulu %d0,%d3 /* d3 = Al * Bh */
|
||||||
|
|
||||||
|
swap %d0
|
||||||
|
mulu %d1,%d0 /* d0 = Ah * Bl */
|
||||||
|
|
||||||
|
add.l %d3,%d0 /* d0 = (Ah*Bl + Al*Bh) */
|
||||||
|
swap %d0
|
||||||
|
clr.w %d0 /* d0 = (Ah*Bl + Al*Bh) << 16 */
|
||||||
|
|
||||||
|
add.l %d2,%d0 /* d0 = A*B */
|
||||||
|
move.l %a2,%d3 /* restore d3 */
|
||||||
|
rts
|
||||||
|
*
|
||||||
|
*A in d0, B in d1, return A/B in d0, A%B in d1
|
||||||
|
*
|
||||||
|
i_ldiv:
|
||||||
|
tst.l %d1
|
||||||
|
bne nz1
|
||||||
|
|
||||||
|
* divide by zero
|
||||||
|
* divu #0,%d0 /* cause trap */
|
||||||
|
move.l #0x80000000,%d0
|
||||||
|
move.l %d0,%d1
|
||||||
|
rts
|
||||||
|
nz1:
|
||||||
|
move.l %d3,%a2 /* save d3 */
|
||||||
|
cmp.l %d1,%d0
|
||||||
|
bhi norm
|
||||||
|
beq is1
|
||||||
|
* A<B, so ret 0, rem A
|
||||||
|
move.l %d0,%d1
|
||||||
|
clr.l %d0
|
||||||
|
move.l %a2,%d3 /* restore d3 */
|
||||||
|
rts
|
||||||
|
* A==B, so ret 1, rem 0
|
||||||
|
is1:
|
||||||
|
moveq.l #1,%d0
|
||||||
|
clr.l %d1
|
||||||
|
move.l %a2,%d3 /* restore d3 */
|
||||||
|
rts
|
||||||
|
* A>B and B is not 0
|
||||||
|
norm:
|
||||||
|
cmp.l #1,%d1
|
||||||
|
bne not1
|
||||||
|
* B==1, so ret A, rem 0
|
||||||
|
clr.l %d1
|
||||||
|
move.l %a2,%d3 /* restore d3 */
|
||||||
|
rts
|
||||||
|
* check for A short (implies B short also)
|
||||||
|
not1:
|
||||||
|
cmp.l #0xffff,%d0
|
||||||
|
bhi slow
|
||||||
|
* A short and B short -- use 'divu'
|
||||||
|
divu %d1,%d0 /* d0 = REM:ANS */
|
||||||
|
swap %d0 /* d0 = ANS:REM */
|
||||||
|
clr.l %d1
|
||||||
|
move.w %d0,%d1 /* d1 = REM */
|
||||||
|
clr.w %d0
|
||||||
|
swap %d0
|
||||||
|
move.l %a2,%d3 /* restore d3 */
|
||||||
|
rts
|
||||||
|
* check for B short
|
||||||
|
slow:
|
||||||
|
cmp.l #0xffff,%d1
|
||||||
|
bhi slower
|
||||||
|
* A long and B short -- use special stuff from gnu
|
||||||
|
move.l %d0,%d2
|
||||||
|
clr.w %d2
|
||||||
|
swap %d2
|
||||||
|
divu %d1,%d2 /* d2 = REM:ANS of Ahi/B */
|
||||||
|
clr.l %d3
|
||||||
|
move.w %d2,%d3 /* d3 = Ahi/B */
|
||||||
|
swap %d3
|
||||||
|
|
||||||
|
move.w %d0,%d2 /* d2 = REM << 16 + Alo */
|
||||||
|
divu %d1,%d2 /* d2 = REM:ANS of stuff/B */
|
||||||
|
|
||||||
|
move.l %d2,%d1
|
||||||
|
clr.w %d1
|
||||||
|
swap %d1 /* d1 = REM */
|
||||||
|
|
||||||
|
clr.l %d0
|
||||||
|
move.w %d2,%d0
|
||||||
|
add.l %d3,%d0 /* d0 = ANS */
|
||||||
|
move.l %a2,%d3 /* restore d3 */
|
||||||
|
rts
|
||||||
|
* A>B, B > 1
|
||||||
|
slower:
|
||||||
|
move.l #1,%d2
|
||||||
|
clr.l %d3
|
||||||
|
moreadj:
|
||||||
|
cmp.l %d0,%d1
|
||||||
|
bhs adj
|
||||||
|
add.l %d2,%d2
|
||||||
|
add.l %d1,%d1
|
||||||
|
bpl moreadj
|
||||||
|
* we shifted B until its >A or sign bit set
|
||||||
|
* we shifted #1 (d2) along with it
|
||||||
|
adj:
|
||||||
|
cmp.l %d0,%d1
|
||||||
|
bhi ltuns
|
||||||
|
or.l %d2,%d3
|
||||||
|
sub.l %d1,%d0
|
||||||
|
ltuns:
|
||||||
|
lsr.l #1,%d1
|
||||||
|
lsr.l #1,%d2
|
||||||
|
bne adj
|
||||||
|
* d3=answer, d0=rem
|
||||||
|
move.l %d0,%d1
|
||||||
|
move.l %d3,%d0
|
||||||
|
move.l %a2,%d3 /* restore d3 */
|
||||||
|
rts
|
||||||
Reference in New Issue
Block a user