Commit Graph

56 Commits

Author SHA1 Message Date
Takashi Toyoshima 1fc9cb8a93 Now GPIO can be accessible via Apple BASIC
POKE -16240, 255 # Set all bits of GPIO0 as output ports
POKE -16224, 255 # Output all one to GPIO0
POKE -16224, 0   # Output all zero to GPIO0
2014-12-13 03:01:38 +09:00
Takashi Toyoshima 2d6878d2a7 Polish VRAM access to TTY TX emulation
It assumes Apple BASIC's manner of controlling screen.
Apple BASIC may be able to work exactly like running through
a virtual terminal device.
2014-12-13 02:32:04 +09:00
Takashi Toyoshima 35bb8b7083 Implement an experimental VRAM to TTY bridge 2014-12-11 04:29:19 +09:00
Takashi Toyoshima a90dca2a01 Now Apple BASIC work on LPC1114 with 2K free RAM 2014-12-11 01:19:39 +09:00
Takashi Toyoshima 7568e2aeac Add UART receive functions 2014-12-11 00:27:35 +09:00
Takashi Toyoshima 02c08505eb Implement I/O for lpc1114
Now Apple BASIC can run on the LPC1114 device :)
2014-12-09 04:54:33 +09:00
Takashi Toyoshima 826647fb93 Update test: now it can run Apple BASIC.
]10 PRINT "HELLO"

]20 END

]LIST

