mirror of
https://github.com/cc65/cc65.git
synced 2024-09-21 10:37:28 +00:00
Merge pull request #2334 from carlo-bramini/fix-sim65-1
[SIM65] Support undocumented opcodes for 6502
This commit is contained in:
commit
a372ead4de
@ -15,7 +15,7 @@ CPU_ISET_4510 = $0400
|
|||||||
CPU_NONE = CPU_ISET_NONE
|
CPU_NONE = CPU_ISET_NONE
|
||||||
CPU_6502 = CPU_ISET_6502
|
CPU_6502 = CPU_ISET_6502
|
||||||
CPU_6502X = CPU_ISET_6502|CPU_ISET_6502X
|
CPU_6502X = CPU_ISET_6502|CPU_ISET_6502X
|
||||||
CPU_6502DTV = CPU_ISET_6502|CPU_ISET_6502X|CPU_ISET_6502DTV
|
CPU_6502DTV = CPU_ISET_6502|CPU_ISET_6502DTV
|
||||||
CPU_65SC02 = CPU_ISET_6502|CPU_ISET_65SC02
|
CPU_65SC02 = CPU_ISET_6502|CPU_ISET_65SC02
|
||||||
CPU_65C02 = CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65C02
|
CPU_65C02 = CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65C02
|
||||||
CPU_65816 = CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65816
|
CPU_65816 = CPU_ISET_6502|CPU_ISET_65SC02|CPU_ISET_65816
|
||||||
|
@ -9,11 +9,21 @@
|
|||||||
.import __MAIN_START__
|
.import __MAIN_START__
|
||||||
.import startup
|
.import startup
|
||||||
|
|
||||||
|
.macpack cpu
|
||||||
|
|
||||||
.segment "EXEHDR"
|
.segment "EXEHDR"
|
||||||
|
|
||||||
.byte $73, $69, $6D, $36, $35 ; 'sim65'
|
.byte $73, $69, $6D, $36, $35 ; 'sim65'
|
||||||
.byte 2 ; header version
|
.byte 2 ; header version
|
||||||
.byte .defined(__SIM65C02__) ; CPU type
|
.if (.cpu .bitand ::CPU_ISET_6502X)
|
||||||
|
.byte 2
|
||||||
|
.elseif (.cpu .bitand ::CPU_ISET_65C02)
|
||||||
|
.byte 1
|
||||||
|
.elseif (.cpu .bitand ::CPU_ISET_6502)
|
||||||
|
.byte 0
|
||||||
|
.else
|
||||||
|
.error Unknow CPU type.
|
||||||
|
.endif
|
||||||
.byte sp ; sp address
|
.byte sp ; sp address
|
||||||
.addr __MAIN_START__ ; load address
|
.addr __MAIN_START__ ; load address
|
||||||
.addr startup ; reset address
|
.addr startup ; reset address
|
||||||
|
2703
src/sim65/6502.c
2703
src/sim65/6502.c
File diff suppressed because it is too large
Load Diff
@ -47,7 +47,8 @@
|
|||||||
/* Supported CPUs */
|
/* Supported CPUs */
|
||||||
typedef enum CPUType {
|
typedef enum CPUType {
|
||||||
CPU_6502,
|
CPU_6502,
|
||||||
CPU_65C02
|
CPU_65C02,
|
||||||
|
CPU_6502X
|
||||||
} CPUType;
|
} CPUType;
|
||||||
|
|
||||||
/* Current CPU */
|
/* Current CPU */
|
||||||
|
@ -177,10 +177,16 @@ static unsigned char ReadProgramFile (void)
|
|||||||
|
|
||||||
/* Get the CPU type from the file header */
|
/* Get the CPU type from the file header */
|
||||||
if ((Val = fgetc(F)) != EOF) {
|
if ((Val = fgetc(F)) != EOF) {
|
||||||
if (Val != CPU_6502 && Val != CPU_65C02) {
|
switch (Val) {
|
||||||
|
case CPU_6502:
|
||||||
|
case CPU_65C02:
|
||||||
|
case CPU_6502X:
|
||||||
|
CPU = Val;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
Error ("'%s': Invalid CPU type", ProgramFile);
|
Error ("'%s': Invalid CPU type", ProgramFile);
|
||||||
}
|
}
|
||||||
CPU = Val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the address of sp from the file header */
|
/* Get the address of sp from the file header */
|
||||||
|
Loading…
Reference in New Issue
Block a user