mirror of
https://github.com/mauiaaron/apple2.git
synced 2024-09-27 09:56:08 +00:00
simplifications
This commit is contained in:
parent
d5c5654931
commit
6eef91baf7
@ -17,27 +17,21 @@
|
|||||||
/* ASSUMPTIONS:
|
/* ASSUMPTIONS:
|
||||||
* flex version 2.5.2 or later
|
* flex version 2.5.2 or later
|
||||||
*
|
*
|
||||||
* this file is processed in several steps. the Makefile first
|
|
||||||
* runs it through cpp so that we can eliminate whole rules which
|
|
||||||
* are unnecessary. the generated file is then run through flex
|
|
||||||
* to generate the actual c code which is then compiled.
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
%{
|
%{
|
||||||
|
|
||||||
/* process includes only the second time we parse this file. */
|
/* process includes only the second time we parse this file. */
|
||||||
#define INC(HASH,STR) HASH ## include STR
|
#include "misc.h"
|
||||||
INC(#,"misc.h")
|
#include "interface.h"
|
||||||
INC(#,"interface.h")
|
#include "debug.h"
|
||||||
INC(#,"debug.h")
|
#include "disk.h"
|
||||||
INC(#,"disk.h")
|
#include "video.h"
|
||||||
INC(#,"video.h")
|
#include "keys.h"
|
||||||
INC(#,"keys.h")
|
#include <unistd.h>
|
||||||
INC(#,<unistd.h>)
|
#include <strings.h>
|
||||||
INC(#,<strings.h>)
|
#include <ctype.h>
|
||||||
INC(#,<ctype.h>)
|
#include "cpu.h"
|
||||||
INC(#,"cpu.h")
|
|
||||||
|
|
||||||
|
|
||||||
YY_BUFFER_STATE buffer = 0;
|
YY_BUFFER_STATE buffer = 0;
|
||||||
@ -100,7 +94,6 @@ ADDRS [0-9a-fA-F]+
|
|||||||
return MEM;
|
return MEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef APPLE_IIE
|
|
||||||
{BOS}(me?m?|as?c?i?i?){WS}+{BANK}{ADDRS}{WS}+\+?{HEX}+{EOS} {
|
{BOS}(me?m?|as?c?i?i?){WS}+{BANK}{ADDRS}{WS}+\+?{HEX}+{EOS} {
|
||||||
/* mem /<bank>/<addrs> <len> */
|
/* mem /<bank>/<addrs> <len> */
|
||||||
int do_ascii = 0;
|
int do_ascii = 0;
|
||||||
@ -117,7 +110,6 @@ ADDRS [0-9a-fA-F]+
|
|||||||
dump_mem(arg1, arg2, 0, do_ascii, arg3);
|
dump_mem(arg1, arg2, 0, do_ascii, arg3);
|
||||||
return MEM;
|
return MEM;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
{BOS}(me?m?|as?c?i?i?){WS}+{ADDRS}{EOS} {
|
{BOS}(me?m?|as?c?i?i?){WS}+{ADDRS}{EOS} {
|
||||||
/* mem <addrs> */
|
/* mem <addrs> */
|
||||||
@ -132,7 +124,6 @@ ADDRS [0-9a-fA-F]+
|
|||||||
return MEM;
|
return MEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef APPLE_IIE
|
|
||||||
{BOS}(me?m?|as?c?i?i?){WS}+{BANK}{ADDRS}{EOS} {
|
{BOS}(me?m?|as?c?i?i?){WS}+{BANK}{ADDRS}{EOS} {
|
||||||
/* mem /<bank>/<addrs> */
|
/* mem /<bank>/<addrs> */
|
||||||
int do_ascii = 0;
|
int do_ascii = 0;
|
||||||
@ -148,7 +139,6 @@ ADDRS [0-9a-fA-F]+
|
|||||||
dump_mem(arg1, 256, 0, do_ascii, arg3);
|
dump_mem(arg1, 256, 0, do_ascii, arg3);
|
||||||
return MEM;
|
return MEM;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
{BOS}(me?m?|as?c?i?i?){WS}+\+{HEX}+{EOS} {
|
{BOS}(me?m?|as?c?i?i?){WS}+\+{HEX}+{EOS} {
|
||||||
/* mem +<len> */
|
/* mem +<len> */
|
||||||
@ -192,7 +182,6 @@ ADDRS [0-9a-fA-F]+
|
|||||||
return MEM;
|
return MEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef APPLE_IIE
|
|
||||||
{BOS}(me?m?|as?c?i?i?){WS}*(lc?1|lc?2){WS}+{BANK}{ADDRS}{WS}+\+?{HEX}+{EOS} {
|
{BOS}(me?m?|as?c?i?i?){WS}*(lc?1|lc?2){WS}+{BANK}{ADDRS}{WS}+\+?{HEX}+{EOS} {
|
||||||
/* dump mem from lc<bank> /<bank>/<addrs> <len> */
|
/* dump mem from lc<bank> /<bank>/<addrs> <len> */
|
||||||
int do_ascii = 0;
|
int do_ascii = 0;
|
||||||
@ -214,7 +203,6 @@ ADDRS [0-9a-fA-F]+
|
|||||||
dump_mem(arg1, arg2, lc, do_ascii, arg3);
|
dump_mem(arg1, arg2, lc, do_ascii, arg3);
|
||||||
return MEM;
|
return MEM;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
{BOS}(me?m?|as?c?i?i?){WS}*(lc?1|lc?2){WS}+{ADDRS}{EOS} {
|
{BOS}(me?m?|as?c?i?i?){WS}*(lc?1|lc?2){WS}+{ADDRS}{EOS} {
|
||||||
/* dump mem from lc<bank> <addrs> */
|
/* dump mem from lc<bank> <addrs> */
|
||||||
@ -233,7 +221,6 @@ ADDRS [0-9a-fA-F]+
|
|||||||
return MEM;
|
return MEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef APPLE_IIE
|
|
||||||
{BOS}(me?m?|as?c?i?i?){WS}*(lc?1|lc?2){WS}+{BANK}{ADDRS}{EOS} {
|
{BOS}(me?m?|as?c?i?i?){WS}*(lc?1|lc?2){WS}+{BANK}{ADDRS}{EOS} {
|
||||||
/* dump mem from lc<bank> /<bank>/<addrs> */
|
/* dump mem from lc<bank> /<bank>/<addrs> */
|
||||||
int do_ascii = 0;
|
int do_ascii = 0;
|
||||||
@ -254,7 +241,6 @@ ADDRS [0-9a-fA-F]+
|
|||||||
dump_mem(arg1, 256, lc, do_ascii, arg3);
|
dump_mem(arg1, 256, lc, do_ascii, arg3);
|
||||||
return MEM;
|
return MEM;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
{BOS}di?s?{WS}+{ADDRS}{WS}+\+?{HEX}+{EOS} {
|
{BOS}di?s?{WS}+{ADDRS}{WS}+\+?{HEX}+{EOS} {
|
||||||
/* disassemble at <addrs> <len> */
|
/* disassemble at <addrs> <len> */
|
||||||
@ -267,7 +253,6 @@ ADDRS [0-9a-fA-F]+
|
|||||||
return DIS;
|
return DIS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef APPLE_IIE
|
|
||||||
{BOS}di?s?{WS}+{BANK}{ADDRS}{WS}+\+?{HEX}+{EOS} {
|
{BOS}di?s?{WS}+{BANK}{ADDRS}{WS}+\+?{HEX}+{EOS} {
|
||||||
/* disassemble at /<bank>/<addrs> <len> */
|
/* disassemble at /<bank>/<addrs> <len> */
|
||||||
while (*debugtext != '/') ++debugtext;
|
while (*debugtext != '/') ++debugtext;
|
||||||
@ -281,7 +266,6 @@ ADDRS [0-9a-fA-F]+
|
|||||||
disasm(arg1, arg2, 0, arg3);
|
disasm(arg1, arg2, 0, arg3);
|
||||||
return DIS;
|
return DIS;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
{BOS}di?s?{WS}+{ADDRS}{EOS} {
|
{BOS}di?s?{WS}+{ADDRS}{EOS} {
|
||||||
/* disassemble at <addrs> */
|
/* disassemble at <addrs> */
|
||||||
@ -295,7 +279,6 @@ ADDRS [0-9a-fA-F]+
|
|||||||
return DIS;
|
return DIS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef APPLE_IIE
|
|
||||||
{BOS}di?s?{WS}+{BANK}{ADDRS}{EOS} {
|
{BOS}di?s?{WS}+{BANK}{ADDRS}{EOS} {
|
||||||
/* disassemble at /<bank>/<addrs> */
|
/* disassemble at /<bank>/<addrs> */
|
||||||
while (*debugtext != '/') ++debugtext;
|
while (*debugtext != '/') ++debugtext;
|
||||||
@ -310,7 +293,6 @@ ADDRS [0-9a-fA-F]+
|
|||||||
disasm(arg1, arg2, 0, arg3);
|
disasm(arg1, arg2, 0, arg3);
|
||||||
return DIS;
|
return DIS;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
{BOS}di?s?{WS}+\+{HEX}+{EOS} {
|
{BOS}di?s?{WS}+\+{HEX}+{EOS} {
|
||||||
/* disassemble current location +<len> */
|
/* disassemble current location +<len> */
|
||||||
@ -343,7 +325,6 @@ ADDRS [0-9a-fA-F]+
|
|||||||
return DIS;
|
return DIS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef APPLE_IIE
|
|
||||||
{BOS}di?s?{WS}*(lc?1|lc?2){WS}+{BANK}{ADDRS}{WS}+\+?{HEX}+{EOS} {
|
{BOS}di?s?{WS}*(lc?1|lc?2){WS}+{BANK}{ADDRS}{WS}+\+?{HEX}+{EOS} {
|
||||||
/* disassemble language<bank> /<bank>/<addr> <len> */
|
/* disassemble language<bank> /<bank>/<addr> <len> */
|
||||||
int lc;
|
int lc;
|
||||||
@ -363,7 +344,6 @@ ADDRS [0-9a-fA-F]+
|
|||||||
disasm(arg1, arg2, lc, arg3);
|
disasm(arg1, arg2, lc, arg3);
|
||||||
return DIS;
|
return DIS;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
{BOS}di?s?{WS}*(lc?1|lc?2){WS}+{ADDRS}{EOS} {
|
{BOS}di?s?{WS}*(lc?1|lc?2){WS}+{ADDRS}{EOS} {
|
||||||
/* disassemble language<bank> <addr> */
|
/* disassemble language<bank> <addr> */
|
||||||
@ -379,7 +359,6 @@ ADDRS [0-9a-fA-F]+
|
|||||||
return DIS;
|
return DIS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef APPLE_IIE
|
|
||||||
{BOS}di?s?{WS}*(lc?1|lc?2){WS}+{BANK}{ADDRS}{EOS} {
|
{BOS}di?s?{WS}*(lc?1|lc?2){WS}+{BANK}{ADDRS}{EOS} {
|
||||||
/* disassemble language<bank> /<bank>/<addr> */
|
/* disassemble language<bank> /<bank>/<addr> */
|
||||||
int lc;
|
int lc;
|
||||||
@ -398,7 +377,6 @@ ADDRS [0-9a-fA-F]+
|
|||||||
disasm(arg1, 256, lc, arg3);
|
disasm(arg1, 256, lc, arg3);
|
||||||
return DIS;
|
return DIS;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
{BOS}re?g?s?{EOS} {
|
{BOS}re?g?s?{EOS} {
|
||||||
/* show cpu state */
|
/* show cpu state */
|
||||||
@ -620,13 +598,11 @@ ADDRS [0-9a-fA-F]+
|
|||||||
return BREAK;
|
return BREAK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef APPLE_IIE
|
|
||||||
{BOS}br65c02{EOS} {
|
{BOS}br65c02{EOS} {
|
||||||
/* set opcode breakpoints on 65c02 instructions */
|
/* set opcode breakpoints on 65c02 instructions */
|
||||||
set_halt_65c02();
|
set_halt_65c02();
|
||||||
return BREAK;
|
return BREAK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
{BOS}ig?n?o?r?e?{EOS} {
|
{BOS}ig?n?o?r?e?{EOS} {
|
||||||
/* ignore everything */
|
/* ignore everything */
|
||||||
@ -694,13 +670,11 @@ ADDRS [0-9a-fA-F]+
|
|||||||
return CLEAR;
|
return CLEAR;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef APPLE_IIE
|
|
||||||
{BOS}cl65c02{EOS} {
|
{BOS}cl65c02{EOS} {
|
||||||
/* clear 65c02 ... */
|
/* clear 65c02 ... */
|
||||||
clear_halt_65c02();
|
clear_halt_65c02();
|
||||||
return CLEAR;
|
return CLEAR;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
{BOS}stat?u?s?{EOS} {
|
{BOS}stat?u?s?{EOS} {
|
||||||
/* show breakpoints and watchpoints */
|
/* show breakpoints and watchpoints */
|
||||||
@ -724,7 +698,6 @@ ADDRS [0-9a-fA-F]+
|
|||||||
return SEARCH;
|
return SEARCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef APPLE_IIE
|
|
||||||
{BOS}sea?r?c?h?{WS}+{BANK}{WS}+{HEX}+{EOS} {
|
{BOS}sea?r?c?h?{WS}+{BANK}{WS}+{HEX}+{EOS} {
|
||||||
/* search memory<bank> for <bytes> */
|
/* search memory<bank> for <bytes> */
|
||||||
while (*debugtext != '/') ++debugtext;
|
while (*debugtext != '/') ++debugtext;
|
||||||
@ -737,7 +710,6 @@ ADDRS [0-9a-fA-F]+
|
|||||||
|
|
||||||
return SEARCH;
|
return SEARCH;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
{BOS}sea?r?c?h?{WS}*(lc?1|lc?2){WS}+{HEX}+{EOS} {
|
{BOS}sea?r?c?h?{WS}*(lc?1|lc?2){WS}+{HEX}+{EOS} {
|
||||||
/* search LC<bank> for <bytes> */
|
/* search LC<bank> for <bytes> */
|
||||||
@ -755,7 +727,6 @@ ADDRS [0-9a-fA-F]+
|
|||||||
return SEARCH;
|
return SEARCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef APPLE_IIE
|
|
||||||
{BOS}sea?r?c?h?{WS}*(lc?1|lc?2){WS}+{BANK}{WS}+{HEX}+{EOS} {
|
{BOS}sea?r?c?h?{WS}*(lc?1|lc?2){WS}+{BANK}{WS}+{HEX}+{EOS} {
|
||||||
/* search LC<bank> memory<bank> for <bytes> */
|
/* search LC<bank> memory<bank> for <bytes> */
|
||||||
int lc;
|
int lc;
|
||||||
@ -774,7 +745,6 @@ ADDRS [0-9a-fA-F]+
|
|||||||
|
|
||||||
return SEARCH;
|
return SEARCH;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
{BOS}key{WS}+{HEX}+{EOS} {
|
{BOS}key{WS}+{HEX}+{EOS} {
|
||||||
/* send key code to emulator */
|
/* send key code to emulator */
|
||||||
|
Loading…
Reference in New Issue
Block a user