Skip to content

Commit

Permalink
Update to newer version
Browse files Browse the repository at this point in the history
  • Loading branch information
gameblabla committed Apr 10, 2023
1 parent c8c7174 commit bc8e40d
Show file tree
Hide file tree
Showing 18 changed files with 480 additions and 54 deletions.
2 changes: 1 addition & 1 deletion PC9801/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CFLAGS += $(DEFINES)

OUTPUT = GAME.EXE

SOURCES = ./main.c gfx.c input.c
SOURCES = ./main.c gfx.c input.c pmd.c

all: asm ${OUTPUT}

Expand Down
Binary file added PC9801/WAVs/DIALOGUE1.wav
Binary file not shown.
Binary file added PC9801/WAVs/DIALOGUE2.wav
Binary file not shown.
Binary file added PC9801/WAVs/DIALOGUE3.wav
Binary file not shown.
Binary file added PC9801/WAVs/DIALOGUE4.wav
Binary file not shown.
Binary file added PC9801/WAVs/DIALOGUE5.wav
Binary file not shown.
Binary file added PC9801/WAVs/FUCK.WAV
Binary file not shown.
Binary file added PC9801/WAVs/FUCK2.WAV
Binary file not shown.
Binary file added PC9801/WAVs/FUCK3.WAV
Binary file not shown.
Binary file added PC9801/WAVs/GAME.P86
Binary file not shown.
Binary file added PC9801/WAVs/GAME.PPC
Binary file not shown.
Binary file added PC9801/WAVs/MYFILE.WAV
Binary file not shown.
52 changes: 47 additions & 5 deletions PC9801/gfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ void gfx_init()
union REGS in, out;
union REGS regs;

gfx_store_palette(old_palette, 16);

in.h.ah = VGA_MODE;
in.h.ch = (3) << 6;
int86(INTERRUPT_VGA, &in, &out);
Expand All @@ -79,6 +77,8 @@ void gfx_init()
int86(INTERRUPT_VGA, &in, &out);
/* Start graphical co-GPU. */
outp(GDC_GFX_COMMAND, GDC_CMD_START);

gfx_store_palette(old_palette, 16);

#if 0
/* Disable text. */
Expand Down Expand Up @@ -109,6 +109,23 @@ void gfx_init()
{
mov DX,'5h'

mov AL,27 ; ESC
int 29h
mov AL,'[' ; '['
int 29h
mov AL,'>' ; '>'
int 29h
mov AL,DH
int 29h
mov AL,DL

int 29h
}
// Hide system line
__asm
{
mov DX,'1l'

mov AL,27 ; ESC
int 29h
mov AL,'[' ; '['
Expand All @@ -126,6 +143,8 @@ void gfx_end()
{
union REGS in, out;

CLEAR_TEXT_VRAM();

gfx_fill_palette(old_palette, 16);

/* Clock both GPUs back to 2.5MHz. */
Expand All @@ -150,12 +169,12 @@ void gfx_end()
outp(GDC_TEXT_COMMAND, GDC_CMD_VSYNC_MASTER);
outp(GDC_GFX_COMMAND, GDC_CMD_VSYNC_SLAVE);

CLEAR_TEXT_VRAM();
CLEAR_TXT();

// Show cursor
__asm
{
mov DX,'1l'
mov DX,'5l'

mov AL,27 ; ESC
int 29h
Expand All @@ -169,7 +188,30 @@ void gfx_end()
int 29h
}

gfx_fill_palette(old_palette, 16);
// Show system line
__asm
{
mov DX,'1h'

mov AL,27 ; ESC
int 29h
mov AL,'[' ; '['
int 29h
mov AL,'>' ; '>'
int 29h
mov AL,DH
int 29h
mov AL,DL
int 29h
}

// KEY BEEP
__asm
{
xor AX,AX
mov ES,AX
and byte ptr ES:[500H],NOT 20h
}
}

void gfx_wait_vsync()
Expand Down
27 changes: 23 additions & 4 deletions PC9801/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "input.h"
#include "keys.h"

uint8_t inputs[8] = {0};
uint8_t inputs[18] = {0};

static union REGS out, in;

Expand All @@ -39,19 +39,38 @@ static void keygroup_sense(char group_id) {

void Get_Input()
{
keygroup_sense(3);
input_update_bool(inputs[CONFIRM_KEY], (out.h.ah & K3_RETURN));

keygroup_sense(0);
input_update_bool(inputs[ESC_KEY], (out.h.ah & K0_ESC));
input_update_bool(inputs[KEY1_GAME], (out.h.ah & K0_1));
input_update_bool(inputs[KEY2_GAME], (out.h.ah & K0_2));
input_update_bool(inputs[KEY3_GAME], (out.h.ah & K0_3));

keygroup_sense(1);
input_update_bool(inputs[KEY0_GAME], (out.h.ah & K1_0));

keygroup_sense(2);
input_update_bool(inputs[KEY_W], (out.h.ah & K2_W));


keygroup_sense(3);
input_update_bool(inputs[CONFIRM_KEY], (out.h.ah & K3_RETURN));
input_update_bool(inputs[KEY_S], (out.h.ah & K3_S));
input_update_bool(inputs[KEY_A], (out.h.ah & K3_A));
input_update_bool(inputs[KEY_D], (out.h.ah & K3_D));


keygroup_sense(6);
input_update_bool(inputs[SPACE_KEY], (out.h.ah & K6_SPACE));

keygroup_sense(9);
keygroup_sense(7);
input_update_bool(inputs[DOWN_KEY], (out.h.ah & K7_ARROW_DOWN));
input_update_bool(inputs[UP_KEY], (out.h.ah & K7_ARROW_UP));
input_update_bool(inputs[LEFT_KEY], (out.h.ah & K7_ARROW_LEFT));
input_update_bool(inputs[RIGHT_KEY], (out.h.ah & K7_ARROW_RIGT));

keygroup_sense(9);
input_update_bool(inputs[NUMPAD0_KEY], (out.h.ah & K9_NUM_0));
input_update_bool(inputs[NUMPAD1_KEY], (out.h.ah & K9_NUM_1));
input_update_bool(inputs[NUMPAD2_KEY], (out.h.ah & K9_NUM_2));
}
16 changes: 15 additions & 1 deletion PC9801/input.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,22 @@
#define SPACE_KEY 5
#define ESC_KEY 6

#define KEY0_GAME 7
#define KEY1_GAME 8
#define KEY2_GAME 9
#define KEY3_GAME 10

#define NUMPAD0_KEY 11
#define NUMPAD1_KEY 12
#define NUMPAD2_KEY 13

#define KEY_W 14
#define KEY_S 15
#define KEY_A 16
#define KEY_D 17

// Function prototypes
extern uint8_t inputs[8];
extern uint8_t inputs[18];
extern void Get_Input();

#endif
Loading

0 comments on commit bc8e40d

Please sign in to comment.