do some irq testing

This commit is contained in:
David Voswinkel 2009-07-12 15:11:27 +02:00
parent 5a2bba0d33
commit 8e2889212a
4 changed files with 38 additions and 11 deletions

View File

@ -320,7 +320,8 @@ void test_crc(){
int main(void) int main(void)
{ {
uint8_t i; uint8_t i;
uint8_t c;
uart_init(); uart_init();
stdout = &uart_stdout; stdout = &uart_stdout;
@ -404,6 +405,23 @@ int main(void)
while (req_state != REQ_STATUS_AVR){ while (req_state != REQ_STATUS_AVR){
usbPoll(); usbPoll();
i = 20;
while (--i) { /* fake USB disconnect for > 250 ms */
_delay_ms(100);
}
printf("Send IRQ\n");
snes_irq_lo();
snes_irq_on();
avr_bus_active();
c = sram_bulk_read();
snes_bus_active();
snes_irq_off();
sram_bulk_read_start(0x003000);
printf("Read 0x3000=%c\n",c);
} }
} }

View File

@ -9,11 +9,15 @@ OBJS=irqtest.o
APP=irqtest.smc APP=irqtest.smc
GFX= GFX=
all: clean $(APP) all: clean $(APP) check
run: run:
zsnes $(APP) zsnes $(APP)
upload: smc
ucon64 --port=usb -xsnesram $(APP)
linkfile: linkfile:
echo "[objects]" > linkerfile.prj echo "[objects]" > linkerfile.prj
@ -21,8 +25,13 @@ linkfile:
optixx.inc: optixx.pcx optixx.inc: optixx.pcx
wine tools/pcx2snes.exe optixx.pcx -b2 -nOptixx -ooptixx.inc wine tools/pcx2snes.exe optixx.pcx -b2 -nOptixx -ooptixx.inc
check: check:
ucon64 -chk $(APP) ucon64 -chk $(APP)
rm -fv *.bak
smc:
ucon64 -smc $(APP)
rm -fv *.bak
%.o: %.asm %.o: %.asm
echo "$@" >> linkerfile.prj echo "$@" >> linkerfile.prj

View File

@ -26,7 +26,7 @@
LOROM LOROM
CARTRIDGETYPE $00 ; $00 = ROM only, see WLA documentation for others CARTRIDGETYPE $00 ; $00 = ROM only, see WLA documentation for others
ROMSIZE $08 ; $08 = 2 Mbits, see WLA doc for more.. ROMSIZE $07 ; $08 = 2 Mbits, see WLA doc for more..
SRAMSIZE $00 ; No SRAM see WLA doc for more.. SRAMSIZE $00 ; No SRAM see WLA doc for more..
COUNTRY $02 ; $01 = U.S. $00 = Japan, that's all I know COUNTRY $02 ; $01 = U.S. $00 = Japan, that's all I know
LICENSEECODE $00 ; Just use $00 LICENSEECODE $00 ; Just use $00

View File

@ -47,8 +47,6 @@ Start_do:
; Setup Video modes and other stuff, then turn on the screen ; Setup Video modes and other stuff, then turn on the screen
jsr SetupVideo jsr SetupVideo
prints "Init done"
lda #$81 lda #$81
sta $4200 sta $4200
@ -101,17 +99,13 @@ SetupVideo:
;.SECTION "IRQHandlers" ;.SECTION "IRQHandlers"
COPHandler: COPHandler:
prints "COPHandler"
rti rti
BRKHandler: BRKHandler:
prints "BRKHandler"
rti rti
ABRTHandler: ABRTHandler:
prints "ABRTHandler"
rti rti
NMIHandler: NMIHandler:
prints "NMIHandler"
rti rti
IRQHandler: IRQHandler:
@ -119,7 +113,13 @@ IRQHandler:
lda PalNum lda PalNum
sta $2122 sta $2122
sta $2122 sta $2122
prints "IRQHandler"
lda #65
sta $3000
idle:
lda $3001
rti rti