PC-98: Implement kanji/graph mode toggling via Ctrl+F4

This commit is contained in:
nmlgc
2021-05-23 16:40:15 +02:00
parent a09d2835ee
commit d68efe0b56
3 changed files with 17 additions and 0 deletions

View File

@@ -288,6 +288,10 @@ private:
PC98_GetCtrlFuncKeyEscape(/*&*/esclen,dev_con_readbuf,code+1u-0x92u); dev_con_pos=0; dev_con_max=esclen;
return (dev_con_max != 0)?true:false;
}
else if (code == 0x95) {// CTRL+F4 Toggle kanji/graph mode HANDLED INTERNALLY, NEVER RETURNED TO CONSOLE
void pc98_toggle_char_mode(void);
pc98_toggle_char_mode();
}
else if (code == 0x97) {// CTRL+F6 Toggle 20/25-line text HANDLED INTERNALLY, NEVER RETURNED TO CONSOLE
/* toggle the bit and change the text layer */
{

View File

@@ -2969,6 +2969,8 @@ void draw_pc98_function_row_elem(unsigned int o, unsigned int co, const struct p
}
void draw_pc98_function_row(unsigned int o, const struct pc98_func_key_shortcut_def* keylist) {
mem_writew(0xA0000+((o+1)*2),real_readb(0x60,0x8B));
mem_writeb(0xA2000+((o+1)*2),0xE1);
for (unsigned int i=0u;i < 5u;i++)
draw_pc98_function_row_elem(o,4u + (i * 7u),keylist[i]);
for (unsigned int i=5u;i < 10u;i++)
@@ -3076,6 +3078,16 @@ void pc98_function_row_user_toggle(void) {
update_pc98_function_row(pc98_function_row_mode+1,true);
}
void pc98_set_char_mode(bool mode) {
real_writeb(0x60,0x8A,mode);
real_writeb(0x60,0x8B,(mode == true) ? ' ' : 'g');
update_pc98_function_row(pc98_function_row_mode,true);
}
void pc98_toggle_char_mode(void) {
pc98_set_char_mode(!real_readb(0x60,0x8A));
}
void pc98_set_digpal_entry(unsigned char ent,unsigned char grb);
void PC98_show_cursor(bool show);

View File

@@ -1220,6 +1220,7 @@ void INT10_Startup(Section *sec) {
*/
real_writeb(0x60,0x8A,1); /* kanji/graph mode */
real_writeb(0x60,0x8B,' '); /* kanji/graph mode indicator */
real_writeb(0x60,0x8C,' '); /* function row mode 2 indicator */
/* number of text rows on the screen.