10  PRINT "HELLO"
20  END

]RUN
HELLO

]
2014-12-08 04:19:05 +09:00
Takashi Toyoshima faacc4ea52 Bug fix: op7e ROR did not store result
- also fp should be saved as 32bit register
2014-12-08 03:38:58 +09:00
Takashi Toyoshima 47d7fb8749 Bug fix: 0x26 is not ROR but ROL 2014-12-08 03:23:08 +09:00
Takashi Toyoshima 4994158c0c Bug fix: 0x2a is not ROR but ROL 2014-12-08 03:19:08 +09:00
Takashi Toyoshima 7dcce64f10 Bug fix: bit 2014-12-08 03:18:54 +09:00
Takashi Toyoshima 5465cc99d2 Update test.c to check Apple BASIC behaviors 2014-12-08 03:11:03 +09:00
Takashi Toyoshima 3f2daf7b08 Bug fix: data was broken on absolute and absolute indexed destination
Now it can show "Apple ][" logo by using Apple BASIC ROM!!
2014-12-08 03:01:27 +09:00
Takashi Toyoshima 62b69b5458 Bug fix: TSX was still wrong 2014-12-08 02:49:17 +09:00
Takashi Toyoshima 77fa2964f1 Bug fix: stack is hard :(
SP should wrap correctly on push and pop
2014-12-08 02:43:05 +09:00
Takashi Toyoshima 9098230d7d Bug fix: conditions are hard :( 2014-12-08 02:35:47 +09:00
Takashi Toyoshima 2ad2fa6efb Bug fix: BRK should set I flag 2014-12-08 00:50:05 +09:00
Takashi Toyoshima 729cac78a0 Bug fix: INX did not store the result correctly 2014-12-08 00:46:38 +09:00
Takashi Toyoshima 82990fdab7 Bug fix: B and reserved flag should not be modified on updating SR 2014-12-08 00:44:42 +09:00
Takashi Toyoshima 42cb53c0ad Bug fix: after TSX, X got a value >= 0x100 2014-12-08 00:36:42 +09:00
Takashi Toyoshima d0ad06c86a Use 6502_65C02_functional_tests, and two bug fixes
- transfer operations should update n and z flags
 - TSX should transfer SP, not SR
2014-12-08 00:21:49 +09:00
Takashi Toyoshima 1f39658a0b Bug fix: toAbsb can not store the right value 2014-12-07 19:02:33 +09:00
Takashi Toyoshima 064567f346 Bug fix: adc and sbc performed wrong carry flag calculation 2014-12-07 19:01:33 +09:00
Takashi Toyoshima 86d07009b1 Add some I/O and memory emulation to check Apple2 BASIC 2014-12-07 18:31:41 +09:00
Takashi Toyoshima 91c94746d8 Bug fix: manage r12 correctly, and TXS used a wrong register
To use r12 in assembly code:
 - use -fomit-frame-pointer for test.c
 - save and restore on calling libc functions
2014-12-07 16:35:46 +09:00
Takashi Toyoshima dbf8142e61 Bug fix on shift operations again. Other macros broke T0. 2014-12-07 15:51:59 +09:00
Takashi Toyoshima e419d9da69 Bug fix: absolute and absolute indexed fetched wrong address 2014-12-07 15:15:06 +09:00
Takashi Toyoshima c5d69f2c14 dec and inc was swapped, and results are not stored correctly 2014-12-07 15:10:05 +09:00
Takashi Toyoshima c3c8eafc07 Bug fix on sbc, C was reversed, and result was not stored on V=0 2014-12-07 15:02:40 +09:00
Takashi Toyoshima 8ff302aaf0 Bug fix: cmp didn't take Z flag 2014-12-07 14:47:46 +09:00
Takashi Toyoshima 51faf4afb1 Bug fix: brannch target calculation was still wrong 2014-12-07 14:44:00 +09:00
Takashi Toyoshima 21b25243d7 Bug fix: bit and cmp operations didn't increment PC 2014-12-07 14:32:52 +09:00
Takashi Toyoshima ff26481127 Bug fix on adc condition flag updates 2014-12-07 14:29:14 +09:00
Takashi Toyoshima ff1f7b8b2f Fix branch operation bugs
- address calculation on not taken
 - use macro to implement each branch operation
2014-12-07 14:05:38 +09:00
Takashi Toyoshima 8d94c76d47 Bug fix on shift operations that set a result to a wrong register 2014-12-07 13:54:47 +09:00
Takashi Toyoshima bc8b0b0906 Bug fux: absolute and absolute indexed didn't increment PC correctly 2014-12-07 13:35:20 +09:00
Takashi Toyoshima 7370d07645 Implement _sbc. They must have many bugs, but anyway, finished. 2014-12-07 12:56:02 +09:00
Takashi Toyoshima 14fa2b22c3 Implement _adc, ...sigh :( 2014-12-07 12:38:48 +09:00
Takashi Toyoshima 90feea53ed Implement _cp and _inc 2014-12-07 11:47:22 +09:00
Takashi Toyoshima b86a32323e Implement all ops, except for macros, _adc, _cp, _inc, _sbc 2014-12-07 02:13:45 +09:00
Takashi Toyoshima 8301b1e97e Implement op -0xde 2014-12-07 02:03:38 +09:00
Takashi Toyoshima 677b893b40 Implement op -0xd0 (except for _adc and _cp macros) 2014-12-07 01:58:56 +09:00
Takashi Toyoshima 4f71331f06 Implement op -0xbf 2014-12-07 01:50:39 +09:00
Takashi Toyoshima f694a16d58 Implement op -0xaf 2014-12-07 01:45:07 +09:00
Takashi Toyoshima 4a3cf30de1 Implement op -0x8f 2014-12-07 01:20:36 +09:00
Takashi Toyoshima 34f60ed8b6 Implement op -0x7f (turning point!) 2014-12-06 23:29:28 +09:00
Takashi Toyoshima 428c8b54c5 Implement op -0x6f (except for _adc macro) 2014-12-06 23:24:53 +09:00
Takashi Toyoshima 8e22cfe6cf Implement op -0x5f 2014-12-06 23:14:21 +09:00
Takashi Toyoshima 4c3a822893 Implement op -0x4f 2014-12-06 23:08:34 +09:00
Takashi Toyoshima fb81353de3 Implmenet op -0x3f 2014-12-06 22:50:50 +09:00