1
0
mirror of https://github.com/catseye/SixtyPical.git synced 2025-02-12 20:30:27 +00:00

Fix bug when zero page address was $00.

This commit is contained in:
Chris Pressey 2018-03-29 11:46:56 +01:00
parent eadf1eb4ae
commit ebe53f540c
4 changed files with 11 additions and 5 deletions

View File

@ -26,7 +26,7 @@ byte colour @ $80
byte luminosity @ $81
byte joystick_delay @ $82
byte table[8] image_data : "ZZZZUUUU" // [126, 129, 153, 165, 129, 165, 129, 126]
byte table[8] image_data : 126, 129, 153, 165, 129, 165, 129, 126
// %01111110
// %10000001
// %10011001

View File

@ -6,4 +6,5 @@ if [ "x$COMPARE" != "x" ]; then
dcc6502 -o 0xf000 -m 200 atari-2600-example.bin > atari-2600-example.bin.disasm.txt
dcc6502 -o 0xf000 -m 200 atari-2600-example-60p.bin > atari-2600-example-60p.bin.disasm.txt
paste atari-2600-example.bin.disasm.txt atari-2600-example-60p.bin.disasm.txt | pr -t -e24
#diff -ru atari-2600-example.bin.disasm.txt atari-2600-example-60p.bin.disasm.txt
fi

View File

@ -68,7 +68,7 @@ class Compiler(object):
return self.labels[name]
def absolute_or_zero_page(self, label):
if label.addr and label.addr < 256:
if label.addr is not None and label.addr < 256:
return ZeroPage(label)
else:
return Absolute(label)

View File

@ -114,19 +114,24 @@ Memory location with explicit address.
Accesses to memory locations in zero-page with `ld` and `st` use zero-page addressing.
| byte zp @ $00
| byte screen @ 100
|
| routine main
| inputs screen
| outputs screen
| inputs screen, zp
| outputs screen, zp
| trashes a, z, n
| {
| ld a, screen
| st a, screen
| ld a, zp
| st a, zp
| }
= $080D LDA $64
= $080F STA $64
= $0811 RTS
= $0811 LDA $00
= $0813 STA $00
= $0815 RTS
Memory location with initial value.