├── .gitignore
├── ADPCM
├── ADPCM.cbp
└── main.c
├── ADPCM2
├── ADPCM2.cbp
└── main.c
├── ADPCM3
├── ADPCM3.cbp
└── main.c
├── Allocation
├── Allocation.cbp
└── main.c
├── Anatomy
├── Anatomy.cbp
├── default
│ └── Anatomy.x
└── main.c
├── Assembler
├── Assembler.cbp
├── assembler_lydux.S
└── assembler_mariko.s
├── Backgrounds
├── Backgrounds.cbp
├── default
│ └── Backgrounds.x
├── main.c
├── utils.c
└── utils.h
├── CastleLand
├── CastleLand.cbp
├── CastleLand_mariko
│ ├── CastleLand.x
│ ├── tiled.pal
│ ├── tiled.tm
│ └── tiled.ts
├── main.c
├── utils.c
└── utils.h
├── FPCube
├── FPCube.cbp
├── README.md
├── default
│ └── FPCube.x
└── main.c
├── FileOperations
├── FileOperations.cbp
├── default
│ └── FileOperations.X
├── lyndux
│ └── FileOperations.X
└── main.c
├── FlyWin
├── FlyWin.cbp
├── FlyWin_mariko
│ └── FlyWin.x
└── main.c
├── HelloWorld
├── HelloWorld.cbp
├── default
│ └── HelloWorld.X
└── main.c
├── Hide
├── Hide.cbp
├── hidem.s
├── hidesp.s
└── script.txt
├── Interrupts
├── Interrupts.cbp
└── main.c
├── LICENSE
├── LdPaletteFF
├── LdPaletteFF.cbp
├── default
│ ├── LdPaletteFF.x
│ └── palette.pal
├── main.c
├── utils.c
└── utils.h
├── LoadImage
├── LoadImage.cbp
├── default
│ └── LoadImage.x
├── main.c
├── utils.c
└── utils.h
├── LoadImg16b
├── LoadImg16b.cbp
├── lydux
│ ├── 16BSonic.pic
│ ├── 24BitLandSc.pic
│ └── LoadImg16b.X
├── main.c
├── mariko
│ ├── 16BSonic.pic
│ ├── 24BitLandSc.pic
│ └── LoadImg16b.x
├── utils.c
└── utils.h
├── LoadImg4b
├── LoadImg4b.cbp
├── lydux
│ ├── LoadImg4b.X
│ ├── formula4b.pal
│ └── formula4b.pic
├── main.c
├── mariko
│ ├── LoadImg4b.x
│ ├── formula4b.pal
│ └── formula4b.pic
├── utils.c
└── utils.h
├── LoadImg8b
├── LoadImg8b.cbp
├── lydux
│ ├── 8BitsColors.pal
│ ├── 8BitsColors.pic
│ └── LoadImg8b.X
├── main.c
├── mariko
│ ├── 8BitsColors.pal
│ ├── 8BitsColors.pic
│ └── LoadImg8b.x
├── utils.c
└── utils.h
├── LoadPCG
├── LoadPCG.cbp
├── default
│ └── LoadPCG.X
├── main.c
├── utils.c
└── utils.h
├── LoadPCGFF
├── LoadPCGFF.cbp
├── default
│ ├── LoadPCGFF.x
│ ├── palette.pal
│ └── ship.pcg
├── main.c
├── utils.c
└── utils.h
├── LoadPalette
├── LoadPalette.cbp
├── default
│ └── LoadPalette.X
└── main.c
├── LoadPaletteDMA
├── LoadPaletteDMA.cbp
├── default
│ ├── LoadPaletteDMA.X
│ └── palette.pal
├── main.c
└── utils.h
├── LoadPaletteLowLevel
├── LoadPaletteLowLevel.cbp
├── default
│ ├── LoadPaletteLL.X
│ └── palette.pal
├── main.c
└── utils.h
├── LoadSprites
├── LoadSprites.cbp
├── default
│ ├── LoadSprites.X
│ ├── palette.pal
│ └── ship.pcg
├── main.c
├── utils.c
└── utils.h
├── LoadSpritesFF
├── LoadSpritesFF.cbp
├── default
│ ├── LoadSpritesFF.x
│ ├── palette.pal
│ └── ship.pcg
├── main.c
├── utils.c
└── utils.h
├── MarioKaBig
├── MarioKaBig.cbp
├── MarioKaBig_mariko
│ ├── MarioKaBig.x
│ ├── tiled.pal
│ ├── tiled.tm
│ └── tiled.ts
├── main.c
├── utils.c
└── utils.h
├── MarioKart
├── MarioKart.cbp
├── MarioKart_lydux
│ └── MarioKart.X
├── MarioKart_mariko
│ ├── MarioKart.x
│ ├── tiled.pal
│ ├── tiled.tm
│ └── tiled.ts
├── README.md
├── game.c
├── game.h
├── graphics.c
├── graphics.h
├── input.c
├── input.h
├── main.c
├── makefile
├── resources.c
├── resources.h
├── stdafx.c
├── stdafx.h
├── utils.c
└── utils.h
├── OPM2
├── OPM2.cbp
├── default
│ └── OPM2.x
└── main.c
├── README.md
├── Raster
├── Raster.cbp
├── asm
│ ├── files.S
│ └── nfiles.S
├── default
│ ├── Raster.x
│ ├── s_walk_0.spt
│ ├── s_walk_1.spt
│ ├── s_walk_2.spt
│ ├── s_walk_3.spt
│ ├── s_walk_4.spt
│ ├── s_walk_5.spt
│ └── sonic.pal
├── main.c
├── newlib_fixes.h
├── utils.c
└── utils.h
├── RayCast
├── RayCast.cbp
├── default
│ └── RayCast.x
└── main.c
├── Resident
├── Resident.cbp
├── calculate_size.bat
├── calculate_size.sh
├── clock.c
├── clock.h
├── default
│ └── Resident.x
├── main.c
├── utils.c
└── utils.h
├── Sonic
├── Sonic.cbp
├── asm
│ ├── files.S
│ └── nfiles.S
├── default
│ ├── Sonic.x
│ ├── sonic_sp
│ │ ├── s_look_d.spt
│ │ ├── s_look_u.spt
│ │ ├── s_run_0.spt
│ │ ├── s_run_1.spt
│ │ ├── s_run_2.spt
│ │ ├── s_run_3.spt
│ │ ├── s_spin_0.spt
│ │ ├── s_spin_1.spt
│ │ ├── s_spin_2.spt
│ │ ├── s_spin_3.spt
│ │ ├── s_still.spt
│ │ ├── s_stop_0.spt
│ │ ├── s_stop_1.spt
│ │ ├── s_wait_0.spt
│ │ ├── s_wait_1.spt
│ │ ├── s_walk_0.spt
│ │ ├── s_walk_1.spt
│ │ ├── s_walk_2.spt
│ │ ├── s_walk_3.spt
│ │ ├── s_walk_4.spt
│ │ ├── s_walk_5.spt
│ │ └── sonic.pal
│ └── tails
│ │ ├── t_fly_0.spt
│ │ ├── t_fly_1.spt
│ │ ├── t_jump_0.spt
│ │ ├── t_jump_1.spt
│ │ ├── t_run_0.spt
│ │ ├── t_run_1.spt
│ │ ├── t_run_2.spt
│ │ ├── t_run_3.spt
│ │ ├── t_run_4.spt
│ │ ├── t_run_5.spt
│ │ ├── t_spin_0.spt
│ │ ├── t_spin_1.spt
│ │ ├── t_spin_2.spt
│ │ ├── t_spin_d_0.spt
│ │ ├── t_spin_d_1.spt
│ │ ├── t_stil_0.spt
│ │ ├── t_stil_1.spt
│ │ ├── t_stil_2.spt
│ │ ├── t_stil_3.spt
│ │ ├── t_swing_0.spt
│ │ ├── t_swing_1.spt
│ │ ├── t_walk_0.spt
│ │ ├── t_walk_1.spt
│ │ ├── t_walk_2.spt
│ │ ├── t_walk_3.spt
│ │ ├── t_walk_4.spt
│ │ ├── t_walk_5.spt
│ │ ├── t_walk_6.spt
│ │ ├── t_walk_7.spt
│ │ └── tails.pal
├── main.c
├── newlib_fixes.h
├── utils.c
└── utils.h
├── Sound
├── Sound.cbp
├── default
│ └── Sound.x
├── lydux
│ └── Sound.X
└── main.c
├── Tetris68
├── README.md
├── Tetris68.cbp
├── default
│ ├── Tetris68.x
│ ├── tetris.pal
│ └── tetris.til
├── main.c
├── tetris.c
├── tetris.h
├── utils.c
└── utils.h
├── Textplains
├── Textplains.cbp
└── main.c
├── Textplan
├── Textplan.cbp
└── main.c
├── WinTools
├── Image.cpp
├── Image.h
├── PCGs.cpp
├── PCGs.h
├── Palettes.cpp
├── Palettes.h
├── WinTools.cbp
├── bmp.cpp
├── bmp.h
├── grafitti.cpp
├── grafitti.h
├── main.c
├── main.cpp
└── stdafx.h
├── assandc
├── assandc.cbp
├── asslib_lydux.S
├── asslib_mariko.s
└── main.c
├── assets
├── captures
│ ├── fpcube.png
│ ├── mariokartA.png
│ └── tetris68.png
├── images
│ ├── 111590-2223717679.png
│ ├── 24BitLandSc.bmp
│ ├── 4BitLandSc.bmp
│ ├── 4bitCircuit.bmp
│ ├── 8BitLandSc.bmp
│ ├── 8BitsColors.Wide.bmp
│ ├── 8BitsColors.big.bmp
│ ├── 8BitsColors.bmp
│ ├── 8BitsLandScapeAndColors.bmp
│ ├── Colours.bmp
│ ├── circuit.bmp
│ └── formula4b.png
└── mariokart
│ ├── 111590-2223717679.png
│ ├── tiled.tmx
│ └── tiles.png
├── blogresi
├── blogresi.cbp
├── blogresi_mariko
│ └── blogresi.x
└── main.c
├── documents
├── DOS calls English.txt
├── DOS calls Japanese.txt
├── EDIT program help.txt
├── IOCS calls English.txt
├── IOCS calls Japanese.txt
├── Mariko tools
│ ├── AR.X English.txt
│ ├── AR.X Japanese.txt
│ ├── AS.X English.txt
│ ├── AS.X Japanese.txt
│ ├── BIND.X English.txt
│ ├── BIND.X Japanese.txt
│ ├── HAS060.X English.txt
│ ├── HAS060.X Japanese.txt
│ ├── LIB.X English.txt
│ ├── LIB.X Japanese.txt
│ ├── LK300.X lk.x English.txt
│ ├── LK300.X lk.x Japanese.txt
│ ├── MAKE.X English.txt
│ ├── MAKE.X Japanese.txt
│ ├── has234.x English.txt
│ ├── has234.x Japanese.txt
│ ├── has250.x English.txt
│ ├── has250.x Japanese.txt
│ ├── has309.x has000.x English.txt
│ ├── has309.x has000.x Japanese.txt
│ ├── hlk301-12.r English.txt
│ ├── hlk301-12.r Japanese.txt
│ ├── silk229.x English.txt
│ ├── silk229.x Japanese.txt
│ ├── silk301.x hlk301.x English.txt
│ ├── silk301.x hlk301.x Japanese.txt
│ └── tool versions.txt
├── Oh!X_1993-02.pdf 99 - 108 Englis.txt
├── Oh!X_1993-02.pdf 99 - 108 Japanese.txt
├── X68kV2FUNC English.txt
├── X68kV2FUNC Japanese.txt
├── assembly notes.txt
├── programmers English.txt
├── programmers Japanese.txt
├── trap English.txt
├── trap Japanese.txt
├── yosshin4004 readme English.txt
└── yosshin4004 readme Japanese.txt
├── tests4bits
├── main.c
└── tests4bits.cbp
├── x68000_gcc
├── logo.png
├── template
│ └── main.c
└── wizard.script
├── x68000_gcc_template.zip
└── x68AssetsComp
├── requirements.txt
├── setup.py
├── tests
├── __init__.py
├── samples
│ ├── 16BitLandSc.bmp
│ ├── 16BitLandSc.pic
│ ├── 8BitsColors.bmp
│ ├── 8BitsColors.pic
│ ├── 8Bitscolors.pal
│ ├── formula4b.pal
│ ├── formula4b.pic
│ ├── formula4b.png
│ ├── mk_circuit.pal
│ ├── mk_circuit.tm
│ ├── mk_circuit.ts
│ ├── tiled.tmx
│ └── tiles.png
└── test_main.py
└── x68assetscomp
├── __init__.py
├── audio_converter.py
├── image_converter.py
├── image_tile.py
├── main.py
├── tmx_converter.py
└── utils.py
/.gitignore:
--------------------------------------------------------------------------------
1 | *.depend
2 | *.layout
3 | *.save
4 | *.map
5 | *.o
6 | /*/.objs/*
--------------------------------------------------------------------------------
/ADPCM/ADPCM.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/ADPCM2/ADPCM2.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/ADPCM3/ADPCM3.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Allocation/Allocation.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Anatomy/Anatomy.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Anatomy/default/Anatomy.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Anatomy/default/Anatomy.x
--------------------------------------------------------------------------------
/Assembler/Assembler.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Assembler/assembler_lydux.S:
--------------------------------------------------------------------------------
1 | | main (__argc, __argv, environ)
2 |
3 | .set Y_VALUE, 31
4 | .set X_VALUE, 0
5 |
6 | .set _B_LOCATE, 0x23
7 | .set _PRINT, 0xff09
8 | .set _EXIT, 0xff00
9 |
10 | .text
11 | .even
12 | .global main
13 | .type main,@function
14 |
15 | main:
16 | move.l %sp@(4), %d0 | __argc (number of command-line arguments)
17 | move.l %sp@(8), %a0 | __argv (pointer to an array of pointers to arguments)
18 | move.l %sp@(12), %a1 | environ (pointer to an array of pointers to environment strings)
19 |
20 | move.l #Y_VALUE, %sp@- |y
21 | move.l #X_VALUE, %sp@- |x
22 | jsr _iocs_b_locate
23 | addq.l #8, %sp
24 |
25 | pea msg_calling_functions
26 | jsr _dos_print | print
27 |
28 |
29 | move.w #Y_VALUE, %d2 |y
30 | move.w #X_VALUE, %d1 |x
31 | moveq #_B_LOCATE, %d0
32 | trap #15
33 | move.l %sp@+, %d2
34 |
35 | pea msg_dos_calls
36 | .short _PRINT | print
37 | addq.l #4, %sp
38 |
39 | bra exit_ok | exit
40 |
41 | exit_ok:
42 | .short _EXIT
43 |
44 | .data
45 |
46 | msg_calling_functions:
47 | .string "Calling functions\r\n"
48 |
49 | msg_dos_calls:
50 | .string "Dos calls\r\n"
51 |
52 | .end main | run from main.
53 |
--------------------------------------------------------------------------------
/Assembler/assembler_mariko.s:
--------------------------------------------------------------------------------
1 | .include doscall.mac
2 | .include iocscall.mac
3 | .text
4 | .even
5 |
6 | main:
7 |
8 | move.l #31, -(sp) ;y
9 | move.l #0, -(sp) ;x
10 | jsr __iocs_b_locate
11 | addq.l #8, sp
12 |
13 | pea msg_calling_functions
14 | jsr __dos_print ; print
15 |
16 |
17 | move.w #31, d2 ;y
18 | move.w #0, d1 ;x
19 | IOCS _B_LOCATE
20 | addq.l #8, sp
21 |
22 | pea msg_dos_calls
23 | DOS _PRINT ; print
24 | addq.l #4, sp
25 |
26 | bra exit_ok ; exit
27 |
28 | exit_ok
29 | DOS _EXIT
30 | .data
31 |
32 | msg_calling_functions:
33 | dc.b 'Calling functions', $0d, $0a,0
34 |
35 | msg_dos_calls:
36 | dc.b 'Dos calls', $0d, $0a, 0
37 |
38 | .end main * run from main.
39 |
--------------------------------------------------------------------------------
/Backgrounds/Backgrounds.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Backgrounds/default/Backgrounds.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Backgrounds/default/Backgrounds.x
--------------------------------------------------------------------------------
/Backgrounds/utils.c:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | int32_t loadPalette()
4 | {
5 | int32_t status;
6 |
7 |
8 |
9 |
10 | uint8_t colour_in_palette, palette_num;
11 |
12 |
13 |
14 | return 0;
15 | }
16 |
17 | int8_t loadPCGs(void)
18 | {
19 | int16_t status;
20 |
21 | //we will collect the palettes pallete by pallete in this array.
22 |
23 |
24 |
25 | return 0;
26 | }
27 |
--------------------------------------------------------------------------------
/Backgrounds/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef _UTILS_H_
2 | #define _UTILS_H_
3 |
4 | #ifdef __MARIKO_CC__
5 | #include
6 | #include
7 | #else
8 | #include
9 | #include
10 | #define interrupt __attribute__ ((interrupt_handler))
11 | #endif
12 |
13 | #include
14 |
15 | //sprite palette utils
16 | #define VERTICAL_BLANKING_DETECTION 0x80000000 //0b10000000000000000000000000000000
17 | #define VERTICAL_BLANKING_NO_DETECT 0
18 |
19 | #define SET_VBD_V(vbd, v) (vbd | v)
20 |
21 | #define SP_DEFCG_8X8_TILE 0
22 | #define SP_DEFCG_16X16_TILE 1
23 |
24 | int32_t loadPalette(void);
25 |
26 | int8_t loadPCGs(void);
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/CastleLand/CastleLand.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/CastleLand/CastleLand_mariko/CastleLand.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/CastleLand/CastleLand_mariko/CastleLand.x
--------------------------------------------------------------------------------
/CastleLand/CastleLand_mariko/tiled.pal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/CastleLand/CastleLand_mariko/tiled.pal
--------------------------------------------------------------------------------
/CastleLand/CastleLand_mariko/tiled.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/CastleLand/CastleLand_mariko/tiled.ts
--------------------------------------------------------------------------------
/CastleLand/utils.c:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | const char *getErrorMessage(int8_t code)
4 | {
5 | char *message;
6 |
7 | switch(code)
8 | {
9 | case -1: message = "Executed invalid function code\r\n"; break;
10 | case -2: message = "Specified file not found\r\n"; break;
11 | case -3: message = "Specified directory not found\r\n"; break;
12 | case -4: message = "Too many open files\r\n"; break;
13 | case -5: message = "Cannot access directory or volume label\r\n"; break;
14 | case -6: message = "Specified handle is not open\r\n"; break;
15 | case -7: message = "Memory manager region was destroyed\r\n"; break;
16 | case -8: message = "Not enough memory to execute\r\n"; break;
17 | case -9: message = "Invalid memory manager pointer specified\r\n"; break;
18 | case -10: message = "Illegal environment specified\r\n"; break;
19 | case -11: message = "Abnormal executable file format\r\n"; break;
20 | case -12: message = "Abnormal open access mode\r\n"; break;
21 | case -13: message = "Error in selecting a filename\r\n"; break;
22 | case -14: message = "Called with invalid parameter\r\n"; break;
23 | case -15: message = "Error in selecting a drive\r\n"; break;
24 | case -16: message = "Cannot remove current directory\r\n"; break;
25 | case -17: message = "Cannot ioctrl device\r\n"; break;
26 | case -18: message = "No more files found"; break;
27 | case -19: message = "Cannot write to specified file\r\n"; break;
28 | case -20: message = "Specified directory already registered\r\n"; break;
29 | case -21: message = "Cannot delete because file exists\r\n"; break;
30 | case -22: message = "Cannot name because file exists\r\n"; break;
31 | case -23: message = "Cannot create file because disk is full\r\n"; break;
32 | case -24: message = "Cannot create file because directory is full\r\n"; break;
33 | case -25: message = "Cannot seek to specified location\r\n"; break;
34 | case -26: message = "Specified supervisor mode with supervisor status on\r\n"; break;
35 | case -27: message = "Thread with same name exists\r\n"; break;
36 | case -28: message = "Interprocess communication buffer is write-protected\r\n"; break;
37 | case -29: message = "Cannot start any more background processes\r\n"; break;
38 | case -32: message = "Not enough lock regions\r\n"; break;
39 | case -33: message = "Locked; cannot access\r\n"; break;
40 | case -34: message = "Handler for specified drive is opened\r\n"; break;
41 | case -35: message = "Symbolic link nest exceeded 16 steps (lndrv)\r\n"; break;
42 | case -80: message = "File exists\r\n"; break;
43 | default: message = "No error\r\n"; break;
44 | }
45 |
46 | return message;
47 | }
48 |
--------------------------------------------------------------------------------
/CastleLand/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef _UTILS_H_
2 | #define _UTILS_H_
3 |
4 | #include
5 |
6 | #define ACCESS_DICTIONARY 0x80 //0b10000000 //1 not for users
7 | #define ACCESS_NORMAL 0x00 //0b00000000 //0
8 |
9 | #define SHARING_TOTAL 0x08 //0b00010000 //4 allow others to write and read
10 | #define SHARING_WRITE_ONLY 0x0C //0b00001100 //3 allow others to write only
11 | #define SHARING_READ_ONLY 0x08 //0b00001000 //2 allow others to read only
12 | #define SHARING_RESTRICTED 0x04 //0b00000100 //1 don't allow others anything
13 | #define SHARING_COMPATIBILITY_MODE 0x00 //0b00000000 //0
14 |
15 | #define MODE_RW 0x02 //0b00000010 //2 open for write and read
16 | #define MODE_W 0x01 //0b00000001 //1 open only for writing
17 | #define MODE_R 0x00 //0b00000000 //0 open only for reading
18 |
19 | union FileConf {
20 | struct {
21 | int8_t access_dictionary:1;
22 | int8_t :2; //padding
23 | int8_t sharing:3;
24 | int8_t mode:2;
25 | } flags;
26 | int8_t config;
27 | };
28 |
29 | #define SEEK_MODE_BEGINNING 0
30 | #define SEEK_MODE_CURRENT 1
31 | #define SEEK_MODE_END 2
32 |
33 | const char *getErrorMessage(int8_t code);
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/FPCube/FPCube.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/FPCube/README.md:
--------------------------------------------------------------------------------
1 | 
--------------------------------------------------------------------------------
/FPCube/default/FPCube.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/FPCube/default/FPCube.x
--------------------------------------------------------------------------------
/FileOperations/FileOperations.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/FileOperations/default/FileOperations.X:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/FileOperations/default/FileOperations.X
--------------------------------------------------------------------------------
/FileOperations/lyndux/FileOperations.X:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/FileOperations/lyndux/FileOperations.X
--------------------------------------------------------------------------------
/FlyWin/FlyWin.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/FlyWin/FlyWin_mariko/FlyWin.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/FlyWin/FlyWin_mariko/FlyWin.x
--------------------------------------------------------------------------------
/HelloWorld/HelloWorld.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/HelloWorld/default/HelloWorld.X:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/HelloWorld/default/HelloWorld.X
--------------------------------------------------------------------------------
/HelloWorld/main.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main(void)
4 | {
5 | _dos_c_print("Hello world !\r\n");
6 |
7 | _dos_exit();
8 | }
9 |
--------------------------------------------------------------------------------
/Hide/Hide.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Hide/script.txt:
--------------------------------------------------------------------------------
1 | run68 has309 %cd%\hidem.s
2 | run68 silk301 %cd%\hidem.o
3 |
4 | run68 has309 %cd%\hidesp.s
5 | run68 silk301 %cd%\hidesp.o
6 |
7 | run68 bind /o %cd%\hide.x %cd%\hidem.x %cd%\hidesp.x
--------------------------------------------------------------------------------
/Interrupts/Interrupts.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/LdPaletteFF/LdPaletteFF.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/LdPaletteFF/default/LdPaletteFF.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LdPaletteFF/default/LdPaletteFF.x
--------------------------------------------------------------------------------
/LdPaletteFF/default/palette.pal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LdPaletteFF/default/palette.pal
--------------------------------------------------------------------------------
/LdPaletteFF/utils.c:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | const char *getErrorMessage(int8_t code)
4 | {
5 | char *message;
6 |
7 | switch(code)
8 | {
9 | case -1: message = "Executed invalid function code\r\n"; break;
10 | case -2: message = "Specified file not found\r\n"; break;
11 | case -3: message = "Specified directory not found\r\n"; break;
12 | case -4: message = "Too many open files\r\n"; break;
13 | case -5: message = "Cannot access directory or volume label\r\n"; break;
14 | case -6: message = "Specified handle is not open\r\n"; break;
15 | case -7: message = "Memory manager region was destroyed\r\n"; break;
16 | case -8: message = "Not enough memory to execute\r\n"; break;
17 | case -9: message = "Invalid memory manager pointer specified\r\n"; break;
18 | case -10: message = "Illegal environment specified\r\n"; break;
19 | case -11: message = "Abnormal executable file format\r\n"; break;
20 | case -12: message = "Abnormal open access mode\r\n"; break;
21 | case -13: message = "Error in selecting a filename\r\n"; break;
22 | case -14: message = "Called with invalid parameter\r\n"; break;
23 | case -15: message = "Error in selecting a drive\r\n"; break;
24 | case -16: message = "Cannot remove current directory\r\n"; break;
25 | case -17: message = "Cannot ioctrl device\r\n"; break;
26 | case -18: message = "No more files found"; break;
27 | case -19: message = "Cannot write to specified file\r\n"; break;
28 | case -20: message = "Specified directory already registered\r\n"; break;
29 | case -21: message = "Cannot delete because file exists\r\n"; break;
30 | case -22: message = "Cannot name because file exists\r\n"; break;
31 | case -23: message = "Cannot create file because disk is full\r\n"; break;
32 | case -24: message = "Cannot create file because directory is full\r\n"; break;
33 | case -25: message = "Cannot seek to specified location\r\n"; break;
34 | case -26: message = "Specified supervisor mode with supervisor status on\r\n"; break;
35 | case -27: message = "Thread with same name exists\r\n"; break;
36 | case -28: message = "Interprocess communication buffer is write-protected\r\n"; break;
37 | case -29: message = "Cannot start any more background processes\r\n"; break;
38 | case -32: message = "Not enough lock regions\r\n"; break;
39 | case -33: message = "Locked; cannot access\r\n"; break;
40 | case -34: message = "Handler for specified drive is opened\r\n"; break;
41 | case -35: message = "Symbolic link nest exceeded 16 steps (lndrv)\r\n"; break;
42 | case -80: message = "File exists\r\n"; break;
43 | default: message = "No error\r\n"; break;
44 | }
45 |
46 | return message;
47 | }
48 |
--------------------------------------------------------------------------------
/LdPaletteFF/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef _UTILS_H_
2 | #define _UTILS_H_
3 |
4 | #ifdef __MARIKO_CC__
5 | #include
6 | #include
7 | #else
8 | #include
9 | #include
10 | #define interrupt __attribute__ ((interrupt_handler))
11 | #endif
12 |
13 | #include
14 |
15 | #define ACCESS_DICTIONARY 0x80 //0b10000000 //1 not for users
16 | #define ACCESS_NORMAL 0x00 //0b00000000 //0
17 |
18 | #define SHARING_TOTAL 0x08 //0b00010000 //4 allow others to write and read
19 | #define SHARING_WRITE_ONLY 0x0C //0b00001100 //3 allow others to write only
20 | #define SHARING_READ_ONLY 0x08 //0b00001000 //2 allow others to read only
21 | #define SHARING_RESTRICTED 0x04 //0b00000100 //1 don't allow others anything
22 | #define SHARING_COMPATIBILITY_MODE 0x00 //0b00000000 //0
23 |
24 | #define MODE_RW 0x02 //0b00000010 //2 open for write and read
25 | #define MODE_W 0x01 //0b00000001 //1 open only for writing
26 | #define MODE_R 0x00 //0b00000000 //0 open only for reading
27 |
28 | #define OPENING_MODE(access, sharing, mode) (access | sharing | mode)
29 |
30 | #define SEEK_MODE_BEGINNING 0
31 | #define SEEK_MODE_CURRENT 1
32 | #define SEEK_MODE_END 2
33 |
34 | const char *getErrorMessage(int8_t code);
35 |
36 | #endif
37 |
38 |
39 |
--------------------------------------------------------------------------------
/LoadImage/LoadImage.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/LoadImage/default/LoadImage.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadImage/default/LoadImage.x
--------------------------------------------------------------------------------
/LoadImage/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef _UTILS_H_
2 | #define _UTILS_H_
3 |
4 | #ifdef __MARIKO_CC__
5 | #include
6 | #include
7 | #else
8 | #include
9 | #include
10 | #define interrupt __attribute__ ((interrupt_handler))
11 | #endif
12 |
13 | #include
14 |
15 | #define ACCESS_DICTIONARY 0x80 //0b10000000 //1 not for users
16 | #define ACCESS_NORMAL 0x00 //0b00000000 //0
17 |
18 | #define SHARING_TOTAL 0x08 //0b00010000 //4 allow others to write and read
19 | #define SHARING_WRITE_ONLY 0x0C //0b00001100 //3 allow others to write only
20 | #define SHARING_READ_ONLY 0x08 //0b00001000 //2 allow others to read only
21 | #define SHARING_RESTRICTED 0x04 //0b00000100 //1 don't allow others anything
22 | #define SHARING_COMPATIBILITY_MODE 0x00 //0b00000000 //0
23 |
24 | #define MODE_RW 0x02 //0b00000010 //2 open for write and read
25 | #define MODE_W 0x01 //0b00000001 //1 open only for writing
26 | #define MODE_R 0x00 //0b00000000 //0 open only for reading
27 |
28 | union FileConf {
29 | struct {
30 | int8_t access_dictionary:1;
31 | int8_t :2; //padding
32 | int8_t sharing:3;
33 | int8_t mode:2;
34 | } flags;
35 | int8_t config;
36 | };
37 |
38 | #define SEEK_MODE_BEGINNING 0
39 | #define SEEK_MODE_CURRENT 1
40 | #define SEEK_MODE_END 2
41 |
42 | const char *getErrorMessage(int8_t code);
43 |
44 | uint32_t start_timer();
45 |
46 | uint32_t start_stop();
47 |
48 | uint32_t millisecond();
49 |
50 | #endif
51 |
--------------------------------------------------------------------------------
/LoadImg16b/LoadImg16b.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/LoadImg16b/lydux/16BSonic.pic:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadImg16b/lydux/16BSonic.pic
--------------------------------------------------------------------------------
/LoadImg16b/lydux/24BitLandSc.pic:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadImg16b/lydux/24BitLandSc.pic
--------------------------------------------------------------------------------
/LoadImg16b/lydux/LoadImg16b.X:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadImg16b/lydux/LoadImg16b.X
--------------------------------------------------------------------------------
/LoadImg16b/mariko/16BSonic.pic:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadImg16b/mariko/16BSonic.pic
--------------------------------------------------------------------------------
/LoadImg16b/mariko/24BitLandSc.pic:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadImg16b/mariko/24BitLandSc.pic
--------------------------------------------------------------------------------
/LoadImg16b/mariko/LoadImg16b.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadImg16b/mariko/LoadImg16b.x
--------------------------------------------------------------------------------
/LoadImg16b/utils.c:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | const char *getErrorMessage(int8_t code)
4 | {
5 | char *message;
6 |
7 | switch(code)
8 | {
9 | case -1: message = "Executed invalid function code\r\n"; break;
10 | case -2: message = "Specified file not found\r\n"; break;
11 | case -3: message = "Specified directory not found\r\n"; break;
12 | case -4: message = "Too many open files\r\n"; break;
13 | case -5: message = "Cannot access directory or volume label\r\n"; break;
14 | case -6: message = "Specified handle is not open\r\n"; break;
15 | case -7: message = "Memory manager region was destroyed\r\n"; break;
16 | case -8: message = "Not enough memory to execute\r\n"; break;
17 | case -9: message = "Invalid memory manager pointer specified\r\n"; break;
18 | case -10: message = "Illegal environment specified\r\n"; break;
19 | case -11: message = "Abnormal executable file format\r\n"; break;
20 | case -12: message = "Abnormal open access mode\r\n"; break;
21 | case -13: message = "Error in selecting a filename\r\n"; break;
22 | case -14: message = "Called with invalid parameter\r\n"; break;
23 | case -15: message = "Error in selecting a drive\r\n"; break;
24 | case -16: message = "Cannot remove current directory\r\n"; break;
25 | case -17: message = "Cannot ioctrl device\r\n"; break;
26 | case -18: message = "No more files found"; break;
27 | case -19: message = "Cannot write to specified file\r\n"; break;
28 | case -20: message = "Specified directory already registered\r\n"; break;
29 | case -21: message = "Cannot delete because file exists\r\n"; break;
30 | case -22: message = "Cannot name because file exists\r\n"; break;
31 | case -23: message = "Cannot create file because disk is full\r\n"; break;
32 | case -24: message = "Cannot create file because directory is full\r\n"; break;
33 | case -25: message = "Cannot seek to specified location\r\n"; break;
34 | case -26: message = "Specified supervisor mode with supervisor status on\r\n"; break;
35 | case -27: message = "Thread with same name exists\r\n"; break;
36 | case -28: message = "Interprocess communication buffer is write-protected\r\n"; break;
37 | case -29: message = "Cannot start any more background processes\r\n"; break;
38 | case -32: message = "Not enough lock regions\r\n"; break;
39 | case -33: message = "Locked; cannot access\r\n"; break;
40 | case -34: message = "Handler for specified drive is opened\r\n"; break;
41 | case -35: message = "Symbolic link nest exceeded 16 steps (lndrv)\r\n"; break;
42 | case -80: message = "File exists\r\n"; break;
43 | default: message = "No error\r\n"; break;
44 | }
45 |
46 | return message;
47 | }
48 |
--------------------------------------------------------------------------------
/LoadImg16b/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef _UTILS_H_
2 | #define _UTILS_H_
3 |
4 | #include
5 |
6 | #define ACCESS_DICTIONARY 0x80 //0b10000000 //1 not for users
7 | #define ACCESS_NORMAL 0x00 //0b00000000 //0
8 |
9 | #define SHARING_TOTAL 0x08 //0b00010000 //4 allow others to write and read
10 | #define SHARING_WRITE_ONLY 0x0C //0b00001100 //3 allow others to write only
11 | #define SHARING_READ_ONLY 0x08 //0b00001000 //2 allow others to read only
12 | #define SHARING_RESTRICTED 0x04 //0b00000100 //1 don't allow others anything
13 | #define SHARING_COMPATIBILITY_MODE 0x00 //0b00000000 //0
14 |
15 | #define MODE_RW 0x02 //0b00000010 //2 open for write and read
16 | #define MODE_W 0x01 //0b00000001 //1 open only for writing
17 | #define MODE_R 0x00 //0b00000000 //0 open only for reading
18 |
19 | union FileConf {
20 | struct {
21 | int8_t access_dictionary:1;
22 | int8_t :2; //padding
23 | int8_t sharing:3;
24 | int8_t mode:2;
25 | } flags;
26 | int8_t config;
27 | };
28 |
29 | #define SEEK_MODE_BEGINNING 0
30 | #define SEEK_MODE_CURRENT 1
31 | #define SEEK_MODE_END 2
32 |
33 | const char *getErrorMessage(int8_t code);
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/LoadImg4b/LoadImg4b.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/LoadImg4b/lydux/LoadImg4b.X:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadImg4b/lydux/LoadImg4b.X
--------------------------------------------------------------------------------
/LoadImg4b/lydux/formula4b.pal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadImg4b/lydux/formula4b.pal
--------------------------------------------------------------------------------
/LoadImg4b/lydux/formula4b.pic:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadImg4b/lydux/formula4b.pic
--------------------------------------------------------------------------------
/LoadImg4b/mariko/LoadImg4b.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadImg4b/mariko/LoadImg4b.x
--------------------------------------------------------------------------------
/LoadImg4b/mariko/formula4b.pal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadImg4b/mariko/formula4b.pal
--------------------------------------------------------------------------------
/LoadImg4b/mariko/formula4b.pic:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadImg4b/mariko/formula4b.pic
--------------------------------------------------------------------------------
/LoadImg4b/utils.c:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | const char *getErrorMessage(int8_t code)
4 | {
5 | char *message;
6 |
7 | switch(code)
8 | {
9 | case -1: message = "Executed invalid function code\r\n"; break;
10 | case -2: message = "Specified file not found\r\n"; break;
11 | case -3: message = "Specified directory not found\r\n"; break;
12 | case -4: message = "Too many open files\r\n"; break;
13 | case -5: message = "Cannot access directory or volume label\r\n"; break;
14 | case -6: message = "Specified handle is not open\r\n"; break;
15 | case -7: message = "Memory manager region was destroyed\r\n"; break;
16 | case -8: message = "Not enough memory to execute\r\n"; break;
17 | case -9: message = "Invalid memory manager pointer specified\r\n"; break;
18 | case -10: message = "Illegal environment specified\r\n"; break;
19 | case -11: message = "Abnormal executable file format\r\n"; break;
20 | case -12: message = "Abnormal open access mode\r\n"; break;
21 | case -13: message = "Error in selecting a filename\r\n"; break;
22 | case -14: message = "Called with invalid parameter\r\n"; break;
23 | case -15: message = "Error in selecting a drive\r\n"; break;
24 | case -16: message = "Cannot remove current directory\r\n"; break;
25 | case -17: message = "Cannot ioctrl device\r\n"; break;
26 | case -18: message = "No more files found"; break;
27 | case -19: message = "Cannot write to specified file\r\n"; break;
28 | case -20: message = "Specified directory already registered\r\n"; break;
29 | case -21: message = "Cannot delete because file exists\r\n"; break;
30 | case -22: message = "Cannot name because file exists\r\n"; break;
31 | case -23: message = "Cannot create file because disk is full\r\n"; break;
32 | case -24: message = "Cannot create file because directory is full\r\n"; break;
33 | case -25: message = "Cannot seek to specified location\r\n"; break;
34 | case -26: message = "Specified supervisor mode with supervisor status on\r\n"; break;
35 | case -27: message = "Thread with same name exists\r\n"; break;
36 | case -28: message = "Interprocess communication buffer is write-protected\r\n"; break;
37 | case -29: message = "Cannot start any more background processes\r\n"; break;
38 | case -32: message = "Not enough lock regions\r\n"; break;
39 | case -33: message = "Locked; cannot access\r\n"; break;
40 | case -34: message = "Handler for specified drive is opened\r\n"; break;
41 | case -35: message = "Symbolic link nest exceeded 16 steps (lndrv)\r\n"; break;
42 | case -80: message = "File exists\r\n"; break;
43 | default: message = "No error\r\n"; break;
44 | }
45 |
46 | return message;
47 | }
48 |
--------------------------------------------------------------------------------
/LoadImg4b/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef _UTILS_H_
2 | #define _UTILS_H_
3 |
4 | #include
5 |
6 | #define ACCESS_DICTIONARY 0x80 //0b10000000 //1 not for users
7 | #define ACCESS_NORMAL 0x00 //0b00000000 //0
8 |
9 | #define SHARING_TOTAL 0x08 //0b00010000 //4 allow others to write and read
10 | #define SHARING_WRITE_ONLY 0x0C //0b00001100 //3 allow others to write only
11 | #define SHARING_READ_ONLY 0x08 //0b00001000 //2 allow others to read only
12 | #define SHARING_RESTRICTED 0x04 //0b00000100 //1 don't allow others anything
13 | #define SHARING_COMPATIBILITY_MODE 0x00 //0b00000000 //0
14 |
15 | #define MODE_RW 0x02 //0b00000010 //2 open for write and read
16 | #define MODE_W 0x01 //0b00000001 //1 open only for writing
17 | #define MODE_R 0x00 //0b00000000 //0 open only for reading
18 |
19 | union FileConf {
20 | struct {
21 | int8_t access_dictionary:1;
22 | int8_t :2; //padding
23 | int8_t sharing:3;
24 | int8_t mode:2;
25 | } flags;
26 | int8_t config;
27 | };
28 |
29 | #define SEEK_MODE_BEGINNING 0
30 | #define SEEK_MODE_CURRENT 1
31 | #define SEEK_MODE_END 2
32 |
33 | const char *getErrorMessage(int8_t code);
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/LoadImg8b/LoadImg8b.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/LoadImg8b/lydux/8BitsColors.pal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadImg8b/lydux/8BitsColors.pal
--------------------------------------------------------------------------------
/LoadImg8b/lydux/8BitsColors.pic:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadImg8b/lydux/8BitsColors.pic
--------------------------------------------------------------------------------
/LoadImg8b/lydux/LoadImg8b.X:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadImg8b/lydux/LoadImg8b.X
--------------------------------------------------------------------------------
/LoadImg8b/mariko/8BitsColors.pal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadImg8b/mariko/8BitsColors.pal
--------------------------------------------------------------------------------
/LoadImg8b/mariko/8BitsColors.pic:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadImg8b/mariko/8BitsColors.pic
--------------------------------------------------------------------------------
/LoadImg8b/mariko/LoadImg8b.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadImg8b/mariko/LoadImg8b.x
--------------------------------------------------------------------------------
/LoadImg8b/utils.c:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | const char *getErrorMessage(int8_t code)
4 | {
5 | char *message;
6 |
7 | switch(code)
8 | {
9 | case -1: message = "Executed invalid function code\r\n"; break;
10 | case -2: message = "Specified file not found\r\n"; break;
11 | case -3: message = "Specified directory not found\r\n"; break;
12 | case -4: message = "Too many open files\r\n"; break;
13 | case -5: message = "Cannot access directory or volume label\r\n"; break;
14 | case -6: message = "Specified handle is not open\r\n"; break;
15 | case -7: message = "Memory manager region was destroyed\r\n"; break;
16 | case -8: message = "Not enough memory to execute\r\n"; break;
17 | case -9: message = "Invalid memory manager pointer specified\r\n"; break;
18 | case -10: message = "Illegal environment specified\r\n"; break;
19 | case -11: message = "Abnormal executable file format\r\n"; break;
20 | case -12: message = "Abnormal open access mode\r\n"; break;
21 | case -13: message = "Error in selecting a filename\r\n"; break;
22 | case -14: message = "Called with invalid parameter\r\n"; break;
23 | case -15: message = "Error in selecting a drive\r\n"; break;
24 | case -16: message = "Cannot remove current directory\r\n"; break;
25 | case -17: message = "Cannot ioctrl device\r\n"; break;
26 | case -18: message = "No more files found"; break;
27 | case -19: message = "Cannot write to specified file\r\n"; break;
28 | case -20: message = "Specified directory already registered\r\n"; break;
29 | case -21: message = "Cannot delete because file exists\r\n"; break;
30 | case -22: message = "Cannot name because file exists\r\n"; break;
31 | case -23: message = "Cannot create file because disk is full\r\n"; break;
32 | case -24: message = "Cannot create file because directory is full\r\n"; break;
33 | case -25: message = "Cannot seek to specified location\r\n"; break;
34 | case -26: message = "Specified supervisor mode with supervisor status on\r\n"; break;
35 | case -27: message = "Thread with same name exists\r\n"; break;
36 | case -28: message = "Interprocess communication buffer is write-protected\r\n"; break;
37 | case -29: message = "Cannot start any more background processes\r\n"; break;
38 | case -32: message = "Not enough lock regions\r\n"; break;
39 | case -33: message = "Locked; cannot access\r\n"; break;
40 | case -34: message = "Handler for specified drive is opened\r\n"; break;
41 | case -35: message = "Symbolic link nest exceeded 16 steps (lndrv)\r\n"; break;
42 | case -80: message = "File exists\r\n"; break;
43 | default: message = "No error\r\n"; break;
44 | }
45 |
46 | return message;
47 | }
48 |
--------------------------------------------------------------------------------
/LoadImg8b/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef _UTILS_H_
2 | #define _UTILS_H_
3 |
4 | #include
5 |
6 | #define ACCESS_DICTIONARY 0x80 //0b10000000 //1 not for users
7 | #define ACCESS_NORMAL 0x00 //0b00000000 //0
8 |
9 | #define SHARING_TOTAL 0x08 //0b00010000 //4 allow others to write and read
10 | #define SHARING_WRITE_ONLY 0x0C //0b00001100 //3 allow others to write only
11 | #define SHARING_READ_ONLY 0x08 //0b00001000 //2 allow others to read only
12 | #define SHARING_RESTRICTED 0x04 //0b00000100 //1 don't allow others anything
13 | #define SHARING_COMPATIBILITY_MODE 0x00 //0b00000000 //0
14 |
15 | #define MODE_RW 0x02 //0b00000010 //2 open for write and read
16 | #define MODE_W 0x01 //0b00000001 //1 open only for writing
17 | #define MODE_R 0x00 //0b00000000 //0 open only for reading
18 |
19 | union FileConf {
20 | struct {
21 | int8_t access_dictionary:1;
22 | int8_t :2; //padding
23 | int8_t sharing:3;
24 | int8_t mode:2;
25 | } flags;
26 | int8_t config;
27 | };
28 |
29 | #define SEEK_MODE_BEGINNING 0
30 | #define SEEK_MODE_CURRENT 1
31 | #define SEEK_MODE_END 2
32 |
33 | const char *getErrorMessage(int8_t code);
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/LoadPCG/LoadPCG.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/LoadPCG/default/LoadPCG.X:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadPCG/default/LoadPCG.X
--------------------------------------------------------------------------------
/LoadPCG/utils.c:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | int32_t loadPalette()
4 | {
5 | int32_t status;
6 |
7 | uint16_t colours[] = {0x0000, 0x5294, 0x0020, 0x003e, 0x0400, 0x07c0, 0x0420, 0x07fe, 0x8000, 0xf800, 0x8020, 0xf83e, 0x8400, 0xffc0, 0xad6a, 0xfffe};
8 |
9 | uint8_t colour_in_palette;
10 |
11 | //now we go through the current palette
12 | for(colour_in_palette = 0; colour_in_palette < 16; colour_in_palette++){
13 | //we set the color
14 | status = _iocs_spalet( //returns 32 bit integer
15 | SET_VBD_V(
16 | VERTICAL_BLANKING_DETECTION,
17 | colour_in_palette //0 - 15 if higher it only takes from 0-15
18 | ),
19 | 1, //first sprite palette
20 | colours[colour_in_palette]
21 | );
22 |
23 | //if any issue...
24 | if(status < 0){
25 | switch(status){
26 | case -1:
27 | _dos_c_print("Incorrect screen mode\r\n");
28 | break;
29 | case -2:
30 | _dos_c_print("attempting to set palette in block 0\r\n");
31 | break;
32 | }
33 | return status;
34 | }
35 | }
36 |
37 | return 0;
38 | }
39 |
--------------------------------------------------------------------------------
/LoadPCG/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef _UTILS_H_
2 | #define _UTILS_H_
3 |
4 | #ifdef __MARIKO_CC__
5 | #include
6 | #include
7 | #else
8 | #include
9 | #include
10 | #define interrupt __attribute__ ((interrupt_handler))
11 | #endif
12 |
13 | #include
14 |
15 | //sprite palette utils
16 | #define VERTICAL_BLANKING_DETECTION 0x80000000 //0b10000000000000000000000000000000
17 | #define VERTICAL_BLANKING_NO_DETECT 0
18 |
19 | #define SET_VBD_V(vbd, v) (vbd | v)
20 |
21 |
22 | int32_t loadPalette(void);
23 |
24 | #endif
25 |
--------------------------------------------------------------------------------
/LoadPCGFF/LoadPCGFF.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/LoadPCGFF/default/LoadPCGFF.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadPCGFF/default/LoadPCGFF.x
--------------------------------------------------------------------------------
/LoadPCGFF/default/palette.pal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadPCGFF/default/palette.pal
--------------------------------------------------------------------------------
/LoadPCGFF/default/ship.pcg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadPCGFF/default/ship.pcg
--------------------------------------------------------------------------------
/LoadPCGFF/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef _UTILS_H_
2 | #define _UTILS_H_
3 |
4 | #ifdef __MARIKO_CC__
5 | #include
6 | #include
7 | #else
8 | #include
9 | #include
10 | #define interrupt __attribute__ ((interrupt_handler))
11 | #endif
12 |
13 | #include
14 |
15 | //file management
16 |
17 | #define ACCESS_DICTIONARY 0x80 //0b10000000 //1 not for users
18 | #define ACCESS_NORMAL 0x00 //0b00000000 //0
19 |
20 | #define SHARING_TOTAL 0x08 //0b00010000 //4 allow others to write and read
21 | #define SHARING_WRITE_ONLY 0x0C //0b00001100 //3 allow others to write only
22 | #define SHARING_READ_ONLY 0x08 //0b00001000 //2 allow others to read only
23 | #define SHARING_RESTRICTED 0x04 //0b00000100 //1 don't allow others anything
24 | #define SHARING_COMPATIBILITY_MODE 0x00 //0b00000000 //0
25 |
26 | #define MODE_RW 0x02 //0b00000010 //2 open for write and read
27 | #define MODE_W 0x01 //0b00000001 //1 open only for writing
28 | #define MODE_R 0x00 //0b00000000 //0 open only for reading
29 |
30 | #define OPENING_MODE(access, sharing, mode) (access | sharing | mode)
31 |
32 | //sprite palette utils
33 | #define VERTICAL_BLANKING_DETECTION 0x80000000 //0b10000000000000000000000000000000
34 | #define VERTICAL_BLANKING_NO_DETECT 0
35 |
36 | #define SET_VBD_V(vbd, v) (vbd | v)
37 |
38 |
39 | int32_t loadPalette(void);
40 |
41 | const char *getErrorMessage(int8_t code);
42 |
43 | #endif
44 |
--------------------------------------------------------------------------------
/LoadPalette/LoadPalette.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/LoadPalette/default/LoadPalette.X:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadPalette/default/LoadPalette.X
--------------------------------------------------------------------------------
/LoadPaletteDMA/LoadPaletteDMA.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/LoadPaletteDMA/default/LoadPaletteDMA.X:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadPaletteDMA/default/LoadPaletteDMA.X
--------------------------------------------------------------------------------
/LoadPaletteDMA/default/palette.pal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadPaletteDMA/default/palette.pal
--------------------------------------------------------------------------------
/LoadPaletteDMA/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef _UTILS_H_
2 | #define _UTILS_H_
3 |
4 | #ifdef __MARIKO_CC__
5 | #include
6 | #include
7 | #else
8 | #include
9 | #include
10 | #define interrupt __attribute__ ((interrupt_handler))
11 | #endif
12 |
13 | #include
14 |
15 | #define ACCESS_DICTIONARY 0x80 //0b10000000 //1 not for users
16 | #define ACCESS_NORMAL 0x00 //0b00000000 //0
17 |
18 | #define SHARING_TOTAL 0x08 //0b00010000 //4 allow others to write and read
19 | #define SHARING_WRITE_ONLY 0x0C //0b00001100 //3 allow others to write only
20 | #define SHARING_READ_ONLY 0x08 //0b00001000 //2 allow others to read only
21 | #define SHARING_RESTRICTED 0x04 //0b00000100 //1 don't allow others anything
22 | #define SHARING_COMPATIBILITY_MODE 0x00 //0b00000000 //0
23 |
24 | #define MODE_RW 0x02 //0b00000010 //2 open for write and read
25 | #define MODE_W 0x01 //0b00000001 //1 open only for writing
26 | #define MODE_R 0x00 //0b00000000 //0 open only for reading
27 |
28 | #define OPENING_MODE(access, sharing, mode) (access | sharing | mode)
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/LoadPaletteLowLevel/LoadPaletteLowLevel.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/LoadPaletteLowLevel/default/LoadPaletteLL.X:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadPaletteLowLevel/default/LoadPaletteLL.X
--------------------------------------------------------------------------------
/LoadPaletteLowLevel/default/palette.pal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadPaletteLowLevel/default/palette.pal
--------------------------------------------------------------------------------
/LoadPaletteLowLevel/main.c:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | /**
4 | * In this example we are loading the palettes from the file palette.pal
5 | * The data is stored in binary format, in 16 bit words sequentially ordered.
6 | * Every palette is 32 bytes long.
7 | *
8 | * Then we are setting the bytes straight away into memory with the super user mode.
9 | */
10 |
11 | #define S_PALETTE_START 0xe82220
12 |
13 | int32_t main(void)
14 | {
15 | int16_t file_handler, status;
16 | int32_t super;
17 |
18 | //we will collect the palettes pallete by pallete in this array.
19 | uint16_t colours[16];
20 |
21 |
22 | //we copy the address into this other pointer to not lose it.
23 | volatile uint16_t *pa = (uint16_t *)S_PALETTE_START;
24 |
25 | //we open the palette file
26 | file_handler = _dos_open(
27 | "palette.pal",
28 | OPENING_MODE(
29 | ACCESS_NORMAL,
30 | SHARING_COMPATIBILITY_MODE,
31 | MODE_R
32 | )
33 | );
34 |
35 | //if any error...
36 | if(file_handler < 0){
37 | _dos_c_print("Can't open the file\r\n");
38 | _dos_exit2(file_handler);
39 | }
40 |
41 | //we set the super user mode to gain access to reserved areas of memory
42 | super = _dos_super(0);
43 |
44 | _dos_c_print("before\r\n");
45 | //whereas there are palettes...
46 | while(_dos_read(file_handler, (char*) colours, sizeof colours)) {
47 |
48 | uint16_t *pBuffer = (uint16_t *) colours; //0
49 |
50 | *++pa = *++pBuffer; //1
51 | *++pa = *++pBuffer; //2
52 | *++pa = *++pBuffer; //3
53 | *++pa = *++pBuffer; //4
54 | *++pa = *++pBuffer; //5
55 | *++pa = *++pBuffer; //6
56 | *++pa = *++pBuffer; //7
57 | *++pa = *++pBuffer; //8
58 | *++pa = *++pBuffer; //9
59 | *++pa = *++pBuffer; //10
60 | *++pa = *++pBuffer; //11
61 | *++pa = *++pBuffer; //12
62 | *++pa = *++pBuffer; //13
63 | *++pa = *++pBuffer; //14
64 | *++pa = *++pBuffer; //15
65 |
66 | _dos_c_print("turn\r\n");
67 | }
68 |
69 | //back to user mode
70 | _dos_super(super);
71 |
72 | //now we close the file
73 | status = _dos_close(file_handler);
74 |
75 | //if any error...
76 | if(status < 0){
77 | _dos_c_print("Can't close the file\r\n");
78 | _dos_exit2(status);
79 | }
80 |
81 | _dos_c_print("Look into the palette window of your emulator and press a key.\r\n");
82 |
83 | //waiting for a keystroke.
84 | _dos_getchar();
85 |
86 | _dos_exit();
87 | }
88 |
--------------------------------------------------------------------------------
/LoadPaletteLowLevel/utils.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef _UTILS_H_
3 | #define _UTILS_H_
4 |
5 | #ifdef __MARIKO_CC__
6 | #include
7 | #include
8 | #else
9 | #include
10 | #include
11 | #define interrupt __attribute__ ((interrupt_handler))
12 | #endif
13 |
14 | #include
15 |
16 | #define ACCESS_DICTIONARY 0x80 //0b10000000 //1 not for users
17 | #define ACCESS_NORMAL 0x00 //0b00000000 //0
18 |
19 | #define SHARING_TOTAL 0x08 //0b00010000 //4 allow others to write and read
20 | #define SHARING_WRITE_ONLY 0x0C //0b00001100 //3 allow others to write only
21 | #define SHARING_READ_ONLY 0x08 //0b00001000 //2 allow others to read only
22 | #define SHARING_RESTRICTED 0x04 //0b00000100 //1 don't allow others anything
23 | #define SHARING_COMPATIBILITY_MODE 0x00 //0b00000000 //0
24 |
25 | #define MODE_RW 0x02 //0b00000010 //2 open for write and read
26 | #define MODE_W 0x01 //0b00000001 //1 open only for writing
27 | #define MODE_R 0x00 //0b00000000 //0 open only for reading
28 |
29 | #define OPENING_MODE(access, sharing, mode) (access | sharing | mode)
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/LoadSprites/LoadSprites.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/LoadSprites/default/LoadSprites.X:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadSprites/default/LoadSprites.X
--------------------------------------------------------------------------------
/LoadSprites/default/palette.pal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadSprites/default/palette.pal
--------------------------------------------------------------------------------
/LoadSprites/default/ship.pcg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadSprites/default/ship.pcg
--------------------------------------------------------------------------------
/LoadSprites/utils.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef _UTILS_H_
3 | #define _UTILS_H_
4 |
5 | #ifdef __MARIKO_CC__
6 | #include
7 | #include
8 | #else
9 | #include
10 | #include
11 | #define interrupt __attribute__ ((interrupt_handler))
12 | #endif
13 |
14 | #include
15 |
16 | //sprite palette utils
17 | #define VERTICAL_BLANKING_DETECTION 0x80000000 //0b10000000000000000000000000000000
18 | #define VERTICAL_BLANKING_NO_DETECT 0
19 |
20 | #define SET_VBD_V(vbd, v) (vbd | v)
21 |
22 | #define SP_DEFCG_8X8_TILE 0
23 | #define SP_DEFCG_16X16_TILE 1
24 |
25 | int32_t loadPalette(void);
26 |
27 | int8_t loadPCGs(void);
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/LoadSpritesFF/LoadSpritesFF.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/LoadSpritesFF/default/LoadSpritesFF.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadSpritesFF/default/LoadSpritesFF.x
--------------------------------------------------------------------------------
/LoadSpritesFF/default/palette.pal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadSpritesFF/default/palette.pal
--------------------------------------------------------------------------------
/LoadSpritesFF/default/ship.pcg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/LoadSpritesFF/default/ship.pcg
--------------------------------------------------------------------------------
/LoadSpritesFF/utils.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef _UTILS_H_
3 | #define _UTILS_H_
4 |
5 | #ifdef __MARIKO_CC__
6 | #include
7 | #include
8 | #else
9 | #include
10 | #include
11 | #define interrupt __attribute__ ((interrupt_handler))
12 | #endif
13 |
14 | #include
15 |
16 | //file management
17 |
18 | #define ACCESS_DICTIONARY 0x80 //0b10000000 //1 not for users
19 | #define ACCESS_NORMAL 0x00 //0b00000000 //0
20 |
21 | #define SHARING_TOTAL 0x08 //0b00010000 //4 allow others to write and read
22 | #define SHARING_WRITE_ONLY 0x0C //0b00001100 //3 allow others to write only
23 | #define SHARING_READ_ONLY 0x08 //0b00001000 //2 allow others to read only
24 | #define SHARING_RESTRICTED 0x04 //0b00000100 //1 don't allow others anything
25 | #define SHARING_COMPATIBILITY_MODE 0x00 //0b00000000 //0
26 |
27 | #define MODE_RW 0x02 //0b00000010 //2 open for write and read
28 | #define MODE_W 0x01 //0b00000001 //1 open only for writing
29 | #define MODE_R 0x00 //0b00000000 //0 open only for reading
30 |
31 | #define OPENING_MODE(access, sharing, mode) (access | sharing | mode)
32 |
33 | //sprite palette utils
34 | #define VERTICAL_BLANKING_DETECTION 0x80000000 //0b10000000000000000000000000000000
35 | #define VERTICAL_BLANKING_NO_DETECT 0
36 |
37 | #define SET_VBD_V(vbd, v) (vbd | v)
38 |
39 | #define SP_DEFCG_8X8_TILE 0
40 | #define SP_DEFCG_16X16_TILE 1
41 |
42 | int32_t loadPalette(void);
43 |
44 | int8_t loadPCGs(void);
45 |
46 | const char *getErrorMessage(int8_t code);
47 |
48 | #endif
49 |
--------------------------------------------------------------------------------
/MarioKaBig/MarioKaBig.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/MarioKaBig/MarioKaBig_mariko/MarioKaBig.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/MarioKaBig/MarioKaBig_mariko/MarioKaBig.x
--------------------------------------------------------------------------------
/MarioKaBig/MarioKaBig_mariko/tiled.pal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/MarioKaBig/MarioKaBig_mariko/tiled.pal
--------------------------------------------------------------------------------
/MarioKaBig/MarioKaBig_mariko/tiled.tm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/MarioKaBig/MarioKaBig_mariko/tiled.tm
--------------------------------------------------------------------------------
/MarioKaBig/MarioKaBig_mariko/tiled.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/MarioKaBig/MarioKaBig_mariko/tiled.ts
--------------------------------------------------------------------------------
/MarioKaBig/utils.c:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | const char *getErrorMessage(int8_t code)
4 | {
5 | char *message;
6 |
7 | switch(code)
8 | {
9 | case -1: message = "Executed invalid function code\r\n"; break;
10 | case -2: message = "Specified file not found\r\n"; break;
11 | case -3: message = "Specified directory not found\r\n"; break;
12 | case -4: message = "Too many open files\r\n"; break;
13 | case -5: message = "Cannot access directory or volume label\r\n"; break;
14 | case -6: message = "Specified handle is not open\r\n"; break;
15 | case -7: message = "Memory manager region was destroyed\r\n"; break;
16 | case -8: message = "Not enough memory to execute\r\n"; break;
17 | case -9: message = "Invalid memory manager pointer specified\r\n"; break;
18 | case -10: message = "Illegal environment specified\r\n"; break;
19 | case -11: message = "Abnormal executable file format\r\n"; break;
20 | case -12: message = "Abnormal open access mode\r\n"; break;
21 | case -13: message = "Error in selecting a filename\r\n"; break;
22 | case -14: message = "Called with invalid parameter\r\n"; break;
23 | case -15: message = "Error in selecting a drive\r\n"; break;
24 | case -16: message = "Cannot remove current directory\r\n"; break;
25 | case -17: message = "Cannot ioctrl device\r\n"; break;
26 | case -18: message = "No more files found"; break;
27 | case -19: message = "Cannot write to specified file\r\n"; break;
28 | case -20: message = "Specified directory already registered\r\n"; break;
29 | case -21: message = "Cannot delete because file exists\r\n"; break;
30 | case -22: message = "Cannot name because file exists\r\n"; break;
31 | case -23: message = "Cannot create file because disk is full\r\n"; break;
32 | case -24: message = "Cannot create file because directory is full\r\n"; break;
33 | case -25: message = "Cannot seek to specified location\r\n"; break;
34 | case -26: message = "Specified supervisor mode with supervisor status on\r\n"; break;
35 | case -27: message = "Thread with same name exists\r\n"; break;
36 | case -28: message = "Interprocess communication buffer is write-protected\r\n"; break;
37 | case -29: message = "Cannot start any more background processes\r\n"; break;
38 | case -32: message = "Not enough lock regions\r\n"; break;
39 | case -33: message = "Locked; cannot access\r\n"; break;
40 | case -34: message = "Handler for specified drive is opened\r\n"; break;
41 | case -35: message = "Symbolic link nest exceeded 16 steps (lndrv)\r\n"; break;
42 | case -80: message = "File exists\r\n"; break;
43 | default: message = "No error\r\n"; break;
44 | }
45 |
46 | return message;
47 | }
48 |
--------------------------------------------------------------------------------
/MarioKaBig/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef _UTILS_H_
2 | #define _UTILS_H_
3 |
4 | #include
5 |
6 | #define ACCESS_DICTIONARY 0x80 //0b10000000 //1 not for users
7 | #define ACCESS_NORMAL 0x00 //0b00000000 //0
8 |
9 | #define SHARING_TOTAL 0x08 //0b00010000 //4 allow others to write and read
10 | #define SHARING_WRITE_ONLY 0x0C //0b00001100 //3 allow others to write only
11 | #define SHARING_READ_ONLY 0x08 //0b00001000 //2 allow others to read only
12 | #define SHARING_RESTRICTED 0x04 //0b00000100 //1 don't allow others anything
13 | #define SHARING_COMPATIBILITY_MODE 0x00 //0b00000000 //0
14 |
15 | #define MODE_RW 0x02 //0b00000010 //2 open for write and read
16 | #define MODE_W 0x01 //0b00000001 //1 open only for writing
17 | #define MODE_R 0x00 //0b00000000 //0 open only for reading
18 |
19 | union FileConf {
20 | struct {
21 | int8_t access_dictionary:1;
22 | int8_t :2; //padding
23 | int8_t sharing:3;
24 | int8_t mode:2;
25 | } flags;
26 | int8_t config;
27 | };
28 |
29 | #define SEEK_MODE_BEGINNING 0
30 | #define SEEK_MODE_CURRENT 1
31 | #define SEEK_MODE_END 2
32 |
33 | const char *getErrorMessage(int8_t code);
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/MarioKart/MarioKart.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/MarioKart/MarioKart_lydux/MarioKart.X:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/MarioKart/MarioKart_lydux/MarioKart.X
--------------------------------------------------------------------------------
/MarioKart/MarioKart_mariko/MarioKart.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/MarioKart/MarioKart_mariko/MarioKart.x
--------------------------------------------------------------------------------
/MarioKart/MarioKart_mariko/tiled.pal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/MarioKart/MarioKart_mariko/tiled.pal
--------------------------------------------------------------------------------
/MarioKart/MarioKart_mariko/tiled.tm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/MarioKart/MarioKart_mariko/tiled.tm
--------------------------------------------------------------------------------
/MarioKart/MarioKart_mariko/tiled.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/MarioKart/MarioKart_mariko/tiled.ts
--------------------------------------------------------------------------------
/MarioKart/README.md:
--------------------------------------------------------------------------------
1 | 
--------------------------------------------------------------------------------
/MarioKart/game.c:
--------------------------------------------------------------------------------
1 |
2 | #include "stdafx.h"
3 | #include "game.h"
4 | #include "input.h"
5 | //#include "update.h"
6 |
7 | #include "graphics.h"
8 | #include "resources.h"
9 |
10 | static int exitFlag = 0;
11 |
12 | static int32_t status;
13 |
14 | void Game_initializeGame()
15 | {
16 | PRINT_FUNCTION();
17 | // Initialize resources, graphics, and input systems
18 |
19 | if(status = Graph_settingUpScreen()){
20 | _dos_c_print(Utils_getErrorMessage(status));
21 | exitFlag = 1;
22 | }
23 |
24 | if(status = Res_loadResources()){
25 | _dos_c_print(Utils_getErrorMessage(status));
26 | exitFlag = 1;
27 | }
28 |
29 | if(status = Graph_initializeGraphics()){
30 | _dos_c_print(Utils_getErrorMessage(status));
31 | exitFlag = 1;
32 | }
33 |
34 | //initializeGraphics();
35 | exitFlag = 0;
36 | }
37 |
38 | void Game_handleInput() {
39 | // Read and process user inputs
40 | Input_processInput();
41 | }
42 |
43 | void Game_updateGame() {
44 | // Update game logic
45 | //updatePhysics();
46 | }
47 |
48 | void Game_renderGraphics() {
49 | // Draw game objects
50 | //clearScreen();
51 | //drawSprites();
52 | //presentFrame();
53 | }
54 |
55 | void Game_cleanupGame()
56 | {
57 | // Free resources and perform cleanup
58 | Graph_closeGraphics();
59 | Res_unloadResources();
60 | }
61 |
62 | int Game_shouldExit() {
63 | return exitFlag;
64 | }
65 |
--------------------------------------------------------------------------------
/MarioKart/game.h:
--------------------------------------------------------------------------------
1 | #ifndef GAME_H
2 | #define GAME_H
3 |
4 | void Game_initializeGame();
5 | void Game_handleInput();
6 | void Game_updateGame();
7 | void Game_renderGraphics();
8 | void Game_cleanupGame();
9 | int Game_shouldExit();
10 |
11 | #endif // GAME_H
12 |
--------------------------------------------------------------------------------
/MarioKart/graphics.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef GRAPHICS_H
3 | #define GRAPHICS_H
4 |
5 | extern int frame;
6 |
7 | int Graph_settingUpScreen();
8 |
9 | int Graph_initializeGraphics();
10 |
11 | void Graph_clearScreen();
12 | void Graph_drawSprites();
13 | void Graph_presentFrame();
14 |
15 | int Graph_closeGraphics();
16 |
17 | #endif // GRAPHICS_H
18 |
--------------------------------------------------------------------------------
/MarioKart/input.c:
--------------------------------------------------------------------------------
1 | #include "stdafx.h"
2 | #include "input.h"
3 |
4 | int input_player_1 = 0x0;
5 | int input_player_2 = 0x0;
6 | int others = 0x0;
7 |
8 | static void Input_handleKeyPress(int key);
9 |
10 | void Input_processInput()
11 | {
12 | /**
13 | * Capturing several keys pressed at the same time.
14 | * We capture the flags of the group of keys the cursor keys belong to.
15 | * for groups: https://gamesx.com/wiki/doku.php?id=x68000:keycodes
16 | */
17 | uint8_t keys = _iocs_bitsns(0x7); //retrieving the state of the keys: CLR ↓ → ↑ ← UNDO R_DOWN R_UP
18 |
19 | input_player_1 = 0; //we restart player 1 controls
20 |
21 | //if left (←) key pressed
22 | if(keys & 0x08){
23 | input_player_1 |= INPUT_LEFT;
24 | }
25 |
26 | //if right (→) key pressed
27 | if(keys & 0x20){
28 | input_player_1 |= INPUT_RIGHT;
29 | }
30 |
31 | //if up (↑) key pressed
32 | if(keys & 0x10){
33 | input_player_1 |= INPUT_UP;
34 | }
35 |
36 | //if down (↓) key pressed
37 | if(keys & 0x40){
38 | input_player_1 |= INPUT_DOWN;
39 | }
40 |
41 | //player 2
42 | input_player_2 = 0; //we restart player 1 controls
43 |
44 | keys = _iocs_bitsns(0x2); //W UP //retrieving the state of the keys: U Y T R E W Q TAB
45 |
46 | //if up (W) key pressed
47 | if(keys & 0x4){
48 | input_player_2 |= INPUT_UP;
49 | }
50 |
51 |
52 | keys = _iocs_bitsns(0x3); //A S, Left & Down //retrieving the state of the keys: S A CR [{ @` P O I
53 |
54 | //if left (A) key pressed
55 | if(keys & 0x40){
56 | input_player_2 |= INPUT_LEFT;
57 | }
58 |
59 | //if down (S) key pressed
60 | if(keys & 0x80){
61 | input_player_2 |= INPUT_DOWN;
62 | }
63 |
64 |
65 | keys = _iocs_bitsns(0x4); // D Right /retrieving the state of the keys: ;+ L K J H G F D
66 |
67 | //if right (D) key pressed
68 | if(keys & 0x1){
69 | input_player_2 |= INPUT_RIGHT;
70 | }
71 |
72 | /*
73 | //other keys
74 | others = 0;
75 |
76 | keys = _iocs_bitsns(0x0);
77 |
78 | if(keys & 0x2){
79 | others |= INPUT_ESC;
80 | }
81 | */
82 | }
83 |
84 | static void Input_handleKeyPress(int key) {
85 | // Example key handling
86 | if (key == 'Q') {
87 | //exitFlag = 1;
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/MarioKart/input.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef INPUT_H
3 | #define INPUT_H
4 |
5 | #define INPUT_UP 0x1
6 | #define INPUT_DOWN 0x2
7 | #define INPUT_LEFT 0x4
8 | #define INPUT_RIGHT 0x8
9 |
10 | #define INPUT_ESC 0x1
11 |
12 | extern int input_player_1;
13 | extern int input_player_2;
14 | extern int others;
15 |
16 | void Input_processInput();
17 |
18 | #endif // INPUT_H
19 |
--------------------------------------------------------------------------------
/MarioKart/main.c:
--------------------------------------------------------------------------------
1 | #include "stdafx.h"
2 |
3 | #include "game.h"
4 | #include "input.h"
5 |
6 |
7 | int main(void)
8 | {
9 | int32_t status;
10 | int key;
11 |
12 | PRINT_FUNCTION();
13 |
14 | Game_initializeGame();
15 |
16 | if(Game_shouldExit()){
17 | Game_cleanupGame();
18 | _dos_exit2(1);
19 | }
20 |
21 | //status = _iocs_window (100, 100, 412, 412);
22 |
23 | //as long a we don't press ESCAPE
24 | while(_dos_inkey() != 27){
25 | //while(!others){
26 | //Game_handleInput();
27 | //input_player_1 = input_player_2 = 0x0;
28 | ;
29 | }
30 |
31 | //waiting for a keystroke.
32 | _dos_getchar();
33 |
34 | Game_cleanupGame();
35 | _dos_exit();
36 | }
37 |
--------------------------------------------------------------------------------
/MarioKart/makefile:
--------------------------------------------------------------------------------
1 | # Variables
2 | SRC_DIR = .
3 | OBJ_DIR = .mariko_objs
4 | BIN_DIR = MarioKart_mariko
5 | LIB_A_NAME = $(OBJ_DIR)/lib1.a
6 | LIB_A_OBJS = $(filter-out $(OBJ_DIR)/main.o, $(OBJS))
7 | EXEC = $(BIN_DIR)/MarioKart.x
8 |
9 | # Libraries to link against
10 | LIBS = -ldos -liocs -lsignal
11 | LIB_DIRS =
12 |
13 | # Automatically find all source files
14 | SRCS = $(wildcard *.c)
15 |
16 | # Create a list of object files in the OBJ_DIR
17 | OBJS = $(SRCS:%.c=$(OBJ_DIR)/%.o)
18 |
19 | # Default target
20 | MarioKart_mariko: $(EXEC)
21 |
22 | # Rule to create the executable
23 | $(EXEC): $(OBJ_DIR)/lib1.a $(OBJ_DIR)/main.o
24 | gcc -o $@ $^ $(LIB_DIRS) $(LIBS)
25 |
26 | $(LIB_A_NAME): $(LIB_A_OBJS)
27 | run68 ar /b $(OBJ_DIR)/lib1.a $(LIB_A_OBJS)
28 |
29 | # Rule to compile source files into object files
30 | $(OBJ_DIR)/%.o: %.c
31 | if not exist $(OBJ_DIR) mkdir $(OBJ_DIR)
32 | gcc -c $< -o $@
33 |
34 | # Rule to clean up the build
35 | cleanMarioKart_mariko:
36 | del /Q /F $(OBJ_DIR)\*.o
37 | del /Q /F $(OBJ_DIR)\*.a
38 | del /Q /F $(BIN_DIR)\*.x
--------------------------------------------------------------------------------
/MarioKart/resources.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef RESOURCES_H
3 | #define RESOURCES_H
4 |
5 | #include
6 |
7 | int Res_loadResources();
8 |
9 | uint16_t* res_tilemap;
10 |
11 | const uint16_t* Res_getTilemap();
12 |
13 | int Res_unloadResources();
14 |
15 | #endif // RESOURCES_H
16 |
--------------------------------------------------------------------------------
/MarioKart/stdafx.c:
--------------------------------------------------------------------------------
1 | #include "stdafx.h"
2 |
3 |
4 |
--------------------------------------------------------------------------------
/MarioKart/stdafx.h:
--------------------------------------------------------------------------------
1 | #ifndef STDAFX_H_INCLUDED
2 | #define STDAFX_H_INCLUDED
3 |
4 | #ifdef __MARIKO_CC__
5 | #include
6 | #include
7 | #else
8 | #include
9 | #include
10 | #include
11 | #define interrupt __attribute__ ((interrupt_handler))
12 | #endif
13 |
14 | #include
15 | //#include
16 |
17 | #include "utils.h"
18 |
19 | #define DEBUG
20 |
21 | #if defined(DEBUG) && !defined(__MARIKO_CC__)
22 | #define PRINT_FUNCTION() printf("%s\n", ___FUNCTION___)
23 | #else
24 | #define PRINT_FUNCTION() // Do nothing
25 | #endif
26 |
27 |
28 | #endif // STDAFX_H_INCLUDED
29 |
--------------------------------------------------------------------------------
/MarioKart/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef _UTILS_H_
2 | #define _UTILS_H_
3 |
4 | #include
5 |
6 | #define ACCESS_DICTIONARY 0x80 //0b10000000 //1 not for users
7 | #define ACCESS_NORMAL 0x00 //0b00000000 //0
8 |
9 | #define SHARING_TOTAL 0x08 //0b00010000 //4 allow others to write and read
10 | #define SHARING_WRITE_ONLY 0x0C //0b00001100 //3 allow others to write only
11 | #define SHARING_READ_ONLY 0x08 //0b00001000 //2 allow others to read only
12 | #define SHARING_RESTRICTED 0x04 //0b00000100 //1 don't allow others anything
13 | #define SHARING_COMPATIBILITY_MODE 0x00 //0b00000000 //0
14 |
15 | #define MODE_RW 0x02 //0b00000010 //2 open for write and read
16 | #define MODE_W 0x01 //0b00000001 //1 open only for writing
17 | #define MODE_R 0x00 //0b00000000 //0 open only for reading
18 |
19 | union FileConf {
20 | struct {
21 | int8_t access_dictionary:1;
22 | int8_t :2; //padding
23 | int8_t sharing:3;
24 | int8_t mode:2;
25 | } flags;
26 | int8_t config;
27 | };
28 |
29 | #define SEEK_MODE_BEGINNING 0
30 | #define SEEK_MODE_CURRENT 1
31 | #define SEEK_MODE_END 2
32 |
33 | const char *Utils_getErrorMessage(int8_t code);
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/OPM2/OPM2.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/OPM2/default/OPM2.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/OPM2/default/OPM2.x
--------------------------------------------------------------------------------
/OPM2/main.c:
--------------------------------------------------------------------------------
1 | #ifdef __MARIKO_CC__
2 | #include
3 | #include
4 | #else
5 | #include
6 | #include
7 | #define interrupt __attribute__ ((interrupt_handler))
8 | #endif
9 |
10 | void opm_int();
11 |
12 | int main(void)
13 | {
14 | _dos_c_print("Hello world !\r\n");
15 |
16 | _iocs_opmintst(opm_int);
17 |
18 | while(_iocs_opmsns() != 0){
19 | asm("nop");
20 | }
21 |
22 | _iocs_opmset (0x20, 0xc7); //11 000 111 LR FFF CCC Chn 0-7 F=Feedback, C=Connection
23 | _iocs_opmset (0x80, 0x1f); //00 0 11111 KK - AAAAA Slot 1-32. Keyscale / Attack K=Keycale, A=attack
24 | _iocs_opmset (0xe0, 0x0f); //0 00 01111 E -- FFFFF Noise E=noise enable F=Frequency (Noise only on Chn7 Slot32)
25 | _iocs_opmset (0x28, 0x4a); //0 100 1010 - OOO NNNN Chn0-7 KeyCode O=Octave, N=Note
26 | _iocs_opmset (0x08, 0x08); //0 0001 000 - SSSS CCC Key On (Play Sound) C=Channel S=Slot (C2 M2 C1 M1)
27 |
28 | {
29 | int cont;
30 | for(cont = 0; cont < 202400; cont++){
31 | asm("nop");
32 | }
33 | }
34 |
35 | _iocs_opmset (0x28, 0x41); //0 100 1010 - OOO NNNN Chn0-7 KeyCode O=Octave, N=Note
36 | _iocs_opmset (0x08, 0x08); //0 0001 000 - SSSS CCC Key On (Play Sound) C=Channel S=Slot (C2 M2 C1 M1)
37 |
38 | while(_iocs_opmsns() != 0){
39 | asm("nop");
40 | }
41 |
42 | {
43 | int cont;
44 | for(cont = 0; cont < 202400; cont++){
45 | asm("nop");
46 | }
47 | }
48 |
49 | _iocs_opmset (0x28, 0x42); //0 100 1010 - OOO NNNN Chn0-7 KeyCode O=Octave, N=Note
50 | _iocs_opmset (0x08, 0x08); //0 0001 000 - SSSS CCC Key On (Play Sound) C=Channel S=Slot (C2 M2 C1 M1)
51 |
52 | _iocs_opmintst((void *) 0);
53 |
54 | _dos_c_print("done\r\n");
55 |
56 | _dos_exit();
57 | }
58 |
59 | void opm_int()
60 | {
61 | _dos_c_print("OPM!\r\n");
62 | }
63 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # X68KTutorials
--------------------------------------------------------------------------------
/Raster/Raster.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Raster/asm/files.S:
--------------------------------------------------------------------------------
1 | /*
2 | This is a replacement for the files.S included in newlib ...
3 | the naming convention is inconsistent, it should be _dos_files,
4 | not _dos_filebuf
5 | */
6 |
7 | | int _dos_files (struct _dos_filbuf *, const char *, int);
8 | .text
9 | .even
10 | .global _fix_dos_files
11 | .type _fix_dos_files,@function
12 | _fix_dos_files:
13 | move.w %sp@(14), %sp@-
14 | move.l %sp@(10), %sp@-
15 | move.l %sp@(10), %sp@-
16 | .short 0xff4e
17 | lea %sp@(10), %sp
18 | rts
19 |
--------------------------------------------------------------------------------
/Raster/asm/nfiles.S:
--------------------------------------------------------------------------------
1 | /*
2 | This is a replacement for the nfiles.S included in newlib ...
3 | the naming convention is inconsistent, it should be _dos_nfiles,
4 | not _dos_filebuf
5 | */
6 | | int _dos_nfiles (struct _dos_filbuf *);
7 | .text
8 | .even
9 | .global _fix_dos_nfiles
10 | .type _fix_dos_nfiles,@function
11 | _fix_dos_nfiles:
12 | move.l %sp@(4), %sp@-
13 | .short 0xff4f
14 | addq.l #4, %sp
15 | rts
16 |
--------------------------------------------------------------------------------
/Raster/default/Raster.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Raster/default/Raster.x
--------------------------------------------------------------------------------
/Raster/default/s_walk_0.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Raster/default/s_walk_0.spt
--------------------------------------------------------------------------------
/Raster/default/s_walk_1.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Raster/default/s_walk_1.spt
--------------------------------------------------------------------------------
/Raster/default/s_walk_2.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Raster/default/s_walk_2.spt
--------------------------------------------------------------------------------
/Raster/default/s_walk_3.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Raster/default/s_walk_3.spt
--------------------------------------------------------------------------------
/Raster/default/s_walk_4.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Raster/default/s_walk_4.spt
--------------------------------------------------------------------------------
/Raster/default/s_walk_5.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Raster/default/s_walk_5.spt
--------------------------------------------------------------------------------
/Raster/default/sonic.pal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Raster/default/sonic.pal
--------------------------------------------------------------------------------
/Raster/newlib_fixes.h:
--------------------------------------------------------------------------------
1 | #ifndef _NEWLIB_FIXES_H_
2 | #define _NEWLIB_FIXES_H_
3 |
4 | extern int _fix_dos_files(struct dos_filbuf *, const char *, int);
5 | extern int _fix_dos_nfiles(struct dos_filbuf *);
6 |
7 | #endif /* _NEWLIB_FIXES_H_ */
8 |
--------------------------------------------------------------------------------
/Raster/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef _UTILS_H_
2 | #define _UTILS_H_
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | #define ACCESS_DICTIONARY 0x80 //0b10000000 //1 not for users
9 | #define ACCESS_NORMAL 0x00 //0b00000000 //0
10 |
11 | #define SHARING_TOTAL 0x08 //0b00010000 //4 allow others to write and read
12 | #define SHARING_WRITE_ONLY 0x0C //0b00001100 //3 allow others to write only
13 | #define SHARING_READ_ONLY 0x08 //0b00001000 //2 allow others to read only
14 | #define SHARING_RESTRICTED 0x04 //0b00000100 //1 don't allow others anything
15 | #define SHARING_COMPATIBILITY_MODE 0x00 //0b00000000 //0
16 |
17 | #define MODE_RW 0x02 //0b00000010 //2 open for write and read
18 | #define MODE_W 0x01 //0b00000001 //1 open only for writing
19 | #define MODE_R 0x00 //0b00000000 //0 open only for reading
20 |
21 | #define OPENING_MODE(access, sharing, mode) (access | sharing | mode)
22 |
23 | union FileConf {
24 | struct {
25 | int8_t access_dictionary:1;
26 | int8_t :2; //padding
27 | int8_t sharing:3;
28 | int8_t mode:2;
29 | } flags;
30 | int8_t config;
31 | };
32 |
33 | #define SEEK_MODE_BEGINNING 0
34 | #define SEEK_MODE_CURRENT 1
35 | #define SEEK_MODE_END 2
36 |
37 | const char *getErrorMessage(int8_t code);
38 |
39 | uint32_t start_timer();
40 |
41 | uint32_t start_stop();
42 |
43 | uint32_t millisecond();
44 |
45 | char * loadData(char * buffer, const char * filename, int8_t config);
46 |
47 | #endif
48 |
--------------------------------------------------------------------------------
/RayCast/RayCast.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/RayCast/default/RayCast.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/RayCast/default/RayCast.x
--------------------------------------------------------------------------------
/Resident/Resident.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/Resident/calculate_size.bat:
--------------------------------------------------------------------------------
1 | docker run --rm -v %cd%:/source_code -w /source_code human64k16.04:devel /bin/bash -c "./calculate_size.sh"
--------------------------------------------------------------------------------
/Resident/calculate_size.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Path to crt0.o
4 | CRT0_PATH="/usr/local/lib/gcc/human68k/4.6.2/../../../../human68k/lib/crt0.o"
5 |
6 | # Extract the size of crt0.o
7 | CRT0_SIZE=$(size "$CRT0_PATH" | grep "$(basename "$CRT0_PATH")" | cut -f1)
8 |
9 | # Calculate the aligned size (rounded up to the nearest multiple of 4)
10 | ALIGNED_SIZE=$(( (CRT0_SIZE + 3) & ~3 ))
11 |
12 | # Generate the header file
13 | echo "#define CRT0_SIZE $ALIGNED_SIZE" > crt0_size.h
--------------------------------------------------------------------------------
/Resident/clock.h:
--------------------------------------------------------------------------------
1 | #ifndef CLOCK_H
2 | #define CLOCK_H
3 |
4 | #ifdef __MARIKO_CC__
5 | #include
6 | #else
7 | #define interrupt __attribute__ ((interrupt_handler))
8 | #endif
9 |
10 | void interrupt process_start();
11 |
12 | void clear_clock();
13 |
14 | #endif
15 |
--------------------------------------------------------------------------------
/Resident/default/Resident.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Resident/default/Resident.x
--------------------------------------------------------------------------------
/Resident/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef UTILS_H
2 | #define UTILS_H
3 |
4 |
5 |
6 | void my_print(const char* format, ...);
7 |
8 | void showStatus(int status);
9 |
10 | #endif
11 |
--------------------------------------------------------------------------------
/Sonic/Sonic.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/Sonic/asm/files.S:
--------------------------------------------------------------------------------
1 | /*
2 | This is a replacement for the files.S included in newlib ...
3 | the naming convention is inconsistent, it should be _dos_files,
4 | not _dos_filebuf
5 | */
6 |
7 | | int _dos_files (struct _dos_filbuf *, const char *, int);
8 | .text
9 | .even
10 | .global _fix_dos_files
11 | .type _fix_dos_files,@function
12 | _fix_dos_files:
13 | move.w %sp@(14), %sp@-
14 | move.l %sp@(10), %sp@-
15 | move.l %sp@(10), %sp@-
16 | .short 0xff4e
17 | lea %sp@(10), %sp
18 | rts
19 |
--------------------------------------------------------------------------------
/Sonic/asm/nfiles.S:
--------------------------------------------------------------------------------
1 | /*
2 | This is a replacement for the nfiles.S included in newlib ...
3 | the naming convention is inconsistent, it should be _dos_nfiles,
4 | not _dos_filebuf
5 | */
6 | | int _dos_nfiles (struct _dos_filbuf *);
7 | .text
8 | .even
9 | .global _fix_dos_nfiles
10 | .type _fix_dos_nfiles,@function
11 | _fix_dos_nfiles:
12 | move.l %sp@(4), %sp@-
13 | .short 0xff4f
14 | addq.l #4, %sp
15 | rts
16 |
--------------------------------------------------------------------------------
/Sonic/default/Sonic.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/Sonic.x
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_look_d.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_look_d.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_look_u.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_look_u.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_run_0.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_run_0.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_run_1.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_run_1.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_run_2.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_run_2.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_run_3.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_run_3.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_spin_0.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_spin_0.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_spin_1.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_spin_1.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_spin_2.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_spin_2.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_spin_3.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_spin_3.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_still.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_still.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_stop_0.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_stop_0.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_stop_1.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_stop_1.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_wait_0.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_wait_0.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_wait_1.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_wait_1.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_walk_0.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_walk_0.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_walk_1.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_walk_1.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_walk_2.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_walk_2.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_walk_3.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_walk_3.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_walk_4.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_walk_4.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/s_walk_5.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/s_walk_5.spt
--------------------------------------------------------------------------------
/Sonic/default/sonic_sp/sonic.pal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/sonic_sp/sonic.pal
--------------------------------------------------------------------------------
/Sonic/default/tails/t_fly_0.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_fly_0.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_fly_1.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_fly_1.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_jump_0.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_jump_0.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_jump_1.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_jump_1.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_run_0.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_run_0.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_run_1.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_run_1.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_run_2.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_run_2.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_run_3.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_run_3.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_run_4.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_run_4.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_run_5.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_run_5.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_spin_0.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_spin_0.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_spin_1.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_spin_1.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_spin_2.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_spin_2.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_spin_d_0.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_spin_d_0.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_spin_d_1.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_spin_d_1.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_stil_0.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_stil_0.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_stil_1.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_stil_1.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_stil_2.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_stil_2.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_stil_3.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_stil_3.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_swing_0.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_swing_0.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_swing_1.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_swing_1.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_walk_0.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_walk_0.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_walk_1.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_walk_1.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_walk_2.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_walk_2.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_walk_3.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_walk_3.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_walk_4.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_walk_4.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_walk_5.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_walk_5.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_walk_6.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_walk_6.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/t_walk_7.spt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/t_walk_7.spt
--------------------------------------------------------------------------------
/Sonic/default/tails/tails.pal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sonic/default/tails/tails.pal
--------------------------------------------------------------------------------
/Sonic/newlib_fixes.h:
--------------------------------------------------------------------------------
1 | #ifndef _NEWLIB_FIXES_H_
2 | #define _NEWLIB_FIXES_H_
3 |
4 | extern int _fix_dos_files(struct dos_filbuf *, const char *, int);
5 | extern int _fix_dos_nfiles(struct dos_filbuf *);
6 |
7 | #endif /* _NEWLIB_FIXES_H_ */
8 |
--------------------------------------------------------------------------------
/Sonic/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef _UTILS_H_
2 | #define _UTILS_H_
3 |
4 | #include
5 |
6 | #define OPEN_ACCESS_DICTIONARY 0x80 //0b10000000 //1 not for users
7 | #define OPEN_ACCESS_NORMAL 0x00 //0b00000000 //0
8 |
9 | #define OPEN_SHARING_TOTAL 0x08 //0b00010000 //4 allow others to write and read
10 | #define OPEN_SHARING_WRITE_ONLY 0x0C //0b00001100 //3 allow others to write only
11 | #define OPEN_SHARING_READ_ONLY 0x08 //0b00001000 //2 allow others to read only
12 | #define OPEN_SHARING_RESTRICTED 0x04 //0b00000100 //1 don't allow others anything
13 | #define OPEN_SHARING_COMPATIBILITY_MODE 0x00 //0b00000000 //0
14 |
15 | #define OPEN_MODE_RW 0x02 //0b00000010 //2 open for write and read
16 | #define OPEN_MODE_W 0x01 //0b00000001 //1 open only for writing
17 | #define OPEN_MODE_R 0x00 //0b00000000 //0 open only for reading
18 |
19 | #define OPENING_MODE(access, sharing, mode) (access | sharing | mode)
20 |
21 | union FileConf {
22 | struct {
23 | int8_t access_dictionary:1;
24 | int8_t :2; //padding
25 | int8_t sharing:3;
26 | int8_t mode:2;
27 | } flags;
28 | int8_t config;
29 | };
30 |
31 | #define SEEK_MODE_BEGINNING 0
32 | #define SEEK_MODE_CURRENT 1
33 | #define SEEK_MODE_END 2
34 |
35 | const char *getErrorMessage(int8_t code);
36 |
37 | uint32_t start_timer();
38 |
39 | uint32_t start_stop();
40 |
41 | uint32_t millisecond();
42 |
43 | #endif
44 |
--------------------------------------------------------------------------------
/Sound/Sound.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Sound/default/Sound.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sound/default/Sound.x
--------------------------------------------------------------------------------
/Sound/lydux/Sound.X:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Sound/lydux/Sound.X
--------------------------------------------------------------------------------
/Tetris68/README.md:
--------------------------------------------------------------------------------
1 | 
--------------------------------------------------------------------------------
/Tetris68/Tetris68.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/Tetris68/default/Tetris68.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Tetris68/default/Tetris68.x
--------------------------------------------------------------------------------
/Tetris68/default/tetris.pal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Tetris68/default/tetris.pal
--------------------------------------------------------------------------------
/Tetris68/default/tetris.til:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/Tetris68/default/tetris.til
--------------------------------------------------------------------------------
/Tetris68/main.c:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 | #include "tetris.h"
3 |
4 | //void shut_system();
5 |
6 | //void interrupt vsync_disp();
7 |
8 | int main(void)
9 | {
10 | int status;
11 |
12 | union FileConf fconf;
13 |
14 | /*
15 | uint8_t state;
16 | while(_dos_inpout(0xFF) == 0){
17 | state = (~_iocs_joyget(1));
18 | _dos_c_locate(0,0);
19 | printf("up %#x \n", state & 0x01 );
20 | printf("down %#x \n", state & 0x02 );
21 | printf("left %#x \n", state & 0x04 );
22 | printf("right %#x \n", state & 0x08 );
23 |
24 | printf("button 1 %#x \n", state & 0x20 );
25 | printf("button 2 %#x \n", state & 0x40 );
26 | }
27 | _dos_exit();
28 | */
29 |
30 | fconf.config = 0;
31 | fconf.flags.access_dictionary = ACCESS_NORMAL;
32 | fconf.flags.sharing = SHARING_COMPATIBILITY_MODE;
33 | fconf.flags.mode = MODE_R;
34 |
35 | init_system();
36 |
37 | loadData((char*)S_PALETTE_START, "tetris.pal", fconf.config);
38 |
39 | loadData((char*)PCG_START, "tetris.til", fconf.config);
40 |
41 | /*
42 | * here I'm setting the scroll 1 to work with the tilemap 0 and to
43 | * make it shown.
44 | * In this example I demonstrate that the tilemap can be either
45 | */
46 | status = _iocs_bgctrlst (
47 | 1, //Background specification (0/1)
48 | 0, //Specifying a text page (0/1)
49 | 1 //Show / Hide specification (0: Hide 1: Show)
50 | );
51 |
52 | players[0] = initContext();
53 | players[0]->nJoy = 0;
54 | players[0]->nPlayer = 0;
55 |
56 | players[1] = initContext();
57 | players[1]->nJoy = 1;
58 | players[1]->nPlayer = 1;
59 |
60 | players[2] = initContext();
61 | players[2]->nJoy = 2;
62 | players[2]->nPlayer = 2;
63 |
64 | players[1]->bGameOver = FALSE;
65 |
66 | game_play();
67 |
68 | _dos_c_print("Press a key.\r\n");
69 |
70 | //waiting for a keystroke.
71 | _dos_getchar();
72 |
73 | shut_system();
74 | _dos_exit();
75 | } //main
76 |
77 |
78 |
--------------------------------------------------------------------------------
/Tetris68/tetris.h:
--------------------------------------------------------------------------------
1 | #ifndef _TETRIS_H_
2 | #define _TETRIS_H_
3 |
4 | #include "utils.h"
5 |
6 | #define TILE_0 TILE_USERINDEX //black
7 | #define TILE_1 TILE_USERINDEX + 1 //green
8 | #define TILE_2 TILE_USERINDEX + 2 //light blue
9 | #define TILE_3 TILE_USERINDEX + 3 //red
10 | #define TILE_4 TILE_USERINDEX + 4 //dark blue
11 | #define TILE_5 TILE_USERINDEX + 5 //light green
12 | #define TILE_6 TILE_USERINDEX + 6 //yellow //16 + 7
13 | #define TILE_7 TILE_USERINDEX + 7 //grey
14 | #define TILE_8 TILE_USERINDEX + 8 //pink
15 |
16 | #define FIELD_WIDTH 10 //12
17 | #define FIELD_HEIGHT 18
18 |
19 | #define SCREEN_TITLE 0
20 | #define SCREEN_RECORDS 1
21 | #define SCREEN_SELECT_PLAYER 2
22 | #define SCREEN_GAME 3
23 | #define SCREEN_END 4
24 |
25 | #define Y_SCREEN 8
26 |
27 | //const uint8_t tetromino[7][16];
28 |
29 | //from genesis
30 | typedef uint8_t bool;
31 |
32 | #define TRUE 1
33 | #define FALSE 0
34 |
35 | #define TILE_USERINDEX 0
36 | #define PAL0 0
37 | #define PAL1 1
38 | #define BG_A 0
39 | #define BG_B 1
40 |
41 | #define BUTTON_A 0x20
42 | #define BUTTON_B 0x40
43 |
44 | #define BUTTON_UP 0x1
45 | #define BUTTON_DOWN 0x2
46 | #define BUTTON_RIGHT 0x8
47 | #define BUTTON_LEFT 0x4
48 |
49 | //from genesis
50 |
51 | typedef struct
52 | {
53 | uint8_t pField[FIELD_WIDTH * FIELD_HEIGHT];
54 | uint16_t *pScreen;
55 | uint8_t *pPieceMap;
56 | uint8_t lines[4];
57 | uint8_t nPlayer;
58 | uint8_t nNextPiece;
59 | uint8_t nCurrentPiece;
60 | uint8_t nCurrentRotation;
61 | uint8_t nCurrentX;
62 | uint8_t nCurrentY;
63 | uint8_t nSpeed;
64 | uint8_t nSpeedCount;
65 | uint8_t nLineAnimation;
66 | uint16_t timer;
67 | bool bStarted;
68 | bool bPressStart;
69 | bool bForceDown;
70 | bool bRotateHold;
71 | uint8_t nPieceCount;
72 | uint16_t nScore;
73 | uint16_t nJoy;
74 | bool bGameOver;
75 | bool bRepaint;
76 | } PlayerContext;
77 |
78 | PlayerContext *players[3];
79 | PlayerContext *context;
80 |
81 | uint16_t *pieceAux;
82 |
83 | PlayerContext *initContext();
84 |
85 | void reset_next_piece(PlayerContext *context);
86 |
87 | uint8_t Rotate(uint8_t px, uint8_t py, uint8_t r);
88 |
89 | void drawNextPiece(uint8_t nPlayer);
90 |
91 | void reset_field(PlayerContext *context);
92 |
93 | uint8_t* updateRotation(uint8_t nTetromino, uint8_t nRotation);
94 |
95 | bool DoesPieceFitContext(PlayerContext *context, uint8_t rotation, int8_t nPosX, int8_t nPosY);
96 |
97 | uint8_t next_empty(PlayerContext *context);
98 |
99 | void empty_lines(PlayerContext *context);
100 |
101 | void line_animation(PlayerContext *context);
102 |
103 | void game_play();
104 |
105 | static void joyEvent(uint16_t joy, uint16_t changed, uint16_t state);
106 |
107 | uint8_t titleScreen();
108 |
109 | uint8_t reordsScreen();
110 |
111 | #endif
112 |
--------------------------------------------------------------------------------
/Textplains/Textplains.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Textplan/Textplan.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/WinTools/Image.cpp:
--------------------------------------------------------------------------------
1 | #include "Image.h"
2 |
3 | Image::saveAs16BitsImage(Bmp bmp, const char *fileDest)
4 | {
5 | puts(__FUNCTION__);
6 |
7 | std::ofstream fImage(fileDest, std::ofstream::binary);
8 |
9 | int32_t num_of_pixels = bmp.getNumPixels();
10 |
11 | uint16_t * img = (uint16_t *)bmp.getImage();
12 |
13 | uint16_t * buffer = (uint16_t *) malloc(sizeof(uint16_t) * num_of_pixels);
14 |
15 | //reverse the bytes for the bigendien
16 | for(int cont = 0; cont < num_of_pixels; cont++){
17 | buffer[cont] = REVERSE_BYTES_16(img[cont]);
18 | }
19 |
20 | fImage.write((char*)buffer, sizeof(uint16_t) * num_of_pixels);
21 |
22 | fImage.close();
23 |
24 | free(buffer);
25 | //free(img);
26 |
27 | return 0;
28 | } //saveAs16BitsImage
29 |
30 | Image::saveAs8BitsImage(Bmp bmp, const char *fileDest)
31 | {
32 | return 0;
33 | } //saveAs8BitsImage
34 |
35 | Image::saveAs4BitsImage(Bmp bmp, const char *fileDest)
36 | {
37 | return 0;
38 | } //saveAs4BitsImage
39 |
--------------------------------------------------------------------------------
/WinTools/Image.h:
--------------------------------------------------------------------------------
1 | #ifndef _IMAGE_H_
2 | #define _IMAGE_H_
3 |
4 | #include "stdafx.h"
5 |
6 | class Image {
7 | public:
8 | static int saveAs16BitsImage(Bmp bmp, const char *fileDest);
9 |
10 | static int saveAs8BitsImage(Bmp bmp, const char *fileDest);
11 |
12 | static int saveAs4BitsImage(Bmp bmp, const char *fileDest);
13 | };
14 |
15 |
16 | #endif
17 |
18 |
--------------------------------------------------------------------------------
/WinTools/PCGs.cpp:
--------------------------------------------------------------------------------
1 | #include "PCGs.h"
2 |
3 | int PCGs::hardcodedPCG(const char* fileDest)
4 | {
5 | std::ofstream pcgFileOut;
6 |
7 | uint32_t star_crafts[] = {
8 | //tile 0
9 | 0x00000000,
10 | 0x0000000d,
11 | 0x0000000d,
12 | 0x000000cb,
13 | 0x000000cb,
14 | 0x000000cb,
15 | 0x003000cd,
16 | 0x003000cd,
17 | //tile 1
18 | 0x00300bcd,
19 | 0x02320bcd,
20 | 0x0232bbcd,
21 | 0x0232bbcd,
22 | 0x0232bbcd,
23 | 0x023200cd,
24 | 0x055500cd,
25 | 0x00000055,
26 | //tile 2
27 | 0x00000000,
28 | 0xd0000000,
29 | 0xd0000000,
30 | 0xbc000000,
31 | 0xbc000000,
32 | 0xbc000000,
33 | 0xdc000300,
34 | 0xdc000300,
35 | //tile 3
36 | 0xdcb00300,
37 | 0xdcb02300,
38 | 0xdcb02300,
39 | 0xdcbb2300,
40 | 0xdcbb2300,
41 | 0xdc002300,
42 | 0xdc005550,
43 | 0x55000000,
44 | };
45 |
46 | pcgFileOut.open(fileDest, std::ios::binary);
47 |
48 | for (uint32_t buffer : star_crafts){
49 |
50 | buffer = REVERSE_BYTES_32(buffer);
51 |
52 | pcgFileOut.write((char*)&buffer, sizeof(uint32_t));
53 | }
54 |
55 | pcgFileOut.close();
56 |
57 | return 0;
58 | }
59 |
60 | int PCGs::reformatPCG(const char* fileSource, const char* fileDest)
61 | {
62 | /*
63 | ofstream pcgFileOut;
64 |
65 | Bmp bmp = Bmp::fromFile(fileSource);
66 |
67 | //bmp.print2();
68 | */
69 | return 0;
70 | }
71 |
--------------------------------------------------------------------------------
/WinTools/PCGs.h:
--------------------------------------------------------------------------------
1 | #ifndef _PCGS_H_
2 | #define _PCGS_H_
3 |
4 | #include "stdafx.h"
5 |
6 | class PCGs
7 | {
8 | public:
9 | static int hardcodedPCG(const char* fileDest);
10 |
11 | static int reformatPCG(const char* fileSource, const char* fileDest);
12 | };
13 |
14 |
15 | #endif
16 |
--------------------------------------------------------------------------------
/WinTools/Palettes.cpp:
--------------------------------------------------------------------------------
1 | #include "palettes.h"
2 |
3 | int Palettes::reformatPalette(const char *fileSource, const char *fileDest)
4 | {
5 | std::fstream paleteFileIn;
6 | std::fstream paleteFileOut;
7 | paleteFileIn.open(fileSource, std::ios::in | std::ios::binary);
8 |
9 | //if any error...
10 | if(!paleteFileIn.is_open()){
11 | std::cout << "Can't open the file" << std::endl;
12 | return 1;
13 | }
14 |
15 | paleteFileOut.open(fileDest, std::ios::out | std::ios::binary);
16 |
17 | //if any error...
18 | if(!paleteFileOut.is_open()){
19 | std::cout << "Can't create the file" << std::endl;
20 | return 1;
21 | }
22 |
23 | uint32_t buffer;
24 |
25 | while(paleteFileIn.read((char*)&buffer, sizeof(buffer))){
26 |
27 | buffer = REVERSE_BYTES_32(buffer);
28 | uint16_t buffer16 = buffer;
29 | buffer16 = REVERSE_BYTES_16(buffer16);
30 |
31 | paleteFileOut.write((char*)&buffer16, sizeof(uint16_t));
32 | }
33 |
34 | paleteFileOut.close();
35 | paleteFileIn.close();
36 |
37 | return 0;
38 | } //reformatPalette
39 |
40 | void Palettes::savePalette(Bmp bmp, const char *fileDest)
41 | {
42 | std::ofstream fPalette(fileDest, std::ofstream::binary);
43 |
44 | RGBQUAD *buffer = bmp.getPalette();
45 |
46 | for(int cont = 0; cont < bmp.getNumOfColours(); cont++){
47 |
48 | uint16_t colour = REVERSE_BYTES_16(
49 | RGB888_2GRB(
50 | buffer[cont].rgbRed,
51 | buffer[cont].rgbGreen,
52 | buffer[cont].rgbBlue,
53 | (
54 | (
55 | (
56 | buffer[cont].rgbRed
57 | + buffer[cont].rgbGreen
58 | + buffer[cont].rgbBlue
59 | ) / 3
60 | ) > 127
61 | )
62 | )
63 | );
64 |
65 | fPalette.write((char*)&colour, sizeof(colour));
66 | }
67 |
68 | fPalette.close();
69 | } //savePalette
70 |
--------------------------------------------------------------------------------
/WinTools/Palettes.h:
--------------------------------------------------------------------------------
1 | #ifndef _PALETTES_H_
2 | #define _PALETTES_H_
3 |
4 | #include "stdafx.h"
5 |
6 | class Bmp; //forward declaration.
7 |
8 | class Palettes {
9 |
10 | public:
11 | static int reformatPalette(const char *fileSource, const char *fileDest);
12 |
13 | static void savePalette(Bmp bmp, const char *fileDest);
14 | };
15 |
16 | #endif
17 |
--------------------------------------------------------------------------------
/WinTools/WinTools.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/WinTools/grafitti.h:
--------------------------------------------------------------------------------
1 | #ifndef _GRAFITTI_H_
2 | #define _GRAFITTI_H_
3 |
4 | //#include "stdafx.h"
5 |
6 | class Grafitti {
7 | public:
8 | static int doGrafitti(const char *fileSource, const char *fileGraff, const char *fileDest);
9 | };
10 |
11 | #endif
12 |
--------------------------------------------------------------------------------
/WinTools/main.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | int main()
5 | {
6 | printf("Hello world!\n");
7 | return 0;
8 | }
9 |
--------------------------------------------------------------------------------
/WinTools/stdafx.h:
--------------------------------------------------------------------------------
1 | #ifndef _STDAFX_H_
2 | #define _STDAFX_H_
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 |
11 | #include "bmp.h"
12 |
13 | #define REVERSE_BYTES_32(num) ( ((num & 0xFF000000) >> 24) | ((num & 0x00FF0000) >> 8) | ((num & 0x0000FF00) << 8) | ((num & 0x000000FF) << 24) )
14 | #define REVERSE_BYTES_24(num) ( ((num & 0xFF0000) >> 16) | (num & 0x00FF00) | ((num & 0x0000FF) << 16) )
15 | #define REVERSE_BYTES_16(num) ( ((num & 0xFF00) >> 8) | ((num & 0x00FF) << 8))
16 |
17 | #define RGB888_2GRB(r, g, b, i) ( ((b&0xF8)>>2) | ((g&0xF8)<<8) | ((r&0xF8)<<3) | i )
18 | #define RGB888_2RGB(r, g, b, i) ( ((r&0xF8)<<8) | ((g&0xF8)<<3) | ((b&0xF8)>>2) | i )
19 |
20 | //using namespace std;
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/assandc/assandc.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/assandc/asslib_lydux.S:
--------------------------------------------------------------------------------
1 | | something
2 |
3 | .set _PRINT, 0xff09
4 |
5 | .global asm_hello
6 | .type asm_hello,@function
7 |
8 | .global asm_hello_callback
9 | .type asm_hello_callback,@function
10 |
11 | .global asm_sum
12 | .type asm_sum,@function
13 |
14 | .global asm_sum_callback
15 | .type asm_sum_callback,@function
16 |
17 | .global asm_running_c_function
18 | .type asm_running_c_function,@function
19 |
20 | .global print_format
21 | .type print_format,@function
22 |
23 | .text
24 | .even
25 | asm_hello:
26 | pea hello | we load the address of hello into a1
27 | | move.l #hello, %sp@- | we push the address of hello into the stack
28 | .short _PRINT | we call the function print
29 | addq.l #4, %sp | we deallocate the stack by moving it up 4 bytes. addq is better because the instruction includes a 3 bit offset that can be 1 - 8
30 | rts
31 |
32 | asm_hello_callback:
33 | jsr hello_from_c
34 | rts
35 |
36 | asm_sum:
37 | move.l %sp@(4), %d0 | retrieve the first param from the stack
38 | move.l %sp@(8), %d1 | retrive the second param from the stack taking into account that the SP has moved 4 bytes
39 | add.l %d1, %d0 | add d1 into d0.
40 | rts | it is understood that the result is in d0.
41 |
42 | asm_sum_callback:
43 | move.l %sp@(8), %sp@- | retrieve the second param from the stack and copy it back to the stack in the following position
44 | move.l %sp@(8), %sp@- | retrive the first param from the stack and copy it back to the stack in the following position (notice that we take from 12 because the stack has moved)
45 | jsr add_from_c | we call the add_from_c function.
46 | addq.l #8, %sp | we deallocate the stack by moving it up 8 bytes. addq is better because the instruction includes a 3 bit offset that can be 1 - 8
47 | rts;
48 |
49 | asm_running_c_function:
50 | move.l %sp@(12), %sp@- | we retrieve the second param and push it back onto the stack
51 | move.l %sp@(12), %sp@- | we retrieve the first param and push it back onto the stak
52 | move.l %sp@(12), %a0 | we load the address of the function that will do the operation into a0
53 | jsr (%a0) | we run the function from C whatever it is
54 | addq.l #8, %sp | we deallocate the stack by moving it up 8 bytes. addq is better because the instruction includes a 3 bit offset that can be 1 - 8
55 | rts
56 |
57 | print_format:
58 | move.l %sp@(16), %sp@- | we push operand 1 into the stack
59 | move.l %sp@(16), %sp@- | we push operand 2 into the stack
60 | move.l %sp@(16), %sp@- | we push sum "result" into the stack
61 | move.l %sp@(16), %sp@- | we push the format into the stack
62 | jsr printf
63 | add.l #16, %sp | we deallocate the stack by moving it up 8 bytes. because the offset is higher than 8 we use add.
64 | rts
65 |
66 | .data
67 | hello:
68 | .string "Hello from ASM\r\n"
69 |
70 |
--------------------------------------------------------------------------------
/assandc/asslib_mariko.s:
--------------------------------------------------------------------------------
1 | .include doscall.mac
2 |
3 | .globl _asm_hello
4 | .globl _asm_hello_callback
5 | .globl _asm_sum
6 | .globl _asm_sum_callback
7 | .globl _asm_running_c_function
8 | .globl _print_format
9 |
10 | .text
11 | .even
12 | _asm_hello:
13 | pea hello ; we load the address of hello into a1
14 | ;move.l #hello,-(sp) ; we push the address of hello into the stack
15 | DOS _PRINT ; we call the function print
16 | addq.l #4,sp ; we deallocate the stack by moving it up 4 bytes. addq is better because the instruction includes a 3 bit offset that can be 1 - 8
17 | rts
18 |
19 | _asm_hello_callback:
20 | jsr _hello_from_c
21 | rts
22 |
23 | _asm_sum:
24 | move.l 4(sp), d0 ; retrieve the first param from the stack
25 | move.l 8(sp), d1 ; retrive the second param from the stack taking into account that the SP has moved 4 bytes
26 | add.l d1, d0 ; add d1 into d0.
27 | rts ; it is understood that the result is in d0.
28 |
29 | _asm_sum_callback:
30 | move.l 8(sp), -(sp) ; retrieve the second param from the stack and copy it back to the stack in the following position
31 | move.l 8(sp), -(sp) ; retrive the first param from the stack and copy it back to the stack in the following position (notice that we take from 12 because the stack has moved)
32 | jsr _add_from_c ; we call the add_from_c function.
33 | addq.l #8, sp ; we deallocate the stack by moving it up 8 bytes. addq is better because the instruction includes a 3 bit offset that can be 1 - 8
34 | rts;
35 |
36 | _asm_running_c_function:
37 | move.l 12(sp), -(sp) ; we retrieve the second param and push it back onto the stack
38 | move.l 12(sp), -(sp) ; we retrieve the first param and push it back onto the stak
39 | move.l 12(sp), a0 ; we load the address of the function that will do the operation into a0
40 | jsr (a0) ; we run the function from C whatever it is
41 | addq.l #8,sp ; we deallocate the stack by moving it up 8 bytes. addq is better because the instruction includes a 3 bit offset that can be 1 - 8
42 | rts
43 |
44 | _print_format:
45 | move.l 16(sp), -(sp) ; we push operant 1 into the stack
46 | move.l 16(sp), -(sp) ; we push operant 2 into the stack
47 | move.l 16(sp), -(sp) ; we push sum "result" into the stack
48 | move.l 16(sp), -(sp) ; we push the format into the stack
49 | jsr _printf
50 | add.l #16, sp ; we deallocate the stack by moving it up 8 bytes. because the offset is higher than 8 we use add.
51 | rts
52 |
53 | .data
54 | hello:
55 | dc.b 'Hello from ASM',$0d,$0a,0
56 |
--------------------------------------------------------------------------------
/assandc/main.c:
--------------------------------------------------------------------------------
1 | #ifdef __MARIKO_CC__
2 | #include
3 | #include
4 | #else
5 | #include
6 | #include
7 | #include
8 | #define interrupt __attribute__ ((interrupt_handler))
9 | #endif
10 |
11 | extern void asm_hello();
12 | extern void asm_hello_callback();
13 | extern int asm_sum(int, int);
14 | extern int asm_sum_callback(int, int);
15 | extern int asm_running_c_function(int(*)(int, int), int, int);
16 | extern void print_format(char *, int, int, int);
17 |
18 | void hello_from_c()
19 | {
20 | _dos_c_print("Hello from C !\r\n");
21 | }
22 |
23 | int add_from_c(int a, int b)
24 | {
25 | //printf("a: %d, b: %d\n", a, b);
26 | return a + b;
27 | }
28 |
29 | int sub_from_c(int a, int b)
30 | {
31 | return a - b;
32 | }
33 |
34 | int mul_from_c(int a, int b)
35 | {
36 | return a * b;
37 | }
38 |
39 | int main(void)
40 | {
41 | int result;
42 | //_dos_c_print("Hello world !\r\n");
43 |
44 | asm_hello();
45 |
46 | asm_hello_callback();
47 |
48 | result = asm_sum(5, 2);
49 |
50 | printf("result from asm_sum() is: %d and should be 7\n", result);
51 |
52 | result = asm_sum_callback(13, 2);
53 |
54 | printf("result from asm_sum_callback() is: %d and should be 15\n", result);
55 |
56 | result = asm_running_c_function(add_from_c, 2, 8);
57 |
58 | printf("result from asm_running_c_function(add_from_c()) is: %d and should be 10\n", result);
59 |
60 | result = asm_running_c_function(sub_from_c, 8, 2);
61 |
62 | printf("result from asm_running_c_function(sub_from_c()) is: %d and should be 6\n", result);
63 |
64 | result = asm_running_c_function(mul_from_c, 2, 8);
65 |
66 | printf("result from asm_running_c_function(mul_from_c()) is: %d and should be 16\n", result);
67 |
68 | result = asm_running_c_function(asm_sum, 2, 8);
69 |
70 | printf("result from asm_running_c_function(asm_sum()) is: %d and should be 10\n", result);
71 |
72 | result = asm_running_c_function(asm_sum_callback, 2, 8);
73 |
74 | printf("result from asm_running_c_function(asm_sum_callback()) is: %d and should be 10\n", result);
75 |
76 | print_format("%d + %d = %d\n", 1, 2, asm_sum(1, 2));
77 |
78 | _dos_exit();
79 | }
80 |
--------------------------------------------------------------------------------
/assets/captures/fpcube.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/assets/captures/fpcube.png
--------------------------------------------------------------------------------
/assets/captures/mariokartA.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/assets/captures/mariokartA.png
--------------------------------------------------------------------------------
/assets/captures/tetris68.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/assets/captures/tetris68.png
--------------------------------------------------------------------------------
/assets/images/111590-2223717679.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/assets/images/111590-2223717679.png
--------------------------------------------------------------------------------
/assets/images/24BitLandSc.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/assets/images/24BitLandSc.bmp
--------------------------------------------------------------------------------
/assets/images/4BitLandSc.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/assets/images/4BitLandSc.bmp
--------------------------------------------------------------------------------
/assets/images/4bitCircuit.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/assets/images/4bitCircuit.bmp
--------------------------------------------------------------------------------
/assets/images/8BitLandSc.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/assets/images/8BitLandSc.bmp
--------------------------------------------------------------------------------
/assets/images/8BitsColors.Wide.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/assets/images/8BitsColors.Wide.bmp
--------------------------------------------------------------------------------
/assets/images/8BitsColors.big.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/assets/images/8BitsColors.big.bmp
--------------------------------------------------------------------------------
/assets/images/8BitsColors.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/assets/images/8BitsColors.bmp
--------------------------------------------------------------------------------
/assets/images/8BitsLandScapeAndColors.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/assets/images/8BitsLandScapeAndColors.bmp
--------------------------------------------------------------------------------
/assets/images/Colours.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/assets/images/Colours.bmp
--------------------------------------------------------------------------------
/assets/images/circuit.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/assets/images/circuit.bmp
--------------------------------------------------------------------------------
/assets/images/formula4b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/assets/images/formula4b.png
--------------------------------------------------------------------------------
/assets/mariokart/111590-2223717679.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/assets/mariokart/111590-2223717679.png
--------------------------------------------------------------------------------
/assets/mariokart/tiles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/assets/mariokart/tiles.png
--------------------------------------------------------------------------------
/blogresi/blogresi.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/blogresi/blogresi_mariko/blogresi.x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/blogresi/blogresi_mariko/blogresi.x
--------------------------------------------------------------------------------
/documents/Mariko tools/AR.X English.txt:
--------------------------------------------------------------------------------
1 | X68k Archiver v1.00 Copyright 1987 SHARP/Hudson
2 | Usage: ar [switch] library [file...]
3 | /a ASCII file mode
4 | /b create backup file
5 | /u file update (default)
6 | /x extract file
7 | /d file deletion
8 | /l list output
9 | /i file specify indirect file
10 | /v verbose mode
--------------------------------------------------------------------------------
/documents/Mariko tools/AR.X Japanese.txt:
--------------------------------------------------------------------------------
1 | X68k Archiver v1.00 Copyright 1987 SHARP/Hudson
2 | 使用法:ar [スイッチ] ライブラリ [ファイル・・・]
3 | /a ASCIIファイルモード
4 | /b バックアップファイルの作成
5 | /u ファイルの更新(ディフォルト)
6 | /x ファイルの取り出し
7 | /d ファイルの削除
8 | /l リスト出力
9 | /i file インダイレクトファイルの指定
10 | /v バーボーズモード
--------------------------------------------------------------------------------
/documents/Mariko tools/AS.X English.txt:
--------------------------------------------------------------------------------
1 | X68k Assembler v3.00 Copyright 1987,88,89,90,91,92,93 SHARP/Hudson
2 | Usage: as [switch] filename
3 | /t path Temporary path specification
4 | /o name object file name
5 | /i path include path specification
6 | /p [file] create list file
7 | /n disable optimization
8 | /w disable warning error output
9 | /u make undefined symbols external references
10 | /d make all symbols external definitions
11 | /8 Set symbol identification length to 8 bytes
12 | /m nn maximum number of symbols (270 Expand software emulation instructions (FScc/MOVEP)
8 | -d make all symbols external definitions
9 | -e defaults to longwords for xref offsets
10 | -f[f,m,w,p] List file format specification (Page break[1], Macro expansion[0], Width[136], Number of page lines[58])
11 | -g output debugging information for SCD
12 | -i include path specification
13 | -j[n] Enhanced symbol overwrite prohibition condition (bit0:[1]=SET,bit1:[1]=OFFSYM)
14 | -k[n] 68060 errata countermeasures (0=[Yes] (-n is disabled), [1]=No)
15 | -l show title on startup
16 | -m <680x0|5x00> Specify CPU to assemble ([68000] to 68060/5200 to 5400)
17 | -n omit indeterminate size optimizations in pass 1 (with -k1)
18 | -o object file name
19 | -p [file] create list file
20 | -s Specifies the maximum number of digits for numeric local labels (1 to [4])
21 | -s [=n] symbol definition
22 | -t Temporary path specification
23 | -u Make undefined symbols external references
24 | -w[n] Specify warning level (0=all suppression, 1,[2],3,4=[all notifications])
25 | -x [file] output symbols
26 | -y[n] pre-defined symbols (0=[disabled], [1]=allowed)
27 | The contents of the environment variable HAS are inserted before the command line
28 | Don't consider '/' as a switch when HAS environment variable starts with '*'
--------------------------------------------------------------------------------
/documents/Mariko tools/HAS060.X Japanese.txt:
--------------------------------------------------------------------------------
1 | X68k High-speed Assembler v3.09+87 Copyright 1990-94/96-99 Y.Nakamura/M.Kamada
2 | 使用法: as [スイッチ] ファイル名
3 | -1 絶対ロング→PC間接(-b1と-eを伴う)
4 | -8 シンボルの識別長を8バイトにする
5 | -b[n] PC間接→絶対ロング(0=[禁止],[1]=68000,2=MEM,3=1+2,4=ALL,5=1+4)
6 | -c[n] 最適化(0=禁止(-k1を伴う),1=(d,An)を禁止,[2]=v2互換,3=[v3互換],4=許可)
7 | -c software emulationの命令を展開する(FScc/MOVEP)
8 | -d すべてのシンボルを外部定義にする
9 | -e 外部参照オフセットのデフォルトをロングワードにする
10 | -f[f,m,w,p] リストファイルのフォーマット指定
11 | (改ページ[1],マクロ展開[0],幅[136],ページ行数[58])
12 | -g SCD用デバッグ情報の出力
13 | -i インクルードパス指定
14 | -j[n] シンボルの上書き禁止条件の強化(bit0:[1]=SET,bit1:[1]=OFFSYM)
15 | -k[n] 68060のエラッタ対策(0=[する](-nは無効),[1]=しない)
16 | -l 起動時にタイトルを表示する
17 | -m <680x0|5x00> アセンブル対象CPUの指定([68000]~68060/5200~5400)
18 | -n パス1で確定できないサイズの最適化を省略する(-k1を伴う)
19 | -o オブジェクトファイル名
20 | -p [file] リストファイル作成
21 | -s 数字ローカルラベルの最大桁数の指定(1~[4])
22 | -s [=n] シンボルの定義
23 | -t テンポラリパス指定
24 | -u 未定義シンボルを外部参照にする
25 | -w[n] ワーニングレベルの指定(0=全抑制,1,[2],3,4=[全通知])
26 | -x [file] シンボルの出力
27 | -y[n] プレデファインシンボル(0=[禁止],[1]=許可)
28 | 環境変数 HAS の内容がコマンドラインの手前に挿入されます
29 | 環境変数 HAS の先頭が '*' のとき '/' をスイッチと見なしません
--------------------------------------------------------------------------------
/documents/Mariko tools/LIB.X English.txt:
--------------------------------------------------------------------------------
1 | X68k Librarian v1.10 Copyright 1990,91,92 SHARP/Hudson
2 | Usage: lib [switch] file [file...]
3 | /m nn maximum number of symbols (201 link lib.a
11 | -L path Specify library search path
12 | -o file Specify execution file name
13 | -p[file] create map file
14 | -r / -rn Create .r format executable
15 | -s embed section information in executable
16 | -t show title on startup
17 | -w disable warning output
18 | -x disable output of symbol table
19 | -0 / -1 Do not/do .ctor/.dtor
20 |
21 | --help (-h) display usage
22 | Cancel the --quiet (-z) --verbose (-v) option
23 | --verbose (-v) verbose
24 | --version display version
25 |
26 | The contents of the environment variable HLK are inserted before the command line.
27 | Link the object with + at the beginning of the file name to the beginning.
--------------------------------------------------------------------------------
/documents/Mariko tools/hlk301-12.r Japanese.txt:
--------------------------------------------------------------------------------
1 | HLK evolution version 3.01+12 Copyright 1989-94 SALT, 1999/07/16 立花えり子.
2 | usege: hlk [switch] file [+file] ...
3 | -a / -an 実行ファイルの拡張子省略時に .x を付けない
4 | -b num ベースアドレスの設定
5 | -d label=num シンボルの定義
6 | -e num アライメント値の設定
7 | -g num ロードモードの設定(0~2)
8 | -i file インダイレクトファイルの指定
9 | -l ライブラリのパスとして環境変数 lib を使用する
10 | -l lib.a をリンクする
11 | -L path ライブラリ検索パスの指定
12 | -o file 実行ファイル名の指定
13 | -p[file] マップファイルの作成
14 | -r / -rn .r 形式実行ファイルの作成
15 | -s セクション情報を実行ファイルに埋め込む
16 | -t 起動時にタイトルを表示する
17 | -w 警告の出力禁止
18 | -x シンボルテーブルの出力禁止
19 | -0 / -1 .ctor/.dtor に対応しない / する
20 |
21 | --help (-h) 使用法表示
22 | --quiet (-z) --verbose (-v) オプションを取り消す
23 | --verbose (-v) 詳細表示
24 | --version バージョン表示
25 |
26 | 環境変数 HLK の内容がコマンドラインの手前に挿入されます.
27 | ファイル名先頭に + をつけたオブジェクトを先頭にリンクします.
--------------------------------------------------------------------------------
/documents/Mariko tools/silk229.x English.txt:
--------------------------------------------------------------------------------
1 | X68k SILK Hi-Speed Linker v2.29 Copyright 1989-93 SALT
2 | modified for GCC Lv.3 Exp.3 (c)1993,94 by Charlie / KYA soft
3 | Usage: lk [switch] file [file...]
4 | -a Do not add .x when omitting extension of executable file
5 | -d label=nn label declaration (hexadecimal)
6 | -t show title on startup
7 | -i file specify indirect file
8 | -l use environment variable lib as library path
9 | -m nn maximum number of symbols (201 < nn < 65536)
10 | -o file name of executable file
11 | -p [file] create map file
12 | -s embed section information in executable
13 | -v verbose mode
14 | -w disable output of warnings
15 | -x disable output of symbol table
16 | -z cancel the -v option
17 | -0 don't do anything for GCC 2
18 |
19 | The contents of the environment variable G2LK are appended to the end of the command line
20 | If the beginning of the object file name is '+', the string after that is
21 | Link to the top of the program assuming it as a file name
22 | -m option is ignored even if specified
--------------------------------------------------------------------------------
/documents/Mariko tools/silk229.x Japanese.txt:
--------------------------------------------------------------------------------
1 | X68k SILK Hi-Speed Linker v2.29 Copyright 1989-93 SALT
2 | modified for GCC Lv.3 Exp.3 (c)1993,94 by Charlie / KYA soft
3 | 使用法:lk [switch] file [file...]
4 | -a 実行ファイルの拡張子省略時に .x を付けない
5 | -d label=nn ラベルの宣言(16進)
6 | -t 起動時にタイトルを表示する
7 | -i file インダイレクトファイルの指定
8 | -l ライブラリのパスとして環境変数 lib を使用する
9 | -m nn 最大シンボル数 (201 < nn < 65536)
10 | -o file 実行ファイル名
11 | -p [file] マップファイルの作成
12 | -s セクション情報を実行ファイルに埋め込む
13 | -v バーボーズモード
14 | -w ワーニングの出力禁止
15 | -x シンボルテーブルの出力禁止
16 | -z -v オプションを取り消す
17 | -0 GCC 2 のための処理を行わない
18 |
19 | 環境変数 G2LK の内容がコマンドラインの最後に追加されます
20 | オブジェクトファイル名の先頭が '+' の場合はそれ以降の文字列を
21 | ファイル名と見なしてプログラムの先頭に来るようにリンクします
22 | -m オプションは指定しても無視されます
--------------------------------------------------------------------------------
/documents/Mariko tools/silk301.x hlk301.x English.txt:
--------------------------------------------------------------------------------
1 | X68k SILK Hi-Speed Linker v3.01 Copyright 1989-94 SALT
2 | Usage: lk [switch] file [file...]
3 | -a Do not add .x when omitting extension of executable file
4 | -d label=nn label declaration (hexadecimal)
5 | -e nn Set alignment value (decimal)
6 | -t show title on startup
7 | -i file specify indirect file
8 | -l use environment variable lib as library path
9 | -m nn maximum number of symbols (201 < nn < 65536)
10 | -o file name of executable file
11 | -p [file] create map file
12 | -s embed section information in executable
13 | -v verbose mode
14 | -w disable output of warnings
15 | -x disable output of symbol table
16 | -z cancel the -v option
17 |
18 | The contents of the environment variable SILK are appended to the end of the command line
19 | If the beginning of the object file name is '+', the string after that is
20 | Link to the top of the program assuming it as a file name
21 | -m option is ignored even if specified
--------------------------------------------------------------------------------
/documents/Mariko tools/silk301.x hlk301.x Japanese.txt:
--------------------------------------------------------------------------------
1 | X68k SILK Hi-Speed Linker v3.01 Copyright 1989-94 SALT
2 | 使用法:lk [switch] file [file...]
3 | -a 実行ファイルの拡張子省略時に .x を付けない
4 | -d label=nn ラベルの宣言(16進)
5 | -e nn アライメント値の設定(10進)
6 | -t 起動時にタイトルを表示する
7 | -i file インダイレクトファイルの指定
8 | -l ライブラリのパスとして環境変数 lib を使用する
9 | -m nn 最大シンボル数 (201 < nn < 65536)
10 | -o file 実行ファイル名
11 | -p [file] マップファイルの作成
12 | -s セクション情報を実行ファイルに埋め込む
13 | -v バーボーズモード
14 | -w ワーニングの出力禁止
15 | -x シンボルテーブルの出力禁止
16 | -z -v オプションを取り消す
17 |
18 | 環境変数 SILK の内容がコマンドラインの最後に追加されます
19 | オブジェクトファイル名の先頭が '+' の場合はそれ以降の文字列を
20 | ファイル名と見なしてプログラムの先頭に来るようにリンクします
21 | -m オプションは指定しても無視されます
--------------------------------------------------------------------------------
/documents/Mariko tools/tool versions.txt:
--------------------------------------------------------------------------------
1 | 1987 run68 AR.X: X68k Archiver v1.00 Copyright 1987 SHARP/Hudson
2 | 1989 run68 BIND.X: X68k Binder v1.00 Copyright 1989 SHARP/Hudson
3 |
4 | 1991 run68 has234.x: X68k High-speed Assembler v2.34 Copyright 1990,91 by Y.Nakamura
5 |
6 | 1992 run68 MAKE.X: X68k Make v1.10 Copyright 1990,91,92 SHARP/Hudson
7 | 1992 run68 LIB.X: X68k Librarian v1.10 Copyright 1990,91,92 SHARP/Hudson
8 | 1992 run68 has250.x: X68k High-speed Assembler v2.50 Copyright 1990,91,92 by Y.Nakamura
9 |
10 | 1993 run68 AS.X: X68k Assembler v3.00 Copyright 1987,88,89,90,91,92,93 SHARP/Hudson
11 | 1993 run68 lk.x / LK300.X: X68k Linker v3.00 Copyright 1987,88,89,90,91,92,93 SHARP/Hudson
12 | 1993 run68 silk229.x: X68k SILK Hi-Speed Linker v2.29 Copyright 1989-93 SALT
13 |
14 | 1994 run68 has309.x / has000.x: X68k High-speed Assembler v3.09 Copyright 1990-94 by Y.Nakamura
15 | 1994 run68 silk301.x / hlk301.x: X68k SILK Hi-Speed Linker v3.01 Copyright 1989-94 SALT
16 |
17 | 1999 run68 HAS060.X: X68k High-speed Assembler v3.09+87 Copyright 1990-94/96-99 Y.Nakamura/M.Kamada
18 | 1999 run68 hlk301-12.r: HLK evolution version 3.01+12 Copyright 1989-94 SALT, 1999/07/16 Eriko Tachibana.
--------------------------------------------------------------------------------
/documents/trap English.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/documents/trap English.txt
--------------------------------------------------------------------------------
/documents/trap Japanese.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/documents/trap Japanese.txt
--------------------------------------------------------------------------------
/tests4bits/tests4bits.cbp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/x68000_gcc/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/x68000_gcc/logo.png
--------------------------------------------------------------------------------
/x68000_gcc/template/main.c:
--------------------------------------------------------------------------------
1 | #ifdef __MARIKO_CC__
2 | #include
3 | #include
4 | #else
5 | #include
6 | #include
7 | #define interrupt __attribute__ ((interrupt_handler))
8 | #endif
9 |
10 | int main(void)
11 | {
12 | _dos_c_print("Hello world !\r\n");
13 |
14 | _dos_exit();
15 | }
16 |
--------------------------------------------------------------------------------
/x68000_gcc/wizard.script:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // X68000 GCC project wizard
4 | //
5 | ////////////////////////////////////////////////////////////////////////////////
6 |
7 | function BeginWizard()
8 | {
9 | Wizard.AddInfoPage(
10 | _T("X68000GCCIntro"),
11 | _T(
12 | "Welcome to the new X68000 GCC project wizard!\n"
13 | + "This wizard will guide you to create a new X68000 GCC project.\n\n"
14 | + "When you 're ready to proceed, please click \"Next\"..."
15 | )
16 | );
17 |
18 | Wizard.AddProjectPathPage();
19 |
20 | Wizard.AddCompilerPage(
21 | _T(""),
22 | _T("x68000_gcc*"),
23 | false,
24 | false
25 | );
26 | }
27 |
28 | function GetFilesDir()
29 | {
30 | return _T("x68000_gcc/template");
31 | }
32 |
33 | function SetupProject(project)
34 | {
35 | local projectname;
36 | local target_mariko;
37 | local target_lydux;
38 | local oc_x = ::wxString();
39 | local ld_opts = ::wxString();
40 | local file;
41 |
42 | projectname = GetProjectManager().GetActiveProject().GetTitle();
43 |
44 | // Configure target Mariko
45 |
46 | //we try to capture the target
47 | target_mariko = project.GetBuildTarget(_T("default"));
48 |
49 | //if the target doesn't exist...
50 | if (IsNull(target_mariko)){
51 | //we create the target
52 | target_mariko = project.AddBuildTarget(_T("default"));
53 | }
54 |
55 |
56 | target_mariko.SetTargetType(ttConsoleOnly);
57 | target_mariko.SetTargetFilenameGenerationPolicy(tgfpPlatformDefault, tgfpNone);
58 | target_mariko.SetOutputFilename(target_mariko.GetTitle() + wxFILE_SEP_PATH + projectname);
59 | DebugSymbolsOn(target_mariko, Wizard.GetCompilerID());
60 |
61 | //we try to capture the target
62 | target_lydux = project.GetBuildTarget(_T("lydux"));
63 |
64 | //if the target doesn't exist...
65 | if (IsNull(target_lydux)){
66 | //we create the target
67 | target_lydux = project.AddBuildTarget(_T("lydux"));
68 | }
69 |
70 | // Objcopy to xfile
71 | oc_x = _T("human68k-objcopy -v -O xfile $(TARGET_OUTPUT_FILE) $(TARGET_OUTPUT_FILE).X");
72 | target_lydux.AddCommandsAfterBuild(oc_x);
73 |
74 | // Setup the linker options
75 | ld_opts = _T("-Wl,-q,-Map=$(TARGET_OUTPUT_FILE).map,--cref");
76 | target_lydux.AddLinkerOption(ld_opts);
77 |
78 | target_lydux.SetTargetType(ttConsoleOnly);
79 | target_lydux.SetTargetFilenameGenerationPolicy(tgfpPlatformDefault, tgfpNone);
80 | target_lydux.SetOutputFilename(target_lydux.GetTitle() + wxFILE_SEP_PATH + projectname);
81 |
82 | //we include the main.c also in this target
83 | file = project.AddFile(_T("lydux"), _T("main.c"), true, true, 50);
84 | file.AddBuildTarget(_T("lydux"));
85 | file.compile = true;
86 |
87 | //we set the human68K_gcc compiler in the lydux target.
88 | target_lydux.SetCompilerID(_T("human68k_gcc"))
89 |
90 | return true;
91 | }
92 |
--------------------------------------------------------------------------------
/x68000_gcc_template.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/x68000_gcc_template.zip
--------------------------------------------------------------------------------
/x68AssetsComp/requirements.txt:
--------------------------------------------------------------------------------
1 | numpy~=2.0.0
2 | pillow~=10.3.0
3 | pip~=24.1.1
4 | x68assetscomp~=0.1.0
5 | pydub~=0.25.1
6 | scipy~=1.14.0
--------------------------------------------------------------------------------
/x68AssetsComp/setup.py:
--------------------------------------------------------------------------------
1 | from setuptools import setup, find_packages
2 |
3 | setup(
4 | name='x68AssetsComp',
5 | version='0.1.0',
6 | packages=find_packages(),
7 | install_requires=[
8 | # List your dependencies here
9 | 'Pillow', # Example dependency
10 | ],
11 | entry_points={
12 | 'console_scripts': [
13 | 'x68AssetsComp=main:main',
14 | ],
15 | },
16 | classifiers=[
17 | 'Programming Language :: Python :: 3',
18 | 'License :: OSI Approved :: MIT License',
19 | 'Operating System :: OS Independent',
20 | ],
21 | python_requires='>=3.6',
22 | )
--------------------------------------------------------------------------------
/x68AssetsComp/tests/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/x68AssetsComp/tests/__init__.py
--------------------------------------------------------------------------------
/x68AssetsComp/tests/samples/16BitLandSc.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/x68AssetsComp/tests/samples/16BitLandSc.bmp
--------------------------------------------------------------------------------
/x68AssetsComp/tests/samples/16BitLandSc.pic:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/x68AssetsComp/tests/samples/16BitLandSc.pic
--------------------------------------------------------------------------------
/x68AssetsComp/tests/samples/8BitsColors.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/x68AssetsComp/tests/samples/8BitsColors.bmp
--------------------------------------------------------------------------------
/x68AssetsComp/tests/samples/8BitsColors.pic:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/x68AssetsComp/tests/samples/8BitsColors.pic
--------------------------------------------------------------------------------
/x68AssetsComp/tests/samples/8Bitscolors.pal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/x68AssetsComp/tests/samples/8Bitscolors.pal
--------------------------------------------------------------------------------
/x68AssetsComp/tests/samples/formula4b.pal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/x68AssetsComp/tests/samples/formula4b.pal
--------------------------------------------------------------------------------
/x68AssetsComp/tests/samples/formula4b.pic:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/x68AssetsComp/tests/samples/formula4b.pic
--------------------------------------------------------------------------------
/x68AssetsComp/tests/samples/formula4b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/x68AssetsComp/tests/samples/formula4b.png
--------------------------------------------------------------------------------
/x68AssetsComp/tests/samples/mk_circuit.pal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/x68AssetsComp/tests/samples/mk_circuit.pal
--------------------------------------------------------------------------------
/x68AssetsComp/tests/samples/mk_circuit.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/x68AssetsComp/tests/samples/mk_circuit.ts
--------------------------------------------------------------------------------
/x68AssetsComp/tests/samples/tiles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FedericoTech/X68KTutorials/104583c0f3cd33d97a2050b12e2c3198924c2c4c/x68AssetsComp/tests/samples/tiles.png
--------------------------------------------------------------------------------
/x68AssetsComp/x68assetscomp/__init__.py:
--------------------------------------------------------------------------------
1 | from PIL import Image
2 | import os
3 | import struct
4 |
5 |
6 | from .tmx_converter import convert_tmx
7 | from .image_converter import convert_image
8 | from .audio_converter import convert_audio
9 |
10 | __all__ = ['convert_tmx', 'convert_image', 'convert_audio']
--------------------------------------------------------------------------------
/x68AssetsComp/x68assetscomp/utils.py:
--------------------------------------------------------------------------------
1 | import warnings
2 |
3 |
4 | def rgb_to_grb(red, green, blue):
5 | try:
6 | with warnings.catch_warnings():
7 | warnings.simplefilter("error", RuntimeWarning)
8 | return (((blue & 0xF8) >> 2)
9 | | ((green & 0xF8) << 8)
10 | | ((red & 0xF8) << 3)
11 | | (int((red + green + blue) // 3) > 127))
12 | except RuntimeWarning as e:
13 | print(f"Types - red: {type(red)}, green: {type(green)}, blue: {type(blue)}")
14 | print(f"Values - red: {red}, green: {green}, blue: {blue}")
15 | raise e
16 |
17 |
18 | def parse_magic_pink(magic_pink):
19 | magic_pink = int(magic_pink, 16)
20 | return rgb_to_grb(
21 | (magic_pink >> 16) & 0xFF,
22 | (magic_pink >> 8) & 0xFF,
23 | magic_pink & 0xFF
24 | )
25 |
26 |
27 | def my_warning(message):
28 | print(f"\033[93mWarning: \033[0m{message}")
29 |
--------------------------------------------------------------------------------