mirror of
https://github.com/SaffronCR/msx-rpg.git
synced 2026-02-04 05:36:20 +00:00
Started working on the character creation screen.
Project cleanup/renaming.
This commit is contained in:
16
Makefile
16
Makefile
@@ -16,7 +16,7 @@
|
||||
#\___________________________________________________________/
|
||||
#
|
||||
# What does this file ?
|
||||
# It generate an MSX DOS executable file ready to be launch on a MSX Computer with MSX-DOS
|
||||
# It generate an MSX DOS executable file ready to be launch on a MSX Computer with MSX-DOS
|
||||
# It also start the openMSX emuilator if it isn't already started
|
||||
#
|
||||
#
|
||||
@@ -27,18 +27,18 @@ ASM = sdasz80 # ASM compilator command name
|
||||
CC = sdcc # SDCC commpilator command name
|
||||
C_FILES := $(CompFile) #test.c $(wildcard *.c) # which files to compil. File name must be sent by Sublime Text Build Systeme into the $(CompFile) variable
|
||||
DEST := dsk/ # destination of executable files
|
||||
ASM_FILES := $(wildcard *.s) # definition of sources files
|
||||
ASM_FILES := $(wildcard *.s) # definition of sources files
|
||||
REL_FILES := $(subst .s,.rel,$(ASM_FILES)) # definition of .rel files
|
||||
|
||||
IHX_FILES := $(subst .c,.ihx,$(C_FILES)) # definition of .ihx files
|
||||
COM_FILES := $(subst .ihx,.com,$(IHX_FILES)) # definition of .com files
|
||||
IHX_FILES := $(subst .c,.ihx,$(C_FILES)) # definition of .ihx files
|
||||
COM_FILES := $(subst .ihx,.com,$(IHX_FILES)) # definition of .com files
|
||||
|
||||
# Folder where to find other compiled files to include
|
||||
INCLUDEDIR = ./fusion-c/include/
|
||||
# Folder where to find Fusion.lib
|
||||
# Folder where to find Fusion.lib
|
||||
LIBDIR = ./fusion-c/lib/
|
||||
|
||||
# standrd crt0
|
||||
# standrd crt0
|
||||
crt0 = $(INCLUDEDIR)crt0_msxdos.rel
|
||||
|
||||
# use this crt0 if you want to pass parameters to your program
|
||||
@@ -63,7 +63,7 @@ crt0 = $(INCLUDEDIR)crt0_msxdos.rel
|
||||
# Standard Code-loc adress
|
||||
ADDR_CODE = 0x106
|
||||
# use this parameter if you are using crt0_msxdos_advanced
|
||||
#ADDR_CODE = 0x180
|
||||
#ADDR_CODE = 0x180
|
||||
ADDR_DATA = 0x0
|
||||
|
||||
# The above line is the full command line used by SDD to compil and link your to source file to an MSX-DOS executable
|
||||
@@ -91,5 +91,5 @@ clean:
|
||||
@echo "....(╯°□°) temp files removed!"
|
||||
|
||||
emulator:
|
||||
# Starting emulator script
|
||||
# Starting emulator script
|
||||
./openMSX/emul_start.sh
|
||||
|
||||
@@ -38,9 +38,9 @@ cd src\audio\
|
||||
%ASM% -o audio.asm
|
||||
cd ..\..
|
||||
|
||||
SDCC --code-loc %ADDR_CODE% --data-loc %ADDR_DATA% --disable-warning 196 -mz80 --no-std-crt0 --opt-code-size fusion.lib -L %LIBDIR% %INC1% %INC2% %INC3% %INC4% %INC5% %INC6% %INC7% %INC8% %INC9% %INCA% %INCB% %INCC% %INCD% %INCE% %INCF% -c src\font.c
|
||||
SDCC --code-loc %ADDR_CODE% --data-loc %ADDR_DATA% --disable-warning 196 -mz80 --no-std-crt0 --opt-code-size fusion.lib -L %LIBDIR% %INC1% %INC2% %INC3% %INC4% %INC5% %INC6% %INC7% %INC8% %INC9% %INCA% %INCB% %INCC% %INCD% %INCE% %INCF% -c src\startscr.c
|
||||
|
||||
SDCC --code-loc %ADDR_CODE% --data-loc %ADDR_DATA% --disable-warning 196 -mz80 --no-std-crt0 --opt-code-size fusion.lib -L %LIBDIR% %INC1% %INC2% %INC3% %INC4% %INC5% %INC6% %INC7% %INC8% %INC9% %INCA% %INCB% %INCC% %INCD% %INCE% %INCF% -c src\startscreen.c
|
||||
SDCC --code-loc %ADDR_CODE% --data-loc %ADDR_DATA% --disable-warning 196 -mz80 --no-std-crt0 --opt-code-size fusion.lib -L %LIBDIR% %INC1% %INC2% %INC3% %INC4% %INC5% %INC6% %INC7% %INC8% %INC9% %INCA% %INCB% %INCC% %INCD% %INCE% %INCF% -c src\creationscr.c
|
||||
|
||||
SDCC --code-loc %ADDR_CODE% --data-loc %ADDR_DATA% --disable-warning 196 -mz80 --no-std-crt0 --opt-code-size fusion.lib -L %LIBDIR% %INC1% %INC2% %INC3% %INC4% %INC5% %INC6% %INC7% %INC8% %INC9% %INCA% %INCB% %INCC% %INCD% %INCE% %INCF% -c src\intro.c
|
||||
|
||||
@@ -52,13 +52,15 @@ SDCC --code-loc %ADDR_CODE% --data-loc %ADDR_DATA% --disable-warning 196 -mz80 -
|
||||
|
||||
SDCC --code-loc %ADDR_CODE% --data-loc %ADDR_DATA% --disable-warning 196 -mz80 --no-std-crt0 --opt-code-size fusion.lib -L %LIBDIR% %INC1% %INC2% %INC3% %INC4% %INC5% %INC6% %INC7% %INC8% %INC9% %INCA% %INCB% %INCC% %INCD% %INCE% %INCF% -c src\encounter.c
|
||||
|
||||
SDCC --code-loc %ADDR_CODE% --data-loc %ADDR_DATA% --disable-warning 196 -mz80 --no-std-crt0 --opt-code-size fusion.lib -L %LIBDIR% %INC1% %INC2% %INC3% %INC4% %INC5% %INC6% %INC7% %INC8% %INC9% %INCA% %INCB% %INCC% %INCD% %INCE% %INCF% -c src\font.c
|
||||
|
||||
SDCC --code-loc %ADDR_CODE% --data-loc %ADDR_DATA% --disable-warning 196 -mz80 --no-std-crt0 --opt-code-size fusion.lib -L %LIBDIR% %INC1% %INC2% %INC3% %INC4% %INC5% %INC6% %INC7% %INC8% %INC9% %INCA% %INCB% %INCC% %INCD% %INCE% %INCF% -c src\gfx.c
|
||||
|
||||
SDCC --code-loc %ADDR_CODE% --data-loc %ADDR_DATA% --disable-warning 196 -mz80 --no-std-crt0 --opt-code-size fusion.lib -L %LIBDIR% %INC1% %INC2% %INC3% %INC4% %INC5% %INC6% %INC7% %INC8% %INC9% %INCA% %INCB% %INCC% %INCD% %INCE% %INCF% -c src\snd.c
|
||||
|
||||
SDCC --code-loc %ADDR_CODE% --data-loc %ADDR_DATA% --disable-warning 196 -mz80 --no-std-crt0 --opt-code-size fusion.lib -L %LIBDIR% %INC1% %INC2% %INC3% %INC4% %INC5% %INC6% %INC7% %INC8% %INC9% %INCA% %INCB% %INCC% %INCD% %INCE% %INCF% -c src\system.c
|
||||
|
||||
SDCC --code-loc %ADDR_CODE% --data-loc %ADDR_DATA% --disable-warning 196 -mz80 --no-std-crt0 --opt-code-size fusion.lib -L %LIBDIR% %INC1% %INC2% %INC3% %INC4% %INC5% %INC6% %INC7% %INC8% %INC9% %INCA% %INCB% %INCC% %INCD% %INCE% %INCF% src\main.c font.rel startscreen.rel intro.rel menu.rel procgen.rel dungeon.rel encounter.rel gfx.rel snd.rel system.rel src\audio\audio.rel
|
||||
SDCC --code-loc %ADDR_CODE% --data-loc %ADDR_DATA% --disable-warning 196 -mz80 --no-std-crt0 --opt-code-size fusion.lib -L %LIBDIR% %INC1% %INC2% %INC3% %INC4% %INC5% %INC6% %INC7% %INC8% %INC9% %INCA% %INCB% %INCC% %INCD% %INCE% %INCF% src\main.c startscr.rel creationscr.rel intro.rel menu.rel procgen.rel dungeon.rel encounter.rel font.rel gfx.rel snd.rel system.rel src\audio\audio.rel
|
||||
|
||||
SET cpath=%~dp0
|
||||
|
||||
|
||||
BIN
dsk/srangers.com
BIN
dsk/srangers.com
Binary file not shown.
@@ -1,53 +1,53 @@
|
||||
;;
|
||||
;; sf_init_menu_song function
|
||||
;; sr_init_menu_song function
|
||||
;; input: nothing
|
||||
;; output: nothing
|
||||
;;
|
||||
_sf_init_menu_song::
|
||||
_sr_init_menu_song::
|
||||
;ld hl,#MENU_START
|
||||
xor a
|
||||
call PLY_AKG_INIT
|
||||
ret
|
||||
|
||||
;;
|
||||
;; sf_init_intro_song function
|
||||
;; sr_init_intro_song function
|
||||
;; input: nothing
|
||||
;; output: nothing
|
||||
;;
|
||||
_sf_init_intro_song::
|
||||
_sr_init_intro_song::
|
||||
;ld hl,#INTRO_START
|
||||
xor a
|
||||
call PLY_AKG_INIT
|
||||
ret
|
||||
|
||||
;;
|
||||
;; sf_init_dungeon_song function
|
||||
;; sr_init_dungeon_song function
|
||||
;; input: nothing
|
||||
;; output: nothing
|
||||
;;
|
||||
_sf_init_dungeon_song::
|
||||
_sr_init_dungeon_song::
|
||||
;ld hl,#DUNGEON_START
|
||||
xor a
|
||||
call PLY_AKG_INIT
|
||||
ret
|
||||
|
||||
;;
|
||||
;; sf_init_song function
|
||||
;; sr_init_song function
|
||||
;; input: nothing
|
||||
;; output: nothing
|
||||
;;
|
||||
_sf_init_battle_song::
|
||||
_sr_init_battle_song::
|
||||
ld hl,#BATTLE_START
|
||||
xor a
|
||||
call PLY_AKG_INIT
|
||||
ret
|
||||
|
||||
;;
|
||||
;; sf_play_song function
|
||||
;; sr_play_song function
|
||||
;; input: nothing
|
||||
;; output: nothing
|
||||
;;
|
||||
_sf_play_song::
|
||||
_sr_play_song::
|
||||
;Play one frame of the song.
|
||||
call PLY_AKG_PLAY
|
||||
ret
|
||||
|
||||
45
src/creationscr.c
Normal file
45
src/creationscr.c
Normal file
@@ -0,0 +1,45 @@
|
||||
//------------------------------------------------------------------
|
||||
// Star Rangers - A Dungeon Crawler for MSX2 using Fusion-C
|
||||
//------------------------------------------------------------------
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "fusion-c/header/msx_fusion.h"
|
||||
#include "fusion-c/header/vdp_sprites.h"
|
||||
#include "fusion-c/header/vdp_graph2.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "font.h"
|
||||
#include "gfx.h"
|
||||
#include "creationscr.h"
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Functions.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void sr_draw_creationscr_intro_text(void)
|
||||
{
|
||||
// Switch to 212 vertical lines.
|
||||
sr_set_screen_height(SH_212);
|
||||
|
||||
sr_set_drawing_state(Begin);
|
||||
|
||||
Cls();
|
||||
SetColors(0, 0, 14);
|
||||
|
||||
sr_draw_text("PRESS SPACE KEY", 8*8, 8*18, 15, 14);
|
||||
sr_draw_text("@1987 SAFFRON SOFT", 8*7, 8*20, 15, 14);
|
||||
|
||||
sr_set_drawing_state(WaitingForVDP);
|
||||
}
|
||||
|
||||
void sr_set_creationscr_state(void)
|
||||
{
|
||||
sr_draw_creationscr_intro_text();
|
||||
}
|
||||
|
||||
void sr_update_creationscr_state(void)
|
||||
{
|
||||
}
|
||||
@@ -2,8 +2,8 @@
|
||||
// Star Rangers - A Dungeon Crawler for MSX2 using Fusion-C
|
||||
//------------------------------------------------------------------
|
||||
|
||||
#ifndef STARTSCREEN_H
|
||||
#define STARTSCREEN_H
|
||||
#ifndef CREATIONSCR_H
|
||||
#define CREATIONSCR_H
|
||||
|
||||
#include "main.h"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
// Prototypes.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void sf_set_startscreen_state(void);
|
||||
void sf_update_startscreen_state(void);
|
||||
void sr_set_creationscr_state(void);
|
||||
void sr_update_creationscr_state(void);
|
||||
|
||||
#endif
|
||||
195
src/dungeon.c
195
src/dungeon.c
@@ -42,115 +42,115 @@ uchar joy;
|
||||
// Functions.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void sf_draw_third_wall_far_left()
|
||||
void sr_draw_third_wall_far_left()
|
||||
{
|
||||
sf_screen_copy(THIRD_WALL_FAR_LEFT_X, THIRD_WALL_FAR_LEFT_Y,
|
||||
sr_screen_copy(THIRD_WALL_FAR_LEFT_X, THIRD_WALL_FAR_LEFT_Y,
|
||||
THIRD_WALL_FAR_DX, THIRD_WALL_FAR_DY,
|
||||
DUNGEON_SCREEN_X,
|
||||
DUNGEON_SCREEN_Y + ((DUNGEON_SCREEN_DY - THIRD_WALL_FAR_DY) * 0.5),
|
||||
WALLS_PAGE, active_page, LOGICAL_TIMP);
|
||||
}
|
||||
|
||||
void sf_draw_third_wall_far_right_fully()
|
||||
void sr_draw_third_wall_far_right_fully()
|
||||
{
|
||||
sf_screen_copy(THIRD_WALL_FAR_RIGHT_X, THIRD_WALL_FAR_RIGHT_Y,
|
||||
sr_screen_copy(THIRD_WALL_FAR_RIGHT_X, THIRD_WALL_FAR_RIGHT_Y,
|
||||
THIRD_WALL_FAR_DX, THIRD_WALL_FAR_DY,
|
||||
DUNGEON_SCREEN_X + DUNGEON_SCREEN_DX - THIRD_WALL_FAR_DX,
|
||||
DUNGEON_SCREEN_Y + ((DUNGEON_SCREEN_DY - THIRD_WALL_FAR_DY) * 0.5),
|
||||
WALLS_PAGE, active_page, LOGICAL_TIMP);
|
||||
}
|
||||
|
||||
void sf_draw_third_wall_far_right_partly()
|
||||
void sr_draw_third_wall_far_right_partly()
|
||||
{
|
||||
sf_screen_copy(THIRD_WALL_FAR_RIGHT_X, THIRD_WALL_FAR_RIGHT_Y,
|
||||
sr_screen_copy(THIRD_WALL_FAR_RIGHT_X, THIRD_WALL_FAR_RIGHT_Y,
|
||||
10, THIRD_WALL_FAR_DY,
|
||||
DUNGEON_SCREEN_X + DUNGEON_SCREEN_DX - THIRD_WALL_FAR_DX,
|
||||
DUNGEON_SCREEN_Y + ((DUNGEON_SCREEN_DY - THIRD_WALL_FAR_DY) * 0.5),
|
||||
WALLS_PAGE, active_page, LOGICAL_TIMP);
|
||||
}
|
||||
|
||||
void sf_draw_third_wall_left()
|
||||
void sr_draw_third_wall_left()
|
||||
{
|
||||
sf_screen_copy(THIRD_WALL_LEFT_X, THIRD_WALL_LEFT_Y,
|
||||
sr_screen_copy(THIRD_WALL_LEFT_X, THIRD_WALL_LEFT_Y,
|
||||
THIRD_WALL_DX, THIRD_WALL_DY,
|
||||
DUNGEON_SCREEN_X + THIRD_WALL_OFFSET_X,
|
||||
DUNGEON_SCREEN_Y + ((DUNGEON_SCREEN_DY - THIRD_WALL_DY) * 0.5),
|
||||
WALLS_PAGE, active_page, LOGICAL_TIMP);
|
||||
}
|
||||
|
||||
void sf_draw_third_wall_right()
|
||||
void sr_draw_third_wall_right()
|
||||
{
|
||||
sf_screen_copy(THIRD_WALL_RIGHT_X, THIRD_WALL_RIGHT_Y,
|
||||
sr_screen_copy(THIRD_WALL_RIGHT_X, THIRD_WALL_RIGHT_Y,
|
||||
THIRD_WALL_DX, THIRD_WALL_DY,
|
||||
DUNGEON_SCREEN_X + DUNGEON_SCREEN_DX - THIRD_WALL_DX - THIRD_WALL_OFFSET_X,
|
||||
DUNGEON_SCREEN_Y + ((DUNGEON_SCREEN_DY - THIRD_WALL_DY) * 0.5),
|
||||
WALLS_PAGE, active_page, LOGICAL_TIMP);
|
||||
}
|
||||
|
||||
void sf_draw_second_wall_far_left()
|
||||
void sr_draw_second_wall_far_left()
|
||||
{
|
||||
sf_screen_copy(SECOND_WALL_FAR_LEFT_X, SECOND_WALL_FAR_LEFT_Y,
|
||||
sr_screen_copy(SECOND_WALL_FAR_LEFT_X, SECOND_WALL_FAR_LEFT_Y,
|
||||
SECOND_WALL_FAR_DX, SECOND_WALL_FAR_DY,
|
||||
DUNGEON_SCREEN_X,
|
||||
DUNGEON_SCREEN_Y + ((DUNGEON_SCREEN_DY - SECOND_WALL_FAR_DY) * 0.5),
|
||||
WALLS_PAGE, active_page, LOGICAL_TIMP);
|
||||
}
|
||||
|
||||
void sf_draw_second_wall_far_right()
|
||||
void sr_draw_second_wall_far_right()
|
||||
{
|
||||
sf_screen_copy(SECOND_WALL_FAR_RIGHT_X, SECOND_WALL_FAR_RIGHT_Y,
|
||||
sr_screen_copy(SECOND_WALL_FAR_RIGHT_X, SECOND_WALL_FAR_RIGHT_Y,
|
||||
SECOND_WALL_FAR_DX, SECOND_WALL_FAR_DY,
|
||||
DUNGEON_SCREEN_X + DUNGEON_SCREEN_DX - SECOND_WALL_FAR_DX,
|
||||
DUNGEON_SCREEN_Y + ((DUNGEON_SCREEN_DY - SECOND_WALL_FAR_DY) * 0.5),
|
||||
WALLS_PAGE, active_page, LOGICAL_TIMP);
|
||||
}
|
||||
|
||||
void sf_draw_second_wall_left()
|
||||
void sr_draw_second_wall_left()
|
||||
{
|
||||
sf_screen_copy(SECOND_WALL_LEFT_X, SECOND_WALL_LEFT_Y,
|
||||
sr_screen_copy(SECOND_WALL_LEFT_X, SECOND_WALL_LEFT_Y,
|
||||
SECOND_WALL_DX, SECOND_WALL_DY,
|
||||
DUNGEON_SCREEN_X,
|
||||
DUNGEON_SCREEN_Y + ((DUNGEON_SCREEN_DY - SECOND_WALL_DY) * 0.5),
|
||||
WALLS_PAGE, active_page, LOGICAL_TIMP);
|
||||
}
|
||||
|
||||
void sf_draw_second_wall_right()
|
||||
void sr_draw_second_wall_right()
|
||||
{
|
||||
sf_screen_copy(SECOND_WALL_RIGHT_X, SECOND_WALL_RIGHT_Y,
|
||||
sr_screen_copy(SECOND_WALL_RIGHT_X, SECOND_WALL_RIGHT_Y,
|
||||
SECOND_WALL_DX, SECOND_WALL_DY,
|
||||
DUNGEON_SCREEN_X + DUNGEON_SCREEN_DX - SECOND_WALL_DX,
|
||||
DUNGEON_SCREEN_Y + ((DUNGEON_SCREEN_DY - SECOND_WALL_DY) * 0.5),
|
||||
WALLS_PAGE, active_page, LOGICAL_TIMP);
|
||||
}
|
||||
|
||||
void sf_draw_first_wall_left()
|
||||
void sr_draw_first_wall_left()
|
||||
{
|
||||
sf_screen_copy(FIRST_WALL_LEFT_X, FIRST_WALL_LEFT_Y,
|
||||
sr_screen_copy(FIRST_WALL_LEFT_X, FIRST_WALL_LEFT_Y,
|
||||
FIRST_WALL_DX, FIRST_WALL_DY,
|
||||
DUNGEON_SCREEN_X, DUNGEON_SCREEN_Y,
|
||||
WALLS_PAGE, active_page, LOGICAL_TIMP);
|
||||
}
|
||||
|
||||
void sf_draw_first_wall_right()
|
||||
void sr_draw_first_wall_right()
|
||||
{
|
||||
sf_screen_copy(FIRST_WALL_RIGHT_X, FIRST_WALL_RIGHT_Y,
|
||||
sr_screen_copy(FIRST_WALL_RIGHT_X, FIRST_WALL_RIGHT_Y,
|
||||
FIRST_WALL_DX, FIRST_WALL_DY,
|
||||
DUNGEON_SCREEN_X + DUNGEON_SCREEN_DX - FIRST_WALL_DX, DUNGEON_SCREEN_Y,
|
||||
WALLS_PAGE, active_page, LOGICAL_TIMP);
|
||||
}
|
||||
|
||||
void sf_draw_third_wall_front()
|
||||
void sr_draw_third_wall_front()
|
||||
{
|
||||
sf_screen_copy(THIRD_FRONT_WALL_X, THIRD_FRONT_WALL_Y,
|
||||
sr_screen_copy(THIRD_FRONT_WALL_X, THIRD_FRONT_WALL_Y,
|
||||
THIRD_FRONT_WALL_DX, THIRD_FRONT_WALL_DY,
|
||||
DUNGEON_SCREEN_X + ((DUNGEON_SCREEN_DX - THIRD_FRONT_WALL_DX) * 0.5),
|
||||
DUNGEON_SCREEN_Y + ((DUNGEON_SCREEN_DY - THIRD_FRONT_WALL_DY) * 0.5),
|
||||
WALLS_PAGE, active_page, LOGICAL_IMP);
|
||||
}
|
||||
|
||||
void sf_draw_second_wall_front()
|
||||
void sr_draw_second_wall_front()
|
||||
{
|
||||
sf_screen_copy(SECOND_FRONT_WALL_X, SECOND_FRONT_WALL_Y,
|
||||
sr_screen_copy(SECOND_FRONT_WALL_X, SECOND_FRONT_WALL_Y,
|
||||
SECOND_FRONT_WALL_DX, SECOND_FRONT_WALL_DY,
|
||||
DUNGEON_SCREEN_X + ((DUNGEON_SCREEN_DX - SECOND_FRONT_WALL_DX) * 0.5),
|
||||
DUNGEON_SCREEN_Y + ((DUNGEON_SCREEN_DY - SECOND_FRONT_WALL_DY) * 0.5),
|
||||
@@ -165,7 +165,7 @@ void sf_draw_second_wall_front()
|
||||
* x o x
|
||||
*
|
||||
*/
|
||||
void sf_update_fp_view(void)
|
||||
void sr_update_fp_view(void)
|
||||
{
|
||||
uint x, y, distx, disty;
|
||||
|
||||
@@ -203,83 +203,83 @@ void sf_update_fp_view(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sf_draw_fp_view(void)
|
||||
void sr_draw_fp_view(void)
|
||||
{
|
||||
// Front walls.
|
||||
if (current_view[7] == TILE_WALL)
|
||||
{
|
||||
sf_draw_second_wall_front();
|
||||
sr_draw_second_wall_front();
|
||||
}
|
||||
else if (current_view[2] == TILE_WALL)
|
||||
{
|
||||
sf_draw_third_wall_front();
|
||||
sr_draw_third_wall_front();
|
||||
}
|
||||
|
||||
if (current_view[1 + DUNGEON_VIEW_DX * 2] == TILE_WALL)
|
||||
{
|
||||
sf_draw_first_wall_left();
|
||||
sr_draw_first_wall_left();
|
||||
}
|
||||
|
||||
if (current_view[3 + DUNGEON_VIEW_DX * 2 ] == TILE_WALL)
|
||||
{
|
||||
sf_draw_first_wall_right();
|
||||
sr_draw_first_wall_right();
|
||||
}
|
||||
|
||||
if (current_view[1 + DUNGEON_VIEW_DX] == TILE_WALL)
|
||||
{
|
||||
sf_draw_second_wall_left();
|
||||
sr_draw_second_wall_left();
|
||||
}
|
||||
|
||||
if (current_view[3 + DUNGEON_VIEW_DX] == TILE_WALL)
|
||||
{
|
||||
sf_draw_second_wall_right();
|
||||
sr_draw_second_wall_right();
|
||||
}
|
||||
|
||||
if (current_view[0 + DUNGEON_VIEW_DX] == TILE_WALL &&
|
||||
current_view[1 + DUNGEON_VIEW_DX * 2] != TILE_WALL)
|
||||
{
|
||||
sf_draw_second_wall_far_left();
|
||||
sr_draw_second_wall_far_left();
|
||||
}
|
||||
|
||||
if (current_view[4 + DUNGEON_VIEW_DX] == TILE_WALL &&
|
||||
current_view[1 + DUNGEON_VIEW_DX * 2] != TILE_WALL)
|
||||
{
|
||||
sf_draw_second_wall_far_right();
|
||||
sr_draw_second_wall_far_right();
|
||||
}
|
||||
|
||||
if (current_view[1] == TILE_WALL &&
|
||||
(current_view[7] != TILE_WALL && current_view[1 + DUNGEON_VIEW_DX * 2] != TILE_WALL))
|
||||
{
|
||||
sf_draw_third_wall_left();
|
||||
sr_draw_third_wall_left();
|
||||
}
|
||||
|
||||
if (current_view[3] == TILE_WALL &&
|
||||
(current_view[7] != TILE_WALL && current_view[3 + DUNGEON_VIEW_DX * 2 ] != TILE_WALL))
|
||||
{
|
||||
sf_draw_third_wall_right();
|
||||
sr_draw_third_wall_right();
|
||||
}
|
||||
|
||||
if (current_view[0] == TILE_WALL &&
|
||||
current_view[1 + DUNGEON_VIEW_DX * 2] != TILE_WALL)
|
||||
{
|
||||
sf_draw_third_wall_far_left();
|
||||
sr_draw_third_wall_far_left();
|
||||
}
|
||||
|
||||
if (current_view[4] == TILE_WALL &&
|
||||
current_view[3 + DUNGEON_VIEW_DX * 2 ] != TILE_WALL)
|
||||
{
|
||||
sf_draw_third_wall_far_right_fully();
|
||||
sr_draw_third_wall_far_right_fully();
|
||||
}
|
||||
}
|
||||
|
||||
void sf_draw_tiles_screen_background(void)
|
||||
void sr_draw_tiles_screen_background(void)
|
||||
{
|
||||
// Draw tiled background.
|
||||
for (uint x = 0; x < 11; x++)
|
||||
{
|
||||
for (uint y = 0; y < 8; y++)
|
||||
{
|
||||
sf_screen_copy(232, 188,
|
||||
sr_screen_copy(232, 188,
|
||||
24, 24,
|
||||
x * 24, y * 24,
|
||||
SPRITES_PAGE, active_page, opHMMM);
|
||||
@@ -292,25 +292,25 @@ void sf_draw_tiles_screen_background(void)
|
||||
0, 0);
|
||||
}
|
||||
|
||||
void sf_draw_portraits(void)
|
||||
void sr_draw_portraits(void)
|
||||
{
|
||||
// Names.
|
||||
sf_draw_text("E.Ilba", PORTRAIT_1_NAME_X, PORTRAIT_1_NAME_Y, 15, 0);
|
||||
sf_draw_text("Echo", PORTRAIT_2_NAME_X, PORTRAIT_2_NAME_Y, 15, 0);
|
||||
sf_draw_text("Lisbeth", PORTRAIT_2_NAME_X, PORTRAIT_3_NAME_Y, 6, 0);
|
||||
sr_draw_text("E.Ilba", PORTRAIT_1_NAME_X, PORTRAIT_1_NAME_Y, 15, 0);
|
||||
sr_draw_text("Echo", PORTRAIT_2_NAME_X, PORTRAIT_2_NAME_Y, 15, 0);
|
||||
sr_draw_text("Lisbeth", PORTRAIT_2_NAME_X, PORTRAIT_3_NAME_Y, 6, 0);
|
||||
|
||||
// Portraits.
|
||||
sf_screen_copy(PORTRAIT_SRC_X, PORTRAIT_SRC_Y,
|
||||
sr_screen_copy(PORTRAIT_SRC_X, PORTRAIT_SRC_Y,
|
||||
PORTRAIT_SIZE, PORTRAIT_SIZE,
|
||||
PORTRAIT_1_X, PORTRAIT_1_Y,
|
||||
SPRITES_PAGE, active_page, opHMMM);
|
||||
|
||||
sf_screen_copy(PORTRAIT_SRC_X + PORTRAIT_SIZE, PORTRAIT_SRC_Y,
|
||||
sr_screen_copy(PORTRAIT_SRC_X + PORTRAIT_SIZE, PORTRAIT_SRC_Y,
|
||||
PORTRAIT_SIZE, PORTRAIT_SIZE,
|
||||
PORTRAIT_2_X, PORTRAIT_2_Y,
|
||||
SPRITES_PAGE, active_page, opHMMM);
|
||||
|
||||
sf_screen_copy(PORTRAIT_SRC_X + PORTRAIT_SIZE + PORTRAIT_SIZE, PORTRAIT_SRC_Y,
|
||||
sr_screen_copy(PORTRAIT_SRC_X + PORTRAIT_SIZE + PORTRAIT_SIZE, PORTRAIT_SRC_Y,
|
||||
PORTRAIT_SIZE, PORTRAIT_SIZE,
|
||||
PORTRAIT_3_X, PORTRAIT_3_Y,
|
||||
SPRITES_PAGE, active_page, opHMMM);
|
||||
@@ -324,7 +324,7 @@ void sf_draw_portraits(void)
|
||||
HP_BAR_SIZE_X, HP_BAR_SIZE_Y, 11, 0);
|
||||
}
|
||||
|
||||
void sf_debug_draw_test_menu(void)
|
||||
void sr_debug_draw_test_menu(void)
|
||||
{
|
||||
// #WIP
|
||||
|
||||
@@ -340,19 +340,19 @@ void sf_debug_draw_test_menu(void)
|
||||
//"Back"
|
||||
|
||||
uint menu_y = MENU_Y + MENU_Y_SPACE;
|
||||
sf_draw_text("*Attack", MENU_X, menu_y, MENU_TEXT_SELECT_COLOR, 0);
|
||||
sr_draw_text("*Attack", MENU_X, menu_y, MENU_TEXT_SELECT_COLOR, 0);
|
||||
|
||||
menu_y += FONT_SIZE + MENU_Y_SPACE;
|
||||
sf_draw_text(" Streams", MENU_X, menu_y, MENU_TEXT_DEFAULT_COLOR, 0);
|
||||
sr_draw_text(" Streams", MENU_X, menu_y, MENU_TEXT_DEFAULT_COLOR, 0);
|
||||
|
||||
menu_y += FONT_SIZE + MENU_Y_SPACE;
|
||||
sf_draw_text(" Equip", MENU_X, menu_y, MENU_TEXT_DEFAULT_COLOR, 0);
|
||||
sr_draw_text(" Equip", MENU_X, menu_y, MENU_TEXT_DEFAULT_COLOR, 0);
|
||||
|
||||
menu_y += FONT_SIZE + MENU_Y_SPACE;
|
||||
sf_draw_text(" Flee", MENU_X, menu_y, MENU_TEXT_DEFAULT_COLOR, 0);
|
||||
sr_draw_text(" Flee", MENU_X, menu_y, MENU_TEXT_DEFAULT_COLOR, 0);
|
||||
}
|
||||
|
||||
void sf_debug_draw_minimap(void)
|
||||
void sr_debug_draw_minimap(void)
|
||||
{
|
||||
for (uint x = 0; x < DUNGEON_SIZE; x++)
|
||||
{
|
||||
@@ -383,32 +383,32 @@ void sf_debug_draw_minimap(void)
|
||||
}
|
||||
|
||||
// Draw the current dungeon room.
|
||||
void sf_draw_dungeon_screen(void)
|
||||
void sr_draw_dungeon_screen(void)
|
||||
{
|
||||
sf_set_drawing_state(Begin);
|
||||
sr_set_drawing_state(Begin);
|
||||
|
||||
// Screen background test.
|
||||
sf_draw_tiles_screen_background();
|
||||
sr_draw_tiles_screen_background();
|
||||
|
||||
// #WIP test menu.
|
||||
sf_debug_draw_test_menu();
|
||||
sr_debug_draw_test_menu();
|
||||
|
||||
// Debug: Minimap.
|
||||
sf_debug_draw_minimap();
|
||||
sr_debug_draw_minimap();
|
||||
|
||||
// Debug: Palette.
|
||||
sf_debug_draw_palette();
|
||||
sr_debug_draw_palette();
|
||||
|
||||
// Party portraits.
|
||||
sf_draw_portraits();
|
||||
sr_draw_portraits();
|
||||
|
||||
// Compass.
|
||||
switch(player_dir)
|
||||
{
|
||||
case North: sf_draw_text("N", COMPASS_X, COMPASS_Y, 9, 0); break;
|
||||
case East: sf_draw_text("E", COMPASS_X, COMPASS_Y, 9, 0); break;
|
||||
case South: sf_draw_text("S", COMPASS_X, COMPASS_Y, 9, 0); break;
|
||||
case West: sf_draw_text("W", COMPASS_X, COMPASS_Y, 9, 0); break;
|
||||
case North: sr_draw_text("N", COMPASS_X, COMPASS_Y, 9, 0); break;
|
||||
case East: sr_draw_text("E", COMPASS_X, COMPASS_Y, 9, 0); break;
|
||||
case South: sr_draw_text("S", COMPASS_X, COMPASS_Y, 9, 0); break;
|
||||
case West: sr_draw_text("W", COMPASS_X, COMPASS_Y, 9, 0); break;
|
||||
}
|
||||
|
||||
// #WIP: Draw a different floor in odd tiles to create ilusion of movement.
|
||||
@@ -421,13 +421,13 @@ void sf_draw_dungeon_screen(void)
|
||||
if (ceiling_tile == 1)
|
||||
{
|
||||
// Draw Standard background minus the floor.
|
||||
sf_screen_copy(0, 0,
|
||||
sr_screen_copy(0, 0,
|
||||
DUNGEON_SCREEN_DX, DUNGEON_SCREEN_DY - 22,
|
||||
DUNGEON_SCREEN_X, DUNGEON_SCREEN_Y,
|
||||
SPRITES_PAGE, active_page, opHMMM);
|
||||
|
||||
// Draw alternate floor.
|
||||
sf_screen_copy(0, 120,
|
||||
sr_screen_copy(0, 120,
|
||||
DUNGEON_SCREEN_DX, 22,
|
||||
DUNGEON_SCREEN_X, DUNGEON_SCREEN_Y + 98,
|
||||
SPRITES_PAGE, active_page, opHMMM);
|
||||
@@ -435,34 +435,34 @@ void sf_draw_dungeon_screen(void)
|
||||
else
|
||||
{
|
||||
// Draw standard background in full.
|
||||
sf_screen_copy(0, 0,
|
||||
sr_screen_copy(0, 0,
|
||||
DUNGEON_SCREEN_DX, DUNGEON_SCREEN_DY,
|
||||
DUNGEON_SCREEN_X, DUNGEON_SCREEN_Y,
|
||||
SPRITES_PAGE, active_page, opHMMM);
|
||||
}
|
||||
|
||||
// Dungeon first person view.
|
||||
sf_update_fp_view();
|
||||
sf_draw_fp_view();
|
||||
sr_update_fp_view();
|
||||
sr_draw_fp_view();
|
||||
|
||||
// #WIP Enemies.
|
||||
//sf_screen_copy(160,32, 55,64, 60,60, SPRITES_PAGE, active_page, LOGICAL_TIMP);
|
||||
//sf_screen_copy(169,55, 32,32, 100,110, SPRITES_PAGE, active_page, LOGICAL_TIMP);
|
||||
//sr_screen_copy(160,32, 55,64, 60,60, SPRITES_PAGE, active_page, LOGICAL_TIMP);
|
||||
//sr_screen_copy(169,55, 32,32, 100,110, SPRITES_PAGE, active_page, LOGICAL_TIMP);
|
||||
|
||||
// #WIP test encounter RNG.
|
||||
if(sf_check_encounter() == TRUE)
|
||||
if(sr_check_encounter() == TRUE)
|
||||
{
|
||||
sf_draw_text("ENCOUNTER!", 0, 0, 9, 0);
|
||||
sr_draw_text("ENCOUNTER!", 0, 0, 9, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
sf_draw_text("NOTHING ", 0, 0, 5, 0);
|
||||
sr_draw_text("NOTHING ", 0, 0, 5, 0);
|
||||
}
|
||||
|
||||
sf_set_drawing_state(WaitingForVDP);
|
||||
sr_set_drawing_state(WaitingForVDP);
|
||||
}
|
||||
|
||||
void sf_move(uint newPosX, uint newPosY)
|
||||
void sr_move(uint newPosX, uint newPosY)
|
||||
{
|
||||
if (newPosX < DUNGEON_SIZE - 1 &&
|
||||
newPosY < DUNGEON_SIZE - 1 &&
|
||||
@@ -474,11 +474,11 @@ void sf_move(uint newPosX, uint newPosY)
|
||||
|
||||
player_moves = TRUE;
|
||||
|
||||
sf_encounter_step();
|
||||
sr_encounter_step();
|
||||
}
|
||||
}
|
||||
|
||||
void sf_rotate_left(void)
|
||||
void sr_rotate_left(void)
|
||||
{
|
||||
if (--player_dir < North)
|
||||
{
|
||||
@@ -488,7 +488,7 @@ void sf_rotate_left(void)
|
||||
player_turns = TRUE;
|
||||
}
|
||||
|
||||
void sf_rotate_right(void)
|
||||
void sr_rotate_right(void)
|
||||
{
|
||||
if (++player_dir > West)
|
||||
{
|
||||
@@ -499,7 +499,7 @@ void sf_rotate_right(void)
|
||||
}
|
||||
|
||||
// Reads input from keyboard's arrow keys and joystick port 1.
|
||||
void sf_update_input_dungeon_mode(void)
|
||||
void sr_update_input_dungeon_mode(void)
|
||||
{
|
||||
// Cursor.
|
||||
for (uchar i = 0; i < 2; i++)
|
||||
@@ -509,21 +509,21 @@ void sf_update_input_dungeon_mode(void)
|
||||
switch (joy)
|
||||
{
|
||||
case UP:
|
||||
sf_move(player_pos_x + dir_translate_x[player_dir],
|
||||
sr_move(player_pos_x + dir_translate_x[player_dir],
|
||||
player_pos_y + dir_translate_y[player_dir]);
|
||||
break;
|
||||
|
||||
case DOWN:
|
||||
sf_move(player_pos_x - dir_translate_x[player_dir],
|
||||
sr_move(player_pos_x - dir_translate_x[player_dir],
|
||||
player_pos_y - dir_translate_y[player_dir]);
|
||||
break;
|
||||
|
||||
case LEFT:
|
||||
sf_rotate_left();
|
||||
sr_rotate_left();
|
||||
break;
|
||||
|
||||
case RIGHT:
|
||||
sf_rotate_right();
|
||||
sr_rotate_right();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -532,48 +532,51 @@ void sf_update_input_dungeon_mode(void)
|
||||
if (TriggerRead(JOY1_BUTTONB) == PRESSED ||
|
||||
TriggerRead(SPACEBAR) == PRESSED )
|
||||
{
|
||||
if (sf_is_generating_dungeon() == FALSE)
|
||||
if (sr_is_generating_dungeon() == FALSE)
|
||||
{
|
||||
sf_generate_dungeon();
|
||||
sr_generate_dungeon();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sf_set_dungeon_state(void)
|
||||
void sr_set_dungeon_state(void)
|
||||
{
|
||||
// Initialize variables.
|
||||
player_moves = FALSE;
|
||||
player_turns = FALSE;
|
||||
ceiling_tile = 0;
|
||||
|
||||
// Switch to 192 vertical lines (for speed gain).
|
||||
sr_set_screen_height(SH_192);
|
||||
|
||||
// This may be set by the random generator in the future?
|
||||
player_dir = North;
|
||||
|
||||
// Generate dungeon.
|
||||
SetColors(0,0,0);
|
||||
Cls();
|
||||
sf_draw_text("Entering the Undercity...", 8, 8, 15, 0);
|
||||
sr_draw_text("Entering the Undercity...", 8, 8, 15, 0);
|
||||
dungeon_map = NULL;
|
||||
sf_generate_dungeon();
|
||||
sr_generate_dungeon();
|
||||
|
||||
// Initialize encounter logic.
|
||||
sf_init_encounter();
|
||||
sr_init_encounter();
|
||||
|
||||
// Initial draw call.
|
||||
Cls();
|
||||
sf_draw_dungeon_screen();
|
||||
sr_draw_dungeon_screen();
|
||||
}
|
||||
|
||||
void sf_update_dungeon_state(void)
|
||||
void sr_update_dungeon_state(void)
|
||||
{
|
||||
// Update input and dungeon view in different cycles.
|
||||
if (player_moves == FALSE && player_turns == FALSE)
|
||||
{
|
||||
sf_update_input_dungeon_mode();
|
||||
sr_update_input_dungeon_mode();
|
||||
}
|
||||
else
|
||||
{
|
||||
sf_draw_dungeon_screen();
|
||||
sr_draw_dungeon_screen();
|
||||
|
||||
// Reset variables.
|
||||
player_moves = FALSE;
|
||||
|
||||
@@ -145,7 +145,7 @@ extern uchar *dungeon_map;
|
||||
// Prototypes.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void sf_set_dungeon_state(void);
|
||||
void sf_update_dungeon_state(void);
|
||||
void sr_set_dungeon_state(void);
|
||||
void sr_update_dungeon_state(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -49,18 +49,18 @@ uchar current_threshold;
|
||||
// Functions.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void sf_init_encounter(void)
|
||||
void sr_init_encounter(void)
|
||||
{
|
||||
current_step = 0;
|
||||
current_threshold = 10;
|
||||
}
|
||||
|
||||
void sf_encounter_step(void)
|
||||
void sr_encounter_step(void)
|
||||
{
|
||||
current_step++;
|
||||
}
|
||||
|
||||
BOOL sf_check_encounter(void)
|
||||
BOOL sr_check_encounter(void)
|
||||
{
|
||||
return (encounter_table[current_step] < current_threshold);
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
// Prototypes.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void sf_init_encounter(void);
|
||||
void sf_encounter_step(void);
|
||||
BOOL sf_check_encounter(void);
|
||||
void sr_init_encounter(void);
|
||||
void sr_encounter_step(void);
|
||||
BOOL sr_check_encounter(void);
|
||||
|
||||
#endif
|
||||
|
||||
166
src/font.c
166
src/font.c
@@ -178,94 +178,94 @@
|
||||
// Functions.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void sf_draw_char(uchar character, uint x, uint y, uchar log_op)
|
||||
void sr_draw_char(uchar character, uint x, uint y, uchar log_op)
|
||||
{
|
||||
switch (character)
|
||||
{
|
||||
case 'a': sf_screen_copy(lax,lay, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'b': sf_screen_copy(lbx,lby, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'c': sf_screen_copy(lcx,lcy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'd': sf_screen_copy(ldx,ldy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'e': sf_screen_copy(lex,ley, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'f': sf_screen_copy(lfx,lfy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'g': sf_screen_copy(lgx,lgy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'h': sf_screen_copy(lhx,lhy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'i': sf_screen_copy(lix,liy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'j': sf_screen_copy(ljx,ljy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'k': sf_screen_copy(lkx,lky, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'l': sf_screen_copy(llx,lly, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'm': sf_screen_copy(lmx,lmy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'n': sf_screen_copy(lnx,lny, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'o': sf_screen_copy(lox,loy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'p': sf_screen_copy(lpx,lpy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'q': sf_screen_copy(lqx,lqy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'r': sf_screen_copy(lrx,lry, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 's': sf_screen_copy(lsx,lsy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 't': sf_screen_copy(ltx,lty, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'u': sf_screen_copy(lux,luy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'v': sf_screen_copy(lvx,lvy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'w': sf_screen_copy(lwx,lwy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'x': sf_screen_copy(lxx,lxy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'y': sf_screen_copy(lyx,lyy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'z': sf_screen_copy(lzx,lzy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'a': sr_screen_copy(lax,lay, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'b': sr_screen_copy(lbx,lby, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'c': sr_screen_copy(lcx,lcy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'd': sr_screen_copy(ldx,ldy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'e': sr_screen_copy(lex,ley, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'f': sr_screen_copy(lfx,lfy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'g': sr_screen_copy(lgx,lgy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'h': sr_screen_copy(lhx,lhy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'i': sr_screen_copy(lix,liy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'j': sr_screen_copy(ljx,ljy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'k': sr_screen_copy(lkx,lky, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'l': sr_screen_copy(llx,lly, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'm': sr_screen_copy(lmx,lmy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'n': sr_screen_copy(lnx,lny, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'o': sr_screen_copy(lox,loy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'p': sr_screen_copy(lpx,lpy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'q': sr_screen_copy(lqx,lqy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'r': sr_screen_copy(lrx,lry, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 's': sr_screen_copy(lsx,lsy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 't': sr_screen_copy(ltx,lty, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'u': sr_screen_copy(lux,luy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'v': sr_screen_copy(lvx,lvy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'w': sr_screen_copy(lwx,lwy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'x': sr_screen_copy(lxx,lxy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'y': sr_screen_copy(lyx,lyy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'z': sr_screen_copy(lzx,lzy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
|
||||
case 'A': sf_screen_copy(uax,uay, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'B': sf_screen_copy(ubx,uby, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'C': sf_screen_copy(ucx,ucy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'D': sf_screen_copy(udx,udy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'E': sf_screen_copy(uex,uey, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'F': sf_screen_copy(ufx,ufy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'G': sf_screen_copy(ugx,ugy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'H': sf_screen_copy(uhx,uhy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'I': sf_screen_copy(uix,uiy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'J': sf_screen_copy(ujx,ujy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'K': sf_screen_copy(ukx,uky, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'L': sf_screen_copy(ulx,uly, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'M': sf_screen_copy(umx,umy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'N': sf_screen_copy(unx,uny, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'O': sf_screen_copy(uox,uoy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'P': sf_screen_copy(upx,upy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'Q': sf_screen_copy(uqx,uqy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'R': sf_screen_copy(urx,ury, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'S': sf_screen_copy(usx,usy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'T': sf_screen_copy(utx,uty, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'U': sf_screen_copy(uux,uuy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'V': sf_screen_copy(uvx,uvy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'W': sf_screen_copy(uwx,uwy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'X': sf_screen_copy(uxx,uxy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'Y': sf_screen_copy(uyx,uyy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'Z': sf_screen_copy(uzx,uzy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'A': sr_screen_copy(uax,uay, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'B': sr_screen_copy(ubx,uby, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'C': sr_screen_copy(ucx,ucy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'D': sr_screen_copy(udx,udy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'E': sr_screen_copy(uex,uey, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'F': sr_screen_copy(ufx,ufy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'G': sr_screen_copy(ugx,ugy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'H': sr_screen_copy(uhx,uhy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'I': sr_screen_copy(uix,uiy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'J': sr_screen_copy(ujx,ujy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'K': sr_screen_copy(ukx,uky, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'L': sr_screen_copy(ulx,uly, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'M': sr_screen_copy(umx,umy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'N': sr_screen_copy(unx,uny, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'O': sr_screen_copy(uox,uoy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'P': sr_screen_copy(upx,upy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'Q': sr_screen_copy(uqx,uqy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'R': sr_screen_copy(urx,ury, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'S': sr_screen_copy(usx,usy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'T': sr_screen_copy(utx,uty, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'U': sr_screen_copy(uux,uuy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'V': sr_screen_copy(uvx,uvy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'W': sr_screen_copy(uwx,uwy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'X': sr_screen_copy(uxx,uxy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'Y': sr_screen_copy(uyx,uyy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case 'Z': sr_screen_copy(uzx,uzy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
|
||||
case '0': sf_screen_copy(zerox,zeroy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '1': sf_screen_copy(onex,oney, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '2': sf_screen_copy(twox,twoy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '3': sf_screen_copy(threex,threey, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '4': sf_screen_copy(fourx,foury, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '5': sf_screen_copy(fivex,fivey, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '6': sf_screen_copy(sixx,sixy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '7': sf_screen_copy(sevenx,seveny, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '8': sf_screen_copy(eightx,eighty, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '9': sf_screen_copy(ninex,niney, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '0': sr_screen_copy(zerox,zeroy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '1': sr_screen_copy(onex,oney, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '2': sr_screen_copy(twox,twoy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '3': sr_screen_copy(threex,threey, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '4': sr_screen_copy(fourx,foury, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '5': sr_screen_copy(fivex,fivey, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '6': sr_screen_copy(sixx,sixy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '7': sr_screen_copy(sevenx,seveny, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '8': sr_screen_copy(eightx,eighty, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '9': sr_screen_copy(ninex,niney, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
|
||||
case '.': sf_screen_copy(dotx,doty, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case ',': sf_screen_copy(commax,commay, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '.': sr_screen_copy(dotx,doty, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case ',': sr_screen_copy(commax,commay, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
|
||||
case ' ': sf_screen_copy(spacex,spacey, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '!': sf_screen_copy(exclax,exclay, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '^': sf_screen_copy(heartx,hearty, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '@': sf_screen_copy(copyx,copyy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '*': sf_screen_copy(asteriskx,asterisky, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case ' ': sr_screen_copy(spacex,spacey, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '!': sr_screen_copy(exclax,exclay, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '^': sr_screen_copy(heartx,hearty, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '@': sr_screen_copy(copyx,copyy, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '*': sr_screen_copy(asteriskx,asterisky, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
|
||||
case '<': sf_screen_copy(uplbx,uplby, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '[': sf_screen_copy(dwnlbx,dwnlby, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '_': sf_screen_copy(midbx,midby, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '>': sf_screen_copy(uprbx,uprby, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case ']': sf_screen_copy(dwnrbx,dwnrby, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '|': sf_screen_copy(latbx,latby, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '<': sr_screen_copy(uplbx,uplby, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '[': sr_screen_copy(dwnlbx,dwnlby, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '_': sr_screen_copy(midbx,midby, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '>': sr_screen_copy(uprbx,uprby, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case ']': sr_screen_copy(dwnrbx,dwnrby, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
case '|': sr_screen_copy(latbx,latby, FONT_SIZE,FONT_SIZE, x,y, FONT_PAGE, active_page, log_op); break;
|
||||
}
|
||||
}
|
||||
|
||||
void sf_draw_text(uchar *text, uint x, uint y, uchar text_color, uchar border_color)
|
||||
void sr_draw_text(uchar *text, uint x, uint y, uchar text_color, uchar border_color)
|
||||
{
|
||||
uchar log_op = LOGICAL_IMP;
|
||||
|
||||
@@ -275,27 +275,27 @@ void sf_draw_text(uchar *text, uint x, uint y, uchar text_color, uchar border_co
|
||||
{
|
||||
// Color border.
|
||||
LMMV(x, y + active_page * 256, FONT_SIZE, FONT_SIZE, border_color, LOGICAL_IMP);
|
||||
sf_draw_char(*text, x, y, LOGICAL_TIMP);
|
||||
sr_draw_char(*text, x, y, LOGICAL_TIMP);
|
||||
|
||||
// Only for color text.
|
||||
if (text_color != 0)
|
||||
{
|
||||
LMMV(x, y + active_page * 256, FONT_SIZE, FONT_SIZE, 15-text_color, LOGICAL_IMP);
|
||||
sf_draw_char(*text, x, y, LOGICAL_XOR);
|
||||
sf_draw_char(*text, x, y, LOGICAL_AND);
|
||||
sr_draw_char(*text, x, y, LOGICAL_XOR);
|
||||
sr_draw_char(*text, x, y, LOGICAL_AND);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Transparent border.
|
||||
sf_draw_char(*text, x, y, LOGICAL_IMP);
|
||||
sr_draw_char(*text, x, y, LOGICAL_IMP);
|
||||
|
||||
// Only for color text.
|
||||
if (text_color != 0)
|
||||
{
|
||||
LMMV(x, y + active_page * 256, FONT_SIZE, FONT_SIZE, 15-text_color, LOGICAL_IMP);
|
||||
sf_draw_char(*text, x, y, LOGICAL_XOR);
|
||||
sf_draw_char(*text, x, y, LOGICAL_AND);
|
||||
sr_draw_char(*text, x, y, LOGICAL_XOR);
|
||||
sr_draw_char(*text, x, y, LOGICAL_AND);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,6 @@
|
||||
// Prototypes.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void sf_draw_text(uchar *text, uint x, uint y, uchar text_color, uchar border_color);
|
||||
void sr_draw_text(uchar *text, uint x, uint y, uchar text_color, uchar border_color);
|
||||
|
||||
#endif
|
||||
|
||||
69
src/gfx.c
69
src/gfx.c
@@ -55,25 +55,27 @@ uchar active_page;
|
||||
|
||||
uchar load_buffer[BUFFER_SIZE];
|
||||
|
||||
enum ScreenHeight current_screen_height;
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Functions.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void sf_init_palette(void)
|
||||
void sr_init_palette(void)
|
||||
{
|
||||
SetSC5Palette((Palette *)palette);
|
||||
}
|
||||
|
||||
BOOL sf_load_sf5_image(uchar *file_name, uint initial_y_pos)
|
||||
BOOL sr_load_sf5_image(uchar *file_name, uint initial_y_pos)
|
||||
{
|
||||
uint read = BUFFER_SIZE;
|
||||
uint read_y_length = 0;
|
||||
|
||||
sf_set_name(&file, file_name);
|
||||
sr_set_name(&file, file_name);
|
||||
|
||||
if (fcb_open(&file) != FCB_SUCCESS)
|
||||
{
|
||||
sf_error_handler(1, file_name);
|
||||
sr_error_handler(1, file_name);
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
@@ -102,23 +104,23 @@ BOOL sf_load_sf5_image(uchar *file_name, uint initial_y_pos)
|
||||
// Check for errors.
|
||||
if (fcb_close(&file) != FCB_SUCCESS)
|
||||
{
|
||||
sf_error_handler(2, file_name);
|
||||
sr_error_handler(2, file_name);
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
BOOL sf_load_sc8_image(uchar *file_name, uint initial_y_pos)
|
||||
BOOL sr_load_sc8_image(uchar *file_name, uint initial_y_pos)
|
||||
{
|
||||
uint read = BUFFER_SIZE;
|
||||
uint read_y_length = 0;
|
||||
|
||||
sf_set_name(&file, file_name);
|
||||
sr_set_name(&file, file_name);
|
||||
|
||||
if (fcb_open(&file) != FCB_SUCCESS)
|
||||
{
|
||||
sf_error_handler(1, file_name);
|
||||
sr_error_handler(1, file_name);
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
@@ -149,7 +151,7 @@ BOOL sf_load_sc8_image(uchar *file_name, uint initial_y_pos)
|
||||
// Check for errors.
|
||||
if (fcb_close(&file) != FCB_SUCCESS)
|
||||
{
|
||||
sf_error_handler(2, file_name);
|
||||
sr_error_handler(2, file_name);
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
@@ -164,7 +166,7 @@ BOOL sf_load_sc8_image(uchar *file_name, uint initial_y_pos)
|
||||
// src_pg = Source Page number of the Zone
|
||||
// dst_pg = Destination number of the zone
|
||||
// mode = OP mode of the copy
|
||||
void sf_screen_copy(uint x1, uint y1, uint dx, uint dy, uint x2, uint y2,
|
||||
void sr_screen_copy(uint x1, uint y1, uint dx, uint dy, uint x2, uint y2,
|
||||
uint src_pg, uint dst_pg, uchar mode)
|
||||
{
|
||||
uint src_y = 0;
|
||||
@@ -192,7 +194,7 @@ void sf_screen_copy(uint x1, uint y1, uint dx, uint dy, uint x2, uint y2,
|
||||
fLMMM(&t);
|
||||
}
|
||||
|
||||
void sf_debug_draw_palette(void)
|
||||
void sr_debug_draw_palette(void)
|
||||
{
|
||||
uint x = 0;
|
||||
uint y = 0;
|
||||
@@ -204,40 +206,49 @@ void sf_debug_draw_palette(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sf_switch_screen(void)
|
||||
void sr_switch_screen(void)
|
||||
{
|
||||
if (sf_get_drawing_state() == WaitingForVDP)
|
||||
if (sr_get_drawing_state() == WaitingForVDP)
|
||||
{
|
||||
SetDisplayPage(active_page);
|
||||
|
||||
active_page = !active_page;
|
||||
SetActivePage(active_page);
|
||||
|
||||
sf_set_drawing_state(Finished);
|
||||
sr_set_drawing_state(Finished);
|
||||
}
|
||||
}
|
||||
|
||||
void sf_set_drawing_state(uchar new_state)
|
||||
void sr_set_drawing_state(uchar new_state)
|
||||
{
|
||||
drawing_state = new_state;
|
||||
}
|
||||
|
||||
uchar sf_get_drawing_state(void)
|
||||
uchar sr_get_drawing_state(void)
|
||||
{
|
||||
return drawing_state;
|
||||
}
|
||||
|
||||
void sf_init_gfx(void)
|
||||
void sr_set_screen_height(uchar height)
|
||||
{
|
||||
if (height != current_screen_height)
|
||||
{
|
||||
VDPLinesSwitch();
|
||||
height = current_screen_height;
|
||||
}
|
||||
}
|
||||
|
||||
void sr_init_gfx(void)
|
||||
{
|
||||
// Set variables.
|
||||
current_screen_height = 212;
|
||||
|
||||
// Disable sprites (speed gain).
|
||||
SpriteOff();
|
||||
|
||||
// Sets display to SCREEN 5 mode resolution 256 pixels x 212 lines x 16 colors.
|
||||
Screen(5);
|
||||
|
||||
// Switch from 212 to 192 vertical lines (for speed gain).
|
||||
VDPLinesSwitch();
|
||||
|
||||
// Switches the MSX2 VDP to 60 Hz (it's best to develop/optimize for 60Hz than 50Hz).
|
||||
VDP60Hz();
|
||||
|
||||
@@ -247,29 +258,29 @@ void sf_init_gfx(void)
|
||||
PutText(5, 5, "LOADING...", LOGICAL_TIMP);
|
||||
|
||||
// Load screens.
|
||||
sf_init_palette();
|
||||
sf_load_sf5_image("BG.SF5", SCREEN_WIDTH * SPRITES_PAGE);
|
||||
sf_load_sf5_image("WALLS.SF5", SCREEN_WIDTH * WALLS_PAGE);
|
||||
//sf_load_sf5_image("STRTSCR.SF5", SCREEN_WIDTH * 0);
|
||||
//sf_load_sf5_image("INTRO01.SF5", SCREEN_WIDTH * 0);
|
||||
sr_init_palette();
|
||||
sr_load_sf5_image("BG.SF5", SCREEN_WIDTH * SPRITES_PAGE);
|
||||
sr_load_sf5_image("WALLS.SF5", SCREEN_WIDTH * WALLS_PAGE);
|
||||
//sr_load_sf5_image("STRTSCR.SF5", SCREEN_WIDTH * 0);
|
||||
//sr_load_sf5_image("INTRO01.SF5", SCREEN_WIDTH * 0);
|
||||
|
||||
// Configure pages.
|
||||
sf_set_drawing_state(Finished);
|
||||
sr_set_drawing_state(Finished);
|
||||
active_page = 0;
|
||||
SetDisplayPage(!active_page);
|
||||
SetActivePage(active_page);
|
||||
}
|
||||
|
||||
BOOL sf_update_gfx(void)
|
||||
BOOL sr_update_gfx(void)
|
||||
{
|
||||
// Checking "is ready to switch", VDP is not busy and vsync.
|
||||
// https://www.msx.org/wiki/VDP_Status_Registers
|
||||
if (sf_get_drawing_state() != WaitingForVDP || VDPstatusNi(2) & 0x1 || IsVsync() == 0)
|
||||
if (sr_get_drawing_state() != WaitingForVDP || VDPstatusNi(2) & 0x1 || IsVsync() == 0)
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
sf_switch_screen();
|
||||
sr_switch_screen();
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
27
src/gfx.h
27
src/gfx.h
@@ -25,6 +25,12 @@ enum DrawingState
|
||||
Finished
|
||||
};
|
||||
|
||||
enum ScreenHeight
|
||||
{
|
||||
SH_192,
|
||||
SH_212
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Variables.
|
||||
//------------------------------------------------------------------
|
||||
@@ -35,18 +41,19 @@ extern char active_page;
|
||||
// Prototypes.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void sf_init_palette(void);
|
||||
BOOL sf_load_sf5_image(uchar *file_name, uint start_Y);
|
||||
BOOL sf_load_sc8_image(uchar *file_name, uint start_Y);
|
||||
void sf_screen_copy(uint x1, uint y1, uint dx, uint dy, uint x2, uint y2, uint src_pg, uint dst_pg, uchar mode);
|
||||
void sf_wait(uint cicles);
|
||||
void sf_set_drawing_state(uchar new_state);
|
||||
uchar sf_get_drawing_state(void);
|
||||
void sf_init_gfx(void);
|
||||
BOOL sf_update_gfx(void);
|
||||
void sr_init_palette(void);
|
||||
BOOL sr_load_sf5_image(uchar *file_name, uint start_Y);
|
||||
BOOL sr_load_sc8_image(uchar *file_name, uint start_Y);
|
||||
void sr_screen_copy(uint x1, uint y1, uint dx, uint dy, uint x2, uint y2, uint src_pg, uint dst_pg, uchar mode);
|
||||
void sr_wait(uint cicles);
|
||||
void sr_set_drawing_state(uchar new_state);
|
||||
uchar sr_get_drawing_state(void);
|
||||
void sr_set_screen_height(uchar height);
|
||||
void sr_init_gfx(void);
|
||||
BOOL sr_update_gfx(void);
|
||||
|
||||
// Debug.
|
||||
|
||||
void sf_debug_draw_palette(void);
|
||||
void sr_debug_draw_palette(void);
|
||||
|
||||
#endif
|
||||
|
||||
24
src/intro.c
24
src/intro.c
@@ -15,30 +15,30 @@
|
||||
#include "gfx.h"
|
||||
#include "intro.h"
|
||||
|
||||
void sf_draw_intro_text(void)
|
||||
void sr_draw_intro_text(void)
|
||||
{
|
||||
// Intro text.
|
||||
sf_set_drawing_state(Begin);
|
||||
sr_set_drawing_state(Begin);
|
||||
// Cls();
|
||||
SetColors(0, 0, 14);
|
||||
|
||||
sf_draw_text("Deep in space far away", 8*4, 8*19, 15, 14);
|
||||
sf_draw_text("from the inhabited regions", 8*3, 8*19+9, 15, 14);
|
||||
sf_draw_text("of the galaxy lies a long", 8*3, 8*19+9+9, 15, 14);
|
||||
sf_draw_text("forgotten alien station", 8*3, 8*19+9+9+9, 15, 14);
|
||||
sr_draw_text("Deep in space far away", 8*4, 8*19, 15, 14);
|
||||
sr_draw_text("from the inhabited regions", 8*3, 8*19+9, 15, 14);
|
||||
sr_draw_text("of the galaxy lies a long", 8*3, 8*19+9+9, 15, 14);
|
||||
sr_draw_text("forgotten alien station", 8*3, 8*19+9+9+9, 15, 14);
|
||||
|
||||
sf_set_drawing_state(WaitingForVDP);
|
||||
sf_wait(1000);
|
||||
sr_set_drawing_state(WaitingForVDP);
|
||||
sr_wait(1000);
|
||||
|
||||
// Go to dungeon state.
|
||||
sf_set_game_state(StartScreen);
|
||||
sr_set_game_state(StartScreen);
|
||||
}
|
||||
|
||||
void sf_set_intro_state(void)
|
||||
void sr_set_intro_state(void)
|
||||
{
|
||||
sf_draw_intro_text();
|
||||
sr_draw_intro_text();
|
||||
}
|
||||
|
||||
void sf_update_intro_state(void)
|
||||
void sr_update_intro_state(void)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
// Prototypes.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void sf_set_intro_state(void);
|
||||
void sf_update_intro_state(void);
|
||||
void sr_set_intro_state(void);
|
||||
void sr_update_intro_state(void);
|
||||
|
||||
#endif
|
||||
|
||||
49
src/main.c
49
src/main.c
@@ -8,16 +8,17 @@
|
||||
|
||||
#include "fusion-c/header/msx_fusion.h"
|
||||
|
||||
#include "system.h"
|
||||
#include "encounter.h"
|
||||
#include "creationscr.h"
|
||||
#include "dungeon.h"
|
||||
#include "menu.h"
|
||||
#include "procgen.h"
|
||||
#include "startscreen.h"
|
||||
#include "intro.h"
|
||||
#include "encounter.h"
|
||||
#include "font.h"
|
||||
#include "gfx.h"
|
||||
#include "intro.h"
|
||||
#include "menu.h"
|
||||
#include "procgen.h"
|
||||
#include "snd.h"
|
||||
#include "startscr.h"
|
||||
#include "system.h"
|
||||
#include "main.h"
|
||||
|
||||
//------------------------------------------------------------------
|
||||
@@ -34,49 +35,51 @@ uint rand_seed;
|
||||
// Functions.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void sf_set_game_state(uchar new_state)
|
||||
void sr_set_game_state(uchar new_state)
|
||||
{
|
||||
game_state = new_state;
|
||||
|
||||
switch(game_state)
|
||||
{
|
||||
case StartScreen: sf_set_startscreen_state(); break;
|
||||
case Intro: sf_set_intro_state(); break;
|
||||
case Dungeon: sf_set_dungeon_state(); break;
|
||||
case StartScreen: sr_set_startscr_state(); break;
|
||||
case CreationScreen: sr_set_creationscr_state(); break;
|
||||
case Intro: sr_set_intro_state(); break;
|
||||
case Dungeon: sr_set_dungeon_state(); break;
|
||||
}
|
||||
}
|
||||
|
||||
void sf_update_game_state(void)
|
||||
void sr_update_game_state(void)
|
||||
{
|
||||
// Player input must wait until the next frame is ready.
|
||||
if (sf_get_drawing_state() == Finished)
|
||||
if (sr_get_drawing_state() == Finished)
|
||||
{
|
||||
switch (game_state)
|
||||
{
|
||||
case StartScreen: sf_update_startscreen_state(); break;
|
||||
case Intro: sf_update_intro_state(); break;
|
||||
case Dungeon: sf_update_dungeon_state(); break;
|
||||
case StartScreen: sr_update_startscr_state(); break;
|
||||
case CreationScreen: sr_update_creationscr_state(); break;
|
||||
case Intro: sr_update_intro_state(); break;
|
||||
case Dungeon: sr_update_dungeon_state(); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static uchar sf_interrupt(void)
|
||||
static uchar sr_interrupt(void)
|
||||
{
|
||||
// Update game logic and audio in separate frames to ease the CPU load.
|
||||
update_frame_count = !update_frame_count;
|
||||
if (update_frame_count == 1)
|
||||
{
|
||||
// Update game logic.
|
||||
sf_update_game_state();
|
||||
sr_update_game_state();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Update audio.
|
||||
sf_update_snd();
|
||||
sr_update_snd();
|
||||
}
|
||||
|
||||
// Update video.
|
||||
return sf_update_gfx();
|
||||
return sr_update_gfx();
|
||||
}
|
||||
|
||||
void main(void)
|
||||
@@ -105,17 +108,17 @@ void main(void)
|
||||
InitPSG();
|
||||
|
||||
// Init sound.
|
||||
sf_init_snd();
|
||||
sr_init_snd();
|
||||
|
||||
// Set gfx configuration.
|
||||
sf_init_gfx();
|
||||
sr_init_gfx();
|
||||
|
||||
// Set interrupt.
|
||||
InitInterruptHandler();
|
||||
SetInterruptHandler(sf_interrupt);
|
||||
SetInterruptHandler(sr_interrupt);
|
||||
|
||||
// Set initial game state.
|
||||
sf_set_game_state(Dungeon);
|
||||
sr_set_game_state(CreationScreen);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
|
||||
10
src/main.h
10
src/main.h
@@ -15,8 +15,14 @@ enum GameState
|
||||
{
|
||||
None,
|
||||
StartScreen,
|
||||
CreationScreen,
|
||||
Intro,
|
||||
Dungeon
|
||||
HubCity,
|
||||
Encounter,
|
||||
Dungeon,
|
||||
Camp,
|
||||
CharacterSheet,
|
||||
Shop
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------
|
||||
@@ -29,6 +35,6 @@ extern uchar active_page;
|
||||
// Prototypes.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void sf_set_game_state(uchar new_state);
|
||||
void sr_set_game_state(uchar new_state);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -36,7 +36,7 @@ uchar is_generating_dungeon;
|
||||
// Functions.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
BOOL sf_check_room_valid(uint room_x, uint room_y, uint room_size_x, uint room_size_y)
|
||||
BOOL sr_check_room_valid(uint room_x, uint room_y, uint room_size_x, uint room_size_y)
|
||||
{
|
||||
// This room goes outside the map.
|
||||
if (room_x + room_size_x > DUNGEON_SIZE ||
|
||||
@@ -62,7 +62,7 @@ BOOL sf_check_room_valid(uint room_x, uint room_y, uint room_size_x, uint room_s
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
void sf_create_corridor(uint room_x, uint room_y, uint room_size_x, uint room_size_y)
|
||||
void sr_create_corridor(uint room_x, uint room_y, uint room_size_x, uint room_size_y)
|
||||
{
|
||||
uint x, y, turn_x_count, turn_y_count;
|
||||
|
||||
@@ -137,7 +137,7 @@ void sf_create_corridor(uint room_x, uint room_y, uint room_size_x, uint room_si
|
||||
prev_y = room_y + rand() % room_size_y;
|
||||
}
|
||||
|
||||
BOOL sf_create_room()
|
||||
BOOL sr_create_room()
|
||||
{
|
||||
uint room_x, room_y, room_size_x, room_size_y;
|
||||
|
||||
@@ -148,7 +148,7 @@ BOOL sf_create_room()
|
||||
room_size_y = rand() % (room_max_size - room_min_size + 1) + room_min_size;
|
||||
|
||||
// Check if this room is valid.
|
||||
if (sf_check_room_valid(room_x - 1, room_y - 1, room_size_x + 2, room_size_y + 2) == FALSE)
|
||||
if (sr_check_room_valid(room_x - 1, room_y - 1, room_size_x + 2, room_size_y + 2) == FALSE)
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
@@ -163,12 +163,12 @@ BOOL sf_create_room()
|
||||
}
|
||||
|
||||
// Create corridor to previous room (if exists).
|
||||
sf_create_corridor(room_x, room_y, room_size_x, room_size_y);
|
||||
sr_create_corridor(room_x, room_y, room_size_x, room_size_y);
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
BOOL sf_is_valid_position(uint x, uint y)
|
||||
BOOL sr_is_valid_position(uint x, uint y)
|
||||
{
|
||||
// Must be in a room tile.
|
||||
if (dungeon_map[x + y * DUNGEON_SIZE] != TILE_ROOM)
|
||||
@@ -193,12 +193,12 @@ BOOL sf_is_valid_position(uint x, uint y)
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
BOOL sf_is_generating_dungeon(void)
|
||||
BOOL sr_is_generating_dungeon(void)
|
||||
{
|
||||
return is_generating_dungeon;
|
||||
}
|
||||
|
||||
BOOL sf_generate_dungeon(void)
|
||||
BOOL sr_generate_dungeon(void)
|
||||
{
|
||||
uint room_count = 0, failsafe_count = 0;
|
||||
uint stairs_x, stairs_y;
|
||||
@@ -231,7 +231,7 @@ BOOL sf_generate_dungeon(void)
|
||||
room_count = rand() % (room_max_count - room_min_count + 1) + room_min_count;
|
||||
while (room_count > 0)
|
||||
{
|
||||
if (sf_create_room() == TRUE)
|
||||
if (sr_create_room() == TRUE)
|
||||
{
|
||||
room_count--;
|
||||
}
|
||||
@@ -256,14 +256,14 @@ BOOL sf_generate_dungeon(void)
|
||||
{
|
||||
player_pos_x = rand() % DUNGEON_SIZE + 1;
|
||||
player_pos_y = rand() % DUNGEON_SIZE + 1;
|
||||
} while (sf_is_valid_position(player_pos_x, player_pos_y) == FALSE);
|
||||
} while (sr_is_valid_position(player_pos_x, player_pos_y) == FALSE);
|
||||
|
||||
// Set random stairs position.
|
||||
do
|
||||
{
|
||||
stairs_x = rand() % DUNGEON_SIZE + 1;
|
||||
stairs_y = rand() % DUNGEON_SIZE + 1;
|
||||
} while (sf_is_valid_position(stairs_x, stairs_y) == FALSE ||
|
||||
} while (sr_is_valid_position(stairs_x, stairs_y) == FALSE ||
|
||||
(stairs_x == player_pos_x && stairs_y == player_pos_y));
|
||||
|
||||
dungeon_map[stairs_x + stairs_y * DUNGEON_SIZE] = TILE_STAIRS;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
// Prototypes.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
BOOL sf_generate_dungeon(void);
|
||||
BOOL sf_is_generating_dungeon(void);
|
||||
BOOL sr_generate_dungeon(void);
|
||||
BOOL sr_is_generating_dungeon(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,19 +23,19 @@ uchar is_playing_song;
|
||||
// Functions.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void sf_init_snd(void)
|
||||
void sr_init_snd(void)
|
||||
{
|
||||
//sf_init_battle_song();
|
||||
//sr_init_battle_song();
|
||||
//is_playing_song = TRUE;
|
||||
|
||||
is_playing_song = FALSE;
|
||||
}
|
||||
|
||||
void sf_update_snd(void)
|
||||
void sr_update_snd(void)
|
||||
{
|
||||
// Update audio.
|
||||
if (is_playing_song == TRUE)
|
||||
{
|
||||
sf_play_song();
|
||||
sr_play_song();
|
||||
}
|
||||
}
|
||||
|
||||
16
src/snd.h
16
src/snd.h
@@ -17,13 +17,13 @@
|
||||
// Prototypes.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void sf_init_song(void);
|
||||
void sf_play_song(void);
|
||||
void sf_init_menu_song(void);
|
||||
void sf_init_intro_song(void);
|
||||
void sf_init_dungeon_song(void);
|
||||
void sf_init_battle_song(void);
|
||||
void sf_init_snd(void);
|
||||
void sf_update_snd(void);
|
||||
void sr_init_song(void);
|
||||
void sr_play_song(void);
|
||||
void sr_init_menu_song(void);
|
||||
void sr_init_intro_song(void);
|
||||
void sr_init_dungeon_song(void);
|
||||
void sr_init_battle_song(void);
|
||||
void sr_init_snd(void);
|
||||
void sr_update_snd(void);
|
||||
|
||||
#endif
|
||||
|
||||
77
src/startscr.c
Normal file
77
src/startscr.c
Normal file
@@ -0,0 +1,77 @@
|
||||
//------------------------------------------------------------------
|
||||
// Star Rangers - A Dungeon Crawler for MSX2 using Fusion-C
|
||||
//------------------------------------------------------------------
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "fusion-c/header/msx_fusion.h"
|
||||
#include "fusion-c/header/vdp_sprites.h"
|
||||
#include "fusion-c/header/vdp_graph2.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "font.h"
|
||||
#include "gfx.h"
|
||||
#include "startscr.h"
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Functions.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void sr_draw_startscr_intro_text(void)
|
||||
{
|
||||
// Switch to 212 vertical lines.
|
||||
sr_set_screen_height(SH_212);
|
||||
|
||||
// Intro text.
|
||||
sr_set_drawing_state(Begin);
|
||||
// Cls();
|
||||
SetColors(0, 0, 14);
|
||||
|
||||
sr_draw_text("PRESS SPACE KEY", 8*8, 8*18, 15, 14);
|
||||
sr_draw_text("@1987 SAFFRON SOFT", 8*7, 8*24, 15, 14);
|
||||
|
||||
//sr_draw_text("@SAFFRON SOFT 2020", 8*6, 100, 2, 0);
|
||||
// PutText(0, 90, "********************************", LOGICAL_IMP);
|
||||
/*
|
||||
sr_draw_text("<______________>", 8*6, 70, 8, 0);
|
||||
sr_draw_text("| |", 8*6, 70+8, 8, 0);
|
||||
sr_draw_text("[______________]", 8*6, 70+8+8, 8, 0);
|
||||
sr_draw_text("SAFFRON SOFT", 8*6+8+8, 70+8, 15, 0);
|
||||
*/
|
||||
|
||||
/*
|
||||
sr_draw_text("<_____COMMAND_____>", 8*6, 8+8, 13, 14);
|
||||
sr_draw_text("| |", 8*6, 8+8+8, 13, 14);
|
||||
sr_draw_text("| |", 8*6, 8+8+8+8, 13, 14);
|
||||
sr_draw_text("| |", 8*6, 8+8+8+8+8, 13, 14);
|
||||
sr_draw_text("| |", 8*6, 8+8+8+8+8+8, 13, 14);
|
||||
sr_draw_text("| |", 8*6, 8+8+8+8+8+8+8, 13, 14);
|
||||
sr_draw_text("| |", 8*6, 8+8+8+8+8+8+8+8, 13, 14);
|
||||
sr_draw_text("| |", 8*6, 8+8+8+8+8+8+8+8+8, 13, 14);
|
||||
sr_draw_text("| |", 8*6, 8+8+8+8+8+8+8+8+8+8, 13, 14);
|
||||
sr_draw_text("[_________________]", 8*6, 8+8+8+8+8+8+8+8+8+8+8, 13, 14);
|
||||
|
||||
sr_draw_text("^TALK SPELL", 8*6+8, 8+8+8+8, 15, 14);
|
||||
sr_draw_text("STATUS ITEM", 8*6+8+8, 8+8+8+8+8+8, 15, 14);
|
||||
sr_draw_text("EQUIP TACTICS", 8*6+8+8, 8+8+8+8+8+8+8+8, 15, 14);
|
||||
sr_draw_text("DOOR SEARCH", 8*6+8+8, 8+8+8+8+8+8+8+8+8+8, 15, 14);
|
||||
*/
|
||||
|
||||
sr_set_drawing_state(WaitingForVDP);
|
||||
sr_wait(1000);
|
||||
|
||||
// Go to dungeon state.
|
||||
sr_set_game_state(Intro);
|
||||
}
|
||||
|
||||
void sr_set_startscr_state(void)
|
||||
{
|
||||
sr_draw_startscr_intro_text();
|
||||
}
|
||||
|
||||
void sr_update_startscr_state(void)
|
||||
{
|
||||
}
|
||||
|
||||
19
src/startscr.h
Normal file
19
src/startscr.h
Normal file
@@ -0,0 +1,19 @@
|
||||
//------------------------------------------------------------------
|
||||
// Star Rangers - A Dungeon Crawler for MSX2 using Fusion-C
|
||||
//------------------------------------------------------------------
|
||||
|
||||
#ifndef STARTSCR_H
|
||||
#define STARTSCR_H
|
||||
|
||||
#include "main.h"
|
||||
|
||||
//...
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Prototypes.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void sr_set_startscr_state(void);
|
||||
void sr_update_startscr_state(void);
|
||||
|
||||
#endif
|
||||
@@ -1,74 +0,0 @@
|
||||
//------------------------------------------------------------------
|
||||
// Star Rangers - A Dungeon Crawler for MSX2 using Fusion-C
|
||||
//------------------------------------------------------------------
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "fusion-c/header/msx_fusion.h"
|
||||
#include "fusion-c/header/vdp_sprites.h"
|
||||
#include "fusion-c/header/vdp_graph2.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "font.h"
|
||||
#include "gfx.h"
|
||||
#include "startscreen.h"
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Functions.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void sf_draw_startscreen_intro_text(void)
|
||||
{
|
||||
// Intro text.
|
||||
sf_set_drawing_state(Begin);
|
||||
// Cls();
|
||||
SetColors(0, 0, 14);
|
||||
|
||||
sf_draw_text("PRESS SPACE KEY", 8*8, 8*18, 15, 14);
|
||||
sf_draw_text("@2020 SAFFRON SOFT", 8*7, 8*24, 15, 14);
|
||||
|
||||
//sf_draw_text("@SAFFRON SOFT 2020", 8*6, 100, 2, 0);
|
||||
// PutText(0, 90, "********************************", LOGICAL_IMP);
|
||||
/*
|
||||
sf_draw_text("<______________>", 8*6, 70, 8, 0);
|
||||
sf_draw_text("| |", 8*6, 70+8, 8, 0);
|
||||
sf_draw_text("[______________]", 8*6, 70+8+8, 8, 0);
|
||||
sf_draw_text("SAFFRON SOFT", 8*6+8+8, 70+8, 15, 0);
|
||||
*/
|
||||
|
||||
/*
|
||||
sf_draw_text("<_____COMMAND_____>", 8*6, 8+8, 13, 14);
|
||||
sf_draw_text("| |", 8*6, 8+8+8, 13, 14);
|
||||
sf_draw_text("| |", 8*6, 8+8+8+8, 13, 14);
|
||||
sf_draw_text("| |", 8*6, 8+8+8+8+8, 13, 14);
|
||||
sf_draw_text("| |", 8*6, 8+8+8+8+8+8, 13, 14);
|
||||
sf_draw_text("| |", 8*6, 8+8+8+8+8+8+8, 13, 14);
|
||||
sf_draw_text("| |", 8*6, 8+8+8+8+8+8+8+8, 13, 14);
|
||||
sf_draw_text("| |", 8*6, 8+8+8+8+8+8+8+8+8, 13, 14);
|
||||
sf_draw_text("| |", 8*6, 8+8+8+8+8+8+8+8+8+8, 13, 14);
|
||||
sf_draw_text("[_________________]", 8*6, 8+8+8+8+8+8+8+8+8+8+8, 13, 14);
|
||||
|
||||
sf_draw_text("^TALK SPELL", 8*6+8, 8+8+8+8, 15, 14);
|
||||
sf_draw_text("STATUS ITEM", 8*6+8+8, 8+8+8+8+8+8, 15, 14);
|
||||
sf_draw_text("EQUIP TACTICS", 8*6+8+8, 8+8+8+8+8+8+8+8, 15, 14);
|
||||
sf_draw_text("DOOR SEARCH", 8*6+8+8, 8+8+8+8+8+8+8+8+8+8, 15, 14);
|
||||
*/
|
||||
|
||||
sf_set_drawing_state(WaitingForVDP);
|
||||
sf_wait(1000);
|
||||
|
||||
// Go to dungeon state.
|
||||
sf_set_game_state(Intro);
|
||||
}
|
||||
|
||||
void sf_set_startscreen_state(void)
|
||||
{
|
||||
sf_draw_startscreen_intro_text();
|
||||
}
|
||||
|
||||
void sf_update_startscreen_state(void)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
//------------------------------------------------------------------
|
||||
|
||||
// In case of Error.
|
||||
void sf_error_handler(uchar n, uchar *name)
|
||||
void sr_error_handler(uchar n, uchar *name)
|
||||
{
|
||||
InitPSG();
|
||||
Screen(0);
|
||||
@@ -40,7 +40,7 @@ void sf_error_handler(uchar n, uchar *name)
|
||||
}
|
||||
|
||||
// Set the name of a file to load (MSX DOS).
|
||||
void sf_set_name(FCB *p_fcb, const uchar *p_name)
|
||||
void sr_set_name(FCB *p_fcb, const uchar *p_name)
|
||||
{
|
||||
uchar i, j;
|
||||
memset(p_fcb, 0, sizeof(FCB));
|
||||
@@ -65,7 +65,7 @@ void sf_set_name(FCB *p_fcb, const uchar *p_name)
|
||||
}
|
||||
}
|
||||
|
||||
void sf_wait(uint cicles)
|
||||
void sr_wait(uint cicles)
|
||||
{
|
||||
for (uint i = 0; i < cicles; i++)
|
||||
{
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
// Prototypes.
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void sf_error_handler(uchar n, uchar *name);
|
||||
void sf_set_name(FCB *p_fcb, const uchar *p_name);
|
||||
void sf_wait(uint cicles);
|
||||
void sr_error_handler(uchar n, uchar *name);
|
||||
void sr_set_name(FCB *p_fcb, const uchar *p_name);
|
||||
void sr_wait(uint cicles);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